зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1553490 - Make RestoreBrowsingContextChildren take an array of BCs. r=nika
Also remove BrowsingContextId now when it's not needed. Differential Revision: https://phabricator.services.mozilla.com/D32151 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
4d6a93f860
Коммит
b9c62bb227
|
@ -341,12 +341,7 @@ void BrowsingContext::RestoreChildren(Children&& aChildren, bool aFromIPC) {
|
|||
if (!aFromIPC && XRE_IsContentProcess()) {
|
||||
auto cc = ContentChild::GetSingleton();
|
||||
MOZ_DIAGNOSTIC_ASSERT(cc);
|
||||
|
||||
nsTArray<BrowsingContextId> contexts(aChildren.Length());
|
||||
for (BrowsingContext* child : aChildren) {
|
||||
contexts.AppendElement(child->Id());
|
||||
}
|
||||
cc->SendRestoreBrowsingContextChildren(this, contexts);
|
||||
cc->SendRestoreBrowsingContextChildren(this, aChildren);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3844,17 +3844,10 @@ mozilla::ipc::IPCResult ContentChild::RecvCacheBrowsingContextChildren(
|
|||
}
|
||||
|
||||
mozilla::ipc::IPCResult ContentChild::RecvRestoreBrowsingContextChildren(
|
||||
BrowsingContext* aContext, nsTArray<BrowsingContextId>&& aChildren) {
|
||||
BrowsingContext* aContext, BrowsingContext::Children&& aChildren) {
|
||||
MOZ_DIAGNOSTIC_ASSERT(aContext);
|
||||
|
||||
BrowsingContext::Children children(aChildren.Length());
|
||||
|
||||
for (auto id : aChildren) {
|
||||
RefPtr<BrowsingContext> child = BrowsingContext::Get(id);
|
||||
children.AppendElement(child);
|
||||
}
|
||||
|
||||
aContext->RestoreChildren(std::move(children), /* aFromIPC */ true);
|
||||
aContext->RestoreChildren(std::move(aChildren), /* aFromIPC */ true);
|
||||
|
||||
return IPC_OK();
|
||||
}
|
||||
|
|
|
@ -722,7 +722,7 @@ class ContentChild final : public PContentChild,
|
|||
BrowsingContext* aContext);
|
||||
|
||||
mozilla::ipc::IPCResult RecvRestoreBrowsingContextChildren(
|
||||
BrowsingContext* aContext, nsTArray<BrowsingContextId>&& aChildren);
|
||||
BrowsingContext* aContext, BrowsingContext::Children&& aChildren);
|
||||
|
||||
mozilla::ipc::IPCResult RecvRegisterBrowsingContextGroup(
|
||||
nsTArray<BrowsingContext::IPCInitializer>&& aInits);
|
||||
|
|
|
@ -5820,7 +5820,7 @@ mozilla::ipc::IPCResult ContentParent::RecvCacheBrowsingContextChildren(
|
|||
}
|
||||
|
||||
mozilla::ipc::IPCResult ContentParent::RecvRestoreBrowsingContextChildren(
|
||||
BrowsingContext* aContext, nsTArray<BrowsingContextId>&& aChildren) {
|
||||
BrowsingContext* aContext, BrowsingContext::Children&& aChildren) {
|
||||
if (!aContext) {
|
||||
MOZ_LOG(BrowsingContext::GetLog(), LogLevel::Debug,
|
||||
("ParentIPC: Trying to restore already detached"));
|
||||
|
@ -5840,14 +5840,7 @@ mozilla::ipc::IPCResult ContentParent::RecvRestoreBrowsingContextChildren(
|
|||
return IPC_OK();
|
||||
}
|
||||
|
||||
BrowsingContext::Children children(aChildren.Length());
|
||||
|
||||
for (auto id : aChildren) {
|
||||
RefPtr<BrowsingContext> child = BrowsingContext::Get(id);
|
||||
children.AppendElement(child);
|
||||
}
|
||||
|
||||
aContext->RestoreChildren(std::move(children), /* aFromIPC */ true);
|
||||
aContext->RestoreChildren(std::move(aChildren), /* aFromIPC */ true);
|
||||
|
||||
aContext->Group()->EachOtherParent(this, [&](ContentParent* aParent) {
|
||||
Unused << aParent->SendRestoreBrowsingContextChildren(aContext, aChildren);
|
||||
|
|
|
@ -629,7 +629,7 @@ class ContentParent final : public PContentParent,
|
|||
BrowsingContext* aContext);
|
||||
|
||||
mozilla::ipc::IPCResult RecvRestoreBrowsingContextChildren(
|
||||
BrowsingContext* aContext, nsTArray<BrowsingContextId>&& aChildren);
|
||||
BrowsingContext* aContext, BrowsingContext::Children&& aChildren);
|
||||
|
||||
mozilla::ipc::IPCResult RecvWindowClose(BrowsingContext* aContext,
|
||||
bool aTrustedCaller);
|
||||
|
|
|
@ -43,7 +43,6 @@ class IdType {
|
|||
|
||||
typedef IdType<BrowserParent> TabId;
|
||||
typedef IdType<ContentParent> ContentParentId;
|
||||
typedef IdType<BrowsingContext> BrowsingContextId;
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
|
|
|
@ -97,7 +97,6 @@ using mozilla::Telemetry::DiscardedData from "mozilla/TelemetryComms.h";
|
|||
using mozilla::CrossProcessMutexHandle from "mozilla/ipc/CrossProcessMutex.h";
|
||||
using refcounted class nsIInputStream from "mozilla/ipc/IPCStreamUtils.h";
|
||||
using refcounted class mozilla::dom::BrowsingContext from "mozilla/dom/BrowsingContext.h";
|
||||
using mozilla::dom::BrowsingContextId from "mozilla/dom/ipc/IdType.h";
|
||||
using mozilla::dom::BrowsingContextTransaction from "mozilla/dom/BrowsingContext.h";
|
||||
using mozilla::dom::BrowsingContextFieldEpochs from "mozilla/dom/BrowsingContext.h";
|
||||
using mozilla::dom::BrowsingContextInitializer from "mozilla/dom/BrowsingContext.h";
|
||||
|
@ -1450,7 +1449,7 @@ both:
|
|||
* Re-attach all BrowsingContexts in a 'aContext'.
|
||||
*/
|
||||
async RestoreBrowsingContextChildren(BrowsingContext aContext,
|
||||
BrowsingContextId[] aChildren);
|
||||
BrowsingContext[] aChildren);
|
||||
|
||||
async WindowClose(BrowsingContext aContext, bool aTrustedCaller);
|
||||
async WindowFocus(BrowsingContext aContext);
|
||||
|
|
Загрузка…
Ссылка в новой задаче