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

Unified Diff: chrome/browser/extensions/extension_updater.cc

Issue 9150016: Move creation and ownership of ResourceDispatcherHost and PluginService to content. This gives a ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 years, 11 months 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/extensions/extension_updater.cc
===================================================================
--- chrome/browser/extensions/extension_updater.cc (revision 116798)
+++ chrome/browser/extensions/extension_updater.cc (working copy)
@@ -482,7 +482,8 @@
service_(service), frequency_seconds_(frequency_seconds),
will_check_soon_(false), extension_prefs_(extension_prefs),
prefs_(prefs), profile_(profile), blacklist_checks_enabled_(true),
- crx_install_is_running_(false) {
+ crx_install_is_running_(false),
+ use_utility_process_(true) {
Init();
}
@@ -622,8 +623,11 @@
public:
// Takes ownership of |fetch_data|.
SafeManifestParser(const std::string& xml, ManifestFetchData* fetch_data,
- base::WeakPtr<ExtensionUpdater> updater)
- : xml_(xml), updater_(updater) {
+ base::WeakPtr<ExtensionUpdater> updater,
+ bool use_utility_process)
+ : xml_(xml),
+ updater_(updater),
+ use_utility_process_(use_utility_process) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
fetch_data_.reset(fetch_data);
}
@@ -635,19 +639,18 @@
if (!BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
base::Bind(
- &SafeManifestParser::ParseInSandbox, this,
- g_browser_process->resource_dispatcher_host()))) {
+ &SafeManifestParser::ParseInSandbox, this))) {
NOTREACHED();
}
}
// Creates the sandboxed utility process and tells it to start parsing.
- void ParseInSandbox(ResourceDispatcherHost* rdh) {
+ void ParseInSandbox() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
// TODO(asargent) we shouldn't need to do this branch here - instead
// UtilityProcessHost should handle it for us. (http://crbug.com/19192)
- bool use_utility_process = rdh &&
+ bool use_utility_process = use_utility_process_ &&
!CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess);
if (use_utility_process) {
UtilityProcessHost* host = new UtilityProcessHost(
@@ -721,6 +724,7 @@
// Should be accessed only on UI thread.
scoped_ptr<ManifestFetchData> fetch_data_;
base::WeakPtr<ExtensionUpdater> updater_;
+ bool use_utility_process_;
};
@@ -736,7 +740,8 @@
VLOG(2) << "beginning manifest parse for " << url;
scoped_refptr<SafeManifestParser> safe_parser(
new SafeManifestParser(data, current_manifest_fetch_.release(),
- weak_ptr_factory_.GetWeakPtr()));
+ weak_ptr_factory_.GetWeakPtr(),
+ use_utility_process_));
safe_parser->Start();
} else {
// TODO(asargent) Do exponential backoff here. (http://crbug.com/12546).

Powered by Google App Engine
This is Rietveld 408576698