| OLD | NEW |
| 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 Loading... |
| 97 return CACHE_STORAGE_CACHE_OPERATION_TYPE_PUT; | 97 return CACHE_STORAGE_CACHE_OPERATION_TYPE_PUT; |
| 98 case blink::WebServiceWorkerCache::OperationTypeDelete: | 98 case blink::WebServiceWorkerCache::OperationTypeDelete: |
| 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.operationType); | 109 CacheOperationTypeFromWebCacheOperationType(web_operation.operationType); |
| 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.matchParams); | 114 QueryParamsFromWebQueryParams(web_operation.matchParams); |
| 118 return operation; | 115 return operation; |
| 119 } | 116 } |
| (...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |