Bug 1307491 - (Part 5) Remove support for per-app-offline in dom/ipc [nukeb2g] r=baku draft
authorValentin Gosu <valentin.gosu@gmail.com>
Mon, 17 Oct 2016 03:59:05 +0200
changeset 425993 1b1eeed587600316a3cb10512cbd5f5182de3f2d
parent 425992 a2d3d44970d17ef6f679adeed4f043c99b250744
child 534042 10ef7a6d534c568c887ac745d98222938086bc1d
push id32564
push uservalentin.gosu@gmail.com
push dateMon, 17 Oct 2016 13:19:46 +0000
reviewersbaku
bugs1307491
milestone52.0a1
Bug 1307491 - (Part 5) Remove support for per-app-offline in dom/ipc [nukeb2g] r=baku MozReview-Commit-ID: 88aPx7K7OsC
dom/ipc/PBrowser.ipdl
dom/ipc/TabChild.cpp
dom/ipc/TabChild.h
dom/ipc/TabParent.cpp
dom/ipc/TabParent.h
--- a/dom/ipc/PBrowser.ipdl
+++ b/dom/ipc/PBrowser.ipdl
@@ -796,21 +796,16 @@ child:
 
     /**
      * Tell the child that the system theme has changed, and that a repaint
      * is necessary.
      */
     async ThemeChanged(LookAndFeelInt[] lookAndFeelIntCache);
 
     /**
-     * Tell the child of an app's offline status
-     */
-    async AppOfflineStatus(uint32_t id, bool offline);
-
-    /**
      * Tell the browser that its frame loader has been swapped
      * with another.
      */
     async SwappedWithOtherRemoteLoader(IPCTabContext context);
 
     /**
      * A potential accesskey was just pressed. Look for accesskey targets
      * using the list of provided charCodes.
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -93,17 +93,16 @@
 #include "StructuredCloneData.h"
 #include "nsViewportInfo.h"
 #include "nsILoadContext.h"
 #include "ipc/nsGUIEventIPC.h"
 #include "mozilla/gfx/Matrix.h"
 #include "UnitTransforms.h"
 #include "ClientLayerManager.h"
 #include "LayersLogging.h"
-#include "nsIOService.h"
 #include "nsDOMClassInfoID.h"
 #include "nsColorPickerProxy.h"
 #include "nsDatePickerProxy.h"
 #include "nsContentPermissionHelper.h"
 #include "nsPresShell.h"
 #include "nsIAppsService.h"
 #include "nsNetUtil.h"
 #include "nsIPermissionManager.h"
@@ -2396,28 +2395,16 @@ TabChild::RecvAsyncMessage(const nsStrin
     CrossProcessCpowHolder cpows(Manager(), aCpows);
     mm->ReceiveMessage(static_cast<EventTarget*>(mTabChildGlobal), nullptr,
                        aMessage, false, &data, &cpows, aPrincipal, nullptr);
   }
   return true;
 }
 
 bool
-TabChild::RecvAppOfflineStatus(const uint32_t& aId, const bool& aOffline)
-{
-  // Instantiate the service to make sure gIOService is initialized
-  nsCOMPtr<nsIIOService> ioService = mozilla::services::GetIOService();
-  if (gIOService && ioService) {
-    gIOService->SetAppOfflineInternal(aId, aOffline ?
-      nsIAppOfflineInfo::OFFLINE : nsIAppOfflineInfo::ONLINE);
-  }
-  return true;
-}
-
-bool
 TabChild::RecvSwappedWithOtherRemoteLoader(const IPCTabContext& aContext)
 {
   nsCOMPtr<nsIDocShell> ourDocShell = do_GetInterface(WebNavigation());
   if (NS_WARN_IF(!ourDocShell)) {
     return true;
   }
 
   nsCOMPtr<nsPIDOMWindowOuter> ourWindow = ourDocShell->GetWindow();
--- a/dom/ipc/TabChild.h
+++ b/dom/ipc/TabChild.h
@@ -413,19 +413,16 @@ public:
   virtual bool RecvLoadRemoteScript(const nsString& aURL,
                                     const bool& aRunInGlobalScope) override;
 
   virtual bool RecvAsyncMessage(const nsString& aMessage,
                                 InfallibleTArray<CpowEntry>&& aCpows,
                                 const IPC::Principal& aPrincipal,
                                 const ClonedMessageData& aData) override;
 
-  virtual bool RecvAppOfflineStatus(const uint32_t& aId,
-                                    const bool& aOffline) override;
-
   virtual bool
   RecvSwappedWithOtherRemoteLoader(const IPCTabContext& aContext) override;
 
   virtual PDocAccessibleChild*
   AllocPDocAccessibleChild(PDocAccessibleChild*, const uint64_t&) override;
 
   virtual bool DeallocPDocAccessibleChild(PDocAccessibleChild*) override;
 
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -282,17 +282,16 @@ TabParent::TabParent(nsIContentParent* a
   , mUpdatedDimensions(false)
   , mSizeMode(nsSizeMode_Normal)
   , mManager(aManager)
   , mDocShellIsActive(false)
   , mMarkedDestroying(false)
   , mIsDestroyed(false)
   , mIsDetached(true)
   , mAppPackageFileDescriptorSent(false)
-  , mSendOfflineStatus(true)
   , mChromeFlags(aChromeFlags)
   , mDragAreaX(0)
   , mDragAreaY(0)
   , mInitedByParent(false)
   , mTabId(aTabId)
   , mCreatingWindow(false)
   , mCursor(nsCursor(-1))
   , mTabSetsCursor(false)
@@ -776,24 +775,16 @@ TabParent::LoadURL(nsIURI* aURI)
 
     if (mCreatingWindow) {
         // Don't send the message if the child wants to load its own URL.
         MOZ_ASSERT(mDelayedURL.IsEmpty());
         mDelayedURL = spec;
         return;
     }
 
-    uint32_t appId = OwnOrContainingAppId();
-    if (mSendOfflineStatus && NS_IsAppOffline(appId)) {
-      // If the app is offline in the parent process
-      // pass that state to the child process as well
-      Unused << SendAppOfflineStatus(appId, true);
-    }
-    mSendOfflineStatus = false;
-
     Unused << SendLoadURL(spec, GetShowInfo());
 
     // If this app is a packaged app then we can speed startup by sending over
     // the file descriptor for the "application.zip" file that it will
     // invariably request. Only do this once.
     if (!mAppPackageFileDescriptorSent) {
         mAppPackageFileDescriptorSent = true;
 
--- a/dom/ipc/TabParent.h
+++ b/dom/ipc/TabParent.h
@@ -675,20 +675,16 @@ private:
   bool mMarkedDestroying;
   // When true, the TabParent is invalid and we should not send IPC messages anymore.
   bool mIsDestroyed;
   // When true, the TabParent is detached from the frame loader.
   bool mIsDetached;
   // Whether we have already sent a FileDescriptor for the app package.
   bool mAppPackageFileDescriptorSent;
 
-  // Whether we need to send the offline status to the TabChild
-  // This is true, until the first call of LoadURL
-  bool mSendOfflineStatus;
-
   uint32_t mChromeFlags;
 
   nsTArray<nsTArray<IPCDataTransferItem>> mInitialDataTransferItems;
 
   RefPtr<gfx::DataSourceSurface> mDnDVisualization;
   int32_t mDragAreaX;
   int32_t mDragAreaY;