Adds associated interface support between RenderFrameHost and RenderFrame.
Introduces a new content::AssociatedInterfaceRegistry and
content::AssociatedInterfaceProvider to serve as Channel-associated
interface counterparts to their shell namesakes.
RenderFrameHost and RenderFrame each have both of these things on them,
and they're routed to the other side using a new RouteProvider interface
buried in RenderProcessHostImpl / ChildThreadImpl on either end.
Also adds a WebContentsInterfaceRegistry to every WebContents,
and a helper WebContentsFrameBindingSet<T> to allow consumers to
very easily manage the lifetime of associated interface bindings
for each frame in a WebContents.
See the follow-up patch for example usage.
Part a series of CLs to enable and demonstrate WebContents associated
interfaces:
1. https://codereview.chromium.org/2309513002
2. https://codereview.chromium.org/2316963005
3. This CL
4. https://codereview.chromium.org/2310583002
BUG=612500
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation
Review-Url: https://codereview.chromium.org/2310563002
Cr-Commit-Position: refs/heads/master@{#418717}
diff --git a/content/common/associated_interface_provider_impl.cc b/content/common/associated_interface_provider_impl.cc
new file mode 100644
index 0000000..c42ff3f1
--- /dev/null
+++ b/content/common/associated_interface_provider_impl.cc
@@ -0,0 +1,28 @@
+// 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/common/associated_interface_provider_impl.h"
+
+namespace content {
+
+AssociatedInterfaceProviderImpl::AssociatedInterfaceProviderImpl(
+ mojom::AssociatedInterfaceProviderAssociatedPtr proxy)
+ : proxy_(std::move(proxy)) {
+}
+
+AssociatedInterfaceProviderImpl::~AssociatedInterfaceProviderImpl() {}
+
+void AssociatedInterfaceProviderImpl::GetInterface(
+ const std::string& name,
+ mojo::ScopedInterfaceEndpointHandle handle) {
+ mojom::AssociatedInterfaceAssociatedRequest request;
+ request.Bind(std::move(handle));
+ return proxy_->GetAssociatedInterface(name, std::move(request));
+}
+
+mojo::AssociatedGroup* AssociatedInterfaceProviderImpl::GetAssociatedGroup() {
+ return proxy_.associated_group();
+}
+
+} // namespace content