| 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" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 } | 54 } |
| 55 | 55 |
| 56 void AppCacheService::AddGroup(AppCacheGroup* group) { | 56 void AppCacheService::AddGroup(AppCacheGroup* group) { |
| 57 const GURL& url = group->manifest_url(); | 57 const GURL& url = group->manifest_url(); |
| 58 DCHECK(groups_.find(url) == groups_.end()); | 58 DCHECK(groups_.find(url) == groups_.end()); |
| 59 groups_.insert(GroupMap::value_type(url, group)); | 59 groups_.insert(GroupMap::value_type(url, group)); |
| 60 } | 60 } |
| 61 | 61 |
| 62 void AppCacheService::RemoveGroup(AppCacheGroup* group) { | 62 void AppCacheService::RemoveGroup(AppCacheGroup* group) { |
| 63 groups_.erase(group->manifest_url()); | 63 groups_.erase(group->manifest_url()); |
| 64 |
| 65 // TODO(jennb): if group is obsolete, delete from storage. |
| 64 } | 66 } |
| 65 | 67 |
| 66 void AppCacheService::LoadCache(int64 id, LoadClient* client) { | 68 void AppCacheService::LoadCache(int64 id, LoadClient* client) { |
| 67 // TODO(michaeln): actually retrieve from storage if needed | 69 // TODO(michaeln): actually retrieve from storage if needed |
| 68 client->CacheLoadedCallback(GetCache(id), id); | 70 client->CacheLoadedCallback(GetCache(id), id); |
| 69 } | 71 } |
| 70 | 72 |
| 71 void AppCacheService::LoadOrCreateGroup(const GURL& manifest_url, | 73 void AppCacheService::LoadOrCreateGroup(const GURL& manifest_url, |
| 72 LoadClient* client) { | 74 LoadClient* client) { |
| 73 // TODO(michaeln): actually retrieve from storage | 75 // TODO(michaeln): actually retrieve from storage |
| (...skipping 18 matching lines...) Expand all Loading... |
| 92 DCHECK(entry); | 94 DCHECK(entry); |
| 93 if (entry) | 95 if (entry) |
| 94 entry->add_types(AppCacheEntry::FOREIGN); | 96 entry->add_types(AppCacheEntry::FOREIGN); |
| 95 } | 97 } |
| 96 | 98 |
| 97 // TODO(michaeln): actually update in storage, and if this cache is | 99 // TODO(michaeln): actually update in storage, and if this cache is |
| 98 // being loaded be sure to update the memory cache upon load completion. | 100 // being loaded be sure to update the memory cache upon load completion. |
| 99 } | 101 } |
| 100 | 102 |
| 101 } // namespace appcache | 103 } // namespace appcache |
| OLD | NEW |