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

Side by Side Diff: content/renderer/cache_storage/cache_storage_dispatcher.cc

Issue 2703343002: ServiceWorker: Use mojo's data pipe for respondWith(stream) (Closed)
Patch Set: Addressed comments from kinuko and haraken 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
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/renderer/cache_storage/cache_storage_dispatcher.h" 5 #include "content/renderer/cache_storage/cache_storage_dispatcher.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <map> 9 #include <map>
10 #include <memory> 10 #include <memory>
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 return CACHE_STORAGE_CACHE_OPERATION_TYPE_PUT; 97 return CACHE_STORAGE_CACHE_OPERATION_TYPE_PUT;
98 case blink::WebServiceWorkerCache::kOperationTypeDelete: 98 case blink::WebServiceWorkerCache::kOperationTypeDelete:
99 return CACHE_STORAGE_CACHE_OPERATION_TYPE_DELETE; 99 return CACHE_STORAGE_CACHE_OPERATION_TYPE_DELETE;
100 default: 100 default:
101 return CACHE_STORAGE_CACHE_OPERATION_TYPE_UNDEFINED; 101 return CACHE_STORAGE_CACHE_OPERATION_TYPE_UNDEFINED;
102 } 102 }
103 } 103 }
104 104
105 CacheStorageBatchOperation BatchOperationFromWebBatchOperation( 105 CacheStorageBatchOperation BatchOperationFromWebBatchOperation(
106 const blink::WebServiceWorkerCache::BatchOperation& web_operation) { 106 const blink::WebServiceWorkerCache::BatchOperation& web_operation) {
107 // We don't support streaming for cache.
108 DCHECK(web_operation.response.StreamURL().IsEmpty());
109
110 CacheStorageBatchOperation operation; 107 CacheStorageBatchOperation operation;
111 operation.operation_type = 108 operation.operation_type =
112 CacheOperationTypeFromWebCacheOperationType(web_operation.operation_type); 109 CacheOperationTypeFromWebCacheOperationType(web_operation.operation_type);
113 operation.request = FetchRequestFromWebRequest(web_operation.request); 110 operation.request = FetchRequestFromWebRequest(web_operation.request);
114 operation.response = 111 operation.response =
115 GetServiceWorkerResponseFromWebResponse(web_operation.response); 112 GetServiceWorkerResponseFromWebResponse(web_operation.response);
116 operation.match_params = 113 operation.match_params =
117 QueryParamsFromWebQueryParams(web_operation.match_params); 114 QueryParamsFromWebQueryParams(web_operation.match_params);
118 return operation; 115 return operation;
119 } 116 }
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 CacheStorageDispatcher::WebResponsesFromResponses( 659 CacheStorageDispatcher::WebResponsesFromResponses(
663 const std::vector<ServiceWorkerResponse>& responses) { 660 const std::vector<ServiceWorkerResponse>& responses) {
664 blink::WebVector<blink::WebServiceWorkerResponse> web_responses( 661 blink::WebVector<blink::WebServiceWorkerResponse> web_responses(
665 responses.size()); 662 responses.size());
666 for (size_t i = 0; i < responses.size(); ++i) 663 for (size_t i = 0; i < responses.size(); ++i)
667 PopulateWebResponseFromResponse(responses[i], &(web_responses[i])); 664 PopulateWebResponseFromResponse(responses[i], &(web_responses[i]));
668 return web_responses; 665 return web_responses;
669 } 666 }
670 667
671 } // namespace content 668 } // namespace content
OLDNEW
« no previous file with comments | « content/common/service_worker/service_worker_types.cc ('k') | content/renderer/service_worker/service_worker_context_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698