Bug 1695999 - Port bug 1689601: Update ChangeRemoteness to use RemotenessOptions struct. r=darktrojan

Differential Revision: https://phabricator.services.mozilla.com/D106990

--HG--
extra : rebase_source : 5813ae0a43d011e515226ff54cf8ca22558f7487
extra : amend_source : d644714128a48be26855dcf43a876300989fd88e
This commit is contained in:
Rob Lemley 2021-03-02 19:30:55 +00:00
Родитель 681b4748a9
Коммит 340169a2ee
1 изменённых файлов: 5 добавлений и 2 удалений

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

@ -471,6 +471,7 @@ nsresult nsMessenger::CompleteOpenURL() {
NS_IMETHODIMP
nsMessenger::OpenURL(const nsACString& aURL) {
mURLToLoad = aURL;
RemotenessChangeOptions changeState;
nsCOMPtr<nsPIDOMWindowOuter> win = nsPIDOMWindowOuter::From(mWindow);
nsIDocShell* rootShell = win->GetDocShell();
@ -490,11 +491,13 @@ nsMessenger::OpenURL(const nsACString& aURL) {
return CompleteOpenURL();
}
// This browsing context is in a child process. Change it to the parent
// process, then load the message.
changeState.mRemoteType = NOT_REMOTE_TYPE;
canonicalBrowsingContext
->ChangeRemoteness(NOT_REMOTE_TYPE,
nsContentUtils::GenerateLoadIdentifier(), false, 0)
->ChangeRemoteness(changeState,
nsContentUtils::GenerateLoadIdentifier())
->Then(
GetMainThreadSerialEventTarget(), __func__,
[flo, self = RefPtr{this}](