Bug 1510569 - Port Content:LoadURIResult message to IPDL r=mconley

The `WebProgress#sendLoadCallResult` method only existed to send a empty async
message and was only called from the `WebNavigationChild`. Since
`WebNavigationChild` is in the process of being removed, it makes sense to
inline the replaced method into its call site.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Barret Rennie 2019-06-13 21:00:34 +00:00
Родитель fa0bdf0264
Коммит 43bd779652
9 изменённых файлов: 29 добавлений и 16 удалений

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

@ -431,7 +431,6 @@ MessageManagerTunnel.prototype = {
"Link:AddSearch",
"PageStyle:StyleSheets",
// Messages sent to RemoteWebProgress.jsm
"Content:LoadURIResult",
"Content:SecurityChange",
// Messages sent to browser.js
"DOMTitleChanged",

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

@ -49,4 +49,10 @@ interface nsIBrowserChild : nsISupports
* loaded.
*/
void beginSendingWebProgressEventsToParent();
/**
* Send a message from the BrowserChild to the BrowserParent that a
* nsIWebNavigation navigation finished in the child.
*/
void notifyNavigationFinished();
};

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

@ -3736,6 +3736,11 @@ NS_IMETHODIMP BrowserChild::OnRefreshAttempted(nsIWebProgress* aWebProgress,
return NS_OK;
}
NS_IMETHODIMP BrowserChild::NotifyNavigationFinished() {
Unused << SendNavigationFinished();
return NS_OK;
}
nsresult BrowserChild::PrepareProgressListenerData(
nsIWebProgress* aWebProgress, nsIRequest* aRequest,
Maybe<WebProgressData>& aWebProgressData, RequestData& aRequestData) {

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

@ -2552,6 +2552,17 @@ mozilla::ipc::IPCResult BrowserParent::RecvOnContentBlockingEvent(
return IPC_OK();
}
mozilla::ipc::IPCResult BrowserParent::RecvNavigationFinished() {
nsCOMPtr<nsIBrowser> browser =
mFrameElement ? mFrameElement->AsBrowser() : nullptr;
if (browser) {
browser->SetIsNavigating(false);
}
return IPC_OK();
}
bool BrowserParent::GetWebProgressListener(
nsIBrowser** aOutBrowser, nsIWebProgress** aOutManager,
nsIWebProgressListener** aOutListener) {

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

@ -308,6 +308,8 @@ class BrowserParent final : public PBrowserParent,
const Maybe<WebProgressData>& aWebProgressData,
const RequestData& aRequestData, const uint32_t& aEvent);
mozilla::ipc::IPCResult RecvNavigationFinished();
bool GetWebProgressListener(nsIBrowser** aOutBrowser,
nsIWebProgress** aOutManager,
nsIWebProgressListener** aOutListener);

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

@ -601,6 +601,8 @@ parent:
async OnContentBlockingEvent(WebProgressData? aWebProgressData,
RequestData aRequestData, uint32_t aEvent);
async NavigationFinished();
async SessionStoreUpdate(nsCString? aDocShellCaps,
bool? aPrivatedMode,
nsCString[] aPositions,

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

@ -54,7 +54,9 @@ class WebNavigationChild extends ActorChild {
try {
fn();
} finally {
this.mm.WebProgress.sendLoadCallResult();
this.mm.docShell.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIBrowserChild)
.notifyNavigationFinished();
}
}

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

@ -25,13 +25,11 @@ class RemoteWebProgressManager {
swapBrowser(aBrowser) {
if (this._messageManager) {
this._messageManager.removeMessageListener("Content:SecurityChange", this);
this._messageManager.removeMessageListener("Content:LoadURIResult", this);
}
this._browser = aBrowser;
this._messageManager = aBrowser.messageManager;
this._messageManager.addMessageListener("Content:SecurityChange", this);
this._messageManager.addMessageListener("Content:LoadURIResult", this);
}
swapListeners(aOtherRemoteWebProgressManager) {
@ -146,14 +144,6 @@ class RemoteWebProgressManager {
receiveMessage(aMessage) {
let json = aMessage.json;
// This message is a custom one we send as a result of a loadURI call.
// It shouldn't go through the same processing as all the forwarded
// webprogresslistener messages.
if (aMessage.name == "Content:LoadURIResult") {
this._browser.isNavigating = false;
return;
}
let webProgress = null;
let isTopLevel = json.webProgress && json.webProgress.isTopLevel;
// The top-level WebProgress is always the same, but because we don't

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

@ -89,10 +89,6 @@ class WebProgressChild {
this._send("Content:SecurityChange", json);
}
sendLoadCallResult() {
this.mm.sendAsyncMessage("Content:LoadURIResult");
}
}
WebProgressChild.prototype.QueryInterface =