Bug 1342863 - (Part 4) DocGroup labeling for runnables dispatched by NS_DispatchTo(Main|Current)Thread in nsDocumentViewer. r=dholbert
☠☠ backed out by 4b3a8d72194c ☠ ☠
authorKuoE0 <kuoe0.tw@gmail.com>
Wed, 15 Mar 2017 12:08:32 +0800
changeset 349003 1b57aaf3cb59a3769bacea45436eb9af32bc258d
parent 349002 ec75fa65fb375bb28c50d17be3f6cfa3323ec0cc
child 349004 1c8548bdac7fa74650ce048286b9d87911e11508
push id39379
push usertlin@mozilla.com
push dateThu, 23 Mar 2017 07:04:44 +0000
treeherderautoland@ca409f78c8a3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1342863
milestone55.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 1342863 - (Part 4) DocGroup labeling for runnables dispatched by NS_DispatchTo(Main|Current)Thread in nsDocumentViewer. r=dholbert MozReview-Commit-ID: 9f32OTpim7V
layout/base/nsDocumentViewer.cpp
--- a/layout/base/nsDocumentViewer.cpp
+++ b/layout/base/nsDocumentViewer.cpp
@@ -2130,17 +2130,21 @@ nsDocumentViewer::Show(void)
     if (mPresShell) {
       nsCOMPtr<nsIPresShell> shell(mPresShell); // bug 378682
       shell->UnsuppressPainting();
     }
   }
 
   // Notify observers that a new page has been shown. This will get run
   // from the event loop after we actually draw the page.
-  NS_DispatchToMainThread(new nsDocumentShownDispatcher(mDocument));
+  RefPtr<nsDocumentShownDispatcher> event =
+    new nsDocumentShownDispatcher(mDocument);
+  mDocument->Dispatch("nsDocumentShownDispatcher",
+                      TaskCategory::Other,
+                      event.forget());
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDocumentViewer::Hide(void)
 {
   if (!mAttachedToParent && mWindow) {
@@ -4622,9 +4626,8 @@ nsDocumentShownDispatcher::Run()
 {
   nsCOMPtr<nsIObserverService> observerService =
     mozilla::services::GetObserverService();
   if (observerService) {
     observerService->NotifyObservers(mDocument, "document-shown", nullptr);
   }
   return NS_OK;
 }
-