Commit 025f5fb9 authored by Alex Thayer's avatar Alex Thayer
Browse files

Bug 1656261 - Back out all recent StartupCache work r=RyanVM

This backs out all work from bug 1627075 as well as all of its
descendents. There were a few conflicts when backing this out but
overall it was pretty clean, so I would say it's a fairly mild
level of risk. Historically Nathan Froyd has reviewed these patches,
but he is no longer at Mozilla, and no one else is particularly
familiar with the code, so I am passing this off to RyanVM who has
at least been familiar with the history of the bug.

Differential Revision: https://phabricator.services.mozilla.com/D90096
parent e5dd298d
Loading
Loading
Loading
Loading
+0 −17
Original line number Diff line number Diff line
@@ -100,7 +100,6 @@
#include "mozilla/plugins/PluginInstanceParent.h"
#include "mozilla/plugins/PluginModuleParent.h"
#include "mozilla/RemoteLazyInputStreamChild.h"
#include "mozilla/scache/StartupCacheChild.h"
#include "mozilla/widget/ScreenManager.h"
#include "mozilla/widget/WidgetMessageUtils.h"
#include "nsBaseDragService.h"
@@ -1910,22 +1909,6 @@ mozilla::ipc::IPCResult ContentChild::RecvPScriptCacheConstructor(
  return IPC_OK();
}

scache::PStartupCacheChild* ContentChild::AllocPStartupCacheChild() {
  return new scache::StartupCacheChild();
}

bool ContentChild::DeallocPStartupCacheChild(
    scache::PStartupCacheChild* cache) {
  delete static_cast<scache::StartupCacheChild*>(cache);
  return true;
}

mozilla::ipc::IPCResult ContentChild::RecvPStartupCacheConstructor(
    scache::PStartupCacheChild* actor) {
  static_cast<scache::StartupCacheChild*>(actor)->Init();
  return IPC_OK();
}

PNeckoChild* ContentChild::AllocPNeckoChild() { return new NeckoChild(); }

mozilla::ipc::IPCResult ContentChild::RecvNetworkLinkTypeChange(
+0 −7
Original line number Diff line number Diff line
@@ -236,13 +236,6 @@ class ContentChild final : public PContentChild,
      PScriptCacheChild*, const FileDescOrError& cacheFile,
      const bool& wantCacheData) override;

  PStartupCacheChild* AllocPStartupCacheChild();

  bool DeallocPStartupCacheChild(PStartupCacheChild*);

  virtual mozilla::ipc::IPCResult RecvPStartupCacheConstructor(
      PStartupCacheChild*) override;

  PNeckoChild* AllocPNeckoChild();

  bool DeallocPNeckoChild(PNeckoChild*);
+0 −18
Original line number Diff line number Diff line
@@ -68,7 +68,6 @@
#include "mozilla/ProcessHangMonitorIPC.h"
#include "mozilla/RDDProcessManager.h"
#include "mozilla/ScopeExit.h"
#include "mozilla/scache/StartupCache.h"
#include "mozilla/ScriptPreloader.h"
#include "mozilla/Services.h"
#include "mozilla/Sprintf.h"
@@ -160,7 +159,6 @@
#include "mozilla/plugins/PluginBridge.h"
#include "mozilla/RemoteLazyInputStreamParent.h"
#include "mozilla/widget/ScreenManager.h"
#include "mozilla/scache/StartupCacheParent.h"
#include "nsAnonymousTemporaryFile.h"
#include "nsAppRunner.h"
#include "nsCExternalHandlerService.h"
@@ -2305,12 +2303,6 @@ bool ContentParent::BeginSubprocessLaunch(ProcessPriority aPriority) {
  }
  mPrefSerializer->AddSharedPrefCmdLineArgs(*mSubprocess, extraArgs);

  auto startupCache = mozilla::scache::StartupCache::GetSingleton();
  if (startupCache) {
    startupCache->AddStartupCacheCmdLineArgs(*mSubprocess, GetRemoteType(),
                                             extraArgs);
  }

  // Register ContentParent as an observer for changes to any pref
  // whose prefix matches the empty string, i.e. all of them.  The
  // observation starts here in order to capture pref updates that
