| 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #include "chrome/browser/plugin_service.h" | 7 #include "chrome/browser/plugin_service.h" |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 const FilePath& plugin_path) { | 213 const FilePath& plugin_path) { |
| 214 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 214 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 215 | 215 |
| 216 PluginProcessHost* plugin_host = FindPluginProcess(plugin_path); | 216 PluginProcessHost* plugin_host = FindPluginProcess(plugin_path); |
| 217 if (plugin_host) | 217 if (plugin_host) |
| 218 return plugin_host; | 218 return plugin_host; |
| 219 | 219 |
| 220 WebPluginInfo info; | 220 WebPluginInfo info; |
| 221 if (!NPAPI::PluginList::Singleton()->GetPluginInfoByPath( | 221 if (!NPAPI::PluginList::Singleton()->GetPluginInfoByPath( |
| 222 plugin_path, &info)) { | 222 plugin_path, &info)) { |
| 223 NOTREACHED(); | |
| 224 return NULL; | 223 return NULL; |
| 225 } | 224 } |
| 226 | 225 |
| 227 // This plugin isn't loaded by any plugin process, so create a new process. | 226 // This plugin isn't loaded by any plugin process, so create a new process. |
| 228 scoped_ptr<PluginProcessHost> new_host(new PluginProcessHost()); | 227 scoped_ptr<PluginProcessHost> new_host(new PluginProcessHost()); |
| 229 if (!new_host->Init(info, ui_locale_)) { | 228 if (!new_host->Init(info, ui_locale_)) { |
| 230 NOTREACHED(); // Init is not expected to fail | 229 NOTREACHED(); // Init is not expected to fail |
| 231 return NULL; | 230 return NULL; |
| 232 } | 231 } |
| 233 | 232 |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 info.mime_types = ASCIIToWide(JoinString(plugins[i].mime_types, '|')); | 423 info.mime_types = ASCIIToWide(JoinString(plugins[i].mime_types, '|')); |
| 425 | 424 |
| 426 // These NPAPI entry points will never be called. TODO(darin): Come up | 425 // These NPAPI entry points will never be called. TODO(darin): Come up |
| 427 // with a cleaner way to register pepper plugins with the NPAPI PluginList, | 426 // with a cleaner way to register pepper plugins with the NPAPI PluginList, |
| 428 // or perhaps refactor the PluginList to be less specific to NPAPI. | 427 // or perhaps refactor the PluginList to be less specific to NPAPI. |
| 429 memset(&info.entry_points, 0, sizeof(info.entry_points)); | 428 memset(&info.entry_points, 0, sizeof(info.entry_points)); |
| 430 | 429 |
| 431 NPAPI::PluginList::Singleton()->RegisterInternalPlugin(info); | 430 NPAPI::PluginList::Singleton()->RegisterInternalPlugin(info); |
| 432 } | 431 } |
| 433 } | 432 } |
| OLD | NEW |