| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/common/pepper_plugin_registry.h" | 5 #include "chrome/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/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 ComputeBuiltInPlugins(plugins); | 272 ComputeBuiltInPlugins(plugins); |
| 273 ComputePluginsFromCommandLine(plugins); | 273 ComputePluginsFromCommandLine(plugins); |
| 274 } | 274 } |
| 275 | 275 |
| 276 // static | 276 // static |
| 277 void PepperPluginRegistry::PreloadModules() { | 277 void PepperPluginRegistry::PreloadModules() { |
| 278 std::vector<PepperPluginInfo> plugins; | 278 std::vector<PepperPluginInfo> plugins; |
| 279 ComputeList(&plugins); | 279 ComputeList(&plugins); |
| 280 for (size_t i = 0; i < plugins.size(); ++i) { | 280 for (size_t i = 0; i < plugins.size(); ++i) { |
| 281 if (!plugins[i].is_internal) { | 281 if (!plugins[i].is_internal) { |
| 282 base::NativeLibrary library = base::LoadNativeLibrary(plugins[i].path); | 282 std::string error; |
| 283 base::NativeLibrary library = base::LoadNativeLibrary(plugins[i].path, |
| 284 &error); |
| 283 LOG_IF(WARNING, !library) << "Unable to load plugin " | 285 LOG_IF(WARNING, !library) << "Unable to load plugin " |
| 284 << plugins[i].path.value(); | 286 << plugins[i].path.value() << " " |
| 287 << error; |
| 285 } | 288 } |
| 286 } | 289 } |
| 287 } | 290 } |
| 288 | 291 |
| 289 const PepperPluginInfo* PepperPluginRegistry::GetInfoForPlugin( | 292 const PepperPluginInfo* PepperPluginRegistry::GetInfoForPlugin( |
| 290 const FilePath& path) const { | 293 const FilePath& path) const { |
| 291 for (size_t i = 0; i < plugin_list_.size(); ++i) { | 294 for (size_t i = 0; i < plugin_list_.size(); ++i) { |
| 292 if (path == plugin_list_[i].path) | 295 if (path == plugin_list_[i].path) |
| 293 return &plugin_list_[i]; | 296 return &plugin_list_[i]; |
| 294 } | 297 } |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 | 427 |
| 425 PepperPluginRegistry::NaClModuleInfoList::iterator | 428 PepperPluginRegistry::NaClModuleInfoList::iterator |
| 426 PepperPluginRegistry::FindNaClModule(const GURL& url) { | 429 PepperPluginRegistry::FindNaClModule(const GURL& url) { |
| 427 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); | 430 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); |
| 428 iter != nacl_module_list_.end(); ++iter) { | 431 iter != nacl_module_list_.end(); ++iter) { |
| 429 if (iter->url == url) | 432 if (iter->url == url) |
| 430 return iter; | 433 return iter; |
| 431 } | 434 } |
| 432 return nacl_module_list_.end(); | 435 return nacl_module_list_.end(); |
| 433 } | 436 } |
| OLD | NEW |