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

Unified Diff: chrome/browser/plugin_service.cc

Issue 4832002: Add PluginDataRemover. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: foo 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
« no previous file with comments | « chrome/browser/plugin_data_remover.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « chrome/browser/plugin_data_remover.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698