Index: chrome/browser/plugin_service.cc |
diff --git a/chrome/browser/plugin_service.cc b/chrome/browser/plugin_service.cc |
index cc6408fb02b186fbfb0dc887160b4df7e0d98236..9c671db23bef6e0eab90fe95cb79f367ab864fac 100644 |
--- a/chrome/browser/plugin_service.cc |
+++ b/chrome/browser/plugin_service.cc |
@@ -207,11 +207,6 @@ PluginProcessHost* PluginService::FindPluginProcess( |
const FilePath& plugin_path) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
- if (plugin_path.value().empty()) { |
- NOTREACHED() << "should only be called if we have a plugin to load"; |
- return NULL; |
- } |
- |
for (BrowserChildProcessHost::Iterator iter(ChildProcessInfo::PLUGIN_PROCESS); |
!iter.Done(); ++iter) { |
PluginProcessHost* plugin = static_cast<PluginProcessHost*>(*iter); |
@@ -226,26 +221,25 @@ PluginProcessHost* PluginService::FindOrStartPluginProcess( |
const FilePath& plugin_path) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
- PluginProcessHost *plugin_host = FindPluginProcess(plugin_path); |
+ PluginProcessHost* plugin_host = FindPluginProcess(plugin_path); |
if (plugin_host) |
return plugin_host; |
WebPluginInfo info; |
if (!NPAPI::PluginList::Singleton()->GetPluginInfoByPath( |
- plugin_path, &info)) { |
- DCHECK(false); |
+ plugin_path, &info)) { |
+ NOTREACHED(); |
return NULL; |
} |
// This plugin isn't loaded by any plugin process, so create a new process. |
- plugin_host = new PluginProcessHost(); |
- if (!plugin_host->Init(info, ui_locale_)) { |
- DCHECK(false); // Init is not expected to fail |
- delete plugin_host; |
+ scoped_ptr<PluginProcessHost> new_host(new PluginProcessHost()); |
+ if (!new_host->Init(info, ui_locale_)) { |
+ NOTREACHED(); // Init is not expected to fail |
return NULL; |
} |
- return plugin_host; |
+ return new_host.release(); |
} |
void PluginService::OpenChannelToPlugin( |