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 #ifndef PPAPI_PROXY_PLUGIN_RESOURCE_H_ | 5 #ifndef PPAPI_PROXY_PLUGIN_RESOURCE_H_ |
6 #define PPAPI_PROXY_PLUGIN_RESOURCE_H_ | 6 #define PPAPI_PROXY_PLUGIN_RESOURCE_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "ppapi/c/pp_instance.h" | 9 #include "ppapi/c/pp_instance.h" |
10 #include "ppapi/proxy/host_resource.h" | |
11 #include "ppapi/proxy/plugin_dispatcher.h" | 10 #include "ppapi/proxy/plugin_dispatcher.h" |
12 #include "ppapi/proxy/plugin_resource_tracker.h" | 11 #include "ppapi/proxy/plugin_resource_tracker.h" |
| 12 #include "ppapi/shared_impl/host_resource.h" |
13 #include "ppapi/shared_impl/resource_object_base.h" | 13 #include "ppapi/shared_impl/resource_object_base.h" |
14 | 14 |
15 namespace pp { | 15 namespace pp { |
16 namespace proxy { | 16 namespace proxy { |
17 | 17 |
18 class PluginResource : public ::ppapi::ResourceObjectBase { | 18 class PluginResource : public ::ppapi::ResourceObjectBase { |
19 public: | 19 public: |
20 PluginResource(const HostResource& resource); | 20 PluginResource(const ppapi::HostResource& resource); |
21 virtual ~PluginResource(); | 21 virtual ~PluginResource(); |
22 | 22 |
23 PP_Instance instance() const { return host_resource_.instance(); } | 23 PP_Instance instance() const { return host_resource_.instance(); } |
24 | 24 |
25 // Returns the host resource ID for sending to the host process. | 25 // Returns the host resource ID for sending to the host process. |
26 const HostResource& host_resource() const { | 26 const ppapi::HostResource& host_resource() const { |
27 return host_resource_; | 27 return host_resource_; |
28 } | 28 } |
29 | 29 |
30 PluginDispatcher* GetDispatcher(); | 30 PluginDispatcher* GetDispatcher(); |
31 | 31 |
32 private: | 32 private: |
33 // The resource ID in the host that this object corresponds to. Inside the | 33 // The resource ID in the host that this object corresponds to. Inside the |
34 // plugin we'll remap the resource IDs so we can have many host processes | 34 // plugin we'll remap the resource IDs so we can have many host processes |
35 // each independently generating resources (which may conflict) but the IDs | 35 // each independently generating resources (which may conflict) but the IDs |
36 // in the plugin will all be unique. | 36 // in the plugin will all be unique. |
37 HostResource host_resource_; | 37 ppapi::HostResource host_resource_; |
38 | 38 |
39 DISALLOW_COPY_AND_ASSIGN(PluginResource); | 39 DISALLOW_COPY_AND_ASSIGN(PluginResource); |
40 }; | 40 }; |
41 | 41 |
42 } // namespace proxy | 42 } // namespace proxy |
43 } // namespace pp | 43 } // namespace pp |
44 | 44 |
45 #endif // PPAPI_PROXY_PLUGIN_RESOURCE_H_ | 45 #endif // PPAPI_PROXY_PLUGIN_RESOURCE_H_ |
OLD | NEW |