| 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 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 scoped_refptr<ResourceRequestBody> body); | 33 scoped_refptr<ResourceRequestBody> body); |
| 34 virtual ~ServiceWorkerControlleeRequestHandler(); | 34 virtual ~ServiceWorkerControlleeRequestHandler(); |
| 35 | 35 |
| 36 // Called via custom URLRequestJobFactory. | 36 // Called via custom URLRequestJobFactory. |
| 37 virtual net::URLRequestJob* MaybeCreateJob( | 37 virtual net::URLRequestJob* MaybeCreateJob( |
| 38 net::URLRequest* request, | 38 net::URLRequest* request, |
| 39 net::NetworkDelegate* network_delegate) OVERRIDE; | 39 net::NetworkDelegate* network_delegate) OVERRIDE; |
| 40 | 40 |
| 41 virtual void GetExtraResponseInfo( | 41 virtual void GetExtraResponseInfo( |
| 42 bool* was_fetched_via_service_worker, | 42 bool* was_fetched_via_service_worker, |
| 43 GURL* original_url_via_service_worker) const OVERRIDE; | 43 GURL* original_url_via_service_worker, |
| 44 base::TimeTicks* fetch_start_time, |
| 45 base::TimeTicks* fetch_ready_time, |
| 46 base::TimeTicks* fetch_end_time) const OVERRIDE; |
| 44 | 47 |
| 45 private: | 48 private: |
| 46 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerControlleeRequestHandlerTest, | 49 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerControlleeRequestHandlerTest, |
| 47 ActivateWaitingVersion); | 50 ActivateWaitingVersion); |
| 48 typedef ServiceWorkerControlleeRequestHandler self; | 51 typedef ServiceWorkerControlleeRequestHandler self; |
| 49 | 52 |
| 50 // For main resource case. | 53 // For main resource case. |
| 51 void PrepareForMainResource(const GURL& url); | 54 void PrepareForMainResource(const GURL& url); |
| 52 void DidLookupRegistrationForMainResource( | 55 void DidLookupRegistrationForMainResource( |
| 53 ServiceWorkerStatusCode status, | 56 ServiceWorkerStatusCode status, |
| 54 const scoped_refptr<ServiceWorkerRegistration>& registration); | 57 const scoped_refptr<ServiceWorkerRegistration>& registration); |
| 55 void OnVersionStatusChanged( | 58 void OnVersionStatusChanged( |
| 56 ServiceWorkerRegistration* registration, | 59 ServiceWorkerRegistration* registration, |
| 57 ServiceWorkerVersion* version); | 60 ServiceWorkerVersion* version); |
| 58 | 61 |
| 59 // For sub resource case. | 62 // For sub resource case. |
| 60 void PrepareForSubResource(); | 63 void PrepareForSubResource(); |
| 61 | 64 |
| 62 bool is_main_resource_load_; | 65 bool is_main_resource_load_; |
| 63 scoped_refptr<ServiceWorkerURLRequestJob> job_; | 66 scoped_refptr<ServiceWorkerURLRequestJob> job_; |
| 64 scoped_refptr<ResourceRequestBody> body_; | 67 scoped_refptr<ResourceRequestBody> body_; |
| 65 base::WeakPtrFactory<ServiceWorkerControlleeRequestHandler> weak_factory_; | 68 base::WeakPtrFactory<ServiceWorkerControlleeRequestHandler> weak_factory_; |
| 66 | 69 |
| 67 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerControlleeRequestHandler); | 70 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerControlleeRequestHandler); |
| 68 }; | 71 }; |
| 69 | 72 |
| 70 } // namespace content | 73 } // namespace content |
| 71 | 74 |
| 72 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTROLLEE_REQUEST_HAND
LER_H_ | 75 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTROLLEE_REQUEST_HAND
LER_H_ |
| OLD | NEW |