| 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 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_ |
| 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 105 |
| 106 // Creates ServiceWorkerFetchRequest from |request_| and |body_|. | 106 // Creates ServiceWorkerFetchRequest from |request_| and |body_|. |
| 107 scoped_ptr<ServiceWorkerFetchRequest> CreateFetchRequest(); | 107 scoped_ptr<ServiceWorkerFetchRequest> CreateFetchRequest(); |
| 108 | 108 |
| 109 // Creates BlobDataHandle of the request body from |body_|. This handle | 109 // Creates BlobDataHandle of the request body from |body_|. This handle |
| 110 // |request_body_blob_data_handle_| will be deleted when | 110 // |request_body_blob_data_handle_| will be deleted when |
| 111 // ServiceWorkerURLRequestJob is deleted. | 111 // ServiceWorkerURLRequestJob is deleted. |
| 112 bool CreateRequestBodyBlob(std::string* blob_uuid, uint64* blob_size); | 112 bool CreateRequestBodyBlob(std::string* blob_uuid, uint64* blob_size); |
| 113 | 113 |
| 114 // For FORWARD_TO_SERVICE_WORKER case. | 114 // For FORWARD_TO_SERVICE_WORKER case. |
| 115 void DidPrepareFetchEvent(); |
| 115 void DidDispatchFetchEvent(ServiceWorkerStatusCode status, | 116 void DidDispatchFetchEvent(ServiceWorkerStatusCode status, |
| 116 ServiceWorkerFetchEventResult fetch_result, | 117 ServiceWorkerFetchEventResult fetch_result, |
| 117 const ServiceWorkerResponse& response); | 118 const ServiceWorkerResponse& response); |
| 118 | 119 |
| 119 // Populates |http_response_headers_|. | 120 // Populates |http_response_headers_|. |
| 120 void CreateResponseHeader(int status_code, | 121 void CreateResponseHeader(int status_code, |
| 121 const std::string& status_text, | 122 const std::string& status_text, |
| 122 const std::map<std::string, std::string>& headers); | 123 const std::map<std::string, std::string>& headers); |
| 123 | 124 |
| 124 // Creates |http_response_info_| using |http_response_headers_| and calls | 125 // Creates |http_response_info_| using |http_response_headers_| and calls |
| (...skipping 25 matching lines...) Expand all Loading... |
| 150 scoped_ptr<storage::BlobDataHandle> request_body_blob_data_handle_; | 151 scoped_ptr<storage::BlobDataHandle> request_body_blob_data_handle_; |
| 151 | 152 |
| 152 base::WeakPtrFactory<ServiceWorkerURLRequestJob> weak_factory_; | 153 base::WeakPtrFactory<ServiceWorkerURLRequestJob> weak_factory_; |
| 153 | 154 |
| 154 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerURLRequestJob); | 155 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerURLRequestJob); |
| 155 }; | 156 }; |
| 156 | 157 |
| 157 } // namespace content | 158 } // namespace content |
| 158 | 159 |
| 159 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_ | 160 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_ |
| OLD | NEW |