Bug 1539147 - Part 1: Remove unused function; r=nika
☠☠ backed out by 1acfb43661fd ☠ ☠
authorJohn Dai <jdai@mozilla.com>
Fri, 03 May 2019 15:30:57 +0000
changeset 531323 5fa4ae41da870759e7cd3531f81604e8f87bc589
parent 531322 c42fe6e0cd6a57563c6fa4d75e9f2a1d786e22bb
child 531324 366f29cc8ce7caedd57c830b8febd02aac3edd1d
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnika
bugs1539147
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1539147 - Part 1: Remove unused function; r=nika Differential Revision: https://phabricator.services.mozilla.com/D29426
dom/ipc/JSWindowActorService.cpp
dom/ipc/JSWindowActorService.h
--- a/dom/ipc/JSWindowActorService.cpp
+++ b/dom/ipc/JSWindowActorService.cpp
@@ -547,54 +547,16 @@ void JSWindowActorService::ConstructActo
 
   // Invoke the constructor loaded from the module.
   if (!JS::Construct(cx, ctor, JS::HandleValueArray::empty(), aActor)) {
     aRv.NoteJSContextException(cx);
     return;
   }
 }
 
-void JSWindowActorService::ReceiveMessage(nsISupports* aTarget,
-                                          JS::RootedObject& aObj,
-                                          const nsString& aMessageName,
-                                          ipc::StructuredCloneData& aData) {
-  IgnoredErrorResult error;
-  AutoEntryScript aes(aObj, "WindowGlobalChild Message Handler");
-  JSContext* cx = aes.cx();
-
-  // We passed the unwrapped object to AutoEntryScript so we now need to
-  // enter the realm of the global object that represents the realm of our
-  // callback.
-  JSAutoRealm ar(cx, aObj);
-  JS::RootedValue json(cx, JS::NullValue());
-
-  // Deserialize our data into a JS object in the correct compartment.
-  aData.Read(aes.cx(), &json, error);
-  if (NS_WARN_IF(error.Failed())) {
-    JS_ClearPendingException(cx);
-    return;
-  }
-
-  RootedDictionary<ReceiveMessageArgument> argument(cx);
-  argument.mObjects = JS_NewPlainObject(cx);
-  argument.mTarget = aTarget;
-  argument.mName = aMessageName;
-  argument.mData = json;
-  argument.mJson = json;
-  argument.mSync = false;
-
-  JS::Rooted<JSObject*> global(cx, JS::GetNonCCWObjectGlobal(aObj));
-  RefPtr<MessageListener> messageListener =
-      new MessageListener(aObj, global, nullptr, nullptr);
-
-  JS::Rooted<JS::Value> dummy(cx);
-  messageListener->ReceiveMessage(argument, &dummy,
-                                  "JSWindowActorService::ReceiveMessage");
-}
-
 void JSWindowActorService::RegisterWindowRoot(EventTarget* aRoot) {
   MOZ_ASSERT(!mRoots.Contains(aRoot));
   mRoots.AppendElement(aRoot);
 
   // Register event listeners on the newly added Window Root.
   for (auto iter = mDescriptors.Iter(); !iter.Done(); iter.Next()) {
     iter.Data()->RegisterListenersFor(aRoot);
   }
--- a/dom/ipc/JSWindowActorService.h
+++ b/dom/ipc/JSWindowActorService.h
@@ -3,17 +3,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_JSWindowActorService_h
 #define mozilla_dom_JSWindowActorService_h
 
 #include "mozilla/dom/BrowsingContext.h"
-#include "mozilla/dom/ipc/StructuredCloneData.h"
 #include "mozilla/ErrorResult.h"
 #include "nsIURI.h"
 #include "nsRefPtrHashtable.h"
 #include "nsString.h"
 #include "nsTArray.h"
 
 namespace mozilla {
 namespace dom {
@@ -44,20 +43,16 @@ class JSWindowActorService final {
   // Load the module for the named Window Actor and contruct it.
   // This method will not initialize the actor or set its manager,
   // which is handled by callers.
   void ConstructActor(const nsAString& aName, bool aParentSide,
                       BrowsingContext* aBrowsingContext, nsIURI* aURI,
                       const nsString& aRemoteType,
                       JS::MutableHandleObject aActor, ErrorResult& aRv);
 
-  void ReceiveMessage(nsISupports* aActor, JS::RootedObject& aObj,
-                      const nsString& aMessageName,
-                      ipc::StructuredCloneData& aData);
-
   // Register or unregister a WindowRoot object from this JSWindowActorService.
   void RegisterWindowRoot(EventTarget* aRoot);
 
   // NOTE: This method is static, as it may be called during shutdown.
   static void UnregisterWindowRoot(EventTarget* aRoot);
 
  private:
   JSWindowActorService();