Bug 1590908 - Part 1: Move parent-only LoadURI method to CanonicalBrowsingContext, r=kmag

These methods are only callable from the parent process, so it doesn't make
sense to have the method available driectly on BrowsingContext.

Differential Revision: https://phabricator.services.mozilla.com/D50854
This commit is contained in:
Nika Layzell
2019-11-04 15:05:47 +00:00
parent aaf67ffeaa
commit c42f4426d0
5 changed files with 55 additions and 51 deletions

View File

@@ -845,37 +845,6 @@ void BrowsingContext::Location(JSContext* aCx,
}
}
void BrowsingContext::LoadURI(const nsAString& aURI,
const LoadURIOptions& aOptions,
ErrorResult& aError) {
nsCOMPtr<nsIURIFixup> uriFixup = components::URIFixup::Service();
nsCOMPtr<nsISupports> consumer = mDocShell.get();
if (!consumer) {
consumer = mEmbedderElement;
}
if (!consumer) {
aError.Throw(NS_ERROR_UNEXPECTED);
return;
}
RefPtr<nsDocShellLoadState> loadState;
nsresult rv = nsDocShellLoadState::CreateFromLoadURIOptions(
consumer, uriFixup, aURI, aOptions, getter_AddRefs(loadState));
if (rv == NS_ERROR_MALFORMED_URI) {
DisplayLoadError(aURI);
return;
}
if (NS_FAILED(rv)) {
aError.Throw(rv);
return;
}
LoadURI(nullptr, loadState, true);
}
nsresult BrowsingContext::LoadURI(BrowsingContext* aAccessor,
nsDocShellLoadState* aLoadState,
bool aSetNavigating) {