summaryrefslogtreecommitdiffstats
path: root/webkit/appcache/appcache_service.cc
diff options
context:
space:
mode:
authormichaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-01 22:30:30 +0000
committermichaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-01 22:30:30 +0000
commit23f1ef1a445a53bcefc8ddab9f4184b1db7321c5 (patch)
treec9f17a33025ed5b5c5dee76a7b4fef9104e9a995 /webkit/appcache/appcache_service.cc
parente143c823ce66af5a83a9a17b6f5938eb16e49392 (diff)
downloadchromium_src-23f1ef1a445a53bcefc8ddab9f4184b1db7321c5.zip
chromium_src-23f1ef1a445a53bcefc8ddab9f4184b1db7321c5.tar.gz
chromium_src-23f1ef1a445a53bcefc8ddab9f4184b1db7321c5.tar.bz2
Plumb request interception into the appcache library for both chrome and test_shell.
AppCache library: * Added AppCacheInterceptor, which is derived from URLRequest::Interceptor. Chrome: * Each UserProfile instantiates a ChromeAppCacheService, which is derived from an appcache library class. * Each ChromeURLRequestContext associated with that profile has a reference to that instance. * ResourceDispatcherHost pokes AppCacheInterceptor when initiating URLRequests and when returning the response head. TestShell: * Added SimpleAppCacheSystem which bundles together appcache lib components for use in a single process with an UI and IO thread. * TestShellWebKit instantiates and initializes an instance of the above, aimed at at temp directory that will get cleaned up when the test run is over. * SimpleResourceLoaderBridge pokes the system when initiating URLRequests and when returning the response head. TEST=none, although many existing tests exercise this stuff BUG=none Review URL: http://codereview.chromium.org/173406 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25099 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/appcache_service.cc')
-rw-r--r--webkit/appcache/appcache_service.cc15
1 files changed, 11 insertions, 4 deletions
diff --git a/webkit/appcache/appcache_service.cc b/webkit/appcache/appcache_service.cc
index 0d3579b..0fd5356 100644
--- a/webkit/appcache/appcache_service.cc
+++ b/webkit/appcache/appcache_service.cc
@@ -17,14 +17,21 @@ AppCacheService::~AppCacheService() {
DCHECK(groups_.empty());
}
-void AppCacheService::RegisterBackendImpl(
+void AppCacheService::Initialize(const FilePath& cache_directory) {
+ // An empty cache directory indicates chrome incognito.
+ cache_directory_ = cache_directory;
+}
+
+void AppCacheService::RegisterBackend(
AppCacheBackendImpl* backend_impl) {
- backends_.insert(backend_impl);
+ DCHECK(backends_.find(backend_impl->process_id()) == backends_.end());
+ backends_.insert(
+ BackendMap::value_type(backend_impl->process_id(), backend_impl));
}
-void AppCacheService::UnregisterBackendImpl(
+void AppCacheService::UnregisterBackend(
AppCacheBackendImpl* backend_impl) {
- backends_.erase(backend_impl);
+ backends_.erase(backend_impl->process_id());
}
void AppCacheService::AddCache(AppCache* cache) {