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

Unified Diff: webkit/appcache/web_application_cache_host_impl.cc

Issue 3009005: Chrome side of changes required to populate appcache resource list.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 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
Index: webkit/appcache/web_application_cache_host_impl.cc
===================================================================
--- webkit/appcache/web_application_cache_host_impl.cc (revision 53710)
+++ webkit/appcache/web_application_cache_host_impl.cc (working copy)
@@ -21,6 +21,7 @@
using WebKit::WebURLRequest;
using WebKit::WebURL;
using WebKit::WebURLResponse;
+using WebKit::WebVector;
namespace appcache {
@@ -87,10 +88,12 @@
all_hosts()->Remove(host_id_);
}
-void WebApplicationCacheHostImpl::OnCacheSelected(int64 selected_cache_id,
- appcache::Status status) {
- status_ = status;
+void WebApplicationCacheHostImpl::OnCacheSelected(
+ const appcache::AppCacheInfo& info) {
+ status_ = info.status;
has_status_ = true;
+ cache_info_ = info;
+ client_->didChangeCacheAssociation();
}
void WebApplicationCacheHostImpl::OnStatusChanged(appcache::Status status) {
@@ -169,6 +172,38 @@
GURL());
}
+void WebApplicationCacheHostImpl::getAssociatedCacheInfo(
+ WebApplicationCacheHost::CacheInfo* info) {
+ if (!cache_info_.is_complete)
+ return;
+ info->manifestURL = cache_info_.manifest_url;
+ info->creationTime = cache_info_.creation_time.ToDoubleT();
+ info->updateTime = cache_info_.last_update_time.ToDoubleT();
+ info->totalSize = cache_info_.size;
+}
+
+void WebApplicationCacheHostImpl::getResourceList(
+ WebVector<ResourceInfo>* resources) {
+ if (!cache_info_.is_complete)
+ return;
+ std::vector<AppCacheResourceInfo> resource_infos;
+ backend_->GetResourceList(host_id_, &resource_infos);
+
+ WebVector<ResourceInfo> web_resources(resource_infos.size());
+ // Convert resource_infos to WebKit API.
+ for (size_t i = 0; i < resource_infos.size(); ++i) {
+ web_resources[i].size = resource_infos[i].size;
+ web_resources[i].isMaster = resource_infos[i].is_master;
+ web_resources[i].isExplicit = resource_infos[i].is_explicit;
+ web_resources[i].isManifest = resource_infos[i].is_manifest;
+ web_resources[i].isForeign = resource_infos[i].is_foreign;
+ web_resources[i].isFallback = resource_infos[i].is_fallback;
+ web_resources[i].url = resource_infos[i].url;
+ }
+
+ resources->swap(web_resources);
+}
+
bool WebApplicationCacheHostImpl::selectCacheWithManifest(
const WebURL& manifest_url) {
// Reset any previous status values we've received from the backend

Powered by Google App Engine
This is Rietveld 408576698