| 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/ppb_url_loader_impl.h" | 10 #include "webkit/plugins/ppapi/ppb_url_loader_impl.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 } | 37 } |
| 38 | 38 |
| 39 int32_t GetURLLoaderBufferedBytes(PP_Resource url_loader) { | 39 int32_t GetURLLoaderBufferedBytes(PP_Resource url_loader) { |
| 40 scoped_refptr<PPB_URLLoader_Impl> loader( | 40 scoped_refptr<PPB_URLLoader_Impl> loader( |
| 41 Resource::GetAs<PPB_URLLoader_Impl>(url_loader)); | 41 Resource::GetAs<PPB_URLLoader_Impl>(url_loader)); |
| 42 if (!loader) | 42 if (!loader) |
| 43 return 0; | 43 return 0; |
| 44 return loader->buffer_size(); | 44 return loader->buffer_size(); |
| 45 } | 45 } |
| 46 | 46 |
| 47 void AddRefModule(PP_Module module) { |
| 48 PluginModule* plugin_module = ResourceTracker::Get()->GetModule(module); |
| 49 if (plugin_module) |
| 50 plugin_module->AddRef(); |
| 51 } |
| 52 |
| 53 void ReleaseModule(PP_Module module) { |
| 54 PluginModule* plugin_module = ResourceTracker::Get()->GetModule(module); |
| 55 if (plugin_module) |
| 56 plugin_module->Release(); |
| 57 } |
| 58 |
| 47 const PPB_Proxy_Private ppb_proxy = { | 59 const PPB_Proxy_Private ppb_proxy = { |
| 48 &PluginCrashed, | 60 &PluginCrashed, |
| 49 &GetInstanceForResource, | 61 &GetInstanceForResource, |
| 50 &SetReserveInstanceIDCallback, | 62 &SetReserveInstanceIDCallback, |
| 51 &GetURLLoaderBufferedBytes | 63 &GetURLLoaderBufferedBytes, |
| 64 &AddRefModule, |
| 65 &ReleaseModule |
| 52 }; | 66 }; |
| 53 | 67 |
| 54 } // namespace | 68 } // namespace |
| 55 | 69 |
| 56 // static | 70 // static |
| 57 const PPB_Proxy_Private* PPB_Proxy_Impl::GetInterface() { | 71 const PPB_Proxy_Private* PPB_Proxy_Impl::GetInterface() { |
| 58 return &ppb_proxy; | 72 return &ppb_proxy; |
| 59 } | 73 } |
| 60 | 74 |
| 61 } // namespace ppapi | 75 } // namespace ppapi |
| 62 } // namespace webkit | 76 } // namespace webkit |
| OLD | NEW |