Backed out 4 changesets (bug 1629866, bug 1570255) for assertion failures on DocumentChannelChild.cpp. CLOSED TREE
Backed out changeset 214e4a11be0d (bug 1570255) Backed out changeset db066dda1bb8 (bug 1570255) Backed out changeset d9f75d88613e (bug 1570255) Backed out changeset fe2d4790b73a (bug 1629866)
This commit is contained in:
@@ -37,7 +37,6 @@
|
||||
#include "mozilla/Logging.h"
|
||||
#include "mozilla/ResultExtensions.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "mozilla/StaticPrefs_fission.h"
|
||||
#include "mozilla/StaticPrefs_page_load.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
#include "nsIURIFixup.h"
|
||||
@@ -360,9 +359,6 @@ void BrowsingContext::CreateFromIPC(BrowsingContext::IPCInitializer&& aInit,
|
||||
}
|
||||
|
||||
context->mWindowless = aInit.mWindowless;
|
||||
if (aInit.mHasSessionHistory) {
|
||||
context->InitSessionHistory();
|
||||
}
|
||||
|
||||
// NOTE: Call through the `Set` methods for these values to ensure that any
|
||||
// relevant process-local state is also updated.
|
||||
@@ -408,9 +404,6 @@ void BrowsingContext::SetDocShell(nsIDocShell* aDocShell) {
|
||||
mDocShell = aDocShell;
|
||||
mDanglingRemoteOuterProxies = !mIsInProcess;
|
||||
mIsInProcess = true;
|
||||
if (mChildSessionHistory) {
|
||||
mChildSessionHistory->SetIsInProcess(true);
|
||||
}
|
||||
}
|
||||
|
||||
// This class implements a callback that will return the remote window proxy for
|
||||
@@ -524,10 +517,6 @@ void BrowsingContext::Attach(bool aFromIPC, ContentParent* aOriginProcess) {
|
||||
PopupBlocker::RegisterOpenPopupSpam();
|
||||
}
|
||||
|
||||
if (IsTop() && GetHasSessionHistory()) {
|
||||
CreateChildSHistory();
|
||||
}
|
||||
|
||||
if (XRE_IsContentProcess() && !aFromIPC) {
|
||||
// Send attach to our parent if we need to.
|
||||
ContentChild::GetSingleton()->SendCreateBrowsingContext(
|
||||
@@ -637,11 +626,6 @@ void BrowsingContext::PrepareForProcessChange() {
|
||||
// different process now. This may need to change in the future with
|
||||
// Cross-Process BFCache.
|
||||
mDocShell = nullptr;
|
||||
if (mChildSessionHistory) {
|
||||
// This can be removed once session history is stored exclusively in the
|
||||
// parent process.
|
||||
mChildSessionHistory->SetIsInProcess(false);
|
||||
}
|
||||
|
||||
if (!mWindowProxy) {
|
||||
return;
|
||||
@@ -1402,16 +1386,16 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(BrowsingContext)
|
||||
tmp->mFields.SetWithoutSyncing<IDX_IsPopupSpam>(false);
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(
|
||||
mDocShell, mParentWindow, mGroup, mEmbedderElement, mWindowContexts,
|
||||
mCurrentWindowContext, mSessionStorageManager, mChildSessionHistory)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mDocShell, mParentWindow, mGroup,
|
||||
mEmbedderElement, mWindowContexts,
|
||||
mCurrentWindowContext, mSessionStorageManager)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(BrowsingContext)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(
|
||||
mDocShell, mParentWindow, mGroup, mEmbedderElement, mWindowContexts,
|
||||
mCurrentWindowContext, mSessionStorageManager, mChildSessionHistory)
|
||||
mCurrentWindowContext, mSessionStorageManager)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
class RemoteLocationProxy
|
||||
@@ -1790,7 +1774,6 @@ BrowsingContext::IPCInitializer BrowsingContext::GetIPCInitializer() {
|
||||
init.mUseRemoteTabs = mUseRemoteTabs;
|
||||
init.mUseRemoteSubframes = mUseRemoteSubframes;
|
||||
init.mOriginAttributes = mOriginAttributes;
|
||||
init.mHasSessionHistory = mChildSessionHistory != nullptr;
|
||||
init.mFields = mFields.Fields();
|
||||
return init;
|
||||
}
|
||||
@@ -2216,55 +2199,6 @@ void BrowsingContext::AddDeprioritizedLoadRunner(nsIRunnable* aRunner) {
|
||||
EventQueuePriority::Idle);
|
||||
}
|
||||
|
||||
void BrowsingContext::InitSessionHistory() {
|
||||
MOZ_ASSERT(!IsDiscarded());
|
||||
MOZ_ASSERT(IsTop());
|
||||
MOZ_ASSERT(EverAttached());
|
||||
|
||||
if (!GetHasSessionHistory()) {
|
||||
SetHasSessionHistory(true);
|
||||
|
||||
// If the top browsing context (this one) is loaded in this process then we
|
||||
// also create the session history implementation for the child process.
|
||||
// This can be removed once session history is stored exclusively in the
|
||||
// parent process.
|
||||
mChildSessionHistory->SetIsInProcess(mDocShell);
|
||||
}
|
||||
}
|
||||
|
||||
ChildSHistory* BrowsingContext::GetChildSessionHistory() {
|
||||
if (!StaticPrefs::fission_sessionHistoryInParent()) {
|
||||
// For now we're checking that the session history object for the child
|
||||
// process is available before returning the ChildSHistory object, because
|
||||
// it is the actual implementation that ChildSHistory forwards to. This can
|
||||
// be removed once session history is stored exclusively in the parent
|
||||
// process.
|
||||
return mChildSessionHistory && mChildSessionHistory->IsInProcess()
|
||||
? mChildSessionHistory.get()
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
return mChildSessionHistory;
|
||||
}
|
||||
|
||||
void BrowsingContext::CreateChildSHistory() {
|
||||
MOZ_ASSERT(IsTop());
|
||||
|
||||
// Because session history is global in a browsing context tree, every process
|
||||
// that has access to a browsing context tree needs access to its session
|
||||
// history. That is why we create the ChildSHistory object in every process
|
||||
// where we have access to this browsing context (which is the top one).
|
||||
mChildSessionHistory = new ChildSHistory(this);
|
||||
}
|
||||
|
||||
void BrowsingContext::DidSet(FieldIndex<IDX_HasSessionHistory>,
|
||||
bool aOldValue) {
|
||||
MOZ_ASSERT(GetHasSessionHistory() || !aOldValue,
|
||||
"We don't support turning off session history.");
|
||||
|
||||
CreateChildSHistory();
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
|
||||
namespace ipc {
|
||||
|
||||
Reference in New Issue
Block a user