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/common/pepper_plugin_registry.h" | 5 #include "content/common/pepper_plugin_registry.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/native_library.h" | 8 #include "base/native_library.h" |
9 #include "base/strings/string_split.h" | 9 #include "base/strings/string_split.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 // Note that in each case, AddLiveModule must be called before completing | 202 // Note that in each case, AddLiveModule must be called before completing |
203 // initialization. If we bail out (in the continue clauses) before saving | 203 // initialization. If we bail out (in the continue clauses) before saving |
204 // the initialized module, it will still try to unregister itself in its | 204 // the initialized module, it will still try to unregister itself in its |
205 // destructor. | 205 // destructor. |
206 for (size_t i = 0; i < plugin_list_.size(); i++) { | 206 for (size_t i = 0; i < plugin_list_.size(); i++) { |
207 const PepperPluginInfo& current = plugin_list_[i]; | 207 const PepperPluginInfo& current = plugin_list_[i]; |
208 if (current.is_out_of_process) | 208 if (current.is_out_of_process) |
209 continue; // Out of process plugins need no special pre-initialization. | 209 continue; // Out of process plugins need no special pre-initialization. |
210 | 210 |
211 scoped_refptr<webkit::ppapi::PluginModule> module = | 211 scoped_refptr<webkit::ppapi::PluginModule> module = |
212 new webkit::ppapi::PluginModule(current.name, current.path, this, | 212 new webkit::ppapi::PluginModule(current.name, current.path, |
213 ppapi::PpapiPermissions(current.permissions)); | 213 ppapi::PpapiPermissions(current.permissions)); |
214 AddLiveModule(current.path, module.get()); | 214 AddLiveModule(current.path, module.get()); |
215 if (current.is_internal) { | 215 if (current.is_internal) { |
216 if (!module->InitAsInternalPlugin(current.internal_entry_points)) { | 216 if (!module->InitAsInternalPlugin(current.internal_entry_points)) { |
217 DLOG(ERROR) << "Failed to load pepper module: " << current.path.value(); | 217 DLOG(ERROR) << "Failed to load pepper module: " << current.path.value(); |
218 continue; | 218 continue; |
219 } | 219 } |
220 } else { | 220 } else { |
221 // Preload all external plugins we're not running out of process. | 221 // Preload all external plugins we're not running out of process. |
222 if (!module->InitAsLibrary(current.path)) { | 222 if (!module->InitAsLibrary(current.path)) { |
223 DLOG(ERROR) << "Failed to load pepper module: " << current.path.value(); | 223 DLOG(ERROR) << "Failed to load pepper module: " << current.path.value(); |
224 continue; | 224 continue; |
225 } | 225 } |
226 } | 226 } |
227 preloaded_modules_[current.path] = module; | 227 preloaded_modules_[current.path] = module; |
228 } | 228 } |
229 } | 229 } |
230 | 230 |
231 } // namespace content | 231 } // namespace content |
OLD | NEW |