OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef PPAPI_PROXY_PLUGIN_RESOURCE_H_ | |
6 #define PPAPI_PROXY_PLUGIN_RESOURCE_H_ | |
7 | |
8 #include "base/basictypes.h" | |
9 #include "ppapi/c/pp_instance.h" | |
10 #include "ppapi/proxy/plugin_dispatcher.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" | |
14 | |
15 namespace pp { | |
16 namespace proxy { | |
17 | |
18 class PluginResource : public ::ppapi::ResourceObjectBase { | |
19 public: | |
20 PluginResource(const ppapi::HostResource& resource); | |
21 virtual ~PluginResource(); | |
22 | |
23 PP_Instance instance() const { return host_resource_.instance(); } | |
24 | |
25 // Returns the host resource ID for sending to the host process. | |
26 const ppapi::HostResource& host_resource() const { | |
27 return host_resource_; | |
28 } | |
29 | |
30 PluginDispatcher* GetDispatcher(); | |
31 | |
32 private: | |
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 | |
35 // each independently generating resources (which may conflict) but the IDs | |
36 // in the plugin will all be unique. | |
37 ppapi::HostResource host_resource_; | |
38 | |
39 DISALLOW_COPY_AND_ASSIGN(PluginResource); | |
40 }; | |
41 | |
42 } // namespace proxy | |
43 } // namespace pp | |
44 | |
45 #endif // PPAPI_PROXY_PLUGIN_RESOURCE_H_ | |
OLD | NEW |