Backed out changeset bcdd097c9a4f (bug 1828690) for causing mass failures. CLOSED TREE

This commit is contained in:
Butkovits Atila 2023-05-03 04:02:36 +03:00
Родитель 76be20b113
Коммит 992799b447
4 изменённых файлов: 18 добавлений и 34 удалений

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

@ -48,7 +48,6 @@
#include "mozilla/dom/WindowProxyHolder.h"
#include "mozilla/dom/SyncedContextInlines.h"
#include "mozilla/dom/XULFrameElement.h"
#include "mozilla/ipc/ProtocolUtils.h"
#include "mozilla/net/DocumentLoadListener.h"
#include "mozilla/net/RequestContextService.h"
#include "mozilla/Assertions.h"
@ -520,9 +519,9 @@ void BrowsingContext::EnsureAttached() {
}
/* static */
mozilla::ipc::IPCResult BrowsingContext::CreateFromIPC(
BrowsingContext::IPCInitializer&& aInit, BrowsingContextGroup* aGroup,
ContentParent* aOriginProcess) {
void BrowsingContext::CreateFromIPC(BrowsingContext::IPCInitializer&& aInit,
BrowsingContextGroup* aGroup,
ContentParent* aOriginProcess) {
MOZ_DIAGNOSTIC_ASSERT(aOriginProcess || XRE_IsContentProcess());
MOZ_DIAGNOSTIC_ASSERT(aGroup);
@ -573,7 +572,7 @@ mozilla::ipc::IPCResult BrowsingContext::CreateFromIPC(
Register(context);
return context->Attach(/* aFromIPC */ true, aOriginProcess);
context->Attach(/* aFromIPC */ true, aOriginProcess);
}
BrowsingContext::BrowsingContext(WindowContext* aParentWindow,
@ -785,8 +784,7 @@ void BrowsingContext::Embed() {
}
}
mozilla::ipc::IPCResult BrowsingContext::Attach(bool aFromIPC,
ContentParent* aOriginProcess) {
void BrowsingContext::Attach(bool aFromIPC, ContentParent* aOriginProcess) {
MOZ_DIAGNOSTIC_ASSERT(!mEverAttached);
MOZ_DIAGNOSTIC_ASSERT_IF(aFromIPC, aOriginProcess || XRE_IsContentProcess());
mEverAttached = true;
@ -805,29 +803,14 @@ mozilla::ipc::IPCResult BrowsingContext::Attach(bool aFromIPC,
MOZ_DIAGNOSTIC_ASSERT(mGroup);
MOZ_DIAGNOSTIC_ASSERT(!mIsDiscarded);
if (mGroup->IsPotentiallyCrossOriginIsolated() !=
MOZ_DIAGNOSTIC_ASSERT(
mGroup->IsPotentiallyCrossOriginIsolated() ==
(Top()->GetOpenerPolicy() ==
nsILoadInfo::OPENER_POLICY_SAME_ORIGIN_EMBEDDER_POLICY_REQUIRE_CORP)) {
MOZ_DIAGNOSTIC_ASSERT(aFromIPC);
if (aFromIPC) {
auto* actor = aOriginProcess
? static_cast<mozilla::ipc::IProtocol*>(aOriginProcess)
: static_cast<mozilla::ipc::IProtocol*>(
ContentChild::GetSingleton());
return IPC_FAIL(
actor,
"Invalid CrossOriginIsolated state in BrowsingContext::Attach call");
} else {
MOZ_CRASH(
"Invalid CrossOriginIsolated state in BrowsingContext::Attach call");
}
}
nsILoadInfo::OPENER_POLICY_SAME_ORIGIN_EMBEDDER_POLICY_REQUIRE_CORP));
AssertCoherentLoadContext();
// Add ourselves either to our parent or BrowsingContextGroup's child list.
// Important: We shouldn't return IPC_FAIL after this point, since the
// BrowsingContext will have already been added to the tree.
if (mParentWindow) {
if (!aFromIPC) {
MOZ_DIAGNOSTIC_ASSERT(!mParentWindow->IsDiscarded(),
@ -905,7 +888,6 @@ mozilla::ipc::IPCResult BrowsingContext::Attach(bool aFromIPC,
if (XRE_IsParentProcess()) {
Canonical()->CanonicalAttach();
}
return IPC_OK();
}
void BrowsingContext::Detach(bool aFromIPC) {

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

@ -54,7 +54,6 @@ class LogModule;
namespace ipc {
class IProtocol;
class IPCResult;
template <typename T>
struct IPDLParamTraits;
@ -790,9 +789,9 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache {
IPCInitializer GetIPCInitializer();
// Create a BrowsingContext object from over IPC.
static mozilla::ipc::IPCResult CreateFromIPC(IPCInitializer&& aInitializer,
BrowsingContextGroup* aGroup,
ContentParent* aOriginProcess);
static void CreateFromIPC(IPCInitializer&& aInitializer,
BrowsingContextGroup* aGroup,
ContentParent* aOriginProcess);
bool IsSandboxedFrom(BrowsingContext* aTarget);
@ -959,7 +958,7 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache {
bool aHasPostData);
private:
mozilla::ipc::IPCResult Attach(bool aFromIPC, ContentParent* aOriginProcess);
void Attach(bool aFromIPC, ContentParent* aOriginProcess);
// Recomputes whether we can execute scripts in this BrowsingContext based on
// the value of AllowJavascript() and whether scripts are allowed in the

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

@ -3816,7 +3816,8 @@ mozilla::ipc::IPCResult ContentChild::RecvCreateBrowsingContext(
RefPtr<BrowsingContextGroup> group =
BrowsingContextGroup::GetOrCreate(aGroupId);
return BrowsingContext::CreateFromIPC(std::move(aInit), group, nullptr);
BrowsingContext::CreateFromIPC(std::move(aInit), group, nullptr);
return IPC_OK();
}
mozilla::ipc::IPCResult ContentChild::RecvDiscardBrowsingContext(
@ -3855,7 +3856,8 @@ mozilla::ipc::IPCResult ContentChild::RecvRegisterBrowsingContextGroup(
MOZ_ASSERT_IF(parent, parent->Group() == group);
#endif
return BrowsingContext::CreateFromIPC(std::move(init), group, nullptr);
BrowsingContext::CreateFromIPC(std::move(init), group, nullptr);
break;
}
case SyncedContextInitializer::TWindowContextInitializer: {
auto& init = initUnion.get_WindowContextInitializer();

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

@ -7293,7 +7293,8 @@ mozilla::ipc::IPCResult ContentParent::RecvCreateBrowsingContext(
return IPC_FAIL(this, "Unrelated context from child in stale group");
}
return BrowsingContext::CreateFromIPC(std::move(aInit), group, this);
BrowsingContext::CreateFromIPC(std::move(aInit), group, this);
return IPC_OK();
}
bool ContentParent::CheckBrowsingContextEmbedder(CanonicalBrowsingContext* aBC,