mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
Bug 1589054 - Part 4: Run DisplayLoadError in a script runner, r=farre
Differential Revision: https://phabricator.services.mozilla.com/D50025 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
d9c800fe18
commit
2f4515047c
@ -165,20 +165,25 @@ void nsFrameLoaderOwner::ChangeRemoteness(
|
||||
const mozilla::dom::RemotenessOptions& aOptions, mozilla::ErrorResult& rv) {
|
||||
std::function<void()> frameLoaderInit = [&] {
|
||||
if (aOptions.mError.WasPassed()) {
|
||||
RefPtr<nsFrameLoader> frameLoader = mFrameLoader;
|
||||
nsresult error = static_cast<nsresult>(aOptions.mError.Value());
|
||||
nsContentUtils::AddScriptRunner(NS_NewRunnableFunction(
|
||||
"nsFrameLoaderOwner::DisplayLoadError", [frameLoader, error]() {
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
rv = NS_NewURI(getter_AddRefs(uri), "about:blank");
|
||||
if (NS_WARN_IF(rv.Failed())) {
|
||||
nsresult rv = NS_NewURI(getter_AddRefs(uri), "about:blank");
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsDocShell* docShell = mFrameLoader->GetDocShell(rv);
|
||||
if (NS_WARN_IF(rv.Failed())) {
|
||||
RefPtr<nsDocShell> docShell =
|
||||
frameLoader->GetDocShell(IgnoreErrors());
|
||||
if (NS_WARN_IF(!docShell)) {
|
||||
return;
|
||||
}
|
||||
bool displayed = false;
|
||||
docShell->DisplayLoadError(static_cast<nsresult>(aOptions.mError.Value()),
|
||||
uri, u"about:blank", nullptr, &displayed);
|
||||
|
||||
docShell->DisplayLoadError(error, uri, u"about:blank", nullptr,
|
||||
&displayed);
|
||||
}));
|
||||
} else if (aOptions.mPendingSwitchID.WasPassed()) {
|
||||
mFrameLoader->ResumeLoad(aOptions.mPendingSwitchID.Value());
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user