summaryrefslogtreecommitdiffstats
path: root/chrome/browser/net
diff options
context:
space:
mode:
authormichaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-11 20:47:32 +0000
committermichaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-11 20:47:32 +0000
commit02a5cdbe64dc598efaa25b06a8de02ffe8ea676b (patch)
treee7a04cc50318e21d72109f40f57d1add8de50d21 /chrome/browser/net
parentb2471359cfbd4f7b9621ba2542b947841bfadb27 (diff)
downloadchromium_src-02a5cdbe64dc598efaa25b06a8de02ffe8ea676b.zip
chromium_src-02a5cdbe64dc598efaa25b06a8de02ffe8ea676b.tar.gz
chromium_src-02a5cdbe64dc598efaa25b06a8de02ffe8ea676b.tar.bz2
Provide a profile.GetAppCacheService() accessor and add two helper methods to ChromeAppCacheService to override the default quota for an origin.
BUG=49993 TESTS=existing tests apply Review URL: http://codereview.chromium.org/2819091 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55773 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/net')
-rw-r--r--chrome/browser/net/chrome_url_request_context.cc16
-rw-r--r--chrome/browser/net/chrome_url_request_context.h1
2 files changed, 5 insertions, 12 deletions
diff --git a/chrome/browser/net/chrome_url_request_context.cc b/chrome/browser/net/chrome_url_request_context.cc
index a67e506..82ffd3dc 100644
--- a/chrome/browser/net/chrome_url_request_context.cc
+++ b/chrome/browser/net/chrome_url_request_context.cc
@@ -302,9 +302,7 @@ ChromeURLRequestContext* FactoryForOriginal::Create() {
context->set_cookie_policy(
new ChromeCookiePolicy(host_content_settings_map_));
- // Create a new AppCacheService.
- context->set_appcache_service(
- new ChromeAppCacheService(profile_dir_path_, context));
+ appcache_service_->set_request_context(context);
#if defined(USE_NSS)
// TODO(ukai): find a better way to set the URLRequestContext for OCSP.
@@ -410,9 +408,7 @@ ChromeURLRequestContext* FactoryForOffTheRecord::Create() {
context->set_ftp_transaction_factory(
new net::FtpNetworkLayer(context->host_resolver()));
- // Create a separate AppCacheService for OTR mode.
- context->set_appcache_service(
- new ChromeAppCacheService(profile_dir_path_, context));
+ appcache_service_->set_request_context(context);
context->set_net_log(io_thread_globals->net_log.get());
return context;
@@ -502,9 +498,6 @@ ChromeURLRequestContext* FactoryForMedia::Create() {
context->set_http_transaction_factory(cache);
- // Use the same appcache service as the profile's main context.
- context->set_appcache_service(main_context->appcache_service());
-
return context;
}
@@ -984,11 +977,9 @@ ChromeURLRequestContextFactory::ChromeURLRequestContextFactory(Profile* profile)
user_script_dir_path_ = profile->GetUserScriptMaster()->user_script_dir();
ssl_config_service_ = profile->GetSSLConfigService();
-
profile_dir_path_ = profile->GetPath();
-
cookie_monster_delegate_ = new ChromeCookieMonsterDelegate(profile);
-
+ appcache_service_ = profile->GetAppCacheService();
database_tracker_ = profile->GetDatabaseTracker();
}
@@ -1012,6 +1003,7 @@ void ChromeURLRequestContextFactory::ApplyProfileParametersToContext(
context->set_transport_security_state(
transport_security_state_);
context->set_ssl_config_service(ssl_config_service_);
+ context->set_appcache_service(appcache_service_);
context->set_database_tracker(database_tracker_);
}
diff --git a/chrome/browser/net/chrome_url_request_context.h b/chrome/browser/net/chrome_url_request_context.h
index 1e7065e..dff0e6f 100644
--- a/chrome/browser/net/chrome_url_request_context.h
+++ b/chrome/browser/net/chrome_url_request_context.h
@@ -393,6 +393,7 @@ class ChromeURLRequestContextFactory {
// user scripts.
FilePath user_script_dir_path_;
scoped_refptr<HostContentSettingsMap> host_content_settings_map_;
+ scoped_refptr<ChromeAppCacheService> appcache_service_;
scoped_refptr<webkit_database::DatabaseTracker> database_tracker_;
scoped_refptr<HostZoomMap> host_zoom_map_;
scoped_refptr<net::TransportSecurityState> transport_security_state_;