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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 // called from both the renderer and browser the other option is to force a | 119 // called from both the renderer and browser the other option is to force a |
120 // special register function for each plugin to be called by both | 120 // special register function for each plugin to be called by both |
121 // RendererMain() and BrowserMain(). This seemed like the better tradeoff. | 121 // RendererMain() and BrowserMain(). This seemed like the better tradeoff. |
122 // | 122 // |
123 // TODO(ajwong): Think up a better way to maintain the plugin registration | 123 // TODO(ajwong): Think up a better way to maintain the plugin registration |
124 // information. Pehraps by construction of a singly linked list of | 124 // information. Pehraps by construction of a singly linked list of |
125 // plugin initializers that is built with static initializers? | 125 // plugin initializers that is built with static initializers? |
126 | 126 |
127 #if defined(ENABLE_REMOTING) | 127 #if defined(ENABLE_REMOTING) |
128 if (CommandLine::ForCurrentProcess()->HasSwitch( | 128 if (CommandLine::ForCurrentProcess()->HasSwitch( |
129 switches::kEnableChromoting)) { | 129 switches::kEnableRemoting)) { |
130 InternalPluginInfo info; | 130 InternalPluginInfo info; |
131 // Add the chromoting plugin. | 131 // Add the chromoting plugin. |
132 DCHECK(info.is_internal); | 132 DCHECK(info.is_internal); |
133 info.path = | 133 info.path = |
134 FilePath(FILE_PATH_LITERAL("internal-chromoting")); | 134 FilePath(FILE_PATH_LITERAL("internal-chromoting")); |
135 info.mime_types.push_back("pepper-application/x-chromoting"); | 135 info.mime_types.push_back("pepper-application/x-chromoting"); |
136 info.entry_points.get_interface = remoting::PPP_GetInterface; | 136 info.entry_points.get_interface = remoting::PPP_GetInterface; |
137 info.entry_points.initialize_module = remoting::PPP_InitializeModule; | 137 info.entry_points.initialize_module = remoting::PPP_InitializeModule; |
138 info.entry_points.shutdown_module = remoting::PPP_ShutdownModule; | 138 info.entry_points.shutdown_module = remoting::PPP_ShutdownModule; |
139 | 139 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 for (size_t i = 0; i < plugins.size(); ++i) { | 176 for (size_t i = 0; i < plugins.size(); ++i) { |
177 const FilePath& path = plugins[i].path; | 177 const FilePath& path = plugins[i].path; |
178 ModuleHandle module = pepper::PluginModule::CreateModule(path); | 178 ModuleHandle module = pepper::PluginModule::CreateModule(path); |
179 if (!module) { | 179 if (!module) { |
180 DLOG(ERROR) << "Failed to load pepper module: " << path.value(); | 180 DLOG(ERROR) << "Failed to load pepper module: " << path.value(); |
181 continue; | 181 continue; |
182 } | 182 } |
183 modules_[path] = module; | 183 modules_[path] = module; |
184 } | 184 } |
185 } | 185 } |
OLD | NEW |