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

Side by Side Diff: content/browser/cache_storage/cache_storage_cache.cc

Issue 2785123002: Make no-location redirect response to be "opaque redirect" when redirect mode is manual. (Closed)
Patch Set: add link to crbug.com/707185 Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/external/wpt/fetch/api/redirect/redirect-location.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/cache_storage/cache_storage_cache.h" 5 #include "content/browser/cache_storage/cache_storage_cache.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <limits> 9 #include <limits>
10 #include <memory> 10 #include <memory>
(...skipping 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after
1012 DCHECK_EQ(CACHE_STORAGE_CACHE_OPERATION_TYPE_PUT, operation.operation_type); 1012 DCHECK_EQ(CACHE_STORAGE_CACHE_OPERATION_TYPE_PUT, operation.operation_type);
1013 1013
1014 std::unique_ptr<ServiceWorkerFetchRequest> request( 1014 std::unique_ptr<ServiceWorkerFetchRequest> request(
1015 new ServiceWorkerFetchRequest( 1015 new ServiceWorkerFetchRequest(
1016 operation.request.url, operation.request.method, 1016 operation.request.url, operation.request.method,
1017 operation.request.headers, operation.request.referrer, 1017 operation.request.headers, operation.request.referrer,
1018 operation.request.is_reload)); 1018 operation.request.is_reload));
1019 1019
1020 // We don't support streaming for cache. 1020 // We don't support streaming for cache.
1021 DCHECK(operation.response.stream_url.is_empty()); 1021 DCHECK(operation.response.stream_url.is_empty());
1022 // We don't support the body of redirect response.
1023 DCHECK(!(operation.response.response_type ==
1024 blink::kWebServiceWorkerResponseTypeOpaqueRedirect &&
1025 operation.response.blob_size));
1026 1022
1027 std::unique_ptr<ServiceWorkerResponse> response = 1023 std::unique_ptr<ServiceWorkerResponse> response =
1028 base::MakeUnique<ServiceWorkerResponse>(operation.response); 1024 base::MakeUnique<ServiceWorkerResponse>(operation.response);
1029 std::unique_ptr<storage::BlobDataHandle> blob_data_handle; 1025 std::unique_ptr<storage::BlobDataHandle> blob_data_handle;
1030 1026
1031 if (!response->blob_uuid.empty()) { 1027 if (!response->blob_uuid.empty()) {
1032 if (!blob_storage_context_) { 1028 if (!blob_storage_context_) {
1033 callback.Run(CACHE_STORAGE_ERROR_STORAGE); 1029 callback.Run(CACHE_STORAGE_ERROR_STORAGE);
1034 return; 1030 return;
1035 } 1031 }
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
1491 temp_entry, INDEX_RESPONSE_BODY, INDEX_SIDE_DATA); 1487 temp_entry, INDEX_RESPONSE_BODY, INDEX_SIDE_DATA);
1492 return blob_storage_context_->AddFinishedBlob(&blob_data); 1488 return blob_storage_context_->AddFinishedBlob(&blob_data);
1493 } 1489 }
1494 1490
1495 std::unique_ptr<CacheStorageCacheHandle> 1491 std::unique_ptr<CacheStorageCacheHandle>
1496 CacheStorageCache::CreateCacheHandle() { 1492 CacheStorageCache::CreateCacheHandle() {
1497 return cache_storage_->CreateCacheHandle(this); 1493 return cache_storage_->CreateCacheHandle(this);
1498 } 1494 }
1499 1495
1500 } // namespace content 1496 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/external/wpt/fetch/api/redirect/redirect-location.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698