summaryrefslogtreecommitdiffstats
path: root/content/browser/service_worker/service_worker_cache.cc
diff options
context:
space:
mode:
authorjkarlin <jkarlin@chromium.org>2014-10-28 05:34:51 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-28 12:35:06 +0000
commitdda17cf9624e778f6c32684637f7f2fac1044882 (patch)
treef639a44f9e7a474e4ddced4a5bae307d1e87ecc4 /content/browser/service_worker/service_worker_cache.cc
parenta90342e18c8cbd97bef789d2d8ef52bf140fb528 (diff)
downloadchromium_src-dda17cf9624e778f6c32684637f7f2fac1044882.zip
chromium_src-dda17cf9624e778f6c32684637f7f2fac1044882.tar.gz
chromium_src-dda17cf9624e778f6c32684637f7f2fac1044882.tar.bz2
[ServiceWorkerCache] Let the response have a URL different from the request.
This is to comply with spec. BUG=424629 Review URL: https://codereview.chromium.org/678733002 Cr-Commit-Position: refs/heads/master@{#301627}
Diffstat (limited to 'content/browser/service_worker/service_worker_cache.cc')
-rw-r--r--content/browser/service_worker/service_worker_cache.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/content/browser/service_worker/service_worker_cache.cc b/content/browser/service_worker/service_worker_cache.cc
index 0882e9c..6069f11 100644
--- a/content/browser/service_worker/service_worker_cache.cc
+++ b/content/browser/service_worker/service_worker_cache.cc
@@ -229,6 +229,9 @@ void MatchDidReadMetadata(
"",
0));
+ if (metadata->response().has_url())
+ response->url = GURL(metadata->response().url());
+
for (int i = 0; i < metadata->response().headers_size(); ++i) {
const ServiceWorkerCacheHeaderMap header = metadata->response().headers(i);
response->headers.insert(std::make_pair(header.name(), header.value()));
@@ -927,6 +930,7 @@ void ServiceWorkerCache::PutDidCreateEntry(scoped_ptr<PutContext> put_context,
response_metadata->set_status_text(put_context->response->status_text);
response_metadata->set_response_type(
WebResponseTypeToProtoResponseType(put_context->response->response_type));
+ response_metadata->set_url(put_context->response->url.spec());
for (ServiceWorkerHeaderMap::const_iterator it =
put_context->response->headers.begin();
it != put_context->response->headers.end();