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

Side by Side Diff: webkit/plugins/ppapi/ppb_proxy_impl.cc

Issue 6628019: Ensure that PP_Instance values are unique within a plugin process in addition... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/plugins/ppapi/plugin_module.cc ('k') | webkit/plugins/ppapi/resource_tracker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "webkit/plugins/ppapi/ppb_proxy_impl.h" 5 #include "webkit/plugins/ppapi/ppb_proxy_impl.h"
6 6
7 #include "ppapi/c/private/ppb_proxy_private.h" 7 #include "ppapi/c/private/ppb_proxy_private.h"
8 #include "webkit/plugins/ppapi/plugin_module.h" 8 #include "webkit/plugins/ppapi/plugin_module.h"
9 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" 9 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
10 #include "webkit/plugins/ppapi/resource.h" 10 #include "webkit/plugins/ppapi/resource.h"
(...skipping 10 matching lines...) Expand all
21 plugin_module->PluginCrashed(); 21 plugin_module->PluginCrashed();
22 } 22 }
23 23
24 PP_Instance GetInstanceForResource(PP_Resource resource) { 24 PP_Instance GetInstanceForResource(PP_Resource resource) {
25 scoped_refptr<Resource> obj(ResourceTracker::Get()->GetResource(resource)); 25 scoped_refptr<Resource> obj(ResourceTracker::Get()->GetResource(resource));
26 if (!obj) 26 if (!obj)
27 return 0; 27 return 0;
28 return obj->instance()->pp_instance(); 28 return obj->instance()->pp_instance();
29 } 29 }
30 30
31 void SetReserveInstanceIDCallback(PP_Module module,
32 PP_Bool (*reserve)(PP_Module, PP_Instance)) {
33 PluginModule* plugin_module = ResourceTracker::Get()->GetModule(module);
34 if (plugin_module)
35 plugin_module->SetReserveInstanceIDCallback(reserve);
36 }
37
31 const PPB_Proxy_Private ppb_proxy = { 38 const PPB_Proxy_Private ppb_proxy = {
32 &PluginCrashed, 39 &PluginCrashed,
33 &GetInstanceForResource 40 &GetInstanceForResource,
41 &SetReserveInstanceIDCallback
34 }; 42 };
35 43
36 } // namespace 44 } // namespace
37 45
38 // static 46 // static
39 const PPB_Proxy_Private* PPB_Proxy_Impl::GetInterface() { 47 const PPB_Proxy_Private* PPB_Proxy_Impl::GetInterface() {
40 return &ppb_proxy; 48 return &ppb_proxy;
41 } 49 }
42 50
43 } // namespace ppapi 51 } // namespace ppapi
44 } // namespace webkit 52 } // namespace webkit
OLDNEW
« no previous file with comments | « webkit/plugins/ppapi/plugin_module.cc ('k') | webkit/plugins/ppapi/resource_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698