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

Unified Diff: webkit/appcache/appcache_service.cc

Issue 192043: AppCacheHost cache selection algorithm (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/appcache/appcache_service.h ('k') | webkit/appcache/appcache_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/appcache/appcache_service.cc
===================================================================
--- webkit/appcache/appcache_service.cc (revision 26254)
+++ webkit/appcache/appcache_service.cc (working copy)
@@ -5,8 +5,10 @@
#include "webkit/appcache/appcache_service.h"
#include "base/logging.h"
+#include "base/ref_counted.h"
#include "webkit/appcache/appcache.h"
#include "webkit/appcache/appcache_backend_impl.h"
+#include "webkit/appcache/appcache_entry.h"
#include "webkit/appcache/appcache_group.h"
namespace appcache {
@@ -60,4 +62,39 @@
groups_.erase(group->manifest_url());
}
+void AppCacheService::LoadCache(int64 id, LoadClient* client) {
+ // TODO(michaeln): actually retrieve from storage if needed
+ client->CacheLoadedCallback(GetCache(id), id);
+}
+
+void AppCacheService::LoadOrCreateGroup(const GURL& manifest_url,
+ LoadClient* client) {
+ // TODO(michaeln): actually retrieve from storage
+ scoped_refptr<AppCacheGroup> group = GetGroup(manifest_url);
+ if (!group.get()) {
+ group = new AppCacheGroup(this, manifest_url);
+ DCHECK(GetGroup(manifest_url));
+ }
+ client->GroupLoadedCallback(group.get(), manifest_url);
+}
+
+void AppCacheService::CancelLoads(LoadClient* client) {
+ // TODO(michaeln): remove client from loading lists
+}
+
+void AppCacheService::MarkAsForeignEntry(const GURL& entry_url,
+ int64 cache_id) {
+ // Update the in-memory cache.
+ AppCache* cache = GetCache(cache_id);
+ if (cache) {
+ AppCacheEntry* entry = cache->GetEntry(entry_url);
+ DCHECK(entry);
+ if (entry)
+ entry->add_types(AppCacheEntry::FOREIGN);
+ }
+
+ // TODO(michaeln): actually update in storage, and if this cache is
+ // being loaded be sure to update the memory cache upon load completion.
+}
+
} // namespace appcache
« no previous file with comments | « webkit/appcache/appcache_service.h ('k') | webkit/appcache/appcache_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698