Skip to content

Commit

Permalink
Backed out 6 changesets (bug 1627075) for causing bustages in Startup…
Browse files Browse the repository at this point in the history
…Cache.cpp

CLOSED TREE

Backed out changeset fc144caf5d06 (bug 1627075)
Backed out changeset a345e05df151 (bug 1627075)
Backed out changeset 288a67aed661 (bug 1627075)
Backed out changeset 2cb021a493d8 (bug 1627075)
Backed out changeset 920398d1c3d3 (bug 1627075)
Backed out changeset ebdcd96a9d20 (bug 1627075)
  • Loading branch information
Mihai Alexandru Michis committed Jul 7, 2020
1 parent 558d46b commit 87cb0ad
Show file tree
Hide file tree
Showing 41 changed files with 412 additions and 2,251 deletions.
10 changes: 0 additions & 10 deletions dom/canvas/WebGLChild.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,6 @@
#include "mozilla/dom/PWebGLChild.h"
#include "mozilla/dom/IpdlQueue.h"

// This is a bit weird. Nothing directly in WebGLChild.h necessitates including
// WebGLParent.h, but if we don't do this, we get compiler errors in the
// generated code inside PWebGLChild.cpp. The error is due to a complex
// dependency chain involving IpdlQueue, which I won't go into here. Including
// WebGLParent.h inside WebGLChild.h is the simplest way we could think of to
// avoid this issue. Including it in any of the code more directly involved in
// the breaking dependency chain unfortunately introduces a cyclical dependency
// between WebGLParent.h and PWebGLParent.h.
#include "mozilla/dom/WebGLParent.h"

namespace mozilla {

class ClientWebGLContext;
Expand Down
18 changes: 0 additions & 18 deletions dom/ipc/ContentChild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,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"
Expand Down Expand Up @@ -1921,23 +1920,6 @@ mozilla::ipc::IPCResult ContentChild::RecvPScriptCacheConstructor(
return IPC_OK();
}

scache::PStartupCacheChild* ContentChild::AllocPStartupCacheChild(
const bool& wantCacheData) {
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, const bool& wantCacheData) {
static_cast<scache::StartupCacheChild*>(actor)->Init(wantCacheData);
return IPC_OK();
}

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

mozilla::ipc::IPCResult ContentChild::RecvNetworkLinkTypeChange(
Expand Down
7 changes: 0 additions & 7 deletions dom/ipc/ContentChild.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,13 +238,6 @@ class ContentChild final : public PContentChild,
PScriptCacheChild*, const FileDescOrError& cacheFile,
const bool& wantCacheData) override;

PStartupCacheChild* AllocPStartupCacheChild(const bool& wantCacheData);

bool DeallocPStartupCacheChild(PStartupCacheChild*);

virtual mozilla::ipc::IPCResult RecvPStartupCacheConstructor(
PStartupCacheChild*, const bool& wantCacheData) override;

PNeckoChild* AllocPNeckoChild();

bool DeallocPNeckoChild(PNeckoChild*);
Expand Down
18 changes: 0 additions & 18 deletions dom/ipc/ContentParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,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"
Expand Down Expand Up @@ -156,7 +155,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"
Expand Down Expand Up @@ -2302,11 +2300,6 @@ bool ContentParent::BeginSubprocessLaunch(ProcessPriority aPriority) {
}
mPrefSerializer->AddSharedPrefCmdLineArgs(*mSubprocess, extraArgs);

auto startupCache = mozilla::scache::StartupCache::GetSingleton();
if (startupCache) {
startupCache->AddStartupCacheCmdLineArgs(*mSubprocess, 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
Expand Down Expand Up @@ -2740,7 +2733,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.
Expand Down Expand Up @@ -3837,16 +3829,6 @@ bool ContentParent::DeallocPScriptCacheParent(PScriptCacheParent* cache) {
return true;
}

PStartupCacheParent* ContentParent::AllocPStartupCacheParent(
const bool& wantCacheData) {
return new scache::StartupCacheParent(wantCacheData);
}

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

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

bool ContentParent::DeallocPNeckoParent(PNeckoParent* necko) {
Expand Down
5 changes: 0 additions & 5 deletions dom/ipc/ContentParent.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ class PreallocatedProcessManagerImpl;
class BenchmarkStorageParent;

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

namespace embedding {
class PrintingParent;
Expand Down Expand Up @@ -927,10 +926,6 @@ class ContentParent final

bool DeallocPScriptCacheParent(PScriptCacheParent* shell);

PStartupCacheParent* AllocPStartupCacheParent(const bool& wantCacheData);

bool DeallocPStartupCacheParent(PStartupCacheParent* shell);

bool DeallocPNeckoParent(PNeckoParent* necko);

already_AddRefed<PExternalHelperAppParent> AllocPExternalHelperAppParent(
Expand Down
15 changes: 0 additions & 15 deletions dom/ipc/ContentProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ bool ContentProcess::Init(int aArgc, char* aArgv[]) {
char* prefMapHandle = nullptr;
char* prefsLen = nullptr;
char* prefMapSize = nullptr;
char* scacheHandle = nullptr;
char* scacheSize = nullptr;
#if defined(XP_MACOSX) && defined(MOZ_SANDBOX)
nsCOMPtr<nsIFile> profileDir;
#endif
Expand Down Expand Up @@ -129,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) {
Expand All @@ -146,11 +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], "-safeMode") == 0) {
gSafeMode = true;

Expand Down Expand Up @@ -187,9 +175,6 @@ bool ContentProcess::Init(int aArgc, char* aArgv[]) {
return false;
}

Unused << mozilla::scache::StartupCache::InitChildSingleton(scacheHandle,
scacheSize);

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

Expand Down
4 changes: 0 additions & 4 deletions dom/ipc/PContent.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ include protocol PVRManager;
include protocol PRemoteDecoderManager;
include protocol PProfiler;
include protocol PScriptCache;
include protocol PStartupCache;
include protocol PSessionStorageObserver;
include protocol PBenchmarkStorage;
include DOMTypes;
Expand Down Expand Up @@ -413,7 +412,6 @@ nested(upto inside_cpow) sync protocol PContent
manages PURLClassifier;
manages PURLClassifierLocal;
manages PScriptCache;
manages PStartupCache;
manages PLoginReputation;
manages PSessionStorageObserver;
manages PBenchmarkStorage;
Expand Down Expand Up @@ -541,8 +539,6 @@ child:

async PScriptCache(FileDescOrError cacheFile, bool wantCacheData);

async PStartupCache(bool wantCacheData);

async RegisterChrome(ChromePackage[] packages, SubstitutionMapping[] substitutions,
OverrideMapping[] overrides, nsCString locale, bool reset);
async RegisterChromeItem(ChromeRegistryItem item);
Expand Down
15 changes: 7 additions & 8 deletions gfx/thebes/gfxFT2FontList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ already_AddRefed<SharedFTFace> FT2FontEntry::GetFTFace(bool aCommit) {
// here would be memory allocation, in which case mFace remains null.
RefPtr<SharedFTFace> face;
if (mFilename[0] != '/') {
RefPtr<CacheAwareZipReader> reader = Omnijar::GetReader(Omnijar::Type::GRE);
RefPtr<nsZipArchive> reader = Omnijar::GetReader(Omnijar::Type::GRE);
nsZipItem* item = reader->GetItem(mFilename.get());
NS_ASSERTION(item, "failed to find zip entry");

uint32_t bufSize = item->RealSize();
uint8_t* fontDataBuf = static_cast<uint8_t*>(malloc(bufSize));
if (fontDataBuf) {
CacheAwareZipCursor cursor(item, reader, fontDataBuf, bufSize);
nsZipCursor cursor(item, reader, fontDataBuf, bufSize);
cursor.Copy(&bufSize);
NS_ASSERTION(bufSize == item->RealSize(), "error reading bundled font");
RefPtr<FTUserFontData> ufd = new FTUserFontData(fontDataBuf, bufSize);
Expand Down Expand Up @@ -458,8 +458,7 @@ hb_blob_t* FT2FontEntry::GetFontTable(uint32_t aTableTag) {
} else {
// A relative path means an omnijar resource, which we may need to
// decompress to a temporary buffer.
RefPtr<CacheAwareZipReader> reader =
Omnijar::GetReader(Omnijar::Type::GRE);
RefPtr<nsZipArchive> reader = Omnijar::GetReader(Omnijar::Type::GRE);
nsZipItem* item = reader->GetItem(mFilename.get());
MOZ_ASSERT(item, "failed to find zip entry");
if (item) {
Expand All @@ -470,7 +469,7 @@ hb_blob_t* FT2FontEntry::GetFontTable(uint32_t aTableTag) {
uint32_t length = item->RealSize();
uint8_t* buffer = static_cast<uint8_t*>(malloc(length));
if (buffer) {
CacheAwareZipCursor cursor(item, reader, buffer, length);
nsZipCursor cursor(item, reader, buffer, length);
cursor.Copy(&length);
MOZ_ASSERT(length == item->RealSize(), "error reading font");
if (length == item->RealSize()) {
Expand Down Expand Up @@ -1160,7 +1159,7 @@ void gfxFT2FontList::FindFontsInOmnijar(FontNameCache* aCache) {
static const char* sJarSearchPaths[] = {
"res/fonts/*.ttf$",
};
RefPtr<CacheAwareZipReader> reader = Omnijar::GetReader(Omnijar::Type::GRE);
RefPtr<nsZipArchive> reader = Omnijar::GetReader(Omnijar::Type::GRE);
for (unsigned i = 0; i < ArrayLength(sJarSearchPaths); i++) {
nsZipFind* find;
if (NS_SUCCEEDED(reader->FindInit(sJarSearchPaths[i], &find))) {
Expand Down Expand Up @@ -1275,7 +1274,7 @@ void gfxFT2FontList::AddFaceToList(const nsCString& aEntryName, uint32_t aIndex,
}
}

void gfxFT2FontList::AppendFacesFromOmnijarEntry(CacheAwareZipReader* aArchive,
void gfxFT2FontList::AppendFacesFromOmnijarEntry(nsZipArchive* aArchive,
const nsCString& aEntryName,
FontNameCache* aCache,
bool aJarChanged) {
Expand Down Expand Up @@ -1314,7 +1313,7 @@ void gfxFT2FontList::AppendFacesFromOmnijarEntry(CacheAwareZipReader* aArchive,
return;
}

CacheAwareZipCursor cursor(item, aArchive, (uint8_t*)buffer, bufSize);
nsZipCursor cursor(item, aArchive, (uint8_t*)buffer, bufSize);
uint8_t* data = cursor.Copy(&bufSize);
MOZ_ASSERT(data && bufSize == item->RealSize(), "error reading bundled font");
if (!data) {
Expand Down
5 changes: 1 addition & 4 deletions gfx/thebes/gfxFT2FontList.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
#include "gfxPlatformFontList.h"

namespace mozilla {

class CacheAwareZipReader;

namespace dom {
class SystemFontListEntry;
};
Expand Down Expand Up @@ -177,7 +174,7 @@ class gfxFT2FontList final : public gfxPlatformFontList {
void AppendFacesFromFontFile(const nsCString& aFileName,
FontNameCache* aCache, StandardFile aStdFile);

void AppendFacesFromOmnijarEntry(mozilla::CacheAwareZipReader* aArchive,
void AppendFacesFromOmnijarEntry(nsZipArchive* aReader,
const nsCString& aEntryName,
FontNameCache* aCache, bool aJarChanged);

Expand Down
2 changes: 1 addition & 1 deletion intl/hyphenation/glue/nsHyphenationManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ void nsHyphenationManager::LoadPatternListFromOmnijar(Omnijar::Type aType) {
return;
}

RefPtr<CacheAwareZipReader> zip = Omnijar::GetReader(aType);
RefPtr<nsZipArchive> zip = Omnijar::GetReader(aType);
if (!zip) {
return;
}
Expand Down
13 changes: 11 additions & 2 deletions intl/hyphenation/glue/nsHyphenator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,20 @@ static const void* GetItemPtrFromJarURI(nsIJARURI* aJAR, uint32_t* aLength) {
if (!file) {
return nullptr;
}
RefPtr<CacheAwareZipReader> archive = Omnijar::GetReader(file);
RefPtr<nsZipArchive> archive = Omnijar::GetReader(file);
if (archive) {
nsCString path;
aJAR->GetJAREntry(path);
return archive->GetData(path.get(), aLength);
nsZipItem* item = archive->GetItem(path.get());
if (item && item->Compression() == 0 && item->Size() > 0) {
// We do NOT own this data, but it won't go away until the omnijar
// file is closed during shutdown.
const uint8_t* data = archive->GetData(item);
if (data) {
*aLength = item->Size();
return data;
}
}
}
return nullptr;
}
Expand Down
9 changes: 4 additions & 5 deletions intl/locale/LocaleService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,14 +295,13 @@ bool LocaleService::IsServer() { return mIsServer; }

static bool GetGREFileContents(const char* aFilePath, nsCString* aOutString) {
// Look for the requested file in omnijar.
RefPtr<CacheAwareZipReader> zip = Omnijar::GetReader(Omnijar::GRE);
RefPtr<nsZipArchive> zip = Omnijar::GetReader(Omnijar::GRE);
if (zip) {
uint32_t length;
const uint8_t* data = zip->GetData(aFilePath, &length);
if (!data) {
nsZipItemPtr<char> item(zip, aFilePath);
if (!item) {
return false;
}
aOutString->Assign(reinterpret_cast<const char*>(data), length);
aOutString->Assign(item.Buffer(), item.Length());
return true;
}

Expand Down
Loading

0 comments on commit 87cb0ad

Please sign in to comment.