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

Unified Diff: content/public/browser/web_contents_binding_set.cc

Issue 2310563002: Adds routed interface support between RenderFrameHost and RenderFrame (Closed)
Patch Set: nit Created 4 years, 3 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
« no previous file with comments | « content/public/browser/web_contents_binding_set.h ('k') | content/public/common/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/browser/web_contents_binding_set.cc
diff --git a/content/public/browser/web_contents_binding_set.cc b/content/public/browser/web_contents_binding_set.cc
new file mode 100644
index 0000000000000000000000000000000000000000..bf46ed6308d6988eda4d93af7529a58c30190cf9
--- /dev/null
+++ b/content/public/browser/web_contents_binding_set.cc
@@ -0,0 +1,43 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/public/browser/web_contents_binding_set.h"
+
+#include <utility>
+
+#include "base/logging.h"
+#include "content/browser/web_contents/web_contents_impl.h"
+
+namespace content {
+
+void WebContentsBindingSet::Binder::OnRequestForFrame(
+ RenderFrameHost* render_frame_host,
+ mojo::ScopedInterfaceEndpointHandle handle) {
+ NOTREACHED();
+}
+
+WebContentsBindingSet::WebContentsBindingSet(WebContents* web_contents,
+ const std::string& interface_name,
+ std::unique_ptr<Binder> binder)
+ : remove_callback_(
+ static_cast<WebContentsImpl*>(web_contents)->AddBindingSet(
+ interface_name, this)),
+ binder_(std::move(binder)) {}
+
+WebContentsBindingSet::~WebContentsBindingSet() {
+ remove_callback_.Run();
+}
+
+void WebContentsBindingSet::CloseAllBindings() {
+ binder_.reset();
+}
+
+void WebContentsBindingSet::OnRequestForFrame(
+ RenderFrameHost* render_frame_host,
+ mojo::ScopedInterfaceEndpointHandle handle) {
+ DCHECK(binder_);
+ binder_->OnRequestForFrame(render_frame_host, std::move(handle));
+}
+
+} // namespace content
« no previous file with comments | « content/public/browser/web_contents_binding_set.h ('k') | content/public/common/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698