Index: ppapi/proxy/ppb_graphics_3d_proxy.cc |
diff --git a/ppapi/proxy/ppb_graphics_3d_proxy.cc b/ppapi/proxy/ppb_graphics_3d_proxy.cc |
index 75f7d83a920b8f36c5e01b90c0f47b9195c3a4ab..48aa88234da62919bce7f1651a8db208ff5fba26 100644 |
--- a/ppapi/proxy/ppb_graphics_3d_proxy.cc |
+++ b/ppapi/proxy/ppb_graphics_3d_proxy.cc |
@@ -146,15 +146,15 @@ PPB_Graphics3D_Proxy::~PPB_Graphics3D_Proxy() { |
// static |
PP_Resource PPB_Graphics3D_Proxy::CreateProxyResource( |
PP_Instance instance, |
- PP_Resource share_context, |
+ PPB_Graphics3D_API* share_context, |
const int32_t* attrib_list) { |
PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance); |
if (!dispatcher) |
return PP_ERROR_BADARGUMENT; |
// TODO(alokp): Support shared context. |
- DCHECK_EQ(0, share_context); |
- if (share_context != 0) |
+ DCHECK(!share_context); |
+ if (share_context) |
return 0; |
std::vector<int32_t> attribs; |
@@ -170,7 +170,7 @@ PP_Resource PPB_Graphics3D_Proxy::CreateProxyResource( |
HostResource result; |
dispatcher->Send(new PpapiHostMsg_PPBGraphics3D_Create( |
- API_ID_PPB_GRAPHICS_3D, instance, attribs, &result)); |
+ API_ID_PPB_GRAPHICS_3D, instance, HostResource(), attribs, &result)); |
(scshunt)
2012/05/16 23:10:44
I'm going to leave this as-is for now. Adding supp
piman
2012/05/16 23:38:45
Why? It should really be as simple as static_cast<
(scshunt)
2012/05/17 16:55:45
Oh. Ok.
|
if (result.is_null()) |
return 0; |
@@ -214,16 +214,21 @@ bool PPB_Graphics3D_Proxy::OnMessageReceived(const IPC::Message& msg) { |
} |
void PPB_Graphics3D_Proxy::OnMsgCreate(PP_Instance instance, |
+ HostResource share_context, |
const std::vector<int32_t>& attribs, |
HostResource* result) { |
if (attribs.empty() || attribs.back() != PP_GRAPHICS3DATTRIB_NONE) |
return; // Bad message. |
thunk::EnterResourceCreation enter(instance); |
- if (enter.succeeded()) { |
+ thunk::EnterResource<thunk::PPB_Graphics3D_API> |
+ enter_share(share_context.host_resource(), true); |
+ if (enter.succeeded() && enter_share.succeeded()) { |
result->SetHostResource( |
- instance, |
- enter.functions()->CreateGraphics3DRaw(instance, 0, &attribs.front())); |
+ instance, |
+ enter.functions()->CreateGraphics3DRaw(instance, |
+ enter_share.object(), |
+ &attribs.front())); |
} |
} |