merge autoland to mozilla-central. r=merge a=merge
authorSebastian Hengst <archaeopteryx@coole-files.de>
Sun, 03 Sep 2017 23:55:53 +0200
changeset 427995 dbf9f7430406ca3220529c5b4c05b26511efa3dc
parent 427986 0afabd3e5c27b0036517b96eecb1f8553d027179 (current diff)
parent 427994 3ee078cdd897330195af852ecdb42d68617f65ee (diff)
child 428172 8e05298328da75f3056a9f1f9609938870d756a0
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge, merge
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
merge autoland to mozilla-central. r=merge a=merge MozReview-Commit-ID: DI1L2b0p988
--- a/browser/components/about/AboutRedirector.cpp
+++ b/browser/components/about/AboutRedirector.cpp
@@ -67,19 +67,21 @@ static const RedirEntry kRedirMap[] = {
     nsIAboutModule::ALLOW_SCRIPT },
   { "robots", "chrome://browser/content/aboutRobots.xhtml",
     nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
     nsIAboutModule::ALLOW_SCRIPT },
   { "searchreset", "chrome://browser/content/search/searchReset.xhtml",
     nsIAboutModule::ALLOW_SCRIPT |
     nsIAboutModule::HIDE_FROM_ABOUTABOUT },
   { "sessionrestore", "chrome://browser/content/aboutSessionRestore.xhtml",
-    nsIAboutModule::ALLOW_SCRIPT },
+    nsIAboutModule::ALLOW_SCRIPT |
+    nsIAboutModule::HIDE_FROM_ABOUTABOUT },
   { "welcomeback", "chrome://browser/content/aboutWelcomeBack.xhtml",
-    nsIAboutModule::ALLOW_SCRIPT },
+    nsIAboutModule::ALLOW_SCRIPT |
+    nsIAboutModule::HIDE_FROM_ABOUTABOUT },
   // Linkable because of indexeddb use (bug 1228118)
   { "home", "chrome://browser/content/abouthome/aboutHome.xhtml",
     nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
     nsIAboutModule::URI_MUST_LOAD_IN_CHILD |
     nsIAboutModule::ALLOW_SCRIPT |
     nsIAboutModule::MAKE_LINKABLE |
     nsIAboutModule::ENABLE_INDEXED_DB },
   // the newtab's actual URL will be determined when the channel is created
--- a/dom/media/MediaFormatReader.cpp
+++ b/dom/media/MediaFormatReader.cpp
@@ -1806,24 +1806,24 @@ MediaFormatReader::NotifyError(TrackType
   LOGV("%s Decoding error", TrackTypeToStr(aTrack));
   auto& decoder = GetDecoderData(aTrack);
   decoder.mError = decoder.HasFatalError() ? decoder.mError : Some(aError);
 
   // The GPU process had crashed and we receive a
   // NS_ERROR_DOM_MEDIA_NEED_NEW_DECODER because we were doing HW decoding.
   // Now, save the related data and we will report the recovery time when a new
   // decoder is ready.
-  if (aTrack == TrackType::kVideoTrack &&
-      aError == NS_ERROR_DOM_MEDIA_NEED_NEW_DECODER &&
-      !aError.GPUCrashTimeStamp().IsNull()) {
-
-    GPUProcessCrashTelemetryLogger::RecordGPUCrashData(mMediaDecoderOwnerID,
-                                                       &decoder,
-                                                       aError.GPUCrashTimeStamp(),
-                                                       TimeStamp::Now());
+  if (aTrack == TrackType::kVideoTrack &&
+      aError == NS_ERROR_DOM_MEDIA_NEED_NEW_DECODER &&
+      !aError.GPUCrashTimeStamp().IsNull()) {
+
+    GPUProcessCrashTelemetryLogger::RecordGPUCrashData(mMediaDecoderOwnerID,
+                                                       &decoder,
+                                                       aError.GPUCrashTimeStamp(),
+                                                       TimeStamp::Now());
   }
 
   ScheduleUpdate(aTrack);
 }
 
 void
 MediaFormatReader::NotifyWaitingForData(TrackType aTrack)
 {
@@ -2009,22 +2009,22 @@ MediaFormatReader::DecodeDemuxedSamples(
   RefPtr<MediaFormatReader> self = this;
   decoder.mFlushed = false;
   decoder.mDecoder->Decode(aSample)
     ->Then(mTaskQueue, __func__,
            [self, this, aTrack, &decoder]
            (const MediaDataDecoder::DecodedData& aResults) {
              decoder.mDecodeRequest.Complete();
              NotifyNewOutput(aTrack, aResults);
-
-             // When we recovered from a GPU crash and get the first decoded
-             // frame, report the recovery time telemetry.
-             if (aTrack == TrackType::kVideoTrack) {
-               GPUProcessCrashTelemetryLogger::ReportTelemetry(
-                 mMediaDecoderOwnerID, &decoder);
+
+             // When we recovered from a GPU crash and get the first decoded
+             // frame, report the recovery time telemetry.
+             if (aTrack == TrackType::kVideoTrack) {
+               GPUProcessCrashTelemetryLogger::ReportTelemetry(
+                 mMediaDecoderOwnerID, &decoder);
              }
            },
            [self, this, aTrack, &decoder](const MediaResult& aError) {
              decoder.mDecodeRequest.Complete();
              NotifyError(aTrack, aError);
            })
     ->Track(decoder.mDecodeRequest);
 }
--- a/dom/media/ipc/VideoDecoderChild.cpp
+++ b/dom/media/ipc/VideoDecoderChild.cpp
@@ -16,31 +16,31 @@ namespace mozilla {
 namespace dom {
 
 using base::Thread;
 using namespace ipc;
 using namespace layers;
 using namespace gfx;
 
 #ifdef XP_WIN
-static void
-ReportUnblacklistingTelemetry(bool isGPUProcessCrashed,
-                              const nsCString& aD3D11BlacklistedDriver,
-                              const nsCString& aD3D9BlacklistedDriver)
-{
-  const nsCString& blacklistedDLL = !aD3D11BlacklistedDriver.IsEmpty()
-                                    ? aD3D11BlacklistedDriver
-                                    : aD3D9BlacklistedDriver;
-
-  if (!blacklistedDLL.IsEmpty()) {
-    Telemetry::Accumulate(Telemetry::VIDEO_UNBLACKINGLISTING_DXVA_DRIVER_RUNTIME_STATUS,
-                          blacklistedDLL,
-                          isGPUProcessCrashed ? 1 : 0);
-  }
-}
+static void
+ReportUnblacklistingTelemetry(bool isGPUProcessCrashed,
+                              const nsCString& aD3D11BlacklistedDriver,
+                              const nsCString& aD3D9BlacklistedDriver)
+{
+  const nsCString& blacklistedDLL = !aD3D11BlacklistedDriver.IsEmpty()
+                                    ? aD3D11BlacklistedDriver
+                                    : aD3D9BlacklistedDriver;
+
+  if (!blacklistedDLL.IsEmpty()) {
+    Telemetry::Accumulate(Telemetry::VIDEO_UNBLACKINGLISTING_DXVA_DRIVER_RUNTIME_STATUS,
+                          blacklistedDLL,
+                          isGPUProcessCrashed ? 1 : 0);
+  }
+}
 #endif // XP_WIN
 
 VideoDecoderChild::VideoDecoderChild()
   : mThread(VideoDecoderManagerChild::GetManagerThread())
   , mCanSend(false)
   , mInitialized(false)
   , mIsHardwareAccelerated(false)
   , mConversion(MediaDataDecoder::ConversionRequired::kNeedNone)
@@ -143,17 +143,17 @@ VideoDecoderChild::ActorDestroy(ActorDes
     // GPU process crashed, record the time and send back to MFR for telemetry.
     mGPUCrashTime = TimeStamp::Now();
 
     // Defer reporting an error until we've recreated the manager so that
     // it'll be safe for MediaFormatReader to recreate decoders
     RefPtr<VideoDecoderChild> ref = this;
     GetManager()->RunWhenRecreated(
       NS_NewRunnableFunction("dom::VideoDecoderChild::ActorDestroy", [=]() {
-        MediaResult error(NS_ERROR_DOM_MEDIA_NEED_NEW_DECODER);
+        MediaResult error(NS_ERROR_DOM_MEDIA_NEED_NEW_DECODER);
         error.SetGPUCrashTimeStamp(ref->mGPUCrashTime);
         if (ref->mInitialized) {
           mDecodedData.Clear();
           mDecodePromise.RejectIfExists(error, __func__);
           mDrainPromise.RejectIfExists(error, __func__);
           mFlushPromise.RejectIfExists(error, __func__);
           // Make sure the next request will be rejected accordingly if ever
           // called.
@@ -177,17 +177,17 @@ VideoDecoderChild::InitIPDL(const VideoI
                             const layers::TextureFactoryIdentifier& aIdentifier)
 {
   RefPtr<VideoDecoderManagerChild> manager =
     VideoDecoderManagerChild::GetSingleton();
 
   // The manager isn't available because VideoDecoderManagerChild has been
   // initialized with null end points and we don't want to decode video on GPU
   // process anymore. Return false here so that we can fallback to other PDMs.
-  if (!manager) {
+  if (!manager) {
     return false;
   }
 
   // The manager doesn't support sending messages because we've just crashed
   // and are working on reinitialization. Don't initialize mIPDLSelfRef and
   // leave us in an error state. We'll then immediately reject the promise when
   // Init() is called and the caller can try again. Hopefully by then the new
   // manager is ready, or we've notified the caller of it being no longer
@@ -241,17 +241,17 @@ VideoDecoderChild::Init()
 }
 
 RefPtr<MediaDataDecoder::DecodePromise>
 VideoDecoderChild::Decode(MediaRawData* aSample)
 {
   AssertOnManagerThread();
 
   if (mNeedNewDecoder) {
-    MediaResult error(NS_ERROR_DOM_MEDIA_NEED_NEW_DECODER);
+    MediaResult error(NS_ERROR_DOM_MEDIA_NEED_NEW_DECODER);
     error.SetGPUCrashTimeStamp(mGPUCrashTime);
     return MediaDataDecoder::DecodePromise::CreateAndReject(error, __func__);
   }
   if (!mCanSend) {
     // We're here if the IPC channel has died but we're still waiting for the
     // RunWhenRecreated task to complete. The decode promise will be rejected
     // when that task is run.
     return mDecodePromise.Ensure(__func__);
@@ -281,32 +281,32 @@ VideoDecoderChild::Decode(MediaRawData* 
 
 RefPtr<MediaDataDecoder::FlushPromise>
 VideoDecoderChild::Flush()
 {
   AssertOnManagerThread();
   mDecodePromise.RejectIfExists(NS_ERROR_DOM_MEDIA_CANCELED, __func__);
   mDrainPromise.RejectIfExists(NS_ERROR_DOM_MEDIA_CANCELED, __func__);
   if (mNeedNewDecoder) {
-    MediaResult error(NS_ERROR_DOM_MEDIA_NEED_NEW_DECODER);
+    MediaResult error(NS_ERROR_DOM_MEDIA_NEED_NEW_DECODER);
     error.SetGPUCrashTimeStamp(mGPUCrashTime);
     return MediaDataDecoder::FlushPromise::CreateAndReject(error, __func__);
   }
   if (mCanSend) {
     SendFlush();
   }
   return mFlushPromise.Ensure(__func__);
 }
 
 RefPtr<MediaDataDecoder::DecodePromise>
 VideoDecoderChild::Drain()
 {
   AssertOnManagerThread();
   if (mNeedNewDecoder) {
-    MediaResult error(NS_ERROR_DOM_MEDIA_NEED_NEW_DECODER);
+    MediaResult error(NS_ERROR_DOM_MEDIA_NEED_NEW_DECODER);
     error.SetGPUCrashTimeStamp(mGPUCrashTime);
     return MediaDataDecoder::DecodePromise::CreateAndReject(error, __func__);
   }
   if (mCanSend) {
     SendDrain();
   }
   return mDrainPromise.Ensure(__func__);
 }
--- a/dom/media/ipc/VideoDecoderManagerParent.cpp
+++ b/dom/media/ipc/VideoDecoderManagerParent.cpp
@@ -19,20 +19,20 @@
 #include "mozilla/layers/ImageDataSerializer.h"
 #include "mozilla/SyncRunnable.h"
 
 #if XP_WIN
 #include <objbase.h>
 #endif
 
 namespace mozilla {
-
-#ifdef XP_WIN
-extern const nsCString GetFoundD3D11BlacklistedDLL();
-extern const nsCString GetFoundD3D9BlacklistedDLL();
+
+#ifdef XP_WIN
+extern const nsCString GetFoundD3D11BlacklistedDLL();
+extern const nsCString GetFoundD3D9BlacklistedDLL();
 #endif // XP_WIN
 
 namespace dom {
 
 using namespace ipc;
 using namespace layers;
 using namespace gfx;
 
--- a/dom/media/platforms/wmf/WMFVideoMFTManager.cpp
+++ b/dom/media/platforms/wmf/WMFVideoMFTManager.cpp
@@ -405,34 +405,34 @@ FindD3D11BlacklistedDLL()
 static const nsCString&
 FindD3D9BlacklistedDLL()
 {
   return FindDXVABlacklistedDLL(sD3D9BlacklistingCache,
                                 gfx::gfxVars::PDMWMFDisableD3D9Dlls(),
                                 "media.wmf.disable-d3d9-for-dlls");
 }
 
-const nsCString
-GetFoundD3D11BlacklistedDLL()
-{
-  if (sD3D11BlacklistingCache) {
-    return sD3D11BlacklistingCache->mBlacklistedDLL;
-  }
-
-  return nsCString();
-}
-
-const nsCString
-GetFoundD3D9BlacklistedDLL()
-{
-  if (sD3D9BlacklistingCache) {
-    return sD3D9BlacklistingCache->mBlacklistedDLL;
-  }
-
-  return nsCString();
+const nsCString
+GetFoundD3D11BlacklistedDLL()
+{
+  if (sD3D11BlacklistingCache) {
+    return sD3D11BlacklistingCache->mBlacklistedDLL;
+  }
+
+  return nsCString();
+}
+
+const nsCString
+GetFoundD3D9BlacklistedDLL()
+{
+  if (sD3D9BlacklistingCache) {
+    return sD3D9BlacklistingCache->mBlacklistedDLL;
+  }
+
+  return nsCString();
 }
 
 class CreateDXVAManagerEvent : public Runnable
 {
 public:
   CreateDXVAManagerEvent(layers::KnowsCompositor* aKnowsCompositor,
                          nsCString& aFailureReason)
     : Runnable("CreateDXVAManagerEvent")
--- a/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
@@ -538,17 +538,17 @@ public class BrowserApp extends GeckoApp
                     tab.doBack();
                     return true;
 
                 case KeyEvent.KEYCODE_RIGHT_BRACKET:
                     tab.doForward();
                     return true;
 
                 case KeyEvent.KEYCODE_R:
-                    tab.doReload(false);
+                    tab.doReload(event.isShiftPressed() ? true : false);
                     return true;
 
                 case KeyEvent.KEYCODE_PERIOD:
                     tab.doStop();
                     return true;
 
                 case KeyEvent.KEYCODE_T:
                     addTab();
--- a/mobile/android/base/java/org/mozilla/gecko/preferences/TopSitesPanelsPreference.java
+++ b/mobile/android/base/java/org/mozilla/gecko/preferences/TopSitesPanelsPreference.java
@@ -1,25 +1,28 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 package org.mozilla.gecko.preferences;
 
 import android.app.AlertDialog;
 import android.content.Context;
+import android.view.LayoutInflater;
 
 import org.mozilla.gecko.R;
 
 /**
  * Custom preference that also adds additional options to the dialog of preferences for Top Sites settings.
  */
 public class TopSitesPanelsPreference extends PanelsPreference {
 
     TopSitesPanelsPreference(Context context, CustomListCategory parentCategory, boolean isRemovable, int index, boolean animate) {
         super(context, parentCategory, isRemovable, index, animate);
     }
 
     @Override
     protected void configureDialogBuilder(AlertDialog.Builder builder) {
+        final LayoutInflater inflater = LayoutInflater.from(getContext());
         builder.setView(R.layout.preference_topsites_panel_dialog);
+        builder.setView(inflater.inflate(R.layout.preference_topsites_panel_dialog, null));
     }
-}
+}
\ No newline at end of file
--- a/servo/components/script/dom/element.rs
+++ b/servo/components/script/dom/element.rs
@@ -1644,27 +1644,32 @@ impl ElementMethods for Element {
         self.set_first_matching_attribute(
             local_name.clone(), value, qualified_name, namespace.clone(), prefix,
             |attr| *attr.local_name() == local_name && *attr.namespace() == namespace);
         Ok(())
     }
 
     // https://dom.spec.whatwg.org/#dom-element-setattributenode
     fn SetAttributeNode(&self, attr: &Attr) -> Fallible<Option<Root<Attr>>> {
-        // Workaround for https://github.com/servo/servo/issues/17366
-        // This ensures that if this is an "id" attr, its value is an Atom
-        attr.swap_value(&mut self.parse_plain_attribute(attr.local_name(), attr.Value()));
-
         // Step 1.
         if let Some(owner) = attr.GetOwnerElement() {
             if &*owner != self {
                 return Err(Error::InUseAttribute);
             }
         }
 
+        let vtable = vtable_for(self.upcast());
+
+        // This ensures that the attribute is of the expected kind for this
+        // specific element. This is inefficient and should probably be done
+        // differently.
+        attr.swap_value(
+            &mut vtable.parse_plain_attribute(attr.local_name(), attr.Value()),
+        );
+
         // Step 2.
         let position = self.attrs.borrow().iter().position(|old_attr| {
             attr.namespace() == old_attr.namespace() && attr.local_name() == old_attr.local_name()
         });
 
         if let Some(position) = position {
             let old_attr = Root::from_ref(&*self.attrs.borrow()[position]);
 
@@ -1683,17 +1688,17 @@ impl ElementMethods for Element {
                     Some(new_value), namespace);
                 ScriptThread::enqueue_callback_reaction(self, reaction, None);
             }
             self.will_mutate_attr(attr);
             attr.set_owner(Some(self));
             self.attrs.borrow_mut()[position] = JS::from_ref(attr);
             old_attr.set_owner(None);
             if attr.namespace() == &ns!() {
-                vtable_for(self.upcast()).attribute_mutated(
+                vtable.attribute_mutated(
                     &attr, AttributeMutation::Set(Some(&old_attr.value())));
             }
 
             // Step 6.
             Ok(Some(old_attr))
         } else {
             // Step 5.
             attr.set_owner(Some(self));
--- a/toolkit/components/extensions/ext-browser-content.js
+++ b/toolkit/components/extensions/ext-browser-content.js
@@ -2,22 +2,23 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 "use strict";
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
-XPCOMUtils.defineLazyModuleGetter(this, "clearTimeout",
-                                  "resource://gre/modules/Timer.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "ExtensionCommon",
-                                  "resource://gre/modules/ExtensionCommon.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "setTimeout",
-                                  "resource://gre/modules/Timer.jsm");
+XPCOMUtils.defineLazyModuleGetters(this, {
+  BrowserUtils: "resource://gre/modules/BrowserUtils.jsm",
+  clearTimeout: "resource://gre/modules/Timer.jsm",
+  E10SUtils: "resource:///modules/E10SUtils.jsm",
+  ExtensionCommon: "resource://gre/modules/ExtensionCommon.jsm",
+  setTimeout: "resource://gre/modules/Timer.jsm",
+});
 
 Cu.import("resource://gre/modules/ExtensionUtils.jsm");
 const {
   getWinUtils,
 } = ExtensionUtils;
 
 /* eslint-env mozilla/frame-script */
 
@@ -283,8 +284,39 @@ const BrowserListener = {
     }
 
     sendAsyncMessage("Extension:BrowserResized", result);
   },
 };
 
 addMessageListener("Extension:InitBrowser", BrowserListener);
 addMessageListener("Extension:UnblockParser", BrowserListener);
+
+var WebBrowserChrome = {
+  onBeforeLinkTraversal(originalTarget, linkURI, linkNode, isAppTab) {
+    return BrowserUtils.onBeforeLinkTraversal(originalTarget, linkURI, linkNode, isAppTab);
+  },
+
+  shouldLoadURI(docShell, URI, referrer, hasPostData, triggeringPrincipal) {
+    return true;
+  },
+
+  shouldLoadURIInThisProcess(URI) {
+    return E10SUtils.shouldLoadURIInThisProcess(URI);
+  },
+
+  reloadInFreshProcess(docShell, URI, referrer, triggeringPrincipal, loadFlags) {
+    return false;
+  },
+
+  startPrerenderingDocument(href, referrer, triggeringPrincipal) {
+  },
+
+  shouldSwitchToPrerenderedDocument(href, referrer, success, failure) {
+    return false;
+  },
+};
+
+if (Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT) {
+  let tabchild = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
+                         .getInterface(Ci.nsITabChild);
+  tabchild.webBrowserChrome = WebBrowserChrome;
+}
--- a/toolkit/system/gnome/nsGConfService.cpp
+++ b/toolkit/system/gnome/nsGConfService.cpp
@@ -5,16 +5,17 @@
 
 #include "mozilla/ArrayUtils.h"
 #include "nsGConfService.h"
 #include "nsString.h"
 #include "nsCOMPtr.h"
 #include "nsComponentManagerUtils.h"
 #include "nsISupportsPrimitives.h"
 #include "nsIMutableArray.h"
+#include "nsXULAppAPI.h"
 #include "prlink.h"
 
 #include <gconf/gconf-client.h>
 
 using namespace mozilla;
 
 #define GCONF_FUNCTIONS \
   FUNC(gconf_client_get_default, GConfClient*, (void)) \
@@ -71,16 +72,20 @@ nsresult
 nsGConfService::Init()
 {
 #define FUNC(name, type, params) { #name, (nsGConfFunc *)&_##name },
   static const nsGConfDynamicFunction kGConfSymbols[] = {
     GCONF_FUNCTIONS
   };
 #undef FUNC
 
+  if (NS_WARN_IF(XRE_IsContentProcess())) {
+    return NS_ERROR_SERVICE_NOT_AVAILABLE;
+  }
+
   if (!gconfLib) {
     gconfLib = PR_LoadLibrary("libgconf-2.so.4");
     if (!gconfLib)
       return NS_ERROR_FAILURE;
   }
 
   for (auto GConfSymbol : kGConfSymbols) {
     *GConfSymbol.function =