Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Side by Side Diff: webkit/appcache/appcache_service.cc

Issue 195077: Tell the AppCacheService which request context to use when fetching resources... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/appcache/appcache_service.h ('k') | webkit/tools/test_shell/simple_appcache_system.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "webkit/appcache/appcache_service.h" 5 #include "webkit/appcache/appcache_service.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "webkit/appcache/appcache.h" 8 #include "webkit/appcache/appcache.h"
9 #include "webkit/appcache/appcache_backend_impl.h" 9 #include "webkit/appcache/appcache_backend_impl.h"
10 #include "webkit/appcache/appcache_group.h" 10 #include "webkit/appcache/appcache_group.h"
11 11
12 namespace appcache { 12 namespace appcache {
13 13
14 AppCacheService::AppCacheService()
15 : last_cache_id_(0), last_group_id_(0),
16 last_entry_id_(0), last_response_id_(0) {
17 }
18
14 AppCacheService::~AppCacheService() { 19 AppCacheService::~AppCacheService() {
15 DCHECK(backends_.empty()); 20 DCHECK(backends_.empty());
16 DCHECK(caches_.empty()); 21 DCHECK(caches_.empty());
17 DCHECK(groups_.empty()); 22 DCHECK(groups_.empty());
18 } 23 }
19 24
20 void AppCacheService::Initialize(const FilePath& cache_directory) { 25 void AppCacheService::Initialize(const FilePath& cache_directory) {
21 // An empty cache directory indicates chrome incognito. 26 // An empty cache directory indicates chrome incognito.
22 cache_directory_ = cache_directory; 27 cache_directory_ = cache_directory;
28 // TODO(michaeln): load last_<foo>_ids from storage
23 } 29 }
24 30
25 void AppCacheService::RegisterBackend( 31 void AppCacheService::RegisterBackend(
26 AppCacheBackendImpl* backend_impl) { 32 AppCacheBackendImpl* backend_impl) {
27 DCHECK(backends_.find(backend_impl->process_id()) == backends_.end()); 33 DCHECK(backends_.find(backend_impl->process_id()) == backends_.end());
28 backends_.insert( 34 backends_.insert(
29 BackendMap::value_type(backend_impl->process_id(), backend_impl)); 35 BackendMap::value_type(backend_impl->process_id(), backend_impl));
30 } 36 }
31 37
32 void AppCacheService::UnregisterBackend( 38 void AppCacheService::UnregisterBackend(
(...skipping 15 matching lines...) Expand all
48 const GURL& url = group->manifest_url(); 54 const GURL& url = group->manifest_url();
49 DCHECK(groups_.find(url) == groups_.end()); 55 DCHECK(groups_.find(url) == groups_.end());
50 groups_.insert(GroupMap::value_type(url, group)); 56 groups_.insert(GroupMap::value_type(url, group));
51 } 57 }
52 58
53 void AppCacheService::RemoveGroup(AppCacheGroup* group) { 59 void AppCacheService::RemoveGroup(AppCacheGroup* group) {
54 groups_.erase(group->manifest_url()); 60 groups_.erase(group->manifest_url());
55 } 61 }
56 62
57 } // namespace appcache 63 } // namespace appcache
OLDNEW
« no previous file with comments | « webkit/appcache/appcache_service.h ('k') | webkit/tools/test_shell/simple_appcache_system.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698