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

Unified Diff: content/browser/cache_storage/cache_storage_cache.cc

Issue 1271733002: [2/3 chromium] Support redirect option of Request and "opaqueredirect" response type. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add _MODE to avoid compile error at Windows. Created 5 years, 4 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: content/browser/cache_storage/cache_storage_cache.cc
diff --git a/content/browser/cache_storage/cache_storage_cache.cc b/content/browser/cache_storage/cache_storage_cache.cc
index dcc9c3d0da7d3ac00b00b734ac7636d3e6dd5bc7..187b027d215e00492050f821fa05ab87b352c9c5 100644
--- a/content/browser/cache_storage/cache_storage_cache.cc
+++ b/content/browser/cache_storage/cache_storage_cache.cc
@@ -76,6 +76,8 @@ blink::WebServiceWorkerResponseType ProtoResponseTypeToWebResponseType(
return blink::WebServiceWorkerResponseTypeError;
case CacheResponse::OPAQUE_TYPE:
return blink::WebServiceWorkerResponseTypeOpaque;
+ case CacheResponse::OPAQUE_REDIRECT_TYPE:
+ return blink::WebServiceWorkerResponseTypeOpaqueRedirect;
}
NOTREACHED();
return blink::WebServiceWorkerResponseTypeOpaque;
@@ -94,10 +96,8 @@ CacheResponse::ResponseType WebResponseTypeToProtoResponseType(
return CacheResponse::ERROR_TYPE;
case blink::WebServiceWorkerResponseTypeOpaque:
return CacheResponse::OPAQUE_TYPE;
- default:
- // TODO(horo): Remove this when WebServiceWorkerResponseTypeOpaqueRedirect
- // will be added in blink's WebServiceWorkerResponseType.h.
- NOTREACHED();
+ case blink::WebServiceWorkerResponseTypeOpaqueRedirect:
+ return CacheResponse::OPAQUE_REDIRECT_TYPE;
}
NOTREACHED();
return CacheResponse::OPAQUE_TYPE;
@@ -725,6 +725,10 @@ void CacheStorageCache::Put(const CacheStorageBatchOperation& operation,
// We don't support streaming for cache.
DCHECK(operation.response.stream_url.is_empty());
+ // We don't support the body of redirect response.
+ DCHECK(!(operation.response.response_type ==
+ blink::WebServiceWorkerResponseTypeOpaqueRedirect &&
+ operation.response.blob_size));
scoped_ptr<ServiceWorkerResponse> response(new ServiceWorkerResponse(
operation.response.url, operation.response.status_code,
operation.response.status_text, operation.response.response_type,
« no previous file with comments | « content/browser/cache_storage/cache_storage.proto ('k') | content/browser/loader/resource_dispatcher_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698