зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
fa0bdf0264
Коммит
43bd779652
|
@ -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 =
|
||||
|
|
Загрузка…
Ссылка в новой задаче