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 "base/logging.h" | 7 #include "base/logging.h" |
8 #include "content/common/pepper_plugin_list.h" | 8 #include "content/common/pepper_plugin_list.h" |
9 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | 9 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
10 #include "content/renderer/pepper/plugin_module.h" | 10 #include "content/renderer/pepper/plugin_module.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 // initialization. If we bail out (in the continue clauses) before saving | 110 // initialization. If we bail out (in the continue clauses) before saving |
111 // the initialized module, it will still try to unregister itself in its | 111 // the initialized module, it will still try to unregister itself in its |
112 // destructor. | 112 // destructor. |
113 for (size_t i = 0; i < plugin_list_.size(); i++) { | 113 for (size_t i = 0; i < plugin_list_.size(); i++) { |
114 const PepperPluginInfo& current = plugin_list_[i]; | 114 const PepperPluginInfo& current = plugin_list_[i]; |
115 if (current.is_out_of_process) | 115 if (current.is_out_of_process) |
116 continue; // Out of process plugins need no special pre-initialization. | 116 continue; // Out of process plugins need no special pre-initialization. |
117 | 117 |
118 scoped_refptr<PluginModule> module = | 118 scoped_refptr<PluginModule> module = |
119 new PluginModule(current.name, | 119 new PluginModule(current.name, |
| 120 current.version, |
120 current.path, | 121 current.path, |
121 ppapi::PpapiPermissions(current.permissions)); | 122 ppapi::PpapiPermissions(current.permissions)); |
122 AddLiveModule(current.path, module.get()); | 123 AddLiveModule(current.path, module.get()); |
123 if (current.is_internal) { | 124 if (current.is_internal) { |
124 if (!module->InitAsInternalPlugin(current.internal_entry_points)) { | 125 if (!module->InitAsInternalPlugin(current.internal_entry_points)) { |
125 DVLOG(1) << "Failed to load pepper module: " << current.path.value(); | 126 DVLOG(1) << "Failed to load pepper module: " << current.path.value(); |
126 continue; | 127 continue; |
127 } | 128 } |
128 } else { | 129 } else { |
129 // Preload all external plugins we're not running out of process. | 130 // Preload all external plugins we're not running out of process. |
130 if (!module->InitAsLibrary(current.path)) { | 131 if (!module->InitAsLibrary(current.path)) { |
131 DVLOG(1) << "Failed to load pepper module: " << current.path.value(); | 132 DVLOG(1) << "Failed to load pepper module: " << current.path.value(); |
132 continue; | 133 continue; |
133 } | 134 } |
134 } | 135 } |
135 preloaded_modules_[current.path] = module; | 136 preloaded_modules_[current.path] = module; |
136 } | 137 } |
137 } | 138 } |
138 | 139 |
139 } // namespace content | 140 } // namespace content |
OLD | NEW |