Backed out 2 changesets (bug 1533569) for causing Android and Win AArch raptors to perma fail and automation.py tier 2 perma fails CLOSED TREE

Backed out changeset 9c5be5540874 (bug 1533569)
Backed out changeset 06da212d37f5 (bug 1533569)
This commit is contained in:
Ciure Andrei 2019-08-17 07:40:54 +03:00
Родитель 4c24a7f0ac
Коммит 7a76528da4
2 изменённых файлов: 6 добавлений и 36 удалений

Просмотреть файл

@ -262,9 +262,6 @@ nsLayoutStylesheetCache::nsLayoutStylesheetCache() : mUsedSharedMemory(0) {
// Use the shared memory handle that was given to us by a SetSharedMemory
// call under ContentChild::InitXPCOM.
mSharedMemory = sSharedMemory.forget();
MOZ_ASSERT(!mSharedMemory || mSharedMemory->mShm.memory(),
"nsLayoutStylesheetCache::SetSharedMemory should have mapped "
"the shared memory");
}
}
@ -273,17 +270,12 @@ nsLayoutStylesheetCache::nsLayoutStylesheetCache() : mUsedSharedMemory(0) {
// (unexpected), or we failed to map the shared memory buffer at the address
// we needed in the content process (might happen).
//
// If mSharedMemory is non-null, but it is not currently mapped, then it means
// we are in the parent process, and we failed to re-map the memory after
// freezing it. (We keep mSharedMemory around so that we can still share it
// to content processes.)
//
// In the parent process, this means we'll just leave our eagerly loaded
// non-shared sheets in the mFooSheet fields. In a content process, we'll
// lazily load our own copies of the sheets later.
if (mSharedMemory) {
if (auto header = static_cast<Header*>(mSharedMemory->mShm.memory())) {
MOZ_RELEASE_ASSERT(header->mMagic == Header::kMagic);
Header* header = static_cast<Header*>(mSharedMemory->mShm.memory());
MOZ_RELEASE_ASSERT(header->mMagic == Header::kMagic);
#define STYLE_SHEET(identifier_, url_, shared_) \
if (shared_) { \
@ -293,7 +285,6 @@ nsLayoutStylesheetCache::nsLayoutStylesheetCache() : mUsedSharedMemory(0) {
}
#include "mozilla/UserAgentStyleSheetList.h"
#undef STYLE_SHEET
}
}
}
@ -325,10 +316,7 @@ void nsLayoutStylesheetCache::InitSharedSheetsInParent() {
MOZ_ASSERT(XRE_IsParentProcess());
mSharedMemory = new Shm();
if (NS_WARN_IF(!mSharedMemory->mShm.CreateFreezeable(kSharedMemorySize))) {
mSharedMemory = nullptr;
return;
}
mSharedMemory->mShm.Create(kSharedMemorySize);
// We need to choose an address to map the shared memory in the parent process
// that we'll also be able to use in content processes. There's no way to
@ -365,14 +353,10 @@ void nsLayoutStylesheetCache::InitSharedSheetsInParent() {
// Failed to map at the address we computed for some reason. Fall back
// to just allocating at a location of the OS's choosing, and hope that
// it works in the content process.
if (NS_WARN_IF(!mSharedMemory->mShm.Map(kSharedMemorySize))) {
mSharedMemory = nullptr;
return;
}
mSharedMemory->mShm.Map(kSharedMemorySize);
}
address = mSharedMemory->mShm.memory();
auto header = static_cast<Header*>(address);
Header* header = static_cast<Header*>(mSharedMemory->mShm.memory());
header->mMagic = Header::kMagic;
#ifdef DEBUG
for (auto ptr : header->mSheets) {
@ -395,20 +379,6 @@ void nsLayoutStylesheetCache::InitSharedSheetsInParent() {
#include "mozilla/UserAgentStyleSheetList.h"
#undef STYLE_SHEET
// Finished writing into the shared memory. Freeze it, so that a process
// can't confuse other processes by changing the UA style sheet contents.
if (NS_WARN_IF(!mSharedMemory->mShm.Freeze())) {
mSharedMemory = nullptr;
return;
}
// The Freeze() call unmaps the shared memory. Re-map it again as read only.
// If this fails, due to something else being mapped into the same place
// between the Freeze() and Map() call, we can just fall back to keeping our
// own copy of the UA style sheets in the parent, and still try sending the
// shared memory to the content processes.
mSharedMemory->mShm.Map(kSharedMemorySize, address);
// Record how must of the shared memory we have used, for memory reporting
// later. We round up to the nearest page since the free space at the end
// of the page isn't really usable for anything else.

Просмотреть файл

@ -4816,7 +4816,7 @@
# Are shared memory User Agent style sheets enabled?
- name: layout.css.shared-memory-ua-sheets.enabled
type: bool
value: true
value: false
mirror: always
- name: layout.css.shadow-parts.enabled