Bug 1313386, part 2 - Make AutoPrintEventDispatcher::DispatchEventToWindowTree non-static. r=dholbert
authorJonathan Watt <jwatt@jwatt.org>
Tue, 01 Nov 2016 21:29:30 +0000
changeset 321917 23f27301062dea942d1d2214aab9e8ba0529d96a
parent 321916 2d98eac568db1ea095b0c989d96faa674d3473ec
child 321918 ef7bd28df4eca8b610f0f6aa1327ff1d81ba2f3a
push id30937
push usercbook@mozilla.com
push dateThu, 10 Nov 2016 16:00:02 +0000
treeherdermozilla-central@d38d06f85ef5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1313386
milestone52.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 1313386, part 2 - Make AutoPrintEventDispatcher::DispatchEventToWindowTree non-static. r=dholbert
layout/base/nsDocumentViewer.cpp
--- a/layout/base/nsDocumentViewer.cpp
+++ b/layout/base/nsDocumentViewer.cpp
@@ -414,29 +414,28 @@ namespace mozilla {
  * https://developer.mozilla.org/en-US/docs/Web/Events/beforeprint
  * https://developer.mozilla.org/en-US/docs/Web/Events/afterprint
  */
 class AutoPrintEventDispatcher
 {
 public:
   explicit AutoPrintEventDispatcher(nsIDocument* aTop) : mTop(aTop)
   {
-    DispatchEventToWindowTree(mTop, NS_LITERAL_STRING("beforeprint"));
+    DispatchEventToWindowTree(NS_LITERAL_STRING("beforeprint"));
   }
   ~AutoPrintEventDispatcher()
   {
-    DispatchEventToWindowTree(mTop, NS_LITERAL_STRING("afterprint"));
+    DispatchEventToWindowTree(NS_LITERAL_STRING("afterprint"));
   }
 
 private:
-  static void DispatchEventToWindowTree(nsIDocument* aDoc,
-                                        const nsAString& aEvent)
+  void DispatchEventToWindowTree(const nsAString& aEvent)
   {
     nsCOMArray<nsIDocument> targets;
-    CollectDocuments(aDoc, &targets);
+    CollectDocuments(mTop, &targets);
     for (int32_t i = 0; i < targets.Count(); ++i) {
       nsIDocument* d = targets[i];
       nsContentUtils::DispatchTrustedEvent(d, d->GetWindow(),
                                            aEvent, false, false, nullptr);
     }
   }
 
   static bool CollectDocuments(nsIDocument* aDocument, void* aData)