Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1475)

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 2947413002: Restrict CM API interface request and message dispatch. (Closed)
Patch Set: Addressed comments, and used an associated interface. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 52ddbab340bdc1211418e09c4e8ef738543b3935..269e54380f46e9ac98a896ae9751f67fa75ef46a 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4371,8 +4371,16 @@ void WebContentsImpl::OnAssociatedInterfaceRequest(
const std::string& interface_name,
mojo::ScopedInterfaceEndpointHandle handle) {
auto it = binding_sets_.find(interface_name);
- if (it != binding_sets_.end())
+ if (it != binding_sets_.end()) {
it->second->OnRequestForFrame(render_frame_host, std::move(handle));
+ return;
+ }
+
+ service_manager::BindSourceInfo source_info(
+ render_frame_host->GetProcess()->GetChildIdentity(),
+ service_manager::CapabilitySet());
+ GetContentClient()->browser()->BindAssociatedInterfaceRequestFromFrame(
+ render_frame_host, source_info, interface_name, std::move(handle));
}
const GURL& WebContentsImpl::GetMainFrameLastCommittedURL() const {

Powered by Google App Engine
This is Rietveld 408576698