summaryrefslogtreecommitdiffstats
path: root/ppapi/proxy/ppb_buffer_proxy.cc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-08 16:31:46 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-08 16:31:46 +0000
commit465faa29046328890a224677db522f1aece8cad0 (patch)
tree5cf23803cc13d27c71c05c4532a5fc434e6d7e4d /ppapi/proxy/ppb_buffer_proxy.cc
parenta313e51c562c3d3400d2bd14231f23e9ca699857 (diff)
downloadchromium_src-465faa29046328890a224677db522f1aece8cad0.zip
chromium_src-465faa29046328890a224677db522f1aece8cad0.tar.gz
chromium_src-465faa29046328890a224677db522f1aece8cad0.tar.bz2
Rent syncemove all uses of the global Dispatcher Get function.
This reqired reworking how plugin->host GetInterface works. Previously, interface requests were symmetric where each side would first do a SupportsInterface to see if the remote side supports the interface, then create the proxy. Since the plugin may talk to multiple renderers, we don't know where to send these requests. The solution is to make the assumption that the renderer always supports all PPB interfaces (which is possible since the proxy is compiled with the executable). This also adds some better lookup for interfaces to avoid having multiple lists of interfaces. We now have a list of interfaces and factory functions in dispatcher.cc. Add some additional testing infrastructure for the dispatchers with simple tests. Review URL: http://codereview.chromium.org/6286070 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74121 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy/ppb_buffer_proxy.cc')
-rw-r--r--ppapi/proxy/ppb_buffer_proxy.cc25
1 files changed, 17 insertions, 8 deletions
diff --git a/ppapi/proxy/ppb_buffer_proxy.cc b/ppapi/proxy/ppb_buffer_proxy.cc
index 5125855..a74bf18 100644
--- a/ppapi/proxy/ppb_buffer_proxy.cc
+++ b/ppapi/proxy/ppb_buffer_proxy.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -109,7 +109,7 @@ void Unmap(PP_Resource resource) {
object->Unmap();
}
-const PPB_Buffer_Dev ppb_buffer = {
+const PPB_Buffer_Dev buffer_interface = {
&Create,
&IsBuffer,
&Describe,
@@ -117,6 +117,11 @@ const PPB_Buffer_Dev ppb_buffer = {
&Unmap,
};
+InterfaceProxy* CreateBufferProxy(Dispatcher* dispatcher,
+ const void* target_interface) {
+ return new PPB_Buffer_Proxy(dispatcher, target_interface);
+}
+
} // namespace
PPB_Buffer_Proxy::PPB_Buffer_Proxy(Dispatcher* dispatcher,
@@ -127,12 +132,16 @@ PPB_Buffer_Proxy::PPB_Buffer_Proxy(Dispatcher* dispatcher,
PPB_Buffer_Proxy::~PPB_Buffer_Proxy() {
}
-const void* PPB_Buffer_Proxy::GetSourceInterface() const {
- return &ppb_buffer;
-}
-
-InterfaceID PPB_Buffer_Proxy::GetInterfaceId() const {
- return INTERFACE_ID_PPB_BUFFER;
+// static
+const InterfaceProxy::Info* PPB_Buffer_Proxy::GetInfo() {
+ static const Info info = {
+ &buffer_interface,
+ PPB_BUFFER_DEV_INTERFACE,
+ INTERFACE_ID_PPB_BUFFER,
+ false,
+ &CreateBufferProxy,
+ };
+ return &info;
}
bool PPB_Buffer_Proxy::OnMessageReceived(const IPC::Message& msg) {