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 321849 23f27301062dea942d1d2214aab9e8ba0529d96a
parent 321848 2d98eac568db1ea095b0c989d96faa674d3473ec
child 321850 ef7bd28df4eca8b610f0f6aa1327ff1d81ba2f3a
push id83685
push userjwatt@jwatt.org
push dateWed, 09 Nov 2016 16:49:01 +0000
treeherdermozilla-inbound@ef7bd28df4ec [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)