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_CONTROLLEE_REQUEST_HANDLER
_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTROLLEE_REQUEST_HANDLER
_H_ |
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTROLLEE_REQUEST_HANDLER
_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTROLLEE_REQUEST_HANDLER
_H_ |
7 | 7 |
8 #include "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
9 #include "content/browser/service_worker/service_worker_request_handler.h" | 9 #include "content/browser/service_worker/service_worker_request_handler.h" |
10 #include "content/common/service_worker/service_worker_types.h" | 10 #include "content/common/service_worker/service_worker_types.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 net::URLRequestJob* MaybeCreateJob( | 47 net::URLRequestJob* MaybeCreateJob( |
48 net::URLRequest* request, | 48 net::URLRequest* request, |
49 net::NetworkDelegate* network_delegate, | 49 net::NetworkDelegate* network_delegate, |
50 ResourceContext* resource_context) override; | 50 ResourceContext* resource_context) override; |
51 | 51 |
52 void GetExtraResponseInfo( | 52 void GetExtraResponseInfo( |
53 bool* was_fetched_via_service_worker, | 53 bool* was_fetched_via_service_worker, |
54 bool* was_fallback_required_by_service_worker, | 54 bool* was_fallback_required_by_service_worker, |
55 GURL* original_url_via_service_worker, | 55 GURL* original_url_via_service_worker, |
56 blink::WebServiceWorkerResponseType* response_type_via_service_worker, | 56 blink::WebServiceWorkerResponseType* response_type_via_service_worker, |
57 base::TimeTicks* worker_start_time) const override; | 57 base::TimeTicks* worker_start_time, |
| 58 base::TimeTicks* worker_ready_time) const override; |
58 | 59 |
59 private: | 60 private: |
60 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerControlleeRequestHandlerTest, | 61 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerControlleeRequestHandlerTest, |
61 ActivateWaitingVersion); | 62 ActivateWaitingVersion); |
62 typedef ServiceWorkerControlleeRequestHandler self; | 63 typedef ServiceWorkerControlleeRequestHandler self; |
63 | 64 |
64 // For main resource case. | 65 // For main resource case. |
65 void PrepareForMainResource(const net::URLRequest* request); | 66 void PrepareForMainResource(const net::URLRequest* request); |
66 void DidLookupRegistrationForMainResource( | 67 void DidLookupRegistrationForMainResource( |
67 ServiceWorkerStatusCode status, | 68 ServiceWorkerStatusCode status, |
68 const scoped_refptr<ServiceWorkerRegistration>& registration); | 69 const scoped_refptr<ServiceWorkerRegistration>& registration); |
69 void OnVersionStatusChanged( | 70 void OnVersionStatusChanged( |
70 ServiceWorkerRegistration* registration, | 71 ServiceWorkerRegistration* registration, |
71 ServiceWorkerVersion* version); | 72 ServiceWorkerVersion* version); |
72 | 73 |
73 // For sub resource case. | 74 // For sub resource case. |
74 void PrepareForSubResource(); | 75 void PrepareForSubResource(); |
75 | 76 |
76 bool is_main_resource_load_; | 77 bool is_main_resource_load_; |
77 scoped_refptr<ServiceWorkerURLRequestJob> job_; | 78 scoped_refptr<ServiceWorkerURLRequestJob> job_; |
78 FetchRequestMode request_mode_; | 79 FetchRequestMode request_mode_; |
79 FetchCredentialsMode credentials_mode_; | 80 FetchCredentialsMode credentials_mode_; |
80 RequestContextType request_context_type_; | 81 RequestContextType request_context_type_; |
81 RequestContextFrameType frame_type_; | 82 RequestContextFrameType frame_type_; |
82 scoped_refptr<ResourceRequestBody> body_; | 83 scoped_refptr<ResourceRequestBody> body_; |
83 ResourceContext* resource_context_; | 84 ResourceContext* resource_context_; |
84 GURL stripped_url_; | 85 GURL stripped_url_; |
85 base::TimeTicks worker_start_time_; | 86 base::TimeTicks worker_start_time_; |
| 87 base::TimeTicks worker_ready_time_; |
86 base::WeakPtrFactory<ServiceWorkerControlleeRequestHandler> weak_factory_; | 88 base::WeakPtrFactory<ServiceWorkerControlleeRequestHandler> weak_factory_; |
87 | 89 |
88 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerControlleeRequestHandler); | 90 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerControlleeRequestHandler); |
89 }; | 91 }; |
90 | 92 |
91 } // namespace content | 93 } // namespace content |
92 | 94 |
93 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTROLLEE_REQUEST_HAND
LER_H_ | 95 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTROLLEE_REQUEST_HAND
LER_H_ |
OLD | NEW |