Bug 923151 - Part 1: Don't #include nsIDocument.h in TabChild.h; r=jst
authorEhsan Akhgari <ehsan@mozilla.com>
Wed, 02 Oct 2013 16:08:30 -0400
changeset 163572 ec20bcd7c9022ef3f30c3ac6976d90c377363ac4
parent 163571 744368060c9bf3c5753ce2acf405571c87738cfc
child 163573 bfaaa5b35899f7d3b41002c115fa96bdcb05b799
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjst
bugs923151
milestone27.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 923151 - Part 1: Don't #include nsIDocument.h in TabChild.h; r=jst
dom/devicestorage/nsDeviceStorage.cpp
dom/ipc/TabChild.cpp
dom/ipc/TabChild.h
--- a/dom/devicestorage/nsDeviceStorage.cpp
+++ b/dom/devicestorage/nsDeviceStorage.cpp
@@ -42,16 +42,17 @@
 #include "nsIDOMDeviceStorageChangeEvent.h"
 #include "nsCRT.h"
 #include "nsIObserverService.h"
 #include "GeneratedEvents.h"
 #include "nsIMIMEService.h"
 #include "nsCExternalHandlerService.h"
 #include "nsIPermissionManager.h"
 #include "nsIStringBundle.h"
+#include "nsIDocument.h"
 #include <algorithm>
 
 #include "mozilla/dom/DeviceStorageBinding.h"
 
 // Microsoft's API Name hackery sucks
 #undef CreateEvent
 
 #ifdef MOZ_WIDGET_GONK
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -2420,16 +2420,28 @@ TabChild::DoSendAsyncMessage(JSContext* 
   if (sCpowsEnabled) {
     if (!cc->GetCPOWManager()->Wrap(aCx, aCpows, &cpows)) {
       return false;
     }
   }
   return SendAsyncMessage(nsString(aMessage), data, cpows);
 }
 
+TabChild*
+TabChild::GetFrom(nsIPresShell* aPresShell)
+{
+  nsIDocument* doc = aPresShell->GetDocument();
+  if (!doc) {
+      return nullptr;
+  }
+  nsCOMPtr<nsISupports> container = doc->GetContainer();
+  nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(container));
+  return GetFrom(docShell);
+}
+
 
 TabChildGlobal::TabChildGlobal(TabChild* aTabChild)
 : mTabChild(aTabChild)
 {
 }
 
 void
 TabChildGlobal::Init()
--- a/dom/ipc/TabChild.h
+++ b/dom/ipc/TabChild.h
@@ -18,17 +18,16 @@
 #include "nsIWebBrowserChrome2.h"
 #include "nsIEmbeddingSiteWindow.h"
 #include "nsIWebBrowserChromeFocus.h"
 #include "nsIDOMEventListener.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIWindowProvider.h"
 #include "nsIDOMWindow.h"
 #include "nsIDocShell.h"
-#include "nsIDocument.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsFrameMessageManager.h"
 #include "nsIWebProgressListener.h"
 #include "nsDOMEventTargetHelper.h"
 #include "nsIDialogCreator.h"
 #include "nsIPresShell.h"
 #include "nsIScriptObjectPrincipal.h"
 #include "nsWeakReference.h"
@@ -349,27 +348,17 @@ public:
 
     static inline TabChild*
     GetFrom(nsIDocShell* aDocShell)
     {
       nsCOMPtr<nsITabChild> tc = do_GetInterface(aDocShell);
       return static_cast<TabChild*>(tc.get());
     }
 
-    static inline TabChild*
-    GetFrom(nsIPresShell* aPresShell)
-    {
-      nsIDocument* doc = aPresShell->GetDocument();
-      if (!doc) {
-          return nullptr;
-      }
-      nsCOMPtr<nsISupports> container = doc->GetContainer();
-      nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(container));
-      return GetFrom(docShell);
-    }
+    static TabChild* GetFrom(nsIPresShell* aPresShell);
 
     static inline TabChild*
     GetFrom(nsIDOMWindow* aWindow)
     {
       nsCOMPtr<nsIWebNavigation> webNav = do_GetInterface(aWindow);
       nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(webNav);
       return GetFrom(docShell);
     }