summaryrefslogtreecommitdiffstats
path: root/chrome/browser/net/chrome_url_request_context.h
diff options
context:
space:
mode:
authormichaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-22 19:50:31 +0000
committermichaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-22 19:50:31 +0000
commite2fc3d25fe020a7e7518af1aea31085adc1002a1 (patch)
treefc64854da0b8cc3ac30df1bb6a399885365fb092 /chrome/browser/net/chrome_url_request_context.h
parentf09ef6740a2d3342dd41796e01916957d20b6586 (diff)
downloadchromium_src-e2fc3d25fe020a7e7518af1aea31085adc1002a1.zip
chromium_src-e2fc3d25fe020a7e7518af1aea31085adc1002a1.tar.gz
chromium_src-e2fc3d25fe020a7e7518af1aea31085adc1002a1.tar.bz2
Fix appcache_service and request_context referencing.
There is one appcache service per profile and several request context per profile. The profile holds a reference to the appcache service. Those request contexts which are subject to retrieval from appcaches hold a reference to the appcache service too. The appcache service is provided with a pointer back to the 'main' request context, this context is used when updating appcaches. Initialization is a little tricky because profiles can't be used on the IO thread and request contexts can't be used on the UI thread. BUG=22597,22125 TEST=many existing tests exercise profile/context creation Review URL: http://codereview.chromium.org/215024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26844 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/net/chrome_url_request_context.h')
-rw-r--r--chrome/browser/net/chrome_url_request_context.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/chrome/browser/net/chrome_url_request_context.h b/chrome/browser/net/chrome_url_request_context.h
index b78e0a7..9eb3c90 100644
--- a/chrome/browser/net/chrome_url_request_context.h
+++ b/chrome/browser/net/chrome_url_request_context.h
@@ -32,13 +32,15 @@ class ChromeURLRequestContext : public URLRequestContext,
// expected to get called on the UI thread.
static ChromeURLRequestContext* CreateOriginal(
Profile* profile, const FilePath& cookie_store_path,
- const FilePath& disk_cache_path, int cache_size);
+ const FilePath& disk_cache_path, int cache_size,
+ ChromeAppCacheService* appcache_service);
// Create an instance for an original profile for media. This is expected to
// get called on UI thread. This method takes a profile and reuses the
// 'original' URLRequestContext for common files.
static ChromeURLRequestContext* CreateOriginalForMedia(Profile *profile,
- const FilePath& disk_cache_path, int cache_size);
+ const FilePath& disk_cache_path, int cache_size,
+ ChromeAppCacheService* appcache_service);
// Create an instance for an original profile for extensions. This is expected
// to get called on UI thread.
@@ -47,7 +49,8 @@ class ChromeURLRequestContext : public URLRequestContext,
// Create an instance for use with an OTR profile. This is expected to get
// called on the UI thread.
- static ChromeURLRequestContext* CreateOffTheRecord(Profile* profile);
+ static ChromeURLRequestContext* CreateOffTheRecord(Profile* profile,
+ ChromeAppCacheService* appcache_service);
// Create an instance of request context for OTR profile for extensions.
static ChromeURLRequestContext* CreateOffTheRecordForExtensions(
@@ -81,16 +84,18 @@ class ChromeURLRequestContext : public URLRequestContext,
const Blacklist* blacklist() const { return blacklist_; }
protected:
- // Private constructor, use the static factory methods instead. This is
+ // Private constructors, use the static factory methods instead. This is
// expected to be called on the UI thread.
- ChromeURLRequestContext(Profile* profile);
+ ChromeURLRequestContext(
+ Profile* profile, ChromeAppCacheService* appcache_service);
ChromeURLRequestContext(ChromeURLRequestContext* other);
// Create a request context for media resources from a regular request
// context. This helper method is called from CreateOriginalForMedia and
// CreateOffTheRecordForMedia.
static ChromeURLRequestContext* CreateRequestContextForMedia(Profile* profile,
- const FilePath& disk_cache_path, int cache_size, bool off_the_record);
+ const FilePath& disk_cache_path, int cache_size, bool off_the_record,
+ ChromeAppCacheService* appache_service);
// NotificationObserver implementation.
virtual void Observe(NotificationType type,