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

Unified Diff: ppapi/proxy/ppb_instance_proxy.cc

Issue 6334016: Refactor PPAPI proxy resource handling to maintain which host they came from,... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 | « ppapi/proxy/ppb_instance_proxy.h ('k') | ppapi/proxy/ppb_pdf_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_instance_proxy.cc
===================================================================
--- ppapi/proxy/ppb_instance_proxy.cc (revision 72840)
+++ ppapi/proxy/ppb_instance_proxy.cc (working copy)
@@ -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.
@@ -7,6 +7,8 @@
#include "ppapi/c/pp_var.h"
#include "ppapi/c/ppb_instance.h"
#include "ppapi/proxy/plugin_dispatcher.h"
+#include "ppapi/proxy/plugin_resource.h"
+#include "ppapi/proxy/plugin_resource_tracker.h"
#include "ppapi/proxy/ppapi_messages.h"
#include "ppapi/proxy/serialized_var.h"
@@ -42,9 +44,15 @@
if (!dispatcher)
return PP_FALSE;
+ PluginResource* object =
+ PluginResourceTracker::GetInstance()->GetResourceObject(device);
+ if (!object || object->instance() != instance)
+ return PP_FALSE;
+
PP_Bool result = PP_FALSE;
dispatcher->Send(new PpapiHostMsg_PPBInstance_BindGraphics(
- INTERFACE_ID_PPB_INSTANCE, instance, device, &result));
+ INTERFACE_ID_PPB_INSTANCE, instance, object->host_resource(),
+ &result));
return result;
}
@@ -134,9 +142,10 @@
}
void PPB_Instance_Proxy::OnMsgBindGraphics(PP_Instance instance,
- PP_Resource device,
+ HostResource device,
PP_Bool* result) {
- *result = ppb_instance_target()->BindGraphics(instance, device);
+ *result = ppb_instance_target()->BindGraphics(instance,
+ device.host_resource());
}
void PPB_Instance_Proxy::OnMsgIsFullFrame(PP_Instance instance,
« no previous file with comments | « ppapi/proxy/ppb_instance_proxy.h ('k') | ppapi/proxy/ppb_pdf_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698