| 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 "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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 128 |
| 129 // static | 129 // static |
| 130 void PepperPluginRegistry::PreloadModules() { | 130 void PepperPluginRegistry::PreloadModules() { |
| 131 std::vector<content::PepperPluginInfo> plugins; | 131 std::vector<content::PepperPluginInfo> plugins; |
| 132 ComputeList(&plugins); | 132 ComputeList(&plugins); |
| 133 for (size_t i = 0; i < plugins.size(); ++i) { | 133 for (size_t i = 0; i < plugins.size(); ++i) { |
| 134 if (!plugins[i].is_internal) { | 134 if (!plugins[i].is_internal) { |
| 135 std::string error; | 135 std::string error; |
| 136 base::NativeLibrary library = base::LoadNativeLibrary(plugins[i].path, | 136 base::NativeLibrary library = base::LoadNativeLibrary(plugins[i].path, |
| 137 &error); | 137 &error); |
| 138 LOG_IF(WARNING, !library) << "Unable to load plugin " | 138 DLOG_IF(WARNING, !library) << "Unable to load plugin " |
| 139 << plugins[i].path.value() << " " | 139 << plugins[i].path.value() << " " |
| 140 << error; | 140 << error; |
| 141 } | 141 } |
| 142 } | 142 } |
| 143 } | 143 } |
| 144 | 144 |
| 145 const content::PepperPluginInfo* PepperPluginRegistry::GetInfoForPlugin( | 145 const content::PepperPluginInfo* PepperPluginRegistry::GetInfoForPlugin( |
| 146 const webkit::WebPluginInfo& info) { | 146 const webkit::WebPluginInfo& info) { |
| 147 for (size_t i = 0; i < plugin_list_.size(); ++i) { | 147 for (size_t i = 0; i < plugin_list_.size(); ++i) { |
| 148 if (info.path == plugin_list_[i].path) | 148 if (info.path == plugin_list_[i].path) |
| 149 return &plugin_list_[i]; | 149 return &plugin_list_[i]; |
| 150 } | 150 } |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 // Preload all external plugins we're not running out of process. | 225 // Preload all external plugins we're not running out of process. |
| 226 if (!module->InitAsLibrary(current.path)) { | 226 if (!module->InitAsLibrary(current.path)) { |
| 227 DLOG(ERROR) << "Failed to load pepper module: " << current.path.value(); | 227 DLOG(ERROR) << "Failed to load pepper module: " << current.path.value(); |
| 228 continue; | 228 continue; |
| 229 } | 229 } |
| 230 } | 230 } |
| 231 preloaded_modules_[current.path] = module; | 231 preloaded_modules_[current.path] = module; |
| 232 } | 232 } |
| 233 } | 233 } |
| 234 | 234 |
| OLD | NEW |