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 "content/renderer/pepper/pepper_plugin_registry.h" | 5 #include "content/renderer/pepper/pepper_plugin_registry.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "content/common/pepper_plugin_list.h" | 10 #include "content/common/pepper_plugin_list.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 if (info.path == plugin_list_[i].path) | 32 if (info.path == plugin_list_[i].path) |
33 return &plugin_list_[i]; | 33 return &plugin_list_[i]; |
34 } | 34 } |
35 // We did not find the plugin in our list. But wait! the plugin can also | 35 // We did not find the plugin in our list. But wait! the plugin can also |
36 // be a latecomer, as it happens with pepper flash. This information | 36 // be a latecomer, as it happens with pepper flash. This information |
37 // is actually in |info| and we can use it to construct it and add it to | 37 // is actually in |info| and we can use it to construct it and add it to |
38 // the list. This same deal needs to be done in the browser side in | 38 // the list. This same deal needs to be done in the browser side in |
39 // PluginService. | 39 // PluginService. |
40 PepperPluginInfo plugin; | 40 PepperPluginInfo plugin; |
41 if (!MakePepperPluginInfo(info, &plugin)) | 41 if (!MakePepperPluginInfo(info, &plugin)) |
42 return NULL; | 42 return nullptr; |
43 | 43 |
44 plugin_list_.push_back(plugin); | 44 plugin_list_.push_back(plugin); |
45 return &plugin_list_[plugin_list_.size() - 1]; | 45 return &plugin_list_.back(); |
46 } | 46 } |
47 | 47 |
48 PluginModule* PepperPluginRegistry::GetLiveModule(const base::FilePath& path) { | 48 PluginModule* PepperPluginRegistry::GetLiveModule(const base::FilePath& path) { |
49 NonOwningModuleMap::iterator module_iter = live_modules_.find(path); | 49 NonOwningModuleMap::iterator module_iter = live_modules_.find(path); |
50 if (module_iter == live_modules_.end()) | 50 if (module_iter == live_modules_.end()) |
51 return NULL; | 51 return NULL; |
52 | 52 |
53 // Check the instances for the module to see if they've all been Delete()d. | 53 // Check the instances for the module to see if they've all been Delete()d. |
54 // We don't want to return a PluginModule in that case, since the plugin may | 54 // We don't want to return a PluginModule in that case, since the plugin may |
55 // have exited already. | 55 // have exited already. |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 if (!module->InitAsLibrary(current.path)) { | 133 if (!module->InitAsLibrary(current.path)) { |
134 DVLOG(1) << "Failed to load pepper module: " << current.path.value(); | 134 DVLOG(1) << "Failed to load pepper module: " << current.path.value(); |
135 continue; | 135 continue; |
136 } | 136 } |
137 } | 137 } |
138 preloaded_modules_[current.path] = module; | 138 preloaded_modules_[current.path] = module; |
139 } | 139 } |
140 } | 140 } |
141 | 141 |
142 } // namespace content | 142 } // namespace content |
OLD | NEW |