summaryrefslogtreecommitdiffstats
path: root/ppapi/proxy/ppb_broker_proxy.cc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-13 04:00:33 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-13 04:00:33 +0000
commit37fe036a2c3e907a5790561e11292904426db144 (patch)
tree4b4c928830476c7450ffd5c69ca9f222ddbcfded /ppapi/proxy/ppb_broker_proxy.cc
parentad432d686c8529838448f6639130f1290db9d5a5 (diff)
downloadchromium_src-37fe036a2c3e907a5790561e11292904426db144.zip
chromium_src-37fe036a2c3e907a5790561e11292904426db144.tar.gz
chromium_src-37fe036a2c3e907a5790561e11292904426db144.tar.bz2
Revert r100853, 100851. Win_shared build is broken.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100854 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy/ppb_broker_proxy.cc')
-rw-r--r--ppapi/proxy/ppb_broker_proxy.cc37
1 files changed, 25 insertions, 12 deletions
diff --git a/ppapi/proxy/ppb_broker_proxy.cc b/ppapi/proxy/ppb_broker_proxy.cc
index ff06759..68ba8c0 100644
--- a/ppapi/proxy/ppb_broker_proxy.cc
+++ b/ppapi/proxy/ppb_broker_proxy.cc
@@ -11,7 +11,6 @@
#include "ppapi/proxy/ppapi_messages.h"
#include "ppapi/thunk/ppb_broker_api.h"
#include "ppapi/thunk/enter.h"
-#include "ppapi/thunk/resource_creation_api.h"
#include "ppapi/thunk/thunk.h"
using ppapi::thunk::PPB_Broker_API;
@@ -41,6 +40,11 @@ int32_t PlatformFileToInt(base::PlatformFile handle) {
#endif
}
+InterfaceProxy* CreateBrokerProxy(Dispatcher* dispatcher,
+ const void* target_interface) {
+ return new PPB_Broker_Proxy(dispatcher, target_interface);
+}
+
} // namespace
class Broker : public PPB_Broker_API, public Resource {
@@ -143,8 +147,9 @@ void Broker::ConnectComplete(IPC::PlatformFileForTransit socket_handle,
PP_RunAndClearCompletionCallback(&current_connect_callback_, result);
}
-PPB_Broker_Proxy::PPB_Broker_Proxy(Dispatcher* dispatcher)
- : InterfaceProxy(dispatcher),
+PPB_Broker_Proxy::PPB_Broker_Proxy(Dispatcher* dispatcher,
+ const void* target_interface)
+ : InterfaceProxy(dispatcher, target_interface) ,
callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)){
}
@@ -152,6 +157,18 @@ PPB_Broker_Proxy::~PPB_Broker_Proxy() {
}
// static
+const InterfaceProxy::Info* PPB_Broker_Proxy::GetInfo() {
+ static const Info info = {
+ ppapi::thunk::GetPPB_Broker_Thunk(),
+ PPB_BROKER_TRUSTED_INTERFACE,
+ INTERFACE_ID_PPB_BROKER,
+ true,
+ &CreateBrokerProxy,
+ };
+ return &info;
+}
+
+// static
PP_Resource PPB_Broker_Proxy::CreateProxyResource(PP_Instance instance) {
PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance);
if (!dispatcher)
@@ -179,12 +196,9 @@ bool PPB_Broker_Proxy::OnMessageReceived(const IPC::Message& msg) {
void PPB_Broker_Proxy::OnMsgCreate(PP_Instance instance,
HostResource* result_resource) {
- thunk::EnterResourceCreation enter(instance);
- if (enter.succeeded()) {
- result_resource->SetHostResource(
- instance,
- enter.functions()->CreateBroker(instance));
- }
+ result_resource->SetHostResource(
+ instance,
+ ppb_broker_target()->CreateTrusted(instance));
}
void PPB_Broker_Proxy::OnMsgConnect(const HostResource& broker) {
@@ -226,9 +240,8 @@ void PPB_Broker_Proxy::ConnectCompleteInHost(int32_t result,
IPC::InvalidPlatformFileForTransit();
if (result == PP_OK) {
int32_t socket_handle = PlatformFileToInt(base::kInvalidPlatformFileValue);
- EnterHostFromHostResource<PPB_Broker_API> enter(broker);
- if (enter.succeeded())
- result = enter.object()->GetHandle(&socket_handle);
+ result = ppb_broker_target()->GetHandle(broker.host_resource(),
+ &socket_handle);
DCHECK(result == PP_OK ||
socket_handle == PlatformFileToInt(base::kInvalidPlatformFileValue));