| OLD | NEW |
| 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 "base/ref_counted.h" | 8 #include "base/ref_counted.h" |
| 9 #include "webkit/appcache/appcache.h" | 9 #include "webkit/appcache/appcache.h" |
| 10 #include "webkit/appcache/appcache_backend_impl.h" | 10 #include "webkit/appcache/appcache_backend_impl.h" |
| 11 #include "webkit/appcache/appcache_entry.h" | 11 #include "webkit/appcache/appcache_entry.h" |
| 12 #include "webkit/appcache/appcache_group.h" | 12 #include "webkit/appcache/appcache_group.h" |
| 13 | 13 |
| 14 namespace appcache { | 14 namespace appcache { |
| 15 | 15 |
| 16 AppCacheService::AppCacheService() | 16 AppCacheService::AppCacheService() |
| 17 : last_cache_id_(0), last_group_id_(0), | 17 : last_cache_id_(0), last_group_id_(0), |
| 18 last_entry_id_(0), last_response_id_(0) { | 18 last_entry_id_(0), last_response_id_(0), |
| 19 request_context_(NULL) { |
| 19 } | 20 } |
| 20 | 21 |
| 21 AppCacheService::~AppCacheService() { | 22 AppCacheService::~AppCacheService() { |
| 22 DCHECK(backends_.empty()); | 23 DCHECK(backends_.empty()); |
| 23 DCHECK(caches_.empty()); | 24 DCHECK(caches_.empty()); |
| 24 DCHECK(groups_.empty()); | 25 DCHECK(groups_.empty()); |
| 25 } | 26 } |
| 26 | 27 |
| 27 void AppCacheService::Initialize(const FilePath& cache_directory) { | 28 void AppCacheService::Initialize(const FilePath& cache_directory) { |
| 28 // An empty cache directory indicates chrome incognito. | 29 // An empty cache directory indicates chrome incognito. |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 DCHECK(entry); | 92 DCHECK(entry); |
| 92 if (entry) | 93 if (entry) |
| 93 entry->add_types(AppCacheEntry::FOREIGN); | 94 entry->add_types(AppCacheEntry::FOREIGN); |
| 94 } | 95 } |
| 95 | 96 |
| 96 // TODO(michaeln): actually update in storage, and if this cache is | 97 // TODO(michaeln): actually update in storage, and if this cache is |
| 97 // being loaded be sure to update the memory cache upon load completion. | 98 // being loaded be sure to update the memory cache upon load completion. |
| 98 } | 99 } |
| 99 | 100 |
| 100 } // namespace appcache | 101 } // namespace appcache |
| OLD | NEW |