Index: chrome/browser/web_resource/web_resource_service.cc |
=================================================================== |
--- chrome/browser/web_resource/web_resource_service.cc (revision 88476) |
+++ chrome/browser/web_resource/web_resource_service.cc (working copy) |
@@ -14,6 +14,7 @@ |
#include "base/values.h" |
#include "chrome/browser/browser_process.h" |
#include "chrome/browser/prefs/pref_service.h" |
+#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/sync/sync_ui_util.h" |
#include "chrome/common/chrome_switches.h" |
#include "chrome/common/extensions/extension.h" |
@@ -66,11 +67,12 @@ |
url_fetcher_.reset(new URLFetcher(GURL( |
web_resource_server), |
URLFetcher::GET, this)); |
- // Use system request context and do not save state in cookies or cache. |
+ // Do not let url fetcher affect existing state in profile (by setting |
+ // cookies, for example. |
url_fetcher_->set_load_flags(net::LOAD_DISABLE_CACHE | |
net::LOAD_DO_NOT_SAVE_COOKIES); |
net::URLRequestContextGetter* url_request_context_getter = |
- g_browser_process->system_request_context(); |
+ web_resource_service_->profile_->GetRequestContext(); |
url_fetcher_->set_request_context(url_request_context_getter); |
url_fetcher_->Start(); |
} |
@@ -195,6 +197,7 @@ |
}; |
WebResourceService::WebResourceService( |
+ Profile* profile, |
PrefService* prefs, |
const char* web_resource_server, |
bool apply_locale_to_url, |
@@ -203,6 +206,7 @@ |
int start_fetch_delay, |
int cache_update_delay) |
: prefs_(prefs), |
+ profile_(profile), |
ALLOW_THIS_IN_INITIALIZER_LIST(service_factory_(this)), |
in_fetch_(false), |
web_resource_server_(web_resource_server), |
@@ -213,6 +217,7 @@ |
cache_update_delay_(cache_update_delay), |
web_resource_update_scheduled_(false) { |
DCHECK(prefs); |
+ DCHECK(profile); |
prefs_->RegisterStringPref(last_update_time_pref_name, |
"0", |
PrefService::UNSYNCABLE_PREF); |