summaryrefslogtreecommitdiffstats
path: root/chrome/browser/web_resource/web_resource_service.cc
diff options
context:
space:
mode:
authorrsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-09 02:43:04 +0000
committerrsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-09 02:43:04 +0000
commitaeb10cb1ec017ca6c30117e792f9725900f54b26 (patch)
treec8b79bf62f027d1330481a7c93ef9622faa5736e /chrome/browser/web_resource/web_resource_service.cc
parent9c3085f2c334471051111ebce5687f917d7075a7 (diff)
downloadchromium_src-aeb10cb1ec017ca6c30117e792f9725900f54b26.zip
chromium_src-aeb10cb1ec017ca6c30117e792f9725900f54b26.tar.gz
chromium_src-aeb10cb1ec017ca6c30117e792f9725900f54b26.tar.bz2
Revert 88400 (Probable breaker of XP Tests(dbg)(5), 10.6 Tests (dbg)(2), 10.5 Tests (dbg)(2))
88400 - Use the System URL Request Context in the web resource service instead of the default profile's context. This change should be made because there will be no more default profile, because these services should be able to run without being attached to a specific profile, and because they should only ever fetch json data from controlled URLs. BUG=64339 TEST=all current web resource tests continue to work. Review URL: http://codereview.chromium.org/7099004 TBR=mirandac@chromium.org Review URL: http://codereview.chromium.org/7108035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88477 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/web_resource/web_resource_service.cc')
-rw-r--r--chrome/browser/web_resource/web_resource_service.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/chrome/browser/web_resource/web_resource_service.cc b/chrome/browser/web_resource/web_resource_service.cc
index 5c116cd0..a60e013 100644
--- a/chrome/browser/web_resource/web_resource_service.cc
+++ b/chrome/browser/web_resource/web_resource_service.cc
@@ -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 @@ class WebResourceService::WebResourceFetcher
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 @@ class WebResourceService::UnpackerClient
};
WebResourceService::WebResourceService(
+ Profile* profile,
PrefService* prefs,
const char* web_resource_server,
bool apply_locale_to_url,
@@ -203,6 +206,7 @@ WebResourceService::WebResourceService(
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 @@ WebResourceService::WebResourceService(
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);