OLD | NEW |
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 Loading... |
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 |
OLD | NEW |