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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 void SetExtraRequestHeaders(const net::HttpRequestHeaders& headers) override; | 137 void SetExtraRequestHeaders(const net::HttpRequestHeaders& headers) override; |
138 int ReadRawData(net::IOBuffer* buf, int buf_size) override; | 138 int ReadRawData(net::IOBuffer* buf, int buf_size) override; |
139 | 139 |
140 //---------------------------------------------------------------------------- | 140 //---------------------------------------------------------------------------- |
141 // The following are intended for use by ServiceWorker(Blob|Stream)Reader. | 141 // The following are intended for use by ServiceWorker(Blob|Stream)Reader. |
142 void OnResponseStarted(); | 142 void OnResponseStarted(); |
143 void OnReadRawDataComplete(int bytes_read); | 143 void OnReadRawDataComplete(int bytes_read); |
144 void RecordResult(ServiceWorkerMetrics::URLRequestJobResult result); | 144 void RecordResult(ServiceWorkerMetrics::URLRequestJobResult result); |
145 //---------------------------------------------------------------------------- | 145 //---------------------------------------------------------------------------- |
146 | 146 |
| 147 void set_renderer_request_time(base::TimeTicks t) { |
| 148 renderer_request_time_ = t; |
| 149 } |
| 150 void set_handler_creation_time(base::TimeTicks t) { |
| 151 handler_creation_time_ = t; |
| 152 } |
| 153 |
147 base::WeakPtr<ServiceWorkerURLRequestJob> GetWeakPtr(); | 154 base::WeakPtr<ServiceWorkerURLRequestJob> GetWeakPtr(); |
148 | 155 |
149 private: | 156 private: |
150 class FileSizeResolver; | 157 class FileSizeResolver; |
151 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerControlleeRequestHandlerTest, | 158 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerControlleeRequestHandlerTest, |
152 LostActiveVersion); | 159 LostActiveVersion); |
153 | 160 |
154 enum ResponseType { | 161 enum ResponseType { |
155 NOT_DETERMINED, | 162 NOT_DETERMINED, |
156 FAIL_DUE_TO_LOST_CONTROLLER, | 163 FAIL_DUE_TO_LOST_CONTROLLER, |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 ResponseBodyType response_body_type_ = UNKNOWN; | 329 ResponseBodyType response_body_type_ = UNKNOWN; |
323 bool did_record_result_ = false; | 330 bool did_record_result_ = false; |
324 | 331 |
325 bool response_is_in_cache_storage_ = false; | 332 bool response_is_in_cache_storage_ = false; |
326 std::string response_cache_storage_cache_name_; | 333 std::string response_cache_storage_cache_name_; |
327 | 334 |
328 ServiceWorkerHeaderList cors_exposed_header_names_; | 335 ServiceWorkerHeaderList cors_exposed_header_names_; |
329 | 336 |
330 std::unique_ptr<FileSizeResolver> file_size_resolver_; | 337 std::unique_ptr<FileSizeResolver> file_size_resolver_; |
331 | 338 |
| 339 base::TimeTicks renderer_request_time_; |
| 340 base::TimeTicks handler_creation_time_; |
| 341 base::TimeTicks job_creation_time_; |
| 342 |
332 base::WeakPtrFactory<ServiceWorkerURLRequestJob> weak_factory_; | 343 base::WeakPtrFactory<ServiceWorkerURLRequestJob> weak_factory_; |
333 | 344 |
334 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerURLRequestJob); | 345 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerURLRequestJob); |
335 }; | 346 }; |
336 | 347 |
337 } // namespace content | 348 } // namespace content |
338 | 349 |
339 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_ | 350 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_ |
OLD | NEW |