OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_RESPONSE_INFO_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_RESPONSE_INFO_H_ |
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_RESPONSE_INFO_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_RESPONSE_INFO_H_ |
7 | 7 |
8 #include "base/supports_user_data.h" | 8 #include "base/supports_user_data.h" |
9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
10 #include "content/common/service_worker/service_worker_types.h" | 10 #include "content/common/service_worker/service_worker_types.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 bool create = false); | 26 bool create = false); |
27 static void ResetDataForRequest(net::URLRequest* request); | 27 static void ResetDataForRequest(net::URLRequest* request); |
28 | 28 |
29 ~ServiceWorkerResponseInfo() override; | 29 ~ServiceWorkerResponseInfo() override; |
30 | 30 |
31 void GetExtraResponseInfo(ResourceResponseInfo* response_info) const; | 31 void GetExtraResponseInfo(ResourceResponseInfo* response_info) const; |
32 void OnPrepareToRestart(base::TimeTicks service_worker_start_time, | 32 void OnPrepareToRestart(base::TimeTicks service_worker_start_time, |
33 base::TimeTicks service_worker_ready_time); | 33 base::TimeTicks service_worker_ready_time); |
34 void OnStartCompleted( | 34 void OnStartCompleted( |
35 bool was_fetched_via_service_worker, | 35 bool was_fetched_via_service_worker, |
| 36 bool was_fetched_via_foreign_fetch, |
36 bool was_fallback_required, | 37 bool was_fallback_required, |
37 const GURL& original_url_via_service_worker, | 38 const GURL& original_url_via_service_worker, |
38 blink::WebServiceWorkerResponseType response_type_via_service_worker, | 39 blink::WebServiceWorkerResponseType response_type_via_service_worker, |
39 base::TimeTicks service_worker_start_time, | 40 base::TimeTicks service_worker_start_time, |
40 base::TimeTicks service_worker_ready_time, | 41 base::TimeTicks service_worker_ready_time, |
41 bool response_is_in_cache_storage, | 42 bool response_is_in_cache_storage, |
42 const std::string& response_cache_storage_cache_name, | 43 const std::string& response_cache_storage_cache_name, |
43 const ServiceWorkerHeaderList& cors_exposed_header_names); | 44 const ServiceWorkerHeaderList& cors_exposed_header_names); |
44 void ResetData(); | 45 void ResetData(); |
45 | 46 |
(...skipping 17 matching lines...) Expand all Loading... |
63 return response_is_in_cache_storage_; | 64 return response_is_in_cache_storage_; |
64 } | 65 } |
65 const std::string& response_cache_storage_cache_name() const { | 66 const std::string& response_cache_storage_cache_name() const { |
66 return response_cache_storage_cache_name_; | 67 return response_cache_storage_cache_name_; |
67 } | 68 } |
68 | 69 |
69 private: | 70 private: |
70 ServiceWorkerResponseInfo(); | 71 ServiceWorkerResponseInfo(); |
71 | 72 |
72 bool was_fetched_via_service_worker_ = false; | 73 bool was_fetched_via_service_worker_ = false; |
| 74 bool was_fetched_via_foreign_fetch_ = false; |
73 bool was_fallback_required_ = false; | 75 bool was_fallback_required_ = false; |
74 GURL original_url_via_service_worker_; | 76 GURL original_url_via_service_worker_; |
75 blink::WebServiceWorkerResponseType response_type_via_service_worker_ = | 77 blink::WebServiceWorkerResponseType response_type_via_service_worker_ = |
76 blink::WebServiceWorkerResponseTypeDefault; | 78 blink::WebServiceWorkerResponseTypeDefault; |
77 base::TimeTicks service_worker_start_time_; | 79 base::TimeTicks service_worker_start_time_; |
78 base::TimeTicks service_worker_ready_time_; | 80 base::TimeTicks service_worker_ready_time_; |
79 bool response_is_in_cache_storage_ = false; | 81 bool response_is_in_cache_storage_ = false; |
80 std::string response_cache_storage_cache_name_; | 82 std::string response_cache_storage_cache_name_; |
81 ServiceWorkerHeaderList cors_exposed_header_names_; | 83 ServiceWorkerHeaderList cors_exposed_header_names_; |
82 }; | 84 }; |
83 | 85 |
84 } // namespace content | 86 } // namespace content |
85 | 87 |
86 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_RESPONSE_INFO_H_ | 88 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_RESPONSE_INFO_H_ |
OLD | NEW |