@@ -2745,7 +2737,6 @@ bool ContentParent::InitInternal(ProcessPriority aInitialPriority) {
  Unused << SendRemoteType(mRemoteType);

  ScriptPreloader::InitContentChild(*this);
  scache::StartupCache::InitContentChild(*this);

  // Initialize the message manager (and load delayed scripts) now that we
  // have established communications with the child.
@@ -3857,15 +3848,6 @@ bool ContentParent::DeallocPScriptCacheParent(PScriptCacheParent* cache) {
  return true;
}

PStartupCacheParent* ContentParent::AllocPStartupCacheParent() {
  return new scache::StartupCacheParent();
}

bool ContentParent::DeallocPStartupCacheParent(PStartupCacheParent* cache) {
  delete static_cast<scache::StartupCacheParent*>(cache);
  return true;
}

PNeckoParent* ContentParent::AllocPNeckoParent() { return new NeckoParent(); }

bool ContentParent::DeallocPNeckoParent(PNeckoParent* necko) {
+0 −5
Original line number Diff line number Diff line
@@ -71,7 +71,6 @@ class PreallocatedProcessManagerImpl;
class BenchmarkStorageParent;

using mozilla::loader::PScriptCacheParent;
using mozilla::scache::PStartupCacheParent;

namespace embedding {
class PrintingParent;
@@ -937,10 +936,6 @@ class ContentParent final

  bool DeallocPScriptCacheParent(PScriptCacheParent* shell);

  PStartupCacheParent* AllocPStartupCacheParent();

  bool DeallocPStartupCacheParent(PStartupCacheParent* shell);

  bool DeallocPNeckoParent(PNeckoParent* necko);

  already_AddRefed<PExternalHelperAppParent> AllocPExternalHelperAppParent(
+0 −20
Original line number Diff line number Diff line
@@ -84,9 +84,6 @@ bool ContentProcess::Init(int aArgc, char* aArgv[]) {
  char* prefMapHandle = nullptr;
  char* prefsLen = nullptr;
  char* prefMapSize = nullptr;
  char* scacheHandle = nullptr;
  char* scacheSize = nullptr;
  bool wantsScache = true;
#if defined(XP_MACOSX) && defined(MOZ_SANDBOX)
  nsCOMPtr<nsIFile> profileDir;
#endif
@@ -130,11 +127,6 @@ bool ContentProcess::Init(int aArgc, char* aArgv[]) {
        return false;
      }
      prefMapHandle = aArgv[i];
    } else if (strcmp(aArgv[i], "-scacheHandle") == 0) {
      if (++i == aArgc) {
        return false;
      }
      scacheHandle = aArgv[i];
#endif

    } else if (strcmp(aArgv[i], "-prefsLen") == 0) {
@@ -147,13 +139,6 @@ bool ContentProcess::Init(int aArgc, char* aArgv[]) {
        return false;
      }
      prefMapSize = aArgv[i];
    } else if (strcmp(aArgv[i], "-scacheSize") == 0) {
      if (++i == aArgc) {
        return false;
      }
      scacheSize = aArgv[i];
    } else if (strcmp(aArgv[i], "-noScache") == 0) {
      wantsScache = false;
    } else if (strcmp(aArgv[i], "-safeMode") == 0) {
      gSafeMode = true;

@@ -190,11 +175,6 @@ bool ContentProcess::Init(int aArgc, char* aArgv[]) {
    return false;
  }

  if (wantsScache) {
    Unused << mozilla::scache::StartupCache::InitChildSingleton(scacheHandle,
                                                                scacheSize);
  }

  mContent.Init(IOThreadChild::message_loop(), ParentPid(), *parentBuildID,
                IOThreadChild::TakeChannel(), *childID, *isForBrowser);

Loading