Bug 1318506 - Label MessagePort runnables by DocGroup (r=bkelly)
☠☠ backed out by ca73f213f05a ☠ ☠
authorBill McCloskey <billm@mozilla.com>
Sun, 13 Nov 2016 10:22:40 -0800
changeset 324962 e642f1df626dbca714a2adbae3b3d2365a9b9bfe
parent 324961 a8b3690476c918318e32b9b88ef2b5894ae4185d
child 324963 bb19a439bfbda749e043add759db08e54d939c2e
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersbkelly
bugs1318506
milestone53.0a1
Bug 1318506 - Label MessagePort runnables by DocGroup (r=bkelly) MozReview-Commit-ID: 8uhgm7ivVSh
dom/messagechannel/MessagePort.cpp
--- a/dom/messagechannel/MessagePort.cpp
+++ b/dom/messagechannel/MessagePort.cpp
@@ -561,16 +561,22 @@ MessagePort::Dispatch()
       break;
   }
 
   RefPtr<SharedMessagePortMessage> data = mMessages.ElementAt(0);
   mMessages.RemoveElementAt(0);
 
   mPostMessageRunnable = new PostMessageRunnable(this, data);
 
+  nsCOMPtr<nsIGlobalObject> global = GetOwnerGlobal();
+  if (NS_IsMainThread() && global) {
+    MOZ_ALWAYS_SUCCEEDS(global->Dispatch("MessagePortMessage", TaskCategory::Other, do_AddRef(mPostMessageRunnable)));
+    return;
+  }
+
   MOZ_ALWAYS_SUCCEEDS(NS_DispatchToCurrentThread(mPostMessageRunnable));
 }
 
 void
 MessagePort::Close()
 {
   CloseInternal(true /* aSoftly */);
 }