Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(923)

Unified Diff: chrome/browser/plugin_service.cc

Issue 4832002: Add PluginDataRemover. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/plugin_service.cc
diff --git a/chrome/browser/plugin_service.cc b/chrome/browser/plugin_service.cc
index cc6408fb02b186fbfb0dc887160b4df7e0d98236..86bed6239f3368d16e7110fe7ec27977c67941b2 100644
--- a/chrome/browser/plugin_service.cc
+++ b/chrome/browser/plugin_service.cc
@@ -226,26 +226,28 @@ PluginProcessHost* PluginService::FindOrStartPluginProcess(
const FilePath& plugin_path) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- PluginProcessHost *plugin_host = FindPluginProcess(plugin_path);
+ if (plugin_path.value().empty())
jam 2010/11/12 20:44:58 curious, any reason to change this logic? it seem
+ return NULL;
+
+ 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(

Powered by Google App Engine
This is Rietveld 408576698