r287685 is a follow-up to the changes merged in bug 30840.
Mehdi, can you approve? Tom, can you do the actual merge?
I support back-porting this. Tom let me know if you want me to the actual cherry-pick.
There is a merge conflict, so if you could do the cherry-pick, that would be great.
r287784