| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 void PepperPluginRegistry::GetInternalPluginInfo( | 146 void PepperPluginRegistry::GetInternalPluginInfo( |
| 147 InternalPluginInfoList* plugin_info) { | 147 InternalPluginInfoList* plugin_info) { |
| 148 // Currently, to centralize the internal plugin registration logic, we | 148 // Currently, to centralize the internal plugin registration logic, we |
| 149 // hardcode the list of plugins, mimetypes, and registration information | 149 // hardcode the list of plugins, mimetypes, and registration information |
| 150 // in this function. This is gross, but because the GetList() function is | 150 // in this function. This is gross, but because the GetList() function is |
| 151 // called from both the renderer and browser the other option is to force a | 151 // called from both the renderer and browser the other option is to force a |
| 152 // special register function for each plugin to be called by both | 152 // special register function for each plugin to be called by both |
| 153 // RendererMain() and BrowserMain(). This seemed like the better tradeoff. | 153 // RendererMain() and BrowserMain(). This seemed like the better tradeoff. |
| 154 // | 154 // |
| 155 // TODO(ajwong): Think up a better way to maintain the plugin registration | 155 // TODO(ajwong): Think up a better way to maintain the plugin registration |
| 156 // information. Pehraps by construction of a singly linked list of | 156 // information. Perhaps by construction of a singly linked list of |
| 157 // plugin initializers that is built with static initializers? | 157 // plugin initializers that is built with static initializers? |
| 158 | 158 |
| 159 #if defined(ENABLE_REMOTING) | 159 #if defined(ENABLE_REMOTING) |
| 160 if (CommandLine::ForCurrentProcess()->HasSwitch( | 160 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 161 switches::kEnableRemoting)) { | 161 switches::kEnableRemoting)) { |
| 162 InternalPluginInfo info; | 162 InternalPluginInfo info; |
| 163 // Add the chromoting plugin. | 163 // Add the chromoting plugin. |
| 164 DCHECK(info.is_internal); | 164 DCHECK(info.is_internal); |
| 165 info.path = | 165 info.path = |
| 166 FilePath(FILE_PATH_LITERAL("internal-chromoting")); | 166 FilePath(FILE_PATH_LITERAL("internal-chromoting")); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 const FilePath& path = plugins[i].path; | 229 const FilePath& path = plugins[i].path; |
| 230 ModuleHandle module = pepper::PluginModule::CreateModule(path); | 230 ModuleHandle module = pepper::PluginModule::CreateModule(path); |
| 231 if (!module) { | 231 if (!module) { |
| 232 DLOG(ERROR) << "Failed to load pepper module: " << path.value(); | 232 DLOG(ERROR) << "Failed to load pepper module: " << path.value(); |
| 233 continue; | 233 continue; |
| 234 } | 234 } |
| 235 module->set_name(plugins[i].name); | 235 module->set_name(plugins[i].name); |
| 236 modules_[path] = module; | 236 modules_[path] = module; |
| 237 } | 237 } |
| 238 } | 238 } |
| OLD | NEW |