summaryrefslogtreecommitdiffstats
path: root/webkit/appcache/web_application_cache_host_impl.cc
diff options
context:
space:
mode:
authormichaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-08 19:21:49 +0000
committermichaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-08 19:21:49 +0000
commitfd2fa3fe2b81d0125c20a6d6f352386bac4a8e23 (patch)
tree52bfc2fa1ab2389fbded937f8e5361ec51d87095 /webkit/appcache/web_application_cache_host_impl.cc
parent5dd6904cd76766fe227f5c8b92d5743706f87ff9 (diff)
downloadchromium_src-fd2fa3fe2b81d0125c20a6d6f352386bac4a8e23.zip
chromium_src-fd2fa3fe2b81d0125c20a6d6f352386bac4a8e23.tar.gz
chromium_src-fd2fa3fe2b81d0125c20a6d6f352386bac4a8e23.tar.bz2
* Add appCacheManifestUrl data member to WebURLResponse, and use it to detect 'foreign' entries.
* Complete the 'contextID' to 'hostID' renaming since that terminology is now used in webcore ResourceRequest. This patch depends on a corresponding webkit change in the chromium port.https://bugs.webkit.org/show_bug.cgi?id=28960 Review URL: http://codereview.chromium.org/201026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25646 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/web_application_cache_host_impl.cc')
-rw-r--r--webkit/appcache/web_application_cache_host_impl.cc23
1 files changed, 15 insertions, 8 deletions
diff --git a/webkit/appcache/web_application_cache_host_impl.cc b/webkit/appcache/web_application_cache_host_impl.cc
index d5d50fb..379a80d 100644
--- a/webkit/appcache/web_application_cache_host_impl.cc
+++ b/webkit/appcache/web_application_cache_host_impl.cc
@@ -63,12 +63,12 @@ void WebApplicationCacheHostImpl::OnEventRaised(appcache::EventID event_id) {
void WebApplicationCacheHostImpl::willStartMainResourceRequest(
WebURLRequest& request) {
- request.setAppCacheContextID(host_id_);
+ request.setAppCacheHostID(host_id_);
}
void WebApplicationCacheHostImpl::willStartSubResourceRequest(
WebURLRequest& request) {
- request.setAppCacheContextID(host_id_);
+ request.setAppCacheHostID(host_id_);
}
void WebApplicationCacheHostImpl::selectCacheWithoutManifest() {
@@ -89,20 +89,23 @@ bool WebApplicationCacheHostImpl::selectCacheWithManifest(
has_status_ = false;
has_cached_status_ = false;
+ GURL manifest_gurl(manifest_url);
+ if (manifest_gurl.has_ref()) {
+ GURL::Replacements replacements;
+ replacements.ClearRef();
+ manifest_gurl = manifest_gurl.ReplaceComponents(replacements);
+ }
+
// Check for new 'master' entries.
if (main_response_.appCacheID() == kNoCacheId) {
should_capture_main_response_ = is_in_http_family_ ? YES : NO;
backend_->SelectCache(host_id_, main_response_url_,
- kNoCacheId, manifest_url);
+ kNoCacheId, manifest_gurl);
return true;
}
// Check for 'foreign' entries.
- // TODO(michaeln): add manifestUrl() accessor to WebURLResponse,
- // for now we don't really detect 'foreign' entries.
- // TODO(michaeln): put an == operator on WebURL?
- GURL manifest_gurl(manifest_url);
- GURL main_response_manifest_gurl(manifest_url); // = mainResp.manifestUrl()
+ GURL main_response_manifest_gurl(main_response_.appCacheManifestURL());
if (main_response_manifest_gurl != manifest_gurl) {
backend_->MarkAsForeignEntry(host_id_, main_response_url_,
main_response_.appCacheID());
@@ -129,10 +132,14 @@ void WebApplicationCacheHostImpl::didReceiveResponseForMainResource(
void WebApplicationCacheHostImpl::didReceiveDataForMainResource(
const char* data, int len) {
+ if (should_capture_main_response_ == NO)
+ return;
// TODO(michaeln): write me
}
void WebApplicationCacheHostImpl::didFinishLoadingMainResource(bool success) {
+ if (should_capture_main_response_ == NO)
+ return;
// TODO(michaeln): write me
}