OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/glue/plugins/pepper_resource_tracker.h" | 5 #include "webkit/glue/plugins/pepper_resource_tracker.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/rand_util.h" | 11 #include "base/rand_util.h" |
12 #include "third_party/ppapi/c/pp_resource.h" | 12 #include "ppapi/c/pp_resource.h" |
13 #include "webkit/glue/plugins/pepper_resource.h" | 13 #include "webkit/glue/plugins/pepper_resource.h" |
14 | 14 |
15 namespace pepper { | 15 namespace pepper { |
16 | 16 |
17 scoped_refptr<Resource> ResourceTracker::GetResource(PP_Resource res) const { | 17 scoped_refptr<Resource> ResourceTracker::GetResource(PP_Resource res) const { |
18 ResourceMap::const_iterator result = live_resources_.find(res); | 18 ResourceMap::const_iterator result = live_resources_.find(res); |
19 if (result == live_resources_.end()) { | 19 if (result == live_resources_.end()) { |
20 return scoped_refptr<Resource>(); | 20 return scoped_refptr<Resource>(); |
21 } | 21 } |
22 return result->second.first; | 22 return result->second.first; |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 } | 148 } |
149 | 149 |
150 PluginModule* ResourceTracker::GetModule(PP_Module module) { | 150 PluginModule* ResourceTracker::GetModule(PP_Module module) { |
151 ModuleMap::iterator found = module_map_.find(module); | 151 ModuleMap::iterator found = module_map_.find(module); |
152 if (found == module_map_.end()) | 152 if (found == module_map_.end()) |
153 return NULL; | 153 return NULL; |
154 return found->second; | 154 return found->second; |
155 } | 155 } |
156 | 156 |
157 } // namespace pepper | 157 } // namespace pepper |
OLD | NEW |