[4.4] Sync with upstream 4.4

DO NOT COMMIT until Bugzilla has been upgraded to 4.4!

Sync with upstream 4.4 and reapply our custom patches for
bug 46413 and bug 58415.

Change-Id: I6c9a234c7c1bf8ff25f9fecb556550b9e5622645