OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_RESOURCE_H_ | 5 #ifndef NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_RESOURCE_H_ |
6 #define NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_RESOURCE_H_ | 6 #define NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_RESOURCE_H_ |
7 | 7 |
8 #include "native_client/src/include/nacl_base.h" | 8 #include "native_client/src/include/nacl_base.h" |
9 #include "native_client/src/include/ref_counted.h" | 9 #include "native_client/src/include/ref_counted.h" |
10 #include "native_client/src/shared/ppapi_proxy/plugin_resource_tracker.h" | 10 #include "native_client/src/shared/ppapi_proxy/plugin_resource_tracker.h" |
11 #include "ppapi/c/pp_resource.h" | 11 #include "ppapi/c/pp_resource.h" |
12 | 12 |
13 namespace ppapi_proxy { | 13 namespace ppapi_proxy { |
14 | 14 |
15 // If you inherit from resource, make sure you add the class name here. | 15 // If you inherit from resource, make sure you add the class name here. |
16 #define FOR_ALL_RESOURCES(F) \ | 16 #define FOR_ALL_RESOURCES(F) \ |
17 F(PluginAudio) \ | 17 F(PluginAudio) \ |
18 F(PluginAudioConfig) \ | 18 F(PluginAudioConfig) \ |
19 F(PluginBuffer) \ | 19 F(PluginBuffer) \ |
20 F(PluginFont) \ | 20 F(PluginFont) \ |
21 F(PluginGraphics2D) \ | 21 F(PluginGraphics2D) \ |
22 F(PluginGraphics3D) \ | 22 F(PluginGraphics3D) \ |
23 F(PluginImageData) \ | 23 F(PluginImageData) \ |
24 F(PluginInputEvent) \ | 24 F(PluginInputEvent) \ |
| 25 F(PluginNetworkMonitorPrivate) \ |
25 F(PluginView) | 26 F(PluginView) |
26 | 27 |
27 // Forward declaration of PluginResource classes. | 28 // Forward declaration of PluginResource classes. |
28 #define DECLARE_RESOURCE_CLASS(RESOURCE) class RESOURCE; | 29 #define DECLARE_RESOURCE_CLASS(RESOURCE) class RESOURCE; |
29 FOR_ALL_RESOURCES(DECLARE_RESOURCE_CLASS) | 30 FOR_ALL_RESOURCES(DECLARE_RESOURCE_CLASS) |
30 #undef DECLARE_RESOURCE_CLASS | 31 #undef DECLARE_RESOURCE_CLASS |
31 | 32 |
32 class PluginResource : public nacl::RefCountedThreadSafe<PluginResource> { | 33 class PluginResource : public nacl::RefCountedThreadSafe<PluginResource> { |
33 public: | 34 public: |
34 PluginResource(); | 35 PluginResource(); |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 // Adopt the resource with 0 browser-side refcount. | 145 // Adopt the resource with 0 browser-side refcount. |
145 const size_t browser_refcount = 0; | 146 const size_t browser_refcount = 0; |
146 return PluginResourceTracker::Get()->AdoptBrowserResource<T>( | 147 return PluginResourceTracker::Get()->AdoptBrowserResource<T>( |
147 res, browser_refcount); | 148 res, browser_refcount); |
148 } | 149 } |
149 | 150 |
150 } // namespace ppapi_proxy | 151 } // namespace ppapi_proxy |
151 | 152 |
152 #endif // NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_RESOURCE_H_ | 153 #endif // NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_RESOURCE_H_ |
153 | 154 |
OLD | NEW |