Merge inbound to mozilla-central a=merge
authorarthur.iakab <aiakab@mozilla.com>
Sat, 16 Jun 2018 00:50:29 +0300
changeset 476920 5b2a9b683f20297ecede5c083c60627d9ea24765
parent 476896 d62ce3e3ee8ad7ed946c6b5bf6d7a793dcbecfe0 (current diff)
parent 476919 ee50bd36be6ebf16363db4636e7489ddd2a8aa4c (diff)
child 476921 a7384267f89c6cc5856c1aa2a01e1e556cea1f16
child 476937 be26c7e898901662063ba149f38899bd4490f888
child 476988 76a5fb275ed822c69175c86cbc3d5e16938b727e
push id9374
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:43:20 +0000
treeherdermozilla-beta@160e085dfb0b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone62.0a1
first release with
nightly linux32
5b2a9b683f20 / 62.0a1 / 20180615220152 / files
nightly linux64
5b2a9b683f20 / 62.0a1 / 20180615220152 / files
nightly mac
5b2a9b683f20 / 62.0a1 / 20180615220152 / files
nightly win32
5b2a9b683f20 / 62.0a1 / 20180615220152 / files
nightly win64
5b2a9b683f20 / 62.0a1 / 20180615220152 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge inbound to mozilla-central a=merge
taskcluster/docker/funsize-balrog-submitter/Dockerfile
taskcluster/docker/funsize-balrog-submitter/Makefile
taskcluster/docker/funsize-balrog-submitter/dep.pubkey
taskcluster/docker/funsize-balrog-submitter/nightly_sha1.pubkey
taskcluster/docker/funsize-balrog-submitter/nightly_sha384.pubkey
taskcluster/docker/funsize-balrog-submitter/release_sha1.pubkey
taskcluster/docker/funsize-balrog-submitter/release_sha384.pubkey
taskcluster/docker/funsize-balrog-submitter/requirements.txt
taskcluster/docker/funsize-balrog-submitter/runme.sh
taskcluster/docker/funsize-balrog-submitter/scripts/funsize-balrog-submitter-complete.py
taskcluster/docker/funsize-balrog-submitter/scripts/funsize-balrog-submitter.py
taskcluster/docker/funsize-balrog-submitter/submit_complete.sh
testing/web-platform/meta/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.overlap.html.ini
testing/web-platform/meta/2dcontext/fill-and-stroke-styles/2d.pattern.image.broken.html.ini
testing/web-platform/meta/2dcontext/path-objects/2d.path.arc.selfintersect.1.html.ini
testing/web-platform/meta/2dcontext/path-objects/2d.path.arc.shape.3.html.ini
testing/web-platform/meta/2dcontext/path-objects/2d.path.rect.zero.3.html.ini
testing/web-platform/meta/2dcontext/path-objects/2d.path.stroke.scale2.html.ini
--- a/browser/extensions/pdfjs/README.mozilla
+++ b/browser/extensions/pdfjs/README.mozilla
@@ -1,5 +1,5 @@
 This is the PDF.js project output, https://github.com/mozilla/pdf.js
 
-Current extension version is: 2.0.575
+Current extension version is: 2.0.581
 
-Taken from upstream commit: 2030d171
+Taken from upstream commit: 790e2124
--- a/browser/extensions/pdfjs/content/build/pdf.js
+++ b/browser/extensions/pdfjs/content/build/pdf.js
@@ -118,18 +118,18 @@ return /******/ (function(modules) { // 
 /************************************************************************/
 /******/ ([
 /* 0 */
 /***/ (function(module, exports, __w_pdfjs_require__) {
 
 "use strict";
 
 
-var pdfjsVersion = '2.0.575';
-var pdfjsBuild = '2030d171';
+var pdfjsVersion = '2.0.581';
+var pdfjsBuild = '790e2124';
 var pdfjsSharedUtil = __w_pdfjs_require__(1);
 var pdfjsDisplayAPI = __w_pdfjs_require__(6);
 var pdfjsDisplayTextLayer = __w_pdfjs_require__(18);
 var pdfjsDisplayAnnotationLayer = __w_pdfjs_require__(19);
 var pdfjsDisplayDOMUtils = __w_pdfjs_require__(7);
 var pdfjsDisplaySVG = __w_pdfjs_require__(20);
 let pdfjsDisplayWorkerOptions = __w_pdfjs_require__(12);
 let pdfjsDisplayAPICompatibility = __w_pdfjs_require__(9);
@@ -4223,17 +4223,17 @@ function _fetchDocument(worker, source, 
     return Promise.reject(new Error('Worker was destroyed'));
   }
   if (pdfDataRangeTransport) {
     source.length = pdfDataRangeTransport.length;
     source.initialData = pdfDataRangeTransport.initialData;
   }
   return worker.messageHandler.sendWithPromise('GetDocRequest', {
     docId,
-    apiVersion: '2.0.575',
+    apiVersion: '2.0.581',
     source: {
       data: source.data,
       url: source.url,
       password: source.password,
       disableAutoFetch: source.disableAutoFetch,
       rangeChunkSize: source.rangeChunkSize,
       length: source.length
     },
@@ -5557,18 +5557,18 @@ var InternalRenderTask = function Intern
         }
       }
     }
   };
   return InternalRenderTask;
 }();
 var version, build;
 {
-  exports.version = version = '2.0.575';
-  exports.build = build = '2030d171';
+  exports.version = version = '2.0.581';
+  exports.build = build = '790e2124';
 }
 exports.getDocument = getDocument;
 exports.LoopbackPort = LoopbackPort;
 exports.PDFDataRangeTransport = PDFDataRangeTransport;
 exports.PDFWorker = PDFWorker;
 exports.PDFDocumentProxy = PDFDocumentProxy;
 exports.PDFPageProxy = PDFPageProxy;
 exports.setPDFNetworkStreamFactory = setPDFNetworkStreamFactory;
--- a/browser/extensions/pdfjs/content/build/pdf.worker.js
+++ b/browser/extensions/pdfjs/content/build/pdf.worker.js
@@ -118,18 +118,18 @@ return /******/ (function(modules) { // 
 /************************************************************************/
 /******/ ([
 /* 0 */
 /***/ (function(module, exports, __w_pdfjs_require__) {
 
 "use strict";
 
 
-var pdfjsVersion = '2.0.575';
-var pdfjsBuild = '2030d171';
+var pdfjsVersion = '2.0.581';
+var pdfjsBuild = '790e2124';
 var pdfjsCoreWorker = __w_pdfjs_require__(1);
 exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler;
 
 /***/ }),
 /* 1 */
 /***/ (function(module, exports, __w_pdfjs_require__) {
 
 "use strict";
@@ -322,17 +322,17 @@ var WorkerMessageHandler = {
     });
   },
   createDocumentHandler(docParams, port) {
     var pdfManager;
     var terminated = false;
     var cancelXHRs = null;
     var WorkerTasks = [];
     let apiVersion = docParams.apiVersion;
-    let workerVersion = '2.0.575';
+    let workerVersion = '2.0.581';
     if (apiVersion !== null && apiVersion !== workerVersion) {
       throw new Error(`The API version "${apiVersion}" does not match ` + `the Worker version "${workerVersion}".`);
     }
     var docId = docParams.docId;
     var docBaseUrl = docParams.docBaseUrl;
     var workerHandlerName = docParams.docId + '_worker';
     var handler = new _message_handler.MessageHandler(workerHandlerName, docId, port);
     handler.postMessageTransfers = docParams.postMessageTransfers;
--- a/browser/extensions/pdfjs/content/web/viewer.css
+++ b/browser/extensions/pdfjs/content/web/viewer.css
@@ -541,38 +541,39 @@ html[dir='rtl'] #sidebarContent {
 #viewerContainer {
   overflow: auto;
   position: absolute;
   top: 32px;
   right: 0;
   bottom: 0;
   left: 0;
   outline: none;
-
+}
+#viewerContainer:not(.pdfPresentationMode) {
   transition-duration: 200ms;
   transition-timing-function: ease;
 }
 html[dir='ltr'] #viewerContainer {
   box-shadow: inset 1px 0 0 hsla(0,0%,100%,.05);
 }
 html[dir='rtl'] #viewerContainer {
   box-shadow: inset -1px 0 0 hsla(0,0%,100%,.05);
 }
 
 #outerContainer.sidebarResizing #viewerContainer {
   /* Improve responsiveness and avoid visual glitches when the sidebar is resized. */
   transition-duration: 0s;
 }
 
-html[dir='ltr'] #outerContainer.sidebarOpen #viewerContainer {
+html[dir='ltr'] #outerContainer.sidebarOpen #viewerContainer:not(.pdfPresentationMode) {
   transition-property: left;
   left: 200px;
   left: var(--sidebar-width);
 }
-html[dir='rtl'] #outerContainer.sidebarOpen #viewerContainer {
+html[dir='rtl'] #outerContainer.sidebarOpen #viewerContainer:not(.pdfPresentationMode) {
   transition-property: right;
   right: 200px;
   right: var(--sidebar-width);
 }
 
 .toolbar {
   position: relative;
   left: 0;
--- a/browser/extensions/pdfjs/content/web/viewer.js
+++ b/browser/extensions/pdfjs/content/web/viewer.js
@@ -664,19 +664,16 @@ let PDFViewerApplication = {
     return !!this.printService;
   },
   get supportsPrinting() {
     return PDFPrintServiceFactory.instance.supportsPrinting;
   },
   get supportsFullscreen() {
     let support;
     support = document.fullscreenEnabled === true || document.mozFullScreenEnabled === true;
-    if (support && _app_options.AppOptions.get('disableFullscreen') === true) {
-      support = false;
-    }
     return (0, _pdfjsLib.shadow)(this, 'supportsFullscreen', support);
   },
   get supportsIntegratedFind() {
     return this.externalServices.supportsIntegratedFind;
   },
   get supportsDocumentFonts() {
     return this.externalServices.supportsDocumentFonts;
   },
@@ -3172,20 +3169,16 @@ const defaultOptions = {
   defaultUrl: {
     value: 'compressed.tracemonkey-pldi-09.pdf',
     kind: OptionKind.VIEWER
   },
   defaultZoomValue: {
     value: '',
     kind: OptionKind.VIEWER
   },
-  disableFullscreen: {
-    value: _viewer_compatibility.viewerCompatibilityParams.disableFullscreen || false,
-    kind: OptionKind.VIEWER
-  },
   disableHistory: {
     value: false,
     kind: OptionKind.VIEWER
   },
   disablePageLabels: {
     value: false,
     kind: OptionKind.VIEWER
   },
--- a/dom/media/systemservices/CamerasChild.cpp
+++ b/dom/media/systemservices/CamerasChild.cpp
@@ -723,17 +723,21 @@ CamerasChild::ActorDestroy(ActorDestroyR
   monitor.NotifyAll();
 }
 
 CamerasChild::CamerasChild()
   : mCallbackMutex("mozilla::cameras::CamerasChild::mCallbackMutex"),
     mIPCIsAlive(true),
     mRequestMutex("mozilla::cameras::CamerasChild::mRequestMutex"),
     mReplyMonitor("mozilla::cameras::CamerasChild::mReplyMonitor"),
-    mZero(0)
+    mReceivedReply(false),
+    mReplySuccess(false),
+    mZero(0),
+    mReplyInteger(0),
+    mReplyScary(false)
 {
   LOG(("CamerasChild: %p", this));
 
   MOZ_COUNT_CTOR(CamerasChild);
 }
 
 CamerasChild::~CamerasChild()
 {
--- a/dom/media/systemservices/CamerasParent.cpp
+++ b/dom/media/systemservices/CamerasParent.cpp
@@ -128,16 +128,17 @@ public:
                        uint32_t aStreamId,
                        const webrtc::VideoFrame& aFrame,
                        const VideoFrameProperties& aProperties)
     : Runnable("camera::DeliverFrameRunnable")
     , mParent(aParent)
     , mCapEngine(aEngine)
     , mStreamId(aStreamId)
     , mProperties(aProperties)
+    , mResult(0)
   {
     // No ShmemBuffer (of the right size) was available, so make an
     // extra buffer here.  We have no idea when we are going to run and
     // it will be potentially long after the webrtc frame callback has
     // returned, so the copy needs to be no later than here.
     // We will need to copy this back into a Shmem later on so we prefer
     // using ShmemBuffers to avoid the extra copy.
     mAlternateBuffer.reset(new unsigned char[aProperties.bufferSize()]);
@@ -150,17 +151,18 @@ public:
                        uint32_t aStreamId,
                        ShmemBuffer aBuffer,
                        VideoFrameProperties& aProperties)
     : Runnable("camera::DeliverFrameRunnable")
     , mParent(aParent)
     , mCapEngine(aEngine)
     , mStreamId(aStreamId)
     , mBuffer(std::move(aBuffer))
-    , mProperties(aProperties){};
+    , mProperties(aProperties)
+    , mResult(0) {};
 
   NS_IMETHOD Run() override {
     if (mParent->IsShuttingDown()) {
       // Communication channel is being torn down
       mResult = 0;
       return NS_OK;
     }
     if (!mParent->DeliverFrameOverIPC(mCapEngine, mStreamId, std::move(mBuffer),
--- a/dom/media/systemservices/MediaSystemResourceManagerChild.cpp
+++ b/dom/media/systemservices/MediaSystemResourceManagerChild.cpp
@@ -7,16 +7,17 @@
 
 #include "MediaSystemResourceManagerChild.h"
 
 namespace mozilla {
 namespace media {
 
 MediaSystemResourceManagerChild::MediaSystemResourceManagerChild()
   : mDestroyed(false)
+  , mManager(nullptr)
 {
 }
 
 MediaSystemResourceManagerChild::~MediaSystemResourceManagerChild()
 {
 }
 
 mozilla::ipc::IPCResult
--- a/dom/media/systemservices/VideoEngine.cpp
+++ b/dom/media/systemservices/VideoEngine.cpp
@@ -235,16 +235,17 @@ bool VideoEngine::WithEntry(const int32_
 int32_t
 VideoEngine::GenerateId() {
   // XXX Something better than this (a map perhaps, or a simple boolean TArray, given
   // the number in-use is O(1) normally!)
   return mId = sId++;
 }
 
 VideoEngine::VideoEngine(UniquePtr<const webrtc::Config>&& aConfig):
+  mId(0),
   mCaptureDevInfo(aConfig->Get<webrtc::CaptureDeviceInfo>()),
   mDeviceInfo(nullptr),
   mConfig(std::move(aConfig))
 {
   LOG((__PRETTY_FUNCTION__));
 }
 
 }
--- a/dom/media/systemservices/VideoEngine.h
+++ b/dom/media/systemservices/VideoEngine.h
@@ -27,17 +27,17 @@ class VideoEngine
 private:
   virtual ~VideoEngine (){};
   // Base cache expiration period
   // Note because cameras use HW plug event detection, this
   // only applies to screen based modes.
   static const int64_t kCacheExpiryPeriodMs = 2000;
 
 public:
-  VideoEngine (){};
+  VideoEngine() : mId(0) {};
   NS_INLINE_DECL_REFCOUNTING(VideoEngine)
 
   static already_AddRefed<VideoEngine> Create(UniquePtr<const webrtc::Config>&& aConfig);
 #if defined(ANDROID)
   static int SetAndroidObjects();
 #endif
   void CreateVideoCapture(int32_t& id, const char* deviceUniqueIdUTF8);
 
--- a/dom/serviceworkers/ServiceWorkerContainer.cpp
+++ b/dom/serviceworkers/ServiceWorkerContainer.cpp
@@ -72,24 +72,26 @@ ServiceWorkerContainer::Create(nsIGlobal
   return ref.forget();
 }
 
 ServiceWorkerContainer::ServiceWorkerContainer(nsIGlobalObject* aGlobal,
                                                already_AddRefed<ServiceWorkerContainer::Inner> aInner)
   : DOMEventTargetHelper(aGlobal)
   , mInner(aInner)
 {
+  mInner->AddContainer(this);
   Maybe<ServiceWorkerDescriptor> controller = aGlobal->GetController();
   if (controller.isSome()) {
     mControllerWorker = aGlobal->GetOrCreateServiceWorker(controller.ref());
   }
 }
 
 ServiceWorkerContainer::~ServiceWorkerContainer()
 {
+  mInner->RemoveContainer(this);
 }
 
 void
 ServiceWorkerContainer::DisconnectFromOwner()
 {
   mControllerWorker = nullptr;
   mReadyPromise = nullptr;
   DOMEventTargetHelper::DisconnectFromOwner();
@@ -353,37 +355,32 @@ ServiceWorkerContainer::Register(const n
   window->NoteCalledRegisterForServiceWorkerScope(cleanedScopeURL);
 
   RefPtr<Promise> outer = Promise::Create(global, aRv);
   if (aRv.Failed()) {
     return nullptr;
   }
 
   RefPtr<ServiceWorkerContainer> self = this;
-  RefPtr<DOMMozPromiseRequestHolder<ServiceWorkerRegistrationPromise>> holder =
-    new DOMMozPromiseRequestHolder<ServiceWorkerRegistrationPromise>(global);
 
-  mInner->Register(clientInfo.ref(), cleanedScopeURL, cleanedScriptURL,
-                   aOptions.mUpdateViaCache)->Then(
-    global->EventTargetFor(TaskCategory::Other), __func__,
-    [self, outer, holder] (const ServiceWorkerRegistrationDescriptor& aDesc) {
-      holder->Complete();
+  mInner->Register(
+    clientInfo.ref(), cleanedScopeURL, cleanedScriptURL, aOptions.mUpdateViaCache,
+    [self, outer] (const ServiceWorkerRegistrationDescriptor& aDesc) {
       ErrorResult rv;
       nsIGlobalObject* global = self->GetGlobalIfValid(rv);
       if (rv.Failed()) {
         outer->MaybeReject(rv);
         return;
       }
       RefPtr<ServiceWorkerRegistration> reg =
         global->GetOrCreateServiceWorkerRegistration(aDesc);
       outer->MaybeResolve(reg);
-    }, [self, outer, holder] (const CopyableErrorResult& aRv) {
-      holder->Complete();
-      outer->MaybeReject(CopyableErrorResult(aRv));
-    })->Track(*holder);
+    }, [outer] (ErrorResult& aRv) {
+      outer->MaybeReject(aRv);
+    });
 
   return outer.forget();
 }
 
 already_AddRefed<ServiceWorker>
 ServiceWorkerContainer::GetController()
 {
   RefPtr<ServiceWorker> ref = mControllerWorker;
@@ -410,42 +407,37 @@ ServiceWorkerContainer::GetRegistrations
   }
 
   RefPtr<Promise> outer = Promise::Create(global, aRv);
   if (aRv.Failed()) {
     return nullptr;
   }
 
   RefPtr<ServiceWorkerContainer> self = this;
-  RefPtr<DOMMozPromiseRequestHolder<ServiceWorkerRegistrationListPromise>> holder =
-    new DOMMozPromiseRequestHolder<ServiceWorkerRegistrationListPromise>(global);
 
-  mInner->GetRegistrations(clientInfo.ref())->Then(
-    global->EventTargetFor(TaskCategory::Other), __func__,
-    [self, outer, holder] (const nsTArray<ServiceWorkerRegistrationDescriptor>& aDescList) {
-      holder->Complete();
+  mInner->GetRegistrations(clientInfo.ref(),
+    [self, outer] (const nsTArray<ServiceWorkerRegistrationDescriptor>& aDescList) {
       ErrorResult rv;
       nsIGlobalObject* global = self->GetGlobalIfValid(rv);
       if (rv.Failed()) {
         outer->MaybeReject(rv);
         return;
       }
       nsTArray<RefPtr<ServiceWorkerRegistration>> regList;
       for (auto& desc : aDescList) {
         RefPtr<ServiceWorkerRegistration> reg =
           global->GetOrCreateServiceWorkerRegistration(desc);
         if (reg) {
           regList.AppendElement(std::move(reg));
         }
       }
       outer->MaybeResolve(regList);
-    }, [self, outer, holder] (const CopyableErrorResult& aRv) {
-      holder->Complete();
-      outer->MaybeReject(CopyableErrorResult(aRv));
-    })->Track(*holder);
+    }, [self, outer] (ErrorResult& aRv) {
+      outer->MaybeReject(aRv);
+    });
 
   return outer.forget();
 }
 
 already_AddRefed<Promise>
 ServiceWorkerContainer::GetRegistration(const nsAString& aURL,
                                         ErrorResult& aRv)
 {
@@ -483,42 +475,38 @@ ServiceWorkerContainer::GetRegistration(
   }
 
   RefPtr<Promise> outer = Promise::Create(global, aRv);
   if (aRv.Failed()) {
     return nullptr;
   }
 
   RefPtr<ServiceWorkerContainer> self = this;
-  RefPtr<DOMMozPromiseRequestHolder<ServiceWorkerRegistrationPromise>> holder =
-    new DOMMozPromiseRequestHolder<ServiceWorkerRegistrationPromise>(global);
 
-  mInner->GetRegistration(clientInfo.ref(), spec)->Then(
-    global->EventTargetFor(TaskCategory::Other), __func__,
-    [self, outer, holder] (const ServiceWorkerRegistrationDescriptor& aDescriptor) {
-      holder->Complete();
+  mInner->GetRegistration(clientInfo.ref(), spec,
+    [self, outer] (const ServiceWorkerRegistrationDescriptor& aDescriptor) {
       ErrorResult rv;
       nsIGlobalObject* global = self->GetGlobalIfValid(rv);
       if (rv.Failed()) {
         outer->MaybeReject(rv);
         return;
       }
       RefPtr<ServiceWorkerRegistration> reg =
         global->GetOrCreateServiceWorkerRegistration(aDescriptor);
       outer->MaybeResolve(reg);
-    }, [self, outer, holder] (const CopyableErrorResult& aRv) {
-      holder->Complete();
-      ErrorResult rv;
-      Unused << self->GetGlobalIfValid(rv);
-      if (!rv.Failed() && !aRv.Failed()) {
-        outer->MaybeResolveWithUndefined();
-        return;
+    }, [self, outer] (ErrorResult& aRv) {
+      if (!aRv.Failed()) {
+        Unused << self->GetGlobalIfValid(aRv);
+        if (!aRv.Failed()) {
+          outer->MaybeResolveWithUndefined();
+          return;
+        }
       }
-      outer->MaybeReject(CopyableErrorResult(aRv));
-    })->Track(*holder);
+      outer->MaybeReject(aRv);
+    });
 
   return outer.forget();
 }
 
 Promise*
 ServiceWorkerContainer::GetReady(ErrorResult& aRv)
 {
   if (mReadyPromise) {
@@ -539,37 +527,32 @@ ServiceWorkerContainer::GetReady(ErrorRe
 
   mReadyPromise = Promise::Create(global, aRv);
   if (aRv.Failed()) {
     return nullptr;
   }
 
   RefPtr<ServiceWorkerContainer> self = this;
   RefPtr<Promise> outer = mReadyPromise;
-  RefPtr<DOMMozPromiseRequestHolder<ServiceWorkerRegistrationPromise>> holder =
-    new DOMMozPromiseRequestHolder<ServiceWorkerRegistrationPromise>(global);
 
-  mInner->GetReady(clientInfo.ref())->Then(
-    global->EventTargetFor(TaskCategory::Other), __func__,
-    [self, outer, holder] (const ServiceWorkerRegistrationDescriptor& aDescriptor) {
-      holder->Complete();
+  mInner->GetReady(clientInfo.ref(),
+    [self, outer] (const ServiceWorkerRegistrationDescriptor& aDescriptor) {
       ErrorResult rv;
       nsIGlobalObject* global = self->GetGlobalIfValid(rv);
       if (rv.Failed()) {
         outer->MaybeReject(rv);
         return;
       }
       RefPtr<ServiceWorkerRegistration> reg =
         global->GetOrCreateServiceWorkerRegistration(aDescriptor);
       NS_ENSURE_TRUE_VOID(reg);
       outer->MaybeResolve(reg);
-    }, [self, outer, holder] (const CopyableErrorResult& aRv) {
-      holder->Complete();
-      outer->MaybeReject(CopyableErrorResult(aRv));
-    })->Track(*holder);
+    }, [self, outer] (ErrorResult& aRv) {
+      outer->MaybeReject(aRv);
+    });
 
   return mReadyPromise;
 }
 
 // Testing only.
 void
 ServiceWorkerContainer::GetScopeForUrl(const nsAString& aUrl,
                                        nsString& aScope,
--- a/dom/serviceworkers/ServiceWorkerContainer.h
+++ b/dom/serviceworkers/ServiceWorkerContainer.h
@@ -21,31 +21,45 @@ class ServiceWorker;
 
 // Lightweight serviceWorker APIs collection.
 class ServiceWorkerContainer final : public DOMEventTargetHelper
 {
 public:
   class Inner
   {
   public:
-    virtual RefPtr<ServiceWorkerRegistrationPromise>
+    virtual void
+    AddContainer(ServiceWorkerContainer* aOuter) = 0;
+
+    virtual void
+    RemoveContainer(ServiceWorkerContainer* aOuter) = 0;
+
+    virtual void
     Register(const ClientInfo& aClientInfo,
              const nsACString& aScopeURL,
              const nsACString& aScriptURL,
-             ServiceWorkerUpdateViaCache aUpdateViaCache) const = 0;
+             ServiceWorkerUpdateViaCache aUpdateViaCache,
+             ServiceWorkerRegistrationCallback&& aSuccessCB,
+             ServiceWorkerFailureCallback&& aFailureCB) const = 0;
 
-    virtual RefPtr<ServiceWorkerRegistrationPromise>
+    virtual void
     GetRegistration(const ClientInfo& aClientInfo,
-                    const nsACString& aURL) const = 0;
+                    const nsACString& aURL,
+                    ServiceWorkerRegistrationCallback&& aSuccessCB,
+                    ServiceWorkerFailureCallback&& aFailureCB) const = 0;
 
-    virtual RefPtr<ServiceWorkerRegistrationListPromise>
-    GetRegistrations(const ClientInfo& aClientInfo) const = 0;
+    virtual void
+    GetRegistrations(const ClientInfo& aClientInfo,
+                     ServiceWorkerRegistrationListCallback&& aSuccessCB,
+                     ServiceWorkerFailureCallback&& aFailureCB) const = 0;
 
-    virtual RefPtr<ServiceWorkerRegistrationPromise>
-    GetReady(const ClientInfo& aClientInfo) const = 0;
+    virtual void
+    GetReady(const ClientInfo& aClientInfo,
+             ServiceWorkerRegistrationCallback&& aSuccessCB,
+             ServiceWorkerFailureCallback&& aFailureCB) const = 0;
 
     NS_INLINE_DECL_PURE_VIRTUAL_REFCOUNTING
   };
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(ServiceWorkerContainer, DOMEventTargetHelper)
 
   IMPL_EVENT_HANDLER(controllerchange)
--- a/dom/serviceworkers/ServiceWorkerContainerImpl.cpp
+++ b/dom/serviceworkers/ServiceWorkerContainerImpl.cpp
@@ -4,62 +4,172 @@
  * 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/. */
 
 #include "ServiceWorkerContainerImpl.h"
 
 namespace mozilla {
 namespace dom {
 
-RefPtr<ServiceWorkerRegistrationPromise>
+ServiceWorkerContainerImpl::~ServiceWorkerContainerImpl()
+{
+  MOZ_DIAGNOSTIC_ASSERT(!mOuter);
+}
+
+ServiceWorkerContainerImpl::ServiceWorkerContainerImpl()
+  : mOuter(nullptr)
+{
+}
+
+void
+ServiceWorkerContainerImpl::AddContainer(ServiceWorkerContainer* aOuter)
+{
+  MOZ_DIAGNOSTIC_ASSERT(aOuter);
+  MOZ_DIAGNOSTIC_ASSERT(!mOuter);
+  mOuter = aOuter;
+}
+
+void
+ServiceWorkerContainerImpl::RemoveContainer(ServiceWorkerContainer* aOuter)
+{
+  MOZ_DIAGNOSTIC_ASSERT(aOuter);
+  MOZ_DIAGNOSTIC_ASSERT(mOuter == aOuter);
+  mOuter = nullptr;
+}
+
+void
 ServiceWorkerContainerImpl::Register(const ClientInfo& aClientInfo,
                                      const nsACString& aScopeURL,
                                      const nsACString& aScriptURL,
-                                     ServiceWorkerUpdateViaCache aUpdateViaCache) const
+                                     ServiceWorkerUpdateViaCache aUpdateViaCache,
+                                     ServiceWorkerRegistrationCallback&& aSuccessCB,
+                                     ServiceWorkerFailureCallback&& aFailureCB) const
 {
+  MOZ_DIAGNOSTIC_ASSERT(mOuter);
+
+  nsIGlobalObject* global = mOuter->GetParentObject();
+  if (NS_WARN_IF(!global)) {
+    aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR));
+    return;
+  }
+
   RefPtr<ServiceWorkerManager> swm = ServiceWorkerManager::GetInstance();
   if (NS_WARN_IF(!swm)) {
-    return ServiceWorkerRegistrationPromise::CreateAndReject(NS_ERROR_DOM_INVALID_STATE_ERR,
-                                                             __func__);
+    aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR));
+    return;
   }
 
-  return swm->Register(aClientInfo, aScopeURL, aScriptURL, aUpdateViaCache);
+  auto holder =
+    MakeRefPtr<DOMMozPromiseRequestHolder<ServiceWorkerRegistrationPromise>>(global);
+
+  swm->Register(aClientInfo, aScopeURL, aScriptURL, aUpdateViaCache)->Then(
+    global->EventTargetFor(TaskCategory::Other), __func__,
+    [successCB = std::move(aSuccessCB), holder] (const ServiceWorkerRegistrationDescriptor& aDescriptor) {
+      holder->Complete();
+      successCB(aDescriptor);
+    }, [failureCB = std::move(aFailureCB), holder] (const CopyableErrorResult& aResult) {
+      holder->Complete();
+      failureCB(CopyableErrorResult(aResult));
+    })->Track(*holder);
 }
 
-RefPtr<ServiceWorkerRegistrationPromise>
+void
 ServiceWorkerContainerImpl::GetRegistration(const ClientInfo& aClientInfo,
-                                            const nsACString& aURL) const
+                                            const nsACString& aURL,
+                                            ServiceWorkerRegistrationCallback&& aSuccessCB,
+                                            ServiceWorkerFailureCallback&& aFailureCB) const
 {
+  MOZ_DIAGNOSTIC_ASSERT(mOuter);
+
+  nsIGlobalObject* global = mOuter->GetParentObject();
+  if (NS_WARN_IF(!global)) {
+    aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR));
+    return;
+  }
+
   RefPtr<ServiceWorkerManager> swm = ServiceWorkerManager::GetInstance();
   if (NS_WARN_IF(!swm)) {
-    return ServiceWorkerRegistrationPromise::CreateAndReject(NS_ERROR_DOM_INVALID_STATE_ERR,
-                                                             __func__);
+    aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR));
+    return;
   }
 
-  return swm->GetRegistration(aClientInfo, aURL);
+  auto holder =
+    MakeRefPtr<DOMMozPromiseRequestHolder<ServiceWorkerRegistrationPromise>>(global);
+
+  swm->GetRegistration(aClientInfo, aURL)->Then(
+    global->EventTargetFor(TaskCategory::Other), __func__,
+    [successCB = std::move(aSuccessCB), holder] (const ServiceWorkerRegistrationDescriptor& aDescriptor) {
+      holder->Complete();
+      successCB(aDescriptor);
+    }, [failureCB = std::move(aFailureCB), holder] (const CopyableErrorResult& aResult) {
+      holder->Complete();
+      failureCB(CopyableErrorResult(aResult));
+    })->Track(*holder);
 }
 
-RefPtr<ServiceWorkerRegistrationListPromise>
-ServiceWorkerContainerImpl::GetRegistrations(const ClientInfo& aClientInfo) const
+void
+ServiceWorkerContainerImpl::GetRegistrations(const ClientInfo& aClientInfo,
+                                             ServiceWorkerRegistrationListCallback&& aSuccessCB,
+                                             ServiceWorkerFailureCallback&& aFailureCB) const
 {
+  MOZ_DIAGNOSTIC_ASSERT(mOuter);
+
+  nsIGlobalObject* global = mOuter->GetParentObject();
+  if (NS_WARN_IF(!global)) {
+    aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR));
+    return;
+  }
+
   RefPtr<ServiceWorkerManager> swm = ServiceWorkerManager::GetInstance();
   if (NS_WARN_IF(!swm)) {
-    return ServiceWorkerRegistrationListPromise::CreateAndReject(NS_ERROR_DOM_INVALID_STATE_ERR,
-                                                                 __func__);
+    aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR));
+    return;
   }
 
-  return swm->GetRegistrations(aClientInfo);
+  auto holder =
+    MakeRefPtr<DOMMozPromiseRequestHolder<ServiceWorkerRegistrationListPromise>>(global);
+
+  swm->GetRegistrations(aClientInfo)->Then(
+    global->EventTargetFor(TaskCategory::Other), __func__,
+    [successCB = std::move(aSuccessCB), holder] (const nsTArray<ServiceWorkerRegistrationDescriptor>& aList) {
+      holder->Complete();
+      successCB(aList);
+    }, [failureCB = std::move(aFailureCB), holder] (const CopyableErrorResult& aResult) {
+      holder->Complete();
+      failureCB(CopyableErrorResult(aResult));
+    })->Track(*holder);
 }
 
-RefPtr<ServiceWorkerRegistrationPromise>
-ServiceWorkerContainerImpl::GetReady(const ClientInfo& aClientInfo) const
+void
+ServiceWorkerContainerImpl::GetReady(const ClientInfo& aClientInfo,
+                                     ServiceWorkerRegistrationCallback&& aSuccessCB,
+                                     ServiceWorkerFailureCallback&& aFailureCB) const
 {
+  MOZ_DIAGNOSTIC_ASSERT(mOuter);
+
+  nsIGlobalObject* global = mOuter->GetParentObject();
+  if (NS_WARN_IF(!global)) {
+    aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR));
+    return;
+  }
+
   RefPtr<ServiceWorkerManager> swm = ServiceWorkerManager::GetInstance();
   if (NS_WARN_IF(!swm)) {
-    return ServiceWorkerRegistrationPromise::CreateAndReject(NS_ERROR_DOM_INVALID_STATE_ERR,
-                                                             __func__);
+    aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR));
+    return;
   }
 
-  return swm->WhenReady(aClientInfo);
+  auto holder =
+    MakeRefPtr<DOMMozPromiseRequestHolder<ServiceWorkerRegistrationPromise>>(global);
+
+  swm->WhenReady(aClientInfo)->Then(
+    global->EventTargetFor(TaskCategory::Other), __func__,
+    [successCB = std::move(aSuccessCB), holder] (const ServiceWorkerRegistrationDescriptor& aDescriptor) {
+      holder->Complete();
+      successCB(aDescriptor);
+    }, [failureCB = std::move(aFailureCB), holder] (const CopyableErrorResult& aResult) {
+      holder->Complete();
+      failureCB(CopyableErrorResult(aResult));
+    })->Track(*holder);
 }
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/serviceworkers/ServiceWorkerContainerImpl.h
+++ b/dom/serviceworkers/ServiceWorkerContainerImpl.h
@@ -10,36 +10,52 @@
 #include "ServiceWorkerContainer.h"
 
 namespace mozilla {
 namespace dom {
 
 // Lightweight serviceWorker APIs collection.
 class ServiceWorkerContainerImpl final : public ServiceWorkerContainer::Inner
 {
-  ~ServiceWorkerContainerImpl() = default;
+  ServiceWorkerContainer* mOuter;
+
+  ~ServiceWorkerContainerImpl();
 
 public:
-  ServiceWorkerContainerImpl() = default;
+  ServiceWorkerContainerImpl();
+
+  void
+  AddContainer(ServiceWorkerContainer* aOuter) override;
 
-  RefPtr<ServiceWorkerRegistrationPromise>
+  void
+  RemoveContainer(ServiceWorkerContainer* aOuter) override;
+
+  void
   Register(const ClientInfo& aClientInfo,
            const nsACString& aScopeURL,
            const nsACString& aScriptURL,
-           ServiceWorkerUpdateViaCache aUpdateViaCache) const override;
+           ServiceWorkerUpdateViaCache aUpdateViaCache,
+           ServiceWorkerRegistrationCallback&& aSuccessCB,
+           ServiceWorkerFailureCallback&& aFailureCB) const override;
 
-  RefPtr<ServiceWorkerRegistrationPromise>
+  void
   GetRegistration(const ClientInfo& aClientInfo,
-                  const nsACString& aURL) const override;
+                  const nsACString& aURL,
+                  ServiceWorkerRegistrationCallback&& aSuccessCB,
+                  ServiceWorkerFailureCallback&& aFailureCB) const override;
 
-  RefPtr<ServiceWorkerRegistrationListPromise>
-  GetRegistrations(const ClientInfo& aClientInfo) const override;
+  void
+  GetRegistrations(const ClientInfo& aClientInfo,
+                   ServiceWorkerRegistrationListCallback&& aSuccessCB,
+                   ServiceWorkerFailureCallback&& aFailureCB) const override;
 
-  RefPtr<ServiceWorkerRegistrationPromise>
-  GetReady(const ClientInfo& aClientInfo) const override;
+  void
+  GetReady(const ClientInfo& aClientInfo,
+           ServiceWorkerRegistrationCallback&& aSuccessCB,
+           ServiceWorkerFailureCallback&& aFailureCB) const override;
 
   NS_INLINE_DECL_REFCOUNTING(ServiceWorkerContainerImpl, override)
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif /* mozilla_dom_serviceworkercontainerimpl_h__ */
--- a/dom/serviceworkers/ServiceWorkerRegistration.cpp
+++ b/dom/serviceworkers/ServiceWorkerRegistration.cpp
@@ -208,36 +208,31 @@ ServiceWorkerRegistration::Update(ErrorR
   }
 
   RefPtr<Promise> outer = Promise::Create(global, aRv);
   if (NS_WARN_IF(aRv.Failed())) {
     return nullptr;
   }
 
   RefPtr<ServiceWorkerRegistration> self = this;
-  RefPtr<DOMMozPromiseRequestHolder<ServiceWorkerRegistrationPromise>> holder =
-    new DOMMozPromiseRequestHolder<ServiceWorkerRegistrationPromise>(global);
 
-  mInner->Update()->Then(
-    global->EventTargetFor(TaskCategory::Other), __func__,
-    [outer, self, holder](const ServiceWorkerRegistrationDescriptor& aDesc) {
-      holder->Complete();
+  mInner->Update(
+    [outer, self](const ServiceWorkerRegistrationDescriptor& aDesc) {
       nsIGlobalObject* global = self->GetParentObject();
       MOZ_DIAGNOSTIC_ASSERT(global);
       RefPtr<ServiceWorkerRegistration> ref =
         global->GetOrCreateServiceWorkerRegistration(aDesc);
       if (!ref) {
         outer->MaybeReject(NS_ERROR_DOM_INVALID_STATE_ERR);
         return;
       }
       outer->MaybeResolve(ref);
-    }, [outer, holder] (const CopyableErrorResult& aRv) {
-      holder->Complete();
-      outer->MaybeReject(CopyableErrorResult(aRv));
-    })->Track(*holder);
+    }, [outer] (ErrorResult& aRv) {
+      outer->MaybeReject(aRv);
+    });
 
   return outer.forget();
 }
 
 already_AddRefed<Promise>
 ServiceWorkerRegistration::Unregister(ErrorResult& aRv)
 {
   if (!mInner) {
@@ -251,28 +246,22 @@ ServiceWorkerRegistration::Unregister(Er
     return nullptr;
   }
 
   RefPtr<Promise> outer = Promise::Create(global, aRv);
   if (NS_WARN_IF(aRv.Failed())) {
     return nullptr;
   }
 
-  RefPtr<DOMMozPromiseRequestHolder<GenericPromise>> holder =
-    new DOMMozPromiseRequestHolder<GenericPromise>(global);
-
-  mInner->Unregister()->Then(
-    global->EventTargetFor(TaskCategory::Other), __func__,
-    [outer, holder] (bool aSuccess) {
-      holder->Complete();
+  mInner->Unregister(
+    [outer] (bool aSuccess) {
       outer->MaybeResolve(aSuccess);
-    }, [outer, holder] (nsresult aRv) {
-      holder->Complete();
+    }, [outer] (ErrorResult& aRv) {
       outer->MaybeReject(aRv);
-    })->Track(*holder);
+    });
 
   return outer.forget();
 }
 
 already_AddRefed<PushManager>
 ServiceWorkerRegistration::GetPushManager(JSContext* aCx, ErrorResult& aRv)
 {
   if (!mPushManager) {
--- a/dom/serviceworkers/ServiceWorkerRegistration.h
+++ b/dom/serviceworkers/ServiceWorkerRegistration.h
@@ -39,21 +39,23 @@ public:
     NS_INLINE_DECL_PURE_VIRTUAL_REFCOUNTING
 
     virtual void
     SetServiceWorkerRegistration(ServiceWorkerRegistration* aReg) = 0;
 
     virtual void
     ClearServiceWorkerRegistration(ServiceWorkerRegistration* aReg) = 0;
 
-    virtual RefPtr<ServiceWorkerRegistrationPromise>
-    Update() = 0;
+    virtual void
+    Update(ServiceWorkerRegistrationCallback&& aSuccessCB,
+           ServiceWorkerFailureCallback&& aFailureCB) = 0;
 
-    virtual RefPtr<GenericPromise>
-    Unregister() = 0;
+    virtual void
+    Unregister(ServiceWorkerBoolCallback&& aSuccessCB,
+               ServiceWorkerFailureCallback&& aFailureCB) = 0;
   };
 
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_DOM_SERVICEWORKERREGISTRATION_IID)
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(ServiceWorkerRegistration, DOMEventTargetHelper)
 
   IMPL_EVENT_HANDLER(updatefound)
 
--- a/dom/serviceworkers/ServiceWorkerRegistrationImpl.cpp
+++ b/dom/serviceworkers/ServiceWorkerRegistrationImpl.cpp
@@ -518,62 +518,98 @@ public:
     }
 
     return NS_OK;
   }
 };
 
 } // namespace
 
-RefPtr<ServiceWorkerRegistrationPromise>
-ServiceWorkerRegistrationMainThread::Update()
+void
+ServiceWorkerRegistrationMainThread::Update(ServiceWorkerRegistrationCallback&& aSuccessCB,
+                                            ServiceWorkerFailureCallback&& aFailureCB)
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_DIAGNOSTIC_ASSERT(mOuter);
 
+  nsIGlobalObject* global = mOuter->GetParentObject();
+  if (!global) {
+    aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR));
+    return;
+  }
+
   nsCOMPtr<nsIPrincipal> principal = mDescriptor.GetPrincipal();
   if (!principal) {
-    return ServiceWorkerRegistrationPromise::CreateAndReject(
-      NS_ERROR_DOM_INVALID_STATE_ERR, __func__);
+    aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR));
+    return;
   }
 
   RefPtr<MainThreadUpdateCallback> cb = new MainThreadUpdateCallback();
   UpdateInternal(principal, NS_ConvertUTF16toUTF8(mScope), cb);
 
-  return cb->Promise();
+  auto holder =
+    MakeRefPtr<DOMMozPromiseRequestHolder<ServiceWorkerRegistrationPromise>>(global);
+
+  cb->Promise()->Then(
+    global->EventTargetFor(TaskCategory::Other), __func__,
+    [successCB = std::move(aSuccessCB), holder] (const ServiceWorkerRegistrationDescriptor& aDescriptor) {
+      holder->Complete();
+      successCB(aDescriptor);
+    }, [failureCB = std::move(aFailureCB), holder] (const CopyableErrorResult& aRv) {
+      holder->Complete();
+      failureCB(CopyableErrorResult(aRv));
+    })->Track(*holder);
 }
 
-RefPtr<GenericPromise>
-ServiceWorkerRegistrationMainThread::Unregister()
+void
+ServiceWorkerRegistrationMainThread::Unregister(ServiceWorkerBoolCallback&& aSuccessCB,
+                                                ServiceWorkerFailureCallback&& aFailureCB)
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_DIAGNOSTIC_ASSERT(mOuter);
 
+  nsIGlobalObject* global = mOuter->GetParentObject();
+  if (!global) {
+    aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR));
+    return;
+  }
+
   nsCOMPtr<nsIServiceWorkerManager> swm =
     mozilla::services::GetServiceWorkerManager();
   if (!swm) {
-    return GenericPromise::CreateAndReject(NS_ERROR_DOM_INVALID_STATE_ERR,
-                                           __func__);
+    aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR));
+    return;
   }
 
   nsCOMPtr<nsIPrincipal> principal = mDescriptor.GetPrincipal();
   if (!principal) {
-    return GenericPromise::CreateAndReject(NS_ERROR_DOM_INVALID_STATE_ERR,
-                                           __func__);
+    aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR));
+    return;
   }
 
   RefPtr<UnregisterCallback> cb = new UnregisterCallback();
 
   nsresult rv = swm->Unregister(principal, cb,
                                 NS_ConvertUTF8toUTF16(mDescriptor.Scope()));
   if (NS_FAILED(rv)) {
-    return GenericPromise::CreateAndReject(rv, __func__);
+    aFailureCB(CopyableErrorResult(rv));
+    return;
   }
 
-  return cb->Promise();
+  auto holder = MakeRefPtr<DOMMozPromiseRequestHolder<GenericPromise>>(global);
+
+  cb->Promise()->Then(
+    global->EventTargetFor(TaskCategory::Other), __func__,
+    [successCB = std::move(aSuccessCB), holder] (bool aResult) {
+      holder->Complete();
+      successCB(aResult);
+    }, [failureCB = std::move(aFailureCB), holder] (nsresult aRv) {
+      holder->Complete();
+      failureCB(CopyableErrorResult(aRv));
+    })->Track(*holder);
 }
 
 ////////////////////////////////////////////////////
 // Worker Thread implementation
 
 class WorkerListener final : public ServiceWorkerRegistrationListener
 {
   const nsString mScope;
@@ -707,98 +743,130 @@ ServiceWorkerRegistrationWorkerThread::S
 void
 ServiceWorkerRegistrationWorkerThread::ClearServiceWorkerRegistration(ServiceWorkerRegistration* aReg)
 {
   MOZ_ASSERT_IF(mOuter, mOuter == aReg);
   ReleaseListener();
   mOuter = nullptr;
 }
 
-RefPtr<ServiceWorkerRegistrationPromise>
-ServiceWorkerRegistrationWorkerThread::Update()
+void
+ServiceWorkerRegistrationWorkerThread::Update(ServiceWorkerRegistrationCallback&& aSuccessCB,
+                                              ServiceWorkerFailureCallback&& aFailureCB)
 {
   if (NS_WARN_IF(!mWorkerRef->GetPrivate())) {
-    return ServiceWorkerRegistrationPromise::CreateAndReject(
-      NS_ERROR_DOM_INVALID_STATE_ERR, __func__);
+    aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR));
+    return;
   }
 
   RefPtr<StrongWorkerRef> workerRef =
     StrongWorkerRef::Create(mWorkerRef->GetPrivate(),
                             "ServiceWorkerRegistration::Update");
   if (NS_WARN_IF(!workerRef)) {
-    return ServiceWorkerRegistrationPromise::CreateAndReject(
-      NS_ERROR_DOM_INVALID_STATE_ERR, __func__);
+    aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR));
+    return;
+  }
+
+  nsIGlobalObject* global = workerRef->Private()->GlobalScope();
+  if (NS_WARN_IF(!global)) {
+    aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR));
+    return;
+  }
+
+  // Eventually we need to support all workers, but for right now this
+  // code assumes we're on a service worker global as self.registration.
+  if (NS_WARN_IF(!workerRef->Private()->IsServiceWorker())) {
+    aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR));
+    return;
   }
 
   // Avoid infinite update loops by ignoring update() calls during top
   // level script evaluation.  See:
   // https://github.com/slightlyoff/ServiceWorker/issues/800
   if (workerRef->Private()->IsLoadingWorkerScript()) {
-    return ServiceWorkerRegistrationPromise::CreateAndResolve(mDescriptor,
-                                                              __func__);
+    aSuccessCB(mDescriptor);
+    return;
+  }
+
+  auto promise = MakeRefPtr<ServiceWorkerRegistrationPromise::Private>(__func__);
+  auto holder =
+    MakeRefPtr<DOMMozPromiseRequestHolder<ServiceWorkerRegistrationPromise>>(global);
+
+  promise->Then(
+    global->EventTargetFor(TaskCategory::Other), __func__,
+    [successCB = std::move(aSuccessCB), holder] (const ServiceWorkerRegistrationDescriptor& aDescriptor) {
+      holder->Complete();
+      successCB(aDescriptor);
+    }, [failureCB = std::move(aFailureCB), holder] (const CopyableErrorResult& aRv) {
+      holder->Complete();
+      failureCB(CopyableErrorResult(aRv));
+    })->Track(*holder);
+
+  RefPtr<SWRUpdateRunnable> r =
+    new SWRUpdateRunnable(workerRef,
+                          promise,
+                          workerRef->Private()->GetServiceWorkerDescriptor());
+
+  nsresult rv = workerRef->Private()->DispatchToMainThread(r.forget());
+  if (NS_FAILED(rv)) {
+    promise->Reject(NS_ERROR_DOM_INVALID_STATE_ERR, __func__);
+    return;
+  }
+}
+
+void
+ServiceWorkerRegistrationWorkerThread::Unregister(ServiceWorkerBoolCallback&& aSuccessCB,
+                                                  ServiceWorkerFailureCallback&& aFailureCB)
+{
+  if (NS_WARN_IF(!mWorkerRef->GetPrivate())) {
+    aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR));
+    return;
+  }
+
+  RefPtr<StrongWorkerRef> workerRef =
+    StrongWorkerRef::Create(mWorkerRef->GetPrivate(), __func__);
+  if (NS_WARN_IF(!workerRef)) {
+    aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR));
+    return;
   }
 
   // Eventually we need to support all workers, but for right now this
   // code assumes we're on a service worker global as self.registration.
   if (NS_WARN_IF(!workerRef->Private()->IsServiceWorker())) {
-    return ServiceWorkerRegistrationPromise::CreateAndReject(
-      NS_ERROR_DOM_INVALID_STATE_ERR, __func__);
+    aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR));
+    return;
   }
 
-  RefPtr<ServiceWorkerRegistrationPromise::Private> outer =
-    new ServiceWorkerRegistrationPromise::Private(__func__);
-
-  RefPtr<SWRUpdateRunnable> r =
-    new SWRUpdateRunnable(workerRef,
-                          outer,
-                          workerRef->Private()->GetServiceWorkerDescriptor());
-
-  nsresult rv = workerRef->Private()->DispatchToMainThread(r.forget());
-  if (NS_FAILED(rv)) {
-    outer->Reject(NS_ERROR_DOM_INVALID_STATE_ERR, __func__);
-    return outer.forget();
+  nsIGlobalObject* global = workerRef->Private()->GlobalScope();
+  if (!global) {
+    aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR));
+    return;
   }
 
-  return outer.forget();
-}
-
-RefPtr<GenericPromise>
-ServiceWorkerRegistrationWorkerThread::Unregister()
-{
-  if (NS_WARN_IF(!mWorkerRef->GetPrivate())) {
-    return GenericPromise::CreateAndReject(
-      NS_ERROR_DOM_INVALID_STATE_ERR, __func__);
-  }
+  auto promise = MakeRefPtr<GenericPromise::Private>(__func__);
+  auto holder = MakeRefPtr<DOMMozPromiseRequestHolder<GenericPromise>>(global);
 
-  RefPtr<StrongWorkerRef> workerRef =
-    StrongWorkerRef::Create(mWorkerRef->GetPrivate(), __func__);
-  if (NS_WARN_IF(!workerRef)) {
-    return GenericPromise::CreateAndReject(
-      NS_ERROR_DOM_INVALID_STATE_ERR, __func__);
-  }
-
-  // Eventually we need to support all workers, but for right now this
-  // code assumes we're on a service worker global as self.registration.
-  if (NS_WARN_IF(!workerRef->Private()->IsServiceWorker())) {
-    return GenericPromise::CreateAndReject(
-      NS_ERROR_DOM_SECURITY_ERR, __func__);
-  }
-
-  RefPtr<GenericPromise::Private> outer = new GenericPromise::Private(__func__);
+  promise->Then(
+    global->EventTargetFor(TaskCategory::Other), __func__,
+    [successCB = std::move(aSuccessCB), holder] (bool aResult) {
+      holder->Complete();
+      successCB(aResult);
+    }, [failureCB = std::move(aFailureCB), holder] (nsresult aRv) {
+      holder->Complete();
+      failureCB(CopyableErrorResult(aRv));
+    })->Track(*holder);
 
   RefPtr<StartUnregisterRunnable> r =
-    new StartUnregisterRunnable(workerRef, outer, mDescriptor);
+    new StartUnregisterRunnable(workerRef, promise, mDescriptor);
 
   nsresult rv = workerRef->Private()->DispatchToMainThread(r);
   if (NS_FAILED(rv)) {
-    outer->Reject(NS_ERROR_DOM_INVALID_STATE_ERR, __func__);
-    return outer.forget();
+    promise->Reject(NS_ERROR_DOM_INVALID_STATE_ERR, __func__);
+    return;
   }
-
-  return outer.forget();
 }
 
 void
 ServiceWorkerRegistrationWorkerThread::InitListener()
 {
   MOZ_ASSERT(!mListener);
   WorkerPrivate* worker = GetCurrentThreadWorkerPrivate();
   MOZ_ASSERT(worker);
--- a/dom/serviceworkers/ServiceWorkerRegistrationImpl.h
+++ b/dom/serviceworkers/ServiceWorkerRegistrationImpl.h
@@ -37,21 +37,23 @@ public:
 
   // ServiceWorkerRegistration::Inner
   void
   SetServiceWorkerRegistration(ServiceWorkerRegistration* aReg) override;
 
   void
   ClearServiceWorkerRegistration(ServiceWorkerRegistration* aReg) override;
 
-  RefPtr<ServiceWorkerRegistrationPromise>
-  Update() override;
+  void
+  Update(ServiceWorkerRegistrationCallback&& aSuccessCB,
+         ServiceWorkerFailureCallback&& aFailureCB) override;
 
-  RefPtr<GenericPromise>
-  Unregister() override;
+  void
+  Unregister(ServiceWorkerBoolCallback&& aSuccessCB,
+             ServiceWorkerFailureCallback&& aFailureCB) override;
 
   // ServiceWorkerRegistrationListener
   void
   UpdateFound() override;
 
   void
   UpdateState(const ServiceWorkerRegistrationDescriptor& aDescriptor) override;
 
@@ -104,21 +106,23 @@ public:
 
   // ServiceWorkerRegistration::Inner
   void
   SetServiceWorkerRegistration(ServiceWorkerRegistration* aReg) override;
 
   void
   ClearServiceWorkerRegistration(ServiceWorkerRegistration* aReg) override;
 
-  RefPtr<ServiceWorkerRegistrationPromise>
-  Update() override;
+  void
+  Update(ServiceWorkerRegistrationCallback&& aSuccessCB,
+         ServiceWorkerFailureCallback&& aFailureCB) override;
 
-  RefPtr<GenericPromise>
-  Unregister() override;
+  void
+  Unregister(ServiceWorkerBoolCallback&& aSuccessCB,
+             ServiceWorkerFailureCallback&& aFailureCB) override;
 
   void
   UpdateFound();
 
 private:
   ~ServiceWorkerRegistrationWorkerThread();
 
   void
--- a/dom/serviceworkers/ServiceWorkerUtils.h
+++ b/dom/serviceworkers/ServiceWorkerUtils.h
@@ -20,16 +20,28 @@ class ServiceWorkerRegistrationData;
 class ServiceWorkerRegistrationDescriptor;
 
 typedef MozPromise<ServiceWorkerRegistrationDescriptor, CopyableErrorResult, false>
         ServiceWorkerRegistrationPromise;
 
 typedef MozPromise<nsTArray<ServiceWorkerRegistrationDescriptor>, CopyableErrorResult, false>
         ServiceWorkerRegistrationListPromise;
 
+typedef std::function<void (const ServiceWorkerRegistrationDescriptor&)>
+        ServiceWorkerRegistrationCallback;
+
+typedef std::function<void (const nsTArray<ServiceWorkerRegistrationDescriptor>&)>
+        ServiceWorkerRegistrationListCallback;
+
+typedef std::function<void (bool)>
+        ServiceWorkerBoolCallback;
+
+typedef std::function<void (ErrorResult&)>
+        ServiceWorkerFailureCallback;
+
 bool
 ServiceWorkerParentInterceptEnabled();
 
 bool
 ServiceWorkerRegistrationDataIsValid(const ServiceWorkerRegistrationData& aData);
 
 nsresult
 ServiceWorkerScopeAndScriptAreValid(const ClientInfo& aClientInfo,
--- a/dom/vr/VRDisplay.cpp
+++ b/dom/vr/VRDisplay.cpp
@@ -265,16 +265,19 @@ VRPose::VRPose(nsISupports* aParent, con
 {
   mFrameId = aState.inputFrameID;
   mozilla::HoldJSObjects(this);
 }
 
 VRPose::VRPose(nsISupports* aParent)
   : Pose(aParent)
 {
+  mVRState.inputFrameID = 0;
+  mVRState.timestamp = 0.0;
+  mVRState.flags = gfx::VRDisplayCapabilityFlags::Cap_None;
   mFrameId = 0;
   mozilla::HoldJSObjects(this);
 }
 
 VRPose::~VRPose()
 {
   mozilla::DropJSObjects(this);
 }
@@ -920,16 +923,19 @@ VRFrameInfo::Update(const gfx::VRDisplay
   mRightProjection = rightFOV.ConstructProjectionMatrix(aDepthNear, aDepthFar, true);
   memcpy(mLeftView.components, aState.leftViewMatrix, sizeof(aState.leftViewMatrix));
   memcpy(mRightView.components, aState.rightViewMatrix, sizeof(aState.rightViewMatrix));
 }
 
 VRFrameInfo::VRFrameInfo()
  : mTimeStampOffset(0.0f)
 {
+  mVRState.inputFrameID = 0;
+  mVRState.timestamp = 0.0;
+  mVRState.flags = gfx::VRDisplayCapabilityFlags::Cap_None;
 }
 
 bool
 VRFrameInfo::IsDirty()
 {
   return mVRState.timestamp == 0;
 }
 
--- a/gfx/layers/ipc/CrossProcessCompositorBridgeParent.cpp
+++ b/gfx/layers/ipc/CrossProcessCompositorBridgeParent.cpp
@@ -201,17 +201,17 @@ CrossProcessCompositorBridgeParent::Allo
 #ifndef MOZ_BUILD_WEBRENDER
   // Extra guard since this in the parent process and we don't want a malicious
   // child process invoking this codepath before it's ready
   MOZ_RELEASE_ASSERT(false);
 #endif
   LayersId layersId = wr::AsLayersId(aPipelineId);
   // Check to see if this child process has access to this layer tree.
   if (!LayerTreeOwnerTracker::Get()->IsMapped(layersId, OtherPid())) {
-    NS_ERROR("Unexpected layers id in AllocPAPZCTreeManagerParent; dropping message...");
+    NS_ERROR("Unexpected layers id in AllocPWebRenderBridgeParent; dropping message...");
     return nullptr;
   }
 
   RefPtr<CompositorBridgeParent> cbp = nullptr;
   RefPtr<WebRenderBridgeParent> root = nullptr;
 
   { // scope lock
     MonitorAutoLock lock(*sIndirectLayerTreesLock);
--- a/gfx/vr/gfxVR.h
+++ b/gfx/vr/gfxVR.h
@@ -101,17 +101,18 @@ struct VRDisplayInfo
   bool operator!=(const VRDisplayInfo& other) const {
     return !(*this == other);
   }
 };
 
 struct VRSubmitFrameResultInfo
 {
   VRSubmitFrameResultInfo()
-   : mFrameNum(0),
+   : mFormat(SurfaceFormat::UNKNOWN),
+     mFrameNum(0),
      mWidth(0),
      mHeight(0)
   {}
 
   nsCString mBase64Image;
   SurfaceFormat mFormat;
   uint64_t mFrameNum;
   uint32_t mWidth;
--- a/gfx/vr/gfxVROpenVR.cpp
+++ b/gfx/vr/gfxVROpenVR.cpp
@@ -426,16 +426,17 @@ VRDisplayOpenVR::SubmitFrame(MacIOSurfac
 }
 
 #endif
 
 VRControllerOpenVR::VRControllerOpenVR(dom::GamepadHand aHand, uint32_t aDisplayID,
                                        uint32_t aNumButtons, uint32_t aNumTriggers,
                                        uint32_t aNumAxes, const nsCString& aId)
   : VRControllerHost(VRDeviceType::OpenVR, aHand, aDisplayID)
+  , mTrackedIndex(0)
   , mVibrateThread(nullptr)
   , mIsVibrateStopped(false)
 {
   MOZ_COUNT_CTOR_INHERITED(VRControllerOpenVR, VRControllerHost);
 
   VRControllerState& state = mControllerInfo.mControllerState;
   strncpy(state.mControllerName, aId.BeginReading(), kVRControllerNameMaxLen);
   state.mNumButtons = aNumButtons;
--- a/ipc/chromium/src/base/process_util_mac.mm
+++ b/ipc/chromium/src/base/process_util_mac.mm
@@ -35,16 +35,19 @@ bool LaunchApp(const std::vector<std::st
     argv_copy[i] = const_cast<char*>(argv[i].c_str());
   }
   argv_copy[argv.size()] = NULL;
 
   EnvironmentArray vars = BuildEnvironmentArray(options.env_map);
 
   posix_spawn_file_actions_t file_actions;
   if (posix_spawn_file_actions_init(&file_actions) != 0) {
+#ifdef ASYNC_CONTENTPROC_LAUNCH
+    MOZ_CRASH("base::LaunchApp: posix_spawn_file_actions_init failed");
+#endif
     return false;
   }
   auto file_actions_guard = mozilla::MakeScopeExit([&file_actions] {
     posix_spawn_file_actions_destroy(&file_actions);
   });
 
   // Turn fds_to_remap array into a set of dup2 calls.
   for (const auto& fd_map : options.fds_to_remap) {
@@ -53,54 +56,77 @@ bool LaunchApp(const std::vector<std::st
 
     if (src_fd == dest_fd) {
       int flags = fcntl(src_fd, F_GETFD);
       if (flags != -1) {
         fcntl(src_fd, F_SETFD, flags & ~FD_CLOEXEC);
       }
     } else {
       if (posix_spawn_file_actions_adddup2(&file_actions, src_fd, dest_fd) != 0) {
+#ifdef ASYNC_CONTENTPROC_LAUNCH
+        MOZ_CRASH("base::LaunchApp: posix_spawn_file_actions_adddup2 failed");
+#endif
         return false;
       }
     }
   }
 
   // Initialize spawn attributes.
   posix_spawnattr_t spawnattr;
   if (posix_spawnattr_init(&spawnattr) != 0) {
+#ifdef ASYNC_CONTENTPROC_LAUNCH
+    MOZ_CRASH("base::LaunchApp: posix_spawnattr_init failed");
+#endif
     return false;
   }
   auto spawnattr_guard = mozilla::MakeScopeExit([&spawnattr] {
     posix_spawnattr_destroy(&spawnattr);
   });
 
   // Prevent the child process from inheriting any file descriptors
   // that aren't named in `file_actions`.  (This is an Apple-specific
   // extension to posix_spawn.)
   if (posix_spawnattr_setflags(&spawnattr, POSIX_SPAWN_CLOEXEC_DEFAULT) != 0) {
+#ifdef ASYNC_CONTENTPROC_LAUNCH
+    MOZ_CRASH("base::LaunchApp: posix_spawnattr_setflags failed");
+#endif
     return false;
   }
 
   // Exempt std{in,out,err} from being closed by POSIX_SPAWN_CLOEXEC_DEFAULT.
   for (int fd = 0; fd <= STDERR_FILENO; ++fd) {
     if (posix_spawn_file_actions_addinherit_np(&file_actions, fd) != 0) {
+#ifdef ASYNC_CONTENTPROC_LAUNCH
+      MOZ_CRASH("base::LaunchApp: posix_spawn_file_actions_addinherit_np "
+                "failed");
+#endif
       return false;
     }
   }
 
   int pid = 0;
   int spawn_succeeded = (posix_spawnp(&pid,
                                       argv_copy[0],
                                       &file_actions,
                                       &spawnattr,
                                       argv_copy,
                                       vars.get()) == 0);
 
   bool process_handle_valid = pid > 0;
   if (!spawn_succeeded || !process_handle_valid) {
+#ifdef ASYNC_CONTENTPROC_LAUNCH
+    if (!spawn_succeeded && !process_handle_valid) {
+      MOZ_CRASH("base::LaunchApp: spawn_succeeded is false and "
+                "process_handle_valid is false");
+    } else if (!spawn_succeeded) {
+      MOZ_CRASH("base::LaunchApp: spawn_succeeded is false");
+    } else {
+      MOZ_CRASH("base::LaunchApp: process_handle_valid is false");
+    }
+#endif
     retval = false;
   } else {
     gProcessLog.print("==> process %d launched child process %d\n",
                       GetCurrentProcId(), pid);
     if (options.wait)
       HANDLE_EINTR(waitpid(pid, 0, 0));
 
     if (process_handle)
--- a/media/libcubeb/README_MOZILLA
+++ b/media/libcubeb/README_MOZILLA
@@ -1,8 +1,8 @@
 The source from this directory was copied from the cubeb
 git repository using the update.sh script.  The only changes
 made were those applied by update.sh and the addition of
 Makefile.in build files for the Mozilla build system.
 
 The cubeb git repository is: git://github.com/kinetiknz/cubeb.git
 
-The git commit ID used was abf6ae235b0f15a2656f2d8692ac13708188165e (2018-06-01 13:02:45 +1200)
+The git commit ID used was 0677b3027b78c629586b099b5155aa6ac7422674 (2018-06-12 08:48:55 -0700)
--- a/media/libcubeb/src/cubeb_sndio.c
+++ b/media/libcubeb/src/cubeb_sndio.c
@@ -46,27 +46,43 @@ struct cubeb_stream {
   unsigned int pbpf;              /* play bytes per frame */
   unsigned int rchan;             /* number of rec channels */
   unsigned int pchan;             /* number of play channels */
   unsigned int nblks;		  /* number of blocks in the buffer */
   uint64_t hwpos;                 /* frame number Joe hears right now */
   uint64_t swpos;                 /* number of frames produced/consumed */
   cubeb_data_callback data_cb;    /* cb to preapare data */
   cubeb_state_callback state_cb;  /* cb to notify about state changes */
+  float volume;			  /* current volume */
 };
 
 static void
-float_to_s16(void *ptr, long nsamp)
+s16_setvol(void *ptr, long nsamp, float volume)
+{
+  int16_t *dst = ptr;
+  int32_t mult = volume * 32768;
+  int32_t s;
+
+  while (nsamp-- > 0) {
+    s = *dst;
+    s = (s * mult) >> 15;
+    *(dst++) = s;
+  }
+}
+
+static void
+float_to_s16(void *ptr, long nsamp, float volume)
 {
   int16_t *dst = ptr;
   float *src = ptr;
+  float mult = volume * 32768;
   int s;
 
   while (nsamp-- > 0) {
-    s = lrintf(*(src++) * 32768);
+    s = lrintf(*(src++) * mult);
     if (s < -32768)
       s = -32768;
     else if (s > 32767)
       s = 32767;
     *(dst++) = s;
   }
 }
 
@@ -164,18 +180,22 @@ sndio_mainloop(void *arg)
         /* need to write (aka drain) the partial play block we got */
         pend = nfr * s->pbpf;
         eof = 1;
       }
 
       if (prime > 0)
         prime--;
 
-      if ((s->mode & SIO_PLAY) && s->conv)
-          float_to_s16(s->pbuf, nfr * s->pchan);
+      if (s->mode & SIO_PLAY) {
+        if (s->conv)
+          float_to_s16(s->pbuf, nfr * s->pchan, s->volume);
+        else
+          s16_setvol(s->pbuf, nfr * s->pchan, s->volume);
+      }
 
       if (s->mode & SIO_REC)
         rstart = 0;
       if (s->mode & SIO_PLAY)
         pstart = 0;
     }
 
     events = 0;
@@ -367,16 +387,17 @@ sndio_stream_init(cubeb * context,
     if (s->pbuf == NULL)
       goto err;
   }
   if (s->mode & SIO_REC) {
     s->rbuf = malloc(bps * rpar.rchan * rpar.round);
     if (s->rbuf == NULL)
       goto err;
   }
+  s->volume = 1.;
   *stream = s;
   DPR("sndio_stream_init() end, ok\n");
   (void)context;
   (void)stream_name;
   return CUBEB_OK;
 err:
   if (s->hdl)
     sio_close(s->hdl);
@@ -471,17 +492,21 @@ sndio_stream_get_position(cubeb_stream *
   return CUBEB_OK;
 }
 
 static int
 sndio_stream_set_volume(cubeb_stream *s, float volume)
 {
   DPR("sndio_stream_set_volume(%f)\n", volume);
   pthread_mutex_lock(&s->mtx);
-  sio_setvol(s->hdl, SIO_MAXVOL * volume);
+  if (volume < 0.)
+    volume = 0.;
+  else if (volume > 1.0)
+    volume = 1.;
+  s->volume = volume;
   pthread_mutex_unlock(&s->mtx);
   return CUBEB_OK;
 }
 
 int
 sndio_stream_get_latency(cubeb_stream * stm, uint32_t * latency)
 {
   // http://www.openbsd.org/cgi-bin/man.cgi?query=sio_open
--- a/media/webrtc/signaling/gtest/sdp_unittests.cpp
+++ b/media/webrtc/signaling/gtest/sdp_unittests.cpp
@@ -36,17 +36,19 @@ extern "C" {
 #define SKIP_TEST_WITH_RUST_PARSER if (!::testing::get<1>(GetParam())) {return;}
 
 using namespace mozilla;
 
 namespace test {
 
 class SdpTest : public ::testing::Test {
   public:
-    SdpTest() : sdp_ptr_(nullptr) {
+    SdpTest()
+      : final_level_(0)
+      , sdp_ptr_(nullptr) {
     }
 
     ~SdpTest() {
       sdp_free_description(sdp_ptr_);
     }
 
     static void SetUpTestCase() {
       NSS_NoDB_Init(nullptr);
@@ -1501,17 +1503,18 @@ TEST_F(SdpTest, parseIceLite) {
   ASSERT_TRUE(sdp_attr_is_present(sdp_ptr_, SDP_ATTR_ICE_LITE,
                                   SDP_SESSION_LEVEL, 0));
 }
 
 class NewSdpTest : public ::testing::Test,
                    public ::testing::WithParamInterface<
                      ::testing::tuple<bool, bool> > {
   public:
-    NewSdpTest() {}
+    NewSdpTest() : mSdpErrorHolder(nullptr) {
+    }
 
     void ParseSdp(const std::string &sdp, bool expectSuccess = true) {
       if (::testing::get<1>(GetParam())) {
         mSdpErrorHolder = &mSipccParser;
         mSdp = mSipccParser.Parse(sdp);
       } else {
         mSdpErrorHolder = &mRustParser;
         mSdp = mRustParser.Parse(sdp);
--- a/media/webrtc/signaling/src/jsep/JsepCodecDescription.h
+++ b/media/webrtc/signaling/src/jsep/JsepCodecDescription.h
@@ -231,16 +231,19 @@ class JsepVideoCodecDescription : public
                             const std::string& name,
                             uint32_t clock,
                             bool enabled = true)
       : JsepCodecDescription(mozilla::SdpMediaSection::kVideo, defaultPt, name,
                              clock, 0, enabled),
         mTmmbrEnabled(false),
         mRembEnabled(false),
         mFECEnabled(false),
+        mREDPayloadType(0),
+        mULPFECPayloadType(0),
+        mProfileLevelId(0),
         mPacketizationMode(0)
   {
     // Add supported rtcp-fb types
     mNackFbTypes.push_back("");
     mNackFbTypes.push_back(SdpRtcpFbAttributeList::pli);
     mCcmFbTypes.push_back(SdpRtcpFbAttributeList::fir);
   }
 
@@ -758,17 +761,18 @@ class JsepApplicationCodecDescription : 
                                   uint16_t localPort,
                                   uint32_t localMaxMessageSize,
                                   bool enabled = true)
       : JsepCodecDescription(mozilla::SdpMediaSection::kApplication, "",
                              name, 0, channels, enabled),
         mLocalPort(localPort),
         mLocalMaxMessageSize(localMaxMessageSize),
         mRemotePort(0),
-        mRemoteMaxMessageSize(0)
+        mRemoteMaxMessageSize(0),
+        mRemoteMMSSet(false)
   {
   }
 
   JSEP_CODEC_CLONE(JsepApplicationCodecDescription)
 
   // Override, uses sctpport or sctpmap instead of rtpmap
   virtual bool
   Matches(const std::string& fmt,
--- a/media/webrtc/signaling/src/jsep/JsepSessionImpl.h
+++ b/media/webrtc/signaling/src/jsep/JsepSessionImpl.h
@@ -38,17 +38,18 @@ public:
         mIceControlling(false),
         mLocalIceIsRestarting(false),
         mRemoteIsIceLite(false),
         mRemoteIceIsRestarting(false),
         mBundlePolicy(kBundleBalanced),
         mSessionId(0),
         mSessionVersion(0),
         mUuidGen(std::move(uuidgen)),
-        mSdpHelper(&mLastError)
+        mSdpHelper(&mLastError),
+        mRunRustParser(false)
   {
   }
 
   // Implement JsepSession methods.
   virtual nsresult Init() override;
 
   virtual nsresult SetIceCredentials(const std::string& ufrag,
                                      const std::string& pwd) override;
--- a/media/webrtc/signaling/src/media-conduit/RtpSourceObserver.cpp
+++ b/media/webrtc/signaling/src/media-conduit/RtpSourceObserver.cpp
@@ -14,16 +14,17 @@ RtpSourceObserver::RtpSourceEntry::ToLin
   if (audioLevel == 127) {
     return 0;
   }
   // All other values are calculated as 10^(-rfc_level/20)
   return std::pow(10, -static_cast<double>(audioLevel) / 20);
 }
 
 RtpSourceObserver::RtpSourceObserver() :
+  mMaxJitterWindow(0),
   mLevelGuard("RtpSourceObserver::mLevelGuard") {}
 
 void
 RtpSourceObserver::OnRtpPacket(const webrtc::WebRtcRTPHeader* aHeader,
                                      const int64_t aTimestamp,
                                      const uint32_t aJitter)
 {
   auto& header = aHeader->header;
--- a/media/webrtc/signaling/src/media-conduit/RunningStat.h
+++ b/media/webrtc/signaling/src/media-conduit/RunningStat.h
@@ -7,17 +7,24 @@
 #define RUNNING_STAT_H_
 #include <math.h>
 
 namespace mozilla {
 
 class RunningStat
 {
 public:
-  RunningStat() : mN(0) {}
+  RunningStat()
+    : mN(0)
+    , mOldM(0.0)
+    , mNewM(0.0)
+    , mOldS(0.0)
+    , mNewS(0.0)
+  {
+  }
 
   void Clear()
   {
     mN = 0;
   }
 
   void Push(double x)
   {
--- a/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp
+++ b/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp
@@ -75,16 +75,30 @@ WebrtcGmpVideoEncoder::WebrtcGmpVideoEnc
   : mGMP(nullptr)
   , mInitting(false)
   , mHost(nullptr)
   , mMaxPayloadSize(0)
   , mCallbackMutex("WebrtcGmpVideoEncoder encoded callback mutex")
   , mCallback(nullptr)
   , mCachedPluginId(0)
 {
+  mCodecParams.mGMPApiVersion = 0;
+  mCodecParams.mCodecType = kGMPVideoCodecInvalid;
+  mCodecParams.mPLType = 0;
+  mCodecParams.mWidth = 0;
+  mCodecParams.mHeight = 0;
+  mCodecParams.mStartBitrate = 0;
+  mCodecParams.mMaxBitrate = 0;
+  mCodecParams.mMinBitrate = 0;
+  mCodecParams.mMaxFramerate = 0;
+  mCodecParams.mFrameDroppingOn = false;
+  mCodecParams.mKeyFrameInterval = 0;
+  mCodecParams.mQPMax = 0;
+  mCodecParams.mNumberOfSimulcastStreams = 0;
+  mCodecParams.mMode = kGMPCodecModeInvalid;
   if (mPCHandle.empty()) {
     mPCHandle = WebrtcGmpPCHandleSetter::GetCurrentHandle();
   }
   MOZ_ASSERT(!mPCHandle.empty());
 }
 
 WebrtcGmpVideoEncoder::~WebrtcGmpVideoEncoder()
 {
--- a/media/webrtc/signaling/src/media-conduit/WebrtcMediaDataDecoderCodec.cpp
+++ b/media/webrtc/signaling/src/media-conduit/WebrtcMediaDataDecoderCodec.cpp
@@ -15,16 +15,17 @@ namespace mozilla {
 
 WebrtcMediaDataDecoder::WebrtcMediaDataDecoder()
   : mThreadPool(GetMediaThreadPool(MediaThreadType::PLATFORM_DECODER))
   , mTaskQueue(new TaskQueue(do_AddRef(mThreadPool),
                              "WebrtcMediaDataDecoder::mTaskQueue"))
   , mImageContainer(layers::LayerManager::CreateImageContainer(
       layers::ImageContainer::ASYNCHRONOUS))
   , mFactory(new PDMFactory())
+  , mTrackType(TrackInfo::kUndefinedTrack)
 {
 }
 
 WebrtcMediaDataDecoder::~WebrtcMediaDataDecoder()
 {
   mTaskQueue->BeginShutdown();
   mTaskQueue->AwaitShutdownAndIdle();
 }
--- a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
+++ b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
@@ -2170,16 +2170,18 @@ MediaPipelineReceiveAudio::OnRtpPacketRe
 }
 
 class MediaPipelineReceiveVideo::PipelineListener
   : public GenericReceiveListener
 {
 public:
   explicit PipelineListener(dom::MediaStreamTrack* aTrack)
     : GenericReceiveListener(aTrack)
+    , mWidth(0)
+    , mHeight(0)
     , mImageContainer(
         LayerManager::CreateImageContainer(ImageContainer::ASYNCHRONOUS))
     , mMutex("Video PipelineListener")
   {
     AddTrackToSource();
   }
 
   // Implement MediaStreamListener
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
@@ -231,17 +231,18 @@ struct nsISupportsWeakReference::COMType
 };
 const nsIID nsISupportsWeakReference::COMTypeInfo<nsSupportsWeakReference, void>::kIID = NS_ISUPPORTSWEAKREFERENCE_IID;
 
 namespace mozilla {
 
 RTCStatsQuery::RTCStatsQuery(bool internal) :
   failed(false),
   internalStats(internal),
-  grabAllLevels(false) {
+  grabAllLevels(false),
+  now(0.0) {
 }
 
 RTCStatsQuery::~RTCStatsQuery() {
   MOZ_ASSERT(NS_IsMainThread());
 }
 
 
 NS_IMPL_ISUPPORTS0(PeerConnectionImpl)
@@ -334,16 +335,19 @@ PeerConnectionImpl::PeerConnectionImpl(c
   , mHaveConfiguredCodecs(false)
   , mHaveDataStream(false)
   , mAddCandidateErrorCount(0)
   , mTrickle(true) // TODO(ekr@rtfm.com): Use pref
   , mPrivateWindow(false)
   , mActiveOnWindow(false)
   , mPacketDumpEnabled(false)
   , mPacketDumpFlagsMutex("Packet dump flags mutex")
+  , listenPort(0)
+  , connectPort(0)
+  , connectStr(nullptr)
 {
   MOZ_ASSERT(NS_IsMainThread());
   auto log = RLogConnector::CreateInstance();
   if (aGlobal) {
     mWindow = do_QueryInterface(aGlobal->GetAsSupports());
     if (IsPrivateBrowsing(mWindow)) {
       mPrivateWindow = true;
       log->EnterPrivateMode();
--- a/media/webrtc/signaling/src/sdp/SipccSdpMediaSection.h
+++ b/media/webrtc/signaling/src/sdp/SipccSdpMediaSection.h
@@ -63,17 +63,22 @@ public:
 
   virtual void AddDataChannel(const std::string& name, uint16_t port,
                               uint16_t streams, uint32_t message_size) override;
 
   virtual void Serialize(std::ostream&) const override;
 
 private:
   SipccSdpMediaSection(size_t level, const SipccSdpAttributeList* sessionLevel)
-      : SdpMediaSection(level), mAttributeList(sessionLevel)
+      : SdpMediaSection(level),
+        mMediaType(static_cast<MediaType>(0)),
+        mPort(0),
+        mPortCount(0),
+        mProtocol(static_cast<Protocol>(0)),
+        mAttributeList(sessionLevel)
   {
   }
 
   bool Load(sdp_t* sdp, uint16_t level, SdpErrorHolder& errorHolder);
   bool LoadConnection(sdp_t* sdp, uint16_t level, SdpErrorHolder& errorHolder);
   bool LoadProtocol(sdp_t* sdp, uint16_t level, SdpErrorHolder& errorHolder);
   bool LoadFormats(sdp_t* sdp, uint16_t level, SdpErrorHolder& errorHolder);
   bool ValidateSimulcast(sdp_t* sdp, uint16_t level,
--- a/media/webrtc/signaling/src/sdp/sipcc/sdp_private.h
+++ b/media/webrtc/signaling/src/sdp/sipcc/sdp_private.h
@@ -342,18 +342,16 @@ extern tinybool sdp_validate_maxprate(co
 extern char *sdp_findchar(const char *ptr, char *char_list);
 extern const char *sdp_getnextstrtok(const char *str, char *tokenstr, unsigned tokenstr_len,
                                const char *delim, sdp_result_e *result);
 extern uint32_t sdp_getnextnumtok(const char *str, const char **str_end,
                              const char *delim, sdp_result_e *result);
 extern uint32_t sdp_getnextnumtok_or_null(const char *str, const char **str_end,
                                      const char *delim, tinybool *null_ind,
                                      sdp_result_e *result);
-extern tinybool sdp_getchoosetok(const char *str, const char **str_end,
-                                 const char *delim, sdp_result_e *result);
 
 extern
 tinybool verify_sdescriptions_mki(char *buf, char *mkiVal, uint16_t *mkiLen);
 
 extern
 tinybool verify_sdescriptions_lifetime(char *buf);
 
 /* sdp_services_xxx.c */
--- a/media/webrtc/signaling/src/sdp/sipcc/sdp_token.c
+++ b/media/webrtc/signaling/src/sdp/sipcc/sdp_token.c
@@ -1157,25 +1157,21 @@ sdp_result_e sdp_parse_media (sdp_t *sdp
             "%s No port specified in m= media line, "
             "parse failed.", sdp_p->debug_str);
         SDP_FREE(mca_p);
         sdp_p->conf_p->num_invalid_param++;
         return (SDP_INVALID_PARAMETER);
     }
     port_ptr = port;
     for (i=0; i < SDP_MAX_PORT_PARAMS; i++) {
-        if (sdp_getchoosetok(port_ptr, &port_ptr, "/ \t", &result) == TRUE) {
-            num[i] = SDP_CHOOSE_PARAM;
-        } else {
-            num[i] = sdp_getnextnumtok(port_ptr, (const char **)&port_ptr,
-                                       "/ \t", &result);
-            if (result != SDP_SUCCESS) {
-                break;
-            }
-        }
+          num[i] = sdp_getnextnumtok(port_ptr, (const char **)&port_ptr,
+                                     "/ \t", &result);
+          if (result != SDP_SUCCESS) {
+              break;
+          }
         num_port_params++;
     }
 
     /* Find the transport protocol type. */
     ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result);
     if (result != SDP_SUCCESS) {
         sdp_parse_error(sdp_p,
             "%s No transport protocol type specified, "
@@ -1396,18 +1392,16 @@ sdp_result_e sdp_parse_media (sdp_t *sdp
                 sdp_parse_error(sdp_p,
                     "%s No webrtc-datachannel token in m= media line, "
                     "parse failed.", sdp_p->debug_str);
                 SDP_FREE(mca_p);
                 sdp_p->conf_p->num_invalid_param++;
                 return (SDP_INVALID_PARAMETER);
             }
             mca_p->sctp_fmt = SDP_SCTP_MEDIA_FMT_WEBRTC_DATACHANNEL;
-        } else if (sdp_getchoosetok(port_ptr, &port_ptr, "/ \t", &result)) {
-            sctp_port = SDP_CHOOSE_PARAM;
         } else {
             sctp_port = sdp_getnextnumtok(port_ptr, (const char **)&port_ptr,
                                            "/ \t", &result);
             if (result != SDP_SUCCESS) {
                 sdp_parse_error(sdp_p,
                     "%s No sctp port specified in m= media line, "
                     "parse failed.", sdp_p->debug_str);
                 SDP_FREE(mca_p);
--- a/media/webrtc/signaling/src/sdp/sipcc/sdp_utils.c
+++ b/media/webrtc/signaling/src/sdp/sipcc/sdp_utils.c
@@ -427,79 +427,16 @@ uint32_t sdp_getnextnumtok (const char *
   }
 
   *result = SDP_SUCCESS;
   *str_end = token_list;
   return (uint32_t) numval;
 }
 
 
-/* See if the next token in a string is the choose character.  The delim
- * characters are passed in as a param.  The check also will not go past
- * a new line char or the end of the string.  Skip any delimiters before
- * the token.
- */
-tinybool sdp_getchoosetok (const char *str, const char **str_end,
-                           const char *delim, sdp_result_e *result)
-{
-    const char *b;
-    int   flag2moveon;
-
-    if ((str == NULL)  || (str_end == NULL)) {
-        *result = SDP_FAILURE;
-        return(FALSE);
-    }
-
-    /* Locate front of token, skipping any delimiters */
-    for ( ; ((*str != '\0') && (*str != '\n') && (*str != '\r')); str++) {
-        flag2moveon = 1;  /* Default to move on unless we find a delimiter */
-        for (b=delim; *b; b++) {
-            if (*str == *b) {
-                flag2moveon = 0;
-                break;
-            }
-        }
-        if( flag2moveon ) {
-            break;  /* We're at the beginning of the token */
-        }
-    }
-
-    /* Make sure there's really a token present. */
-    if ((*str == '\0') || (*str == '\n') || (*str == '\r')) {
-        *result = SDP_FAILURE;
-        *str_end = (char *)str;
-        return(FALSE);
-    }
-
-    /* See if the token is '$' followed by a delimiter char or end of str. */
-    if (*str == '$') {
-        str++;
-        if ((*str == '\0') || (*str == '\n') || (*str == '\r')) {
-            *result = SDP_SUCCESS;
-            /* skip the choose char in the string. */
-            *str_end = (char *)(str+1);
-            return(TRUE);
-        }
-        for (b=delim; *b; b++) {
-            if (*str == *b) {
-                *result = SDP_SUCCESS;
-                /* skip the choose char in the string. */
-                *str_end = (char *)(str+1);
-                return(TRUE);
-            }
-        }
-    }
-
-    /* If the token was not '$' followed by a delim, token is not choose */
-    *result = SDP_SUCCESS;
-    *str_end = (char *)str;
-    return(FALSE);
-
-}
-
 /*
  * SDP Crypto Utility Functions.
  *
  * First a few common definitions.
  */
 
 /*
  * Constants
--- a/netwerk/sctp/datachannel/DataChannel.cpp
+++ b/netwerk/sctp/datachannel/DataChannel.cpp
@@ -302,16 +302,21 @@ debug_printf(const char *format, ...)
     va_end(ap);
   }
 }
 
 DataChannelConnection::DataChannelConnection(DataConnectionListener *listener,
                                              nsIEventTarget *aTarget)
   : NeckoTargetHolder(aTarget)
   , mLock("netwerk::sctp::DataChannelConnection")
+  , mSendInterleaved(false)
+  , mPpidFragmentation(false)
+  , mMaxMessageSizeSet(false)
+  , mMaxMessageSize(0)
+  , mAllocateEven(false)
 {
   mCurrentStream = 0;
   mState = CLOSED;
   mSocket = nullptr;
   mMasterSocket = nullptr;
   mListener = listener;
   mDtls = nullptr;
   mLocalPort = 0;
--- a/netwerk/sctp/datachannel/DataChannel.h
+++ b/netwerk/sctp/datachannel/DataChannel.h
@@ -62,17 +62,22 @@ public:
   ~OutgoingMsg() = default;;
   void Advance(size_t offset);
   struct sctp_sendv_spa &GetInfo() { return *mInfo; };
   size_t GetLength() { return mLength; };
   size_t GetLeft() { return mLength - mPos; };
   const uint8_t *GetData() { return (const uint8_t *)(mData + mPos); };
 
 protected:
-  OutgoingMsg() = default;; // Use this for inheritance only
+  OutgoingMsg() // Use this for inheritance only
+    : mLength(0)
+    , mData(nullptr)
+    , mInfo(nullptr)
+    , mPos(0)
+  {};
   size_t mLength;
   const uint8_t *mData;
   struct sctp_sendv_spa *mInfo;
   size_t mPos;
 };
 
 // For queuing outgoing messages
 // This class copies data of an outgoing message.
@@ -377,16 +382,17 @@ public:
     , mConnection(connection)
     , mLabel(label)
     , mProtocol(protocol)
     , mState(state)
     , mStream(stream)
     , mPrPolicy(policy)
     , mPrValue(value)
     , mFlags(flags)
+    , mId(0)
     , mIsRecvBinary(false)
     , mBufferedThreshold(0) // default from spec
     , mMainThreadEventTarget(connection->GetNeckoTarget())
     {
       NS_ASSERTION(mConnection,"NULL connection");
     }
 
 private:
--- a/storage/StorageBaseStatementInternal.cpp
+++ b/storage/StorageBaseStatementInternal.cpp
@@ -106,17 +106,18 @@ private:
   RefPtr<Connection> mConnection;
   sqlite3_stmt *mAsyncStatement;
 };
 
 ////////////////////////////////////////////////////////////////////////////////
 //// StorageBaseStatementInternal
 
 StorageBaseStatementInternal::StorageBaseStatementInternal()
-: mAsyncStatement(nullptr)
+: mNativeConnection(nullptr)
+, mAsyncStatement(nullptr)
 {
 }
 
 void
 StorageBaseStatementInternal::asyncFinalize()
 {
   nsIEventTarget *target = mDBConnection->getAsyncExecutionTarget();
   if (target) {
--- a/storage/mozStorageStatement.cpp
+++ b/storage/mozStorageStatement.cpp
@@ -106,16 +106,18 @@ NS_IMPL_QUERY_INTERFACE(StatementClassIn
 static StatementClassInfo sStatementClassInfo;
 
 ////////////////////////////////////////////////////////////////////////////////
 //// Statement
 
 Statement::Statement()
 : StorageBaseStatementInternal()
 , mDBStatement(nullptr)
+, mParamCount(0)
+, mResultColumnCount(0)
 , mColumnNames()
 , mExecuting(false)
 {
 }
 
 nsresult
 Statement::initialize(Connection *aDBConnection,
                       sqlite3 *aNativeConnection,
deleted file mode 100644
--- a/taskcluster/docker/funsize-balrog-submitter/Dockerfile
+++ /dev/null
@@ -1,35 +0,0 @@
-FROM ubuntu:xenial
-MAINTAINER Rail Aliiev <rail@mozilla.com>
-
-# Required software
-ENV DEBIAN_FRONTEND noninteractive
-# Chain apt-get commands with apt-get clean in a single docker RUN
-# to make sure that files are removed within a single docker layer
-RUN apt-get update -q && \
-    apt-get install -yyq --no-install-recommends \
-    python mercurial curl python-boto python-setuptools python-cryptography \
-    python-dev gcc liblzma-dev && \
-    apt-get clean
-
-COPY requirements.txt /tmp/
-# python-pip installs a lot of dependencies increasing the size of an image
-# drastically.
-RUN easy_install pip
-RUN pip install -r /tmp/requirements.txt
-
-RUN hg clone https://hg.mozilla.org/build/tools /home/worker/tools
-
-RUN useradd -d /home/worker -s /bin/bash -m worker
-
-RUN mkdir /home/worker/bin
-COPY scripts/* /home/worker/bin/
-RUN mkdir /home/worker/keys
-COPY *.pubkey /home/worker/keys/
-COPY runme.sh /runme.sh
-COPY submit_complete.sh /submit_complete.sh
-RUN chmod 755 /home/worker/bin/* /runme.sh /submit_complete.sh
-
-ENV           HOME          /home/worker
-ENV           SHELL         /bin/bash
-ENV           USER          worker
-ENV           LOGNAME       worker
deleted file mode 100644
--- a/taskcluster/docker/funsize-balrog-submitter/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-DOCKERIO_USERNAME =$(error DOCKERIO_USERNAME should be set)
-IMAGE_NAME = funsize-balrog-submitter
-FULL_IMAGE_NAME = $(DOCKERIO_USERNAME)/$(IMAGE_NAME)
-
-build:
-	docker build -t $(FULL_IMAGE_NAME) --no-cache --rm .
-
-push:
-	docker push $(FULL_IMAGE_NAME):latest
-
-pull:
-	docker pull $(FULL_IMAGE_NAME):latest
-
-update_pubkeys:
-	curl https://hg.mozilla.org/mozilla-central/raw-file/default/toolkit/mozapps/update/updater/nightly_aurora_level3_primary.der | openssl x509 -inform DER -pubkey -noout > nightly.pubkey
-	curl https://hg.mozilla.org/mozilla-central/raw-file/default/toolkit/mozapps/update/updater/dep1.der | openssl x509 -inform DER -pubkey -noout > dep.pubkey
-	curl https://hg.mozilla.org/mozilla-central/raw-file/default/toolkit/mozapps/update/updater/release_primary.der | openssl x509 -inform DER -pubkey -noout > release.pubkey
deleted file mode 100644
--- a/taskcluster/docker/funsize-balrog-submitter/dep.pubkey
+++ /dev/null
@@ -1,9 +0,0 @@
------BEGIN PUBLIC KEY-----
-MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzjHSobdeiQ3JHP/cCIOp
-WaX9y12rL5mIo9OR9bpqEZdD0yXJJJeZA887Mv8slqsM+qObMUpKvfEE6zyYPIZJ
-ANib31neI5BBYHhfhf2f5EnkilSYlmU3Gx+uRsmsdt58PpYe124tOAGgca/8bUy3
-eb6kUUTwvMI0oWQuPkGUaoHVQyj/bBMTrIkyF3UbfFtiX/SfOPvIoabNUe+pQHUe
-pqC2+RxzDGj+shTq/hYhtXlptFzsEEb2+0foLy0MY8C30dP2QqbM2iavvr/P8OcS
-Gm3H0TQcRzIEBzvPcIjiZi1nQj/r/3TlYRNCjuYT/HsNLXrB/U5Tc990jjAUJxdH
-0wIDAQAB
------END PUBLIC KEY-----
deleted file mode 100644
--- a/taskcluster/docker/funsize-balrog-submitter/nightly_sha1.pubkey
+++ /dev/null
@@ -1,9 +0,0 @@
------BEGIN PUBLIC KEY-----
-MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4j/IS3gWbyVVnWn4ZRnC
-Fuzb6VAaHa0I+4E504ekhVAhbKlSfBstkLbXajdjUVAJpn02zWnOaTl5KAdpDpIp
-SkdA4mK20ej3/Ij7gIt8IwaX+ArXL8mP84pxDn5BgaNADm3206Z6YQzc/TDYu529
-qkDFmLqNUVRJAhPO+qqhKHIcVGh8HUHXN6XV1qOFip+UU0M474jAGgurVmAv8Rh7
-VvM0v5KmB6V6WHwM5gwjg2yRY/o+xYIsNeSes9rpp+MOs/RnUA6LI4WZGY4YahvX
-VclIXBDgbWPYtojexIJkmYj8JIIRsh3eCsrRRe14fq7cBurp3CxBYMlDHf0RUoaq
-hQIDAQAB
------END PUBLIC KEY-----
deleted file mode 100644
--- a/taskcluster/docker/funsize-balrog-submitter/nightly_sha384.pubkey
+++ /dev/null
@@ -1,14 +0,0 @@
------BEGIN PUBLIC KEY-----
-MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAth151NGY8PBzn0bii9Yc
-AjYHZDwP9Lj1c3owG0zLqW2kPcdp86QTAcoYunHGYFFakNG3tooZhzwkMjZ1OrXc
-ERjD6AuVSGIBdsKtKP4vLtMjDUteFN4K2+rveozcnYFZuTWEajGu8uoYsv4QgdEA
-nTBC39j0J33xlfUR+XKuxzhxNrFX+fRFWuLDJrPziMcVA/mzf0gXlhtEsfV0HYyg
-yWpHdIWww+llysD1QOQAHk94Ss8c/4BFXFxlwlLeNlB1ZqLm1LsNy0jUy9EHeO3C
-H6eqmiFEbpdjlrkJdgR1NcTzeY/Qf/nhWH6BAZrSapQycF7OSLU+rFWMQUElSPLc
-NVl7oNAAfSYLTvRjPGi+mJK3wGFQw1EpwQl+elE1oj4+sHvIVpDrLb6btpxfr1cZ
-pR4Di/hkOIymxEDWvtUhOxUXnYbDKQSDcAHKM/xR3sdIAiVtVuL4hyBwlAqkQc2j
-H+SmnCbazgnq5+dN4y5DjoOgbZQ/koE3s3bUzzMeIxaul9v4gMtGROw3PQ3OZcP0
-lgjPRhY+NeTnWMo2nGb4/eS6Cn2qFLfbEQjsj6pJJBNKfvK/gm1jXb3PgXXdf8+d
-2xTPOX8QNpSK7C0w4vYlvSpYZlsx2cznEOV6LDqP0QHUnmd/k1xWRRGiQ7gtT+BV
-Fn0h7JyTGmEdFu6l4OhS8hMCAwEAAQ==
------END PUBLIC KEY-----
deleted file mode 100644
--- a/taskcluster/docker/funsize-balrog-submitter/release_sha1.pubkey
+++ /dev/null
@@ -1,9 +0,0 @@
------BEGIN PUBLIC KEY-----
-MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvH4r94FpQ0gvr1hhTfV9
-NUeWPJ5CN6TZRq7v/Dc4nkJ1J4IP1B3UEii34tcNKpy1nKupiZuTT6T1zQYT+z5x
-3UkDF9qQboQ8RNb/BEz/cN3on/LTEnZ7YSraRL11M6cEB8mvmJxddCEquwqccRbs
-Usp8WUB7uRv1w6Anley7N9F/LE1iLPwJasZypRnzWb3aYsJy0cMFOYy+OXVdpktn
-qYqlNIjnt84u4Nil6UXnBbIJNUVOCY8wOFClNvVpubjPkWK1gtdWy3x/hJU5RpAO
-K9cnHxq4M/I4SUWTWO3r7yweQiHG4Jyoc7sP1jkwjBkSG93sDEycfwOdOoZft3wN
-sQIDAQAB
------END PUBLIC KEY-----
deleted file mode 100644
--- a/taskcluster/docker/funsize-balrog-submitter/release_sha384.pubkey
+++ /dev/null
@@ -1,14 +0,0 @@
------BEGIN PUBLIC KEY-----
-MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxCHbY+fP3dvaP9XVbmK6
-i4rbqo72INEWgDSYbr/DIYfCSzHC9H8pU8dyjt+Nd8OtoUZtBD1N9fP7SlrvPZSI
-ZSW4k0e9Ky5aV3Uy+ivamSvYszkhqdeP2y7MBu73XHKYONR9PnKa+ovmREwSEI+h
-1e0ebm8zvF7Ndwx0mOeZkDu9SDkDGg4aj2xrJyBBOuGVjuctMZ6l1davANI5xiJ0
-GBEU3tR1gJs1T4vLBis5mEFn9y4kgyw/HrxmRYGnZL4fLb2fTI+pNW0Twu3KWwwi
-LgLkkVrNWiHSk7YWqxjcg5IA3pQETQ17paTHoB5Mnkvuh6MkDXvRG5VgAHZAigr6
-fJMsasOUaBeos/cD1LDQEIObpetlxc0Fiu/lvUts0755otkhI+yv35+wUa6GJrsE
-CsT7c/LaFtQXg06aGXbMLDn0bE/e+nw9KWT/rE1iYXMFkzrqoTeYJ+v7/fD/ywU8
-m8l4CZmXxzd/RogMrM3xl+j4ucAAltDQyL4yLySaIT05w5U8z2zJDEXFvpFDSRfF
-K3kjLwGub7wNwaQDuh/msIUdavu4g+GNikCXAJ8AssLuYatyHoltd2tf+EIIDW3U
-zzLpymnLo3cAz3IPfXyqVB+mcLcpqbHjl3hWms6l1wGtz6S4WqdrWs/KfzS5EyDK
-r63xn1Rg/XFmR57EsFEXAZ8CAwEAAQ==
------END PUBLIC KEY-----
deleted file mode 100644
--- a/taskcluster/docker/funsize-balrog-submitter/requirements.txt
+++ /dev/null
@@ -1,1 +0,0 @@
-mar==2.1.2
deleted file mode 100644
--- a/taskcluster/docker/funsize-balrog-submitter/runme.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/bash
-
-set -xe
-
-test "$PARENT_TASK_ARTIFACTS_URL_PREFIX"
-test "$BALROG_API_ROOT"
-test "$SHA1_SIGNING_CERT"
-test "$SHA384_SIGNING_CERT"
-
-
-ARTIFACTS_DIR="/home/worker/artifacts"
-mkdir -p "$ARTIFACTS_DIR"
-
-curl --location --retry 10 --retry-delay 10 -o "$ARTIFACTS_DIR/manifest.json" \
-    "$PARENT_TASK_ARTIFACTS_URL_PREFIX/manifest.json"
-
-cat "$ARTIFACTS_DIR/manifest.json"
-# EXTRA_BALROG_SUBMITTER_PARAMS is optional
-# shellcheck disable=SC2086
-python /home/worker/bin/funsize-balrog-submitter.py \
-    --artifacts-url-prefix "$PARENT_TASK_ARTIFACTS_URL_PREFIX" \
-    --manifest "$ARTIFACTS_DIR/manifest.json" \
-    -a "$BALROG_API_ROOT" \
-    --sha1-signing-cert "/home/worker/keys/${SHA1_SIGNING_CERT}.pubkey" \
-    --sha384-signing-cert "/home/worker/keys/${SHA384_SIGNING_CERT}.pubkey" \
-    --verbose \
-    "$EXTRA_BALROG_SUBMITTER_PARAMS"
deleted file mode 100644
--- a/taskcluster/docker/funsize-balrog-submitter/scripts/funsize-balrog-submitter-complete.py
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/usr/bin/env python
-from __future__ import absolute_import, print_function
-
-import site
-import os
-import logging
-import argparse
-import json
-
-site.addsitedir("/home/worker/tools/lib/python")
-
-from balrog.submitter.cli import ReleaseSubmitterV4
-from util.retry import retry
-
-log = logging.getLogger(__name__)
-
-
-def main():
-    parser = argparse.ArgumentParser()
-    parser.add_argument("--manifest", required=True)
-    parser.add_argument("-a", "--api-root", required=True,
-                        help="Balrog API root")
-    parser.add_argument("-v", "--verbose", action="store_const",
-                        dest="loglevel", const=logging.DEBUG,
-                        default=logging.INFO)
-    parser.add_argument("--product", help="Override product name from application.ini")
-    args = parser.parse_args()
-    logging.basicConfig(format="%(asctime)s - %(levelname)s - %(message)s",
-                        level=args.loglevel)
-    logging.getLogger("requests").setLevel(logging.WARNING)
-    logging.getLogger("boto").setLevel(logging.WARNING)
-
-    balrog_username = os.environ.get("BALROG_USERNAME")
-    balrog_password = os.environ.get("BALROG_PASSWORD")
-    suffix = os.environ.get("BALROG_BLOB_SUFFIX")
-    if not balrog_username and not balrog_password:
-        raise RuntimeError("BALROG_USERNAME and BALROG_PASSWORD environment "
-                           "variables should be set")
-    if not suffix:
-        raise RuntimeError("BALROG_BLOB_SUFFIX environment variable should be set")
-
-    manifest = json.load(open(args.manifest))
-    auth = (balrog_username, balrog_password)
-
-    for e in manifest:
-        complete_info = [{
-            "hash": e["hash"],
-            "size": e["size"],
-        }]
-
-        submitter = ReleaseSubmitterV4(api_root=args.api_root, auth=auth,
-                                       suffix=suffix)
-        productName = args.product or e["appName"]
-        retry(lambda: submitter.run(
-            platform=e["platform"], productName=productName,
-            version=e["toVersion"],
-            build_number=e["toBuildNumber"],
-            appVersion=e["version"], extVersion=e["version"],
-            buildID=e["to_buildid"], locale=e["locale"],
-            hashFunction='sha512', completeInfo=complete_info),
-            attempts=30, sleeptime=10, max_sleeptime=60, jitter=3,
-        )
-
-
-if __name__ == '__main__':
-    main()
deleted file mode 100644
--- a/taskcluster/docker/funsize-balrog-submitter/scripts/funsize-balrog-submitter.py
+++ /dev/null
@@ -1,229 +0,0 @@
-#!/usr/bin/env python
-from __future__ import absolute_import, print_function
-
-import site
-import os
-import logging
-import argparse
-import json
-import hashlib
-import requests
-import tempfile
-from boto.s3.connection import S3Connection
-from mardor.reader import MarReader
-from mardor.signing import get_keysize
-
-site.addsitedir("/home/worker/tools/lib/python")
-
-from balrog.submitter.cli import NightlySubmitterV4, ReleaseSubmitterV4
-from util.retry import retry, retriable
-
-log = logging.getLogger(__name__)
-
-
-def get_hash(content, hash_type="md5"):
-    h = hashlib.new(hash_type)
-    h.update(content)
-    return h.hexdigest()
-
-
-@retriable()
-def download(url, dest, mode=None):
-    log.debug("Downloading %s to %s", url, dest)
-    r = requests.get(url)
-    r.raise_for_status()
-
-    bytes_downloaded = 0
-    with open(dest, 'wb') as fd:
-        for chunk in r.iter_content(4096):
-            fd.write(chunk)
-            bytes_downloaded += len(chunk)
-
-    log.debug('Downloaded %s bytes', bytes_downloaded)
-    if 'content-length' in r.headers:
-        log.debug('Content-Length: %s bytes', r.headers['content-length'])
-        if bytes_downloaded != int(r.headers['content-length']):
-            raise IOError('Unexpected number of bytes downloaded')
-
-    if mode:
-        log.debug("chmod %o %s", mode, dest)
-        os.chmod(dest, mode)
-
-
-def verify_signature(mar, certs):
-    log.info("Checking %s signature", mar)
-    with open(mar, 'rb') as mar_fh:
-        m = MarReader(mar_fh)
-        m.verify(verify_key=certs.get(m.signature_type))
-
-
-def verify_copy_to_s3(bucket_name, aws_access_key_id, aws_secret_access_key,
-                      mar_url, mar_dest, signing_certs):
-    conn = S3Connection(aws_access_key_id, aws_secret_access_key)
-    bucket = conn.get_bucket(bucket_name)
-    _, dest = tempfile.mkstemp()
-    log.info("Downloading %s to %s...", mar_url, dest)
-    download(mar_url, dest)
-    log.info("Verifying the signature...")
-    if not os.getenv("MOZ_DISABLE_MAR_CERT_VERIFICATION"):
-        verify_signature(dest, signing_certs)
-    for name in possible_names(mar_dest, 10):
-        log.info("Checking if %s already exists", name)
-        key = bucket.get_key(name)
-        if not key:
-            log.info("Uploading to %s...", name)
-            key = bucket.new_key(name)
-            # There is a chance for race condition here. To avoid it we check
-            # the return value with replace=False. It should be not None.
-            length = key.set_contents_from_filename(dest, replace=False)
-            if length is None:
-                log.warn("Name race condition using %s, trying again...", name)
-                continue
-            else:
-                # key.make_public() may lead to race conditions, because
-                # it doesn't pass version_id, so it may not set permissions
-                bucket.set_canned_acl(acl_str='public-read', key_name=name,
-                                      version_id=key.version_id)
-                # Use explicit version_id to avoid using "latest" version
-                return key.generate_url(expires_in=0, query_auth=False,
-                                        version_id=key.version_id)
-        else:
-            if get_hash(retry(key.get_contents_as_string)) == \
-                    get_hash(open(dest).read()):
-                log.info("%s has the same MD5 checksum, not uploading...",
-                         name)
-                return key.generate_url(expires_in=0, query_auth=False,
-                                        version_id=key.version_id)
-            log.info("%s already exists with different checksum, "
-                     "trying another one...", name)
-
-    raise RuntimeError("Cannot generate a unique name for %s", mar_dest)
-
-
-def possible_names(initial_name, amount):
-    """Generate names appending counter before extension"""
-    prefix, ext = os.path.splitext(initial_name)
-    return [initial_name] + ["{}-{}{}".format(prefix, n, ext) for n in
-                             range(1, amount + 1)]
-
-
-def main():
-    parser = argparse.ArgumentParser()
-    parser.add_argument("--artifacts-url-prefix", required=True,
-                        help="URL prefix for MAR")
-    parser.add_argument("--manifest", required=True)
-    parser.add_argument("-a", "--api-root", required=True,
-                        help="Balrog API root")
-    parser.add_argument("-d", "--dummy", action="store_true",
-                        help="Add '-dummy' suffix to branch name")
-    parser.add_argument("--sha1-signing-cert", required=True)
-    parser.add_argument("--sha384-signing-cert", required=True)
-    parser.add_argument("-v", "--verbose", action="store_const",
-                        dest="loglevel", const=logging.DEBUG,
-                        default=logging.INFO)
-    parser.add_argument("--product", help="Override product name from application.ini")
-    args = parser.parse_args()
-    logging.basicConfig(format="%(asctime)s - %(levelname)s - %(message)s",
-                        level=args.loglevel)
-    logging.getLogger("requests").setLevel(logging.WARNING)
-    logging.getLogger("boto").setLevel(logging.WARNING)
-
-    balrog_username = os.environ.get("BALROG_USERNAME")
-    balrog_password = os.environ.get("BALROG_PASSWORD")
-    if not balrog_username and not balrog_password:
-        raise RuntimeError("BALROG_USERNAME and BALROG_PASSWORD environment "
-                           "variables should be set")
-    # blob suffix used for releases only
-    suffix = os.environ.get("BALROG_BLOB_SUFFIX")
-
-    s3_bucket = os.environ.get("S3_BUCKET")
-    aws_access_key_id = os.environ.get("AWS_ACCESS_KEY_ID")
-    aws_secret_access_key = os.environ.get("AWS_SECRET_ACCESS_KEY")
-    if not (s3_bucket and aws_access_key_id and aws_secret_access_key):
-        log.warn("Skipping S3 uploads...")
-        uploads_enabled = False
-    else:
-        uploads_enabled = True
-
-    manifest = json.load(open(args.manifest))
-    auth = (balrog_username, balrog_password)
-
-    signing_certs = {
-        'sha1': open(args.sha1_signing_cert, 'rb').read(),
-        'sha384': open(args.sha384_signing_cert, 'rb').read(),
-    }
-
-    assert(get_keysize(signing_certs['sha1']) == 2048)
-    assert(get_keysize(signing_certs['sha384']) == 4096)
-
-    for e in manifest:
-        complete_info = [{
-            "hash": e["to_hash"],
-            "size": e["to_size"],
-        }]
-        partial_info = [{
-            "hash": e["hash"],
-            "size": e["size"],
-        }]
-
-        if "previousVersion" in e and "previousBuildNumber" in e:
-            log.info("Release style balrog submission")
-            partial_info[0]["previousVersion"] = e["previousVersion"]
-            partial_info[0]["previousBuildNumber"] = e["previousBuildNumber"]
-            submitter = ReleaseSubmitterV4(api_root=args.api_root, auth=auth,
-                                           dummy=args.dummy, suffix=suffix)
-            productName = args.product or e["appName"]
-            if suffix:
-                log.warning("Not submitting complete info")
-                complete_info = None
-            retry(lambda: submitter.run(
-                platform=e["platform"], productName=productName,
-                version=e["toVersion"],
-                build_number=e["toBuildNumber"],
-                appVersion=e["version"], extVersion=e["version"],
-                buildID=e["to_buildid"], locale=e["locale"],
-                hashFunction='sha512',
-                partialInfo=partial_info, completeInfo=complete_info),
-                attempts=30, sleeptime=10, max_sleeptime=60, jitter=3,
-            )
-        elif "from_buildid" in e and uploads_enabled:
-            log.info("Nightly style balrog submission")
-            partial_mar_url = "{}/{}".format(args.artifacts_url_prefix,
-                                             e["mar"])
-            complete_mar_url = e["to_mar"]
-            dest_prefix = "{branch}/{buildid}".format(
-                branch=e["branch"], buildid=e["to_buildid"])
-            partial_mar_dest = "{}/{}".format(dest_prefix, e["mar"])
-            complete_mar_filename = "{appName}-{branch}-{version}-" \
-                                    "{platform}-{locale}.complete.mar"
-            complete_mar_filename = complete_mar_filename.format(
-                appName=e["appName"], branch=e["branch"],
-                version=e["version"], platform=e["platform"],
-                locale=e["locale"]
-            )
-            complete_mar_dest = "{}/{}".format(dest_prefix,
-                                               complete_mar_filename)
-            partial_info[0]["url"] = verify_copy_to_s3(
-                s3_bucket, aws_access_key_id, aws_secret_access_key,
-                partial_mar_url, partial_mar_dest, signing_certs)
-            complete_info[0]["url"] = verify_copy_to_s3(
-                s3_bucket, aws_access_key_id, aws_secret_access_key,
-                complete_mar_url, complete_mar_dest, signing_certs)
-            partial_info[0]["from_buildid"] = e["from_buildid"]
-            submitter = NightlySubmitterV4(api_root=args.api_root, auth=auth,
-                                           dummy=args.dummy)
-            productName = args.product or e["appName"]
-            retry(lambda: submitter.run(
-                platform=e["platform"], buildID=e["to_buildid"],
-                productName=productName, branch=e["branch"],
-                appVersion=e["version"], locale=e["locale"],
-                hashFunction='sha512', extVersion=e["version"],
-                partialInfo=partial_info, completeInfo=complete_info),
-                attempts=30, sleeptime=10, max_sleeptime=60, jitter=3,
-            )
-        else:
-            raise RuntimeError("Cannot determine Balrog submission style")
-
-
-if __name__ == '__main__':
-    main()
deleted file mode 100644
--- a/taskcluster/docker/funsize-balrog-submitter/submit_complete.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/bash
-
-set -xe
-
-test "$PARENT_TASK_ARTIFACTS_URL_PREFIX"
-test "$BALROG_API_ROOT"
-# BALROG_BLOB_SUFFIX is used by the script implicitly to avoid possible CLI
-# issues with suffixes starting with "-"
-test "$BALROG_BLOB_SUFFIX"
-
-
-ARTIFACTS_DIR="/home/worker/artifacts"
-mkdir -p "$ARTIFACTS_DIR"
-
-curl --location --retry 10 --retry-delay 10 -o "$ARTIFACTS_DIR/manifest.json" \
-    "$PARENT_TASK_ARTIFACTS_URL_PREFIX/manifest.json"
-
-cat "$ARTIFACTS_DIR/manifest.json"
-python /home/worker/bin/funsize-balrog-submitter-complete.py  \
-    --manifest "$ARTIFACTS_DIR/manifest.json" \
-    -a "$BALROG_API_ROOT" \
-    --verbose \
-    "$EXTRA_BALROG_SUBMITTER_PARAMS"
--- a/tools/fuzzing/faulty/Faulty.cpp
+++ b/tools/fuzzing/faulty/Faulty.cpp
@@ -14,20 +14,24 @@
 #include "FuzzingMutate.h"
 #include "FuzzingTraits.h"
 #include "chrome/common/ipc_channel.h"
 #include "chrome/common/ipc_message.h"
 #include "chrome/common/file_descriptor_set_posix.h"
 #include "mozilla/ipc/Faulty.h"
 #include "mozilla/TypeTraits.h"
 #include "nsNetCID.h"
+#include "nsIEventTarget.h"
 #include "nsIFile.h"
 #include "nsIFileStreams.h"
 #include "nsILineInputStream.h"
+#include "nsIRunnable.h"
+#include "nsThreadUtils.h"
 #include "nsLocalFile.h"
+#include "nsNetCID.h"
 #include "nsPrintfCString.h"
 #include "nsTArray.h"
 #include "nsXULAppAPI.h"
 #include "prenv.h"
 
 
 namespace mozilla {
 namespace ipc {
@@ -753,20 +757,33 @@ Faulty::ReadFile(const char* aPathname, 
 }
 
 bool
 Faulty::IsMessageNameBlacklisted(const char *aMessageName) {
   static bool sFileLoaded = false;
   static nsTArray<nsCString> sMessageBlacklist;
 
   if (!sFileLoaded && mBlacklistPath) {
-    if (ReadFile(mBlacklistPath, sMessageBlacklist) != NS_OK) {
-      return false;
-    }
-    sFileLoaded = true;
+    /* Run ReadFile() on the main thread to prevent
+       MOZ_ASSERT(NS_IsMainThread()) in nsStandardURL via nsNetStartup(). */
+    nsCOMPtr<nsIRunnable> r = NS_NewRunnableFunction(
+      "Fuzzer::ReadBlacklistOnMainThread",
+      [&]() {
+        if (Faulty::ReadFile(mBlacklistPath, sMessageBlacklist) != NS_OK) {
+          sFileLoaded = false;
+        } else {
+          sFileLoaded = true;
+        }
+      }
+    );
+    NS_DispatchToMainThread(r.forget(), NS_DISPATCH_SYNC);
+  }
+
+  if (!sFileLoaded) {
+    return false;
   }
 
   if (sMessageBlacklist.Length() == 0) {
     return false;
   }
 
   return sMessageBlacklist.Contains(aMessageName);
 }