зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1578624 - P5: Add DisplayLoadError to BrowsingContext. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D44761 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
70bb7111fa
Коммит
1acea42856
|
@ -837,6 +837,22 @@ nsresult BrowsingContext::LoadURI(BrowsingContext* aAccessor,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
void BrowsingContext::DisplayLoadError(const nsAString& aURI) {
|
||||
MOZ_LOG(GetLog(), LogLevel::Debug, ("DisplayLoadError"));
|
||||
MOZ_DIAGNOSTIC_ASSERT(!IsDiscarded());
|
||||
MOZ_DIAGNOSTIC_ASSERT(mDocShell || XRE_IsParentProcess());
|
||||
|
||||
if (mDocShell) {
|
||||
bool didDisplayLoadError = false;
|
||||
mDocShell->DisplayLoadError(NS_ERROR_MALFORMED_URI, nullptr,
|
||||
PromiseFlatString(aURI).get(), nullptr,
|
||||
&didDisplayLoadError);
|
||||
} else {
|
||||
Unused << Canonical()->GetCurrentWindowGlobal()->SendDisplayLoadError(
|
||||
PromiseFlatString(aURI));
|
||||
}
|
||||
}
|
||||
|
||||
void BrowsingContext::Close(CallerType aCallerType, ErrorResult& aError) {
|
||||
// FIXME We need to set mClosed, but only once we're sending the
|
||||
// DOMWindowClose event (which happens in the process where the
|
||||
|
|
|
@ -188,6 +188,8 @@ class BrowsingContext : public nsWrapperCache, public BrowsingContextBase {
|
|||
nsresult LoadURI(BrowsingContext* aAccessor, nsDocShellLoadState* aLoadState,
|
||||
bool aSetNavigating = false);
|
||||
|
||||
void DisplayLoadError(const nsAString& aURI);
|
||||
|
||||
// Determine if the current BrowsingContext was 'cached' by the logic in
|
||||
// CacheChildren.
|
||||
bool IsCached();
|
||||
|
|
|
@ -62,6 +62,8 @@ child:
|
|||
|
||||
async LoadURIInChild(nsDocShellLoadState aLoadState, bool aSetNavigating);
|
||||
|
||||
async DisplayLoadError(nsString aURI);
|
||||
|
||||
both:
|
||||
async RawMessage(JSWindowActorMessageMeta aMetadata, ClonedMessageData aData);
|
||||
|
||||
|
|
|
@ -242,6 +242,16 @@ mozilla::ipc::IPCResult WindowGlobalChild::RecvLoadURIInChild(
|
|||
return IPC_OK();
|
||||
}
|
||||
|
||||
mozilla::ipc::IPCResult WindowGlobalChild::RecvDisplayLoadError(
|
||||
const nsAString& aURI) {
|
||||
bool didDisplayLoadError = false;
|
||||
mWindowGlobal->GetDocShell()->DisplayLoadError(
|
||||
NS_ERROR_MALFORMED_URI, nullptr, PromiseFlatString(aURI).get(), nullptr,
|
||||
&didDisplayLoadError);
|
||||
mWindowGlobal->GetBrowserChild()->NotifyNavigationFinished();
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
static nsresult ChangeFrameRemoteness(WindowGlobalChild* aWgc,
|
||||
BrowsingContext* aBc,
|
||||
const nsString& aRemoteType,
|
||||
|
|
|
@ -117,6 +117,8 @@ class WindowGlobalChild final : public WindowGlobalActor,
|
|||
mozilla::ipc::IPCResult RecvLoadURIInChild(nsDocShellLoadState* aLoadState,
|
||||
bool aSetNavigating);
|
||||
|
||||
mozilla::ipc::IPCResult RecvDisplayLoadError(const nsAString& aURI);
|
||||
|
||||
mozilla::ipc::IPCResult RecvChangeFrameRemoteness(
|
||||
dom::BrowsingContext* aBc, const nsString& aRemoteType,
|
||||
uint64_t aPendingSwitchId, ChangeFrameRemotenessResolver&& aResolver);
|
||||
|
|
Загрузка…
Ссылка в новой задаче