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 #include "ppapi/proxy/plugin_resource_tracker.h" | 5 #include "ppapi/proxy/plugin_resource_tracker.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
9 #include "ppapi/proxy/plugin_dispatcher.h" | 9 #include "ppapi/proxy/plugin_dispatcher.h" |
10 #include "ppapi/proxy/plugin_globals.h" | 10 #include "ppapi/proxy/plugin_globals.h" |
11 #include "ppapi/proxy/ppapi_messages.h" | 11 #include "ppapi/proxy/ppapi_messages.h" |
12 #include "ppapi/proxy/serialized_var.h" | 12 #include "ppapi/proxy/serialized_var.h" |
13 #include "ppapi/shared_impl/proxy_lock.h" | 13 #include "ppapi/shared_impl/proxy_lock.h" |
14 #include "ppapi/shared_impl/resource.h" | 14 #include "ppapi/shared_impl/resource.h" |
15 #include "ppapi/shared_impl/var.h" | 15 #include "ppapi/shared_impl/var.h" |
16 | 16 |
17 namespace ppapi { | 17 namespace ppapi { |
18 namespace proxy { | 18 namespace proxy { |
19 | 19 |
20 PluginResourceTracker::PluginResourceTracker() : ResourceTracker(THREAD_SAFE) { | 20 PluginResourceTracker::PluginResourceTracker() { |
21 } | 21 } |
22 | 22 |
23 PluginResourceTracker::~PluginResourceTracker() { | 23 PluginResourceTracker::~PluginResourceTracker() { |
24 } | 24 } |
25 | 25 |
26 PP_Resource PluginResourceTracker::PluginResourceForHostResource( | 26 PP_Resource PluginResourceTracker::PluginResourceForHostResource( |
27 const HostResource& resource) const { | 27 const HostResource& resource) const { |
28 HostResourceMap::const_iterator found = host_resource_map_.find(resource); | 28 HostResourceMap::const_iterator found = host_resource_map_.find(resource); |
29 if (found == host_resource_map_.end()) | 29 if (found == host_resource_map_.end()) |
30 return 0; | 30 return 0; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 // the instance was destroyed. In that case the browser-side resource has | 62 // the instance was destroyed. In that case the browser-side resource has |
63 // already been freed correctly on the browser side. | 63 // already been freed correctly on the browser side. |
64 dispatcher->Send(new PpapiHostMsg_PPBCore_ReleaseResource( | 64 dispatcher->Send(new PpapiHostMsg_PPBCore_ReleaseResource( |
65 API_ID_PPB_CORE, object->host_resource())); | 65 API_ID_PPB_CORE, object->host_resource())); |
66 } | 66 } |
67 } | 67 } |
68 } | 68 } |
69 | 69 |
70 } // namespace proxy | 70 } // namespace proxy |
71 } // namespace ppapi | 71 } // namespace ppapi |
OLD | NEW |