Use frame-specific WebContentsObserver::OnMessageReceived.
The 3 IPC messages touched by this CL are
1) already being sent with a routing id coming from
RenderFrameObserver::routing_id.
2) already handled by a frame-specific
WebContentsObserver::OnMessageReceived implemented by
PluginObserver or PdfPluginPlaceholder
Therefore, it seems that the handlers of these IPCs in
ChromeWebViewPermissionHelperDelegate are incorrect
to listen for this IPCs on the view-related, not frame-specific
OnMessageReceived overload.
This CL moves handling of these IPCs to be consistently done through
frame-specific OnMessageReceived and removes the no-longer-needed
overload where possible (e.g. in WebViewPermissionHelper).
Bug: 758026
Change-Id: I62c42ee54f4ed12d3076a27ab8093cb1c30fd665
Reviewed-on: https://chromium-review.googlesource.com/627341
Reviewed-by: Lucas Gadani <[email protected]>
Reviewed-by: Nick Carter <[email protected]>
Commit-Queue: Ćukasz Anforowicz <[email protected]>
Cr-Commit-Position: refs/heads/master@{#498618}
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index ace18c5..5b54c76 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -779,8 +779,9 @@
}
for (auto& observer : observers_) {
- // TODO(nick, creis): Replace all uses of this variant of OnMessageReceived
- // with the version that takes a RenderFrameHost, and delete it.
+ // TODO(nick, creis): https://crbug.com/758026: Replace all uses of this
+ // variant of OnMessageReceived with the version that takes a
+ // RenderFrameHost, and then delete it.
if (observer.OnMessageReceived(message))
return true;
}