| 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/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/native_library.h" | 9 #include "base/native_library.h" |
| 10 #include "base/string_split.h" | 10 #include "base/string_split.h" |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 // Note that in each case, AddLiveModule must be called before completing | 220 // Note that in each case, AddLiveModule must be called before completing |
| 221 // initialization. If we bail out (in the continue clauses) before saving | 221 // initialization. If we bail out (in the continue clauses) before saving |
| 222 // the initialized module, it will still try to unregister itself in its | 222 // the initialized module, it will still try to unregister itself in its |
| 223 // destructor. | 223 // destructor. |
| 224 for (size_t i = 0; i < plugin_list_.size(); i++) { | 224 for (size_t i = 0; i < plugin_list_.size(); i++) { |
| 225 const PepperPluginInfo& current = plugin_list_[i]; | 225 const PepperPluginInfo& current = plugin_list_[i]; |
| 226 if (current.is_out_of_process) | 226 if (current.is_out_of_process) |
| 227 continue; // Out of process plugins need no special pre-initialization. | 227 continue; // Out of process plugins need no special pre-initialization. |
| 228 | 228 |
| 229 scoped_refptr<webkit::ppapi::PluginModule> module = | 229 scoped_refptr<webkit::ppapi::PluginModule> module = |
| 230 new webkit::ppapi::PluginModule(current.name, current.path, this, | 230 new webkit::ppapi::PluginModule(current.name, current.version, |
| 231 ppapi::PpapiPermissions(current.permissions)); | 231 current.path, this, ppapi::PpapiPermissions(current.permissions)); |
| 232 AddLiveModule(current.path, module); | 232 AddLiveModule(current.path, module); |
| 233 if (current.is_internal) { | 233 if (current.is_internal) { |
| 234 if (!module->InitAsInternalPlugin(current.internal_entry_points)) { | 234 if (!module->InitAsInternalPlugin(current.internal_entry_points)) { |
| 235 DLOG(ERROR) << "Failed to load pepper module: " << current.path.value(); | 235 DLOG(ERROR) << "Failed to load pepper module: " << current.path.value(); |
| 236 continue; | 236 continue; |
| 237 } | 237 } |
| 238 } else { | 238 } else { |
| 239 // Preload all external plugins we're not running out of process. | 239 // Preload all external plugins we're not running out of process. |
| 240 if (!module->InitAsLibrary(current.path)) { | 240 if (!module->InitAsLibrary(current.path)) { |
| 241 DLOG(ERROR) << "Failed to load pepper module: " << current.path.value(); | 241 DLOG(ERROR) << "Failed to load pepper module: " << current.path.value(); |
| 242 continue; | 242 continue; |
| 243 } | 243 } |
| 244 } | 244 } |
| 245 preloaded_modules_[current.path] = module; | 245 preloaded_modules_[current.path] = module; |
| 246 } | 246 } |
| 247 } | 247 } |
| 248 | 248 |
| 249 } // namespace content | 249 } // namespace content |
| OLD | NEW |