| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 FetchRequestMode request_mode, | 46 FetchRequestMode request_mode, |
| 47 FetchCredentialsMode credentials_mode, | 47 FetchCredentialsMode credentials_mode, |
| 48 FetchRedirectMode redirect_mode, | 48 FetchRedirectMode redirect_mode, |
| 49 ResourceType resource_type, | 49 ResourceType resource_type, |
| 50 RequestContextType request_context_type, | 50 RequestContextType request_context_type, |
| 51 RequestContextFrameType frame_type, | 51 RequestContextFrameType frame_type, |
| 52 scoped_refptr<ResourceRequestBodyImpl> body); | 52 scoped_refptr<ResourceRequestBodyImpl> body); |
| 53 ~ServiceWorkerControlleeRequestHandler() override; | 53 ~ServiceWorkerControlleeRequestHandler() override; |
| 54 | 54 |
| 55 // Called via custom URLRequestJobFactory. | 55 // Called via custom URLRequestJobFactory. |
| 56 // Returning a nullptr indicates that the request is not handled by |
| 57 // this handler. |
| 58 // This could get called multiple times during the lifetime. |
| 56 net::URLRequestJob* MaybeCreateJob( | 59 net::URLRequestJob* MaybeCreateJob( |
| 57 net::URLRequest* request, | 60 net::URLRequest* request, |
| 58 net::NetworkDelegate* network_delegate, | 61 net::NetworkDelegate* network_delegate, |
| 59 ResourceContext* resource_context) override; | 62 ResourceContext* resource_context) override; |
| 60 | 63 |
| 64 // Used only for PlzNavigate and --enable-network-service cases. |
| 65 // This will replace MaybeCreateJob() once NetworkService is enabled. |
| 66 // This could get called multiple times during the lifetime in redirect |
| 67 // cases. (In fallback-to-network cases we basically forward the request |
| 68 // to the request to the next request handler) |
| 69 // URLLoaderRequestHandler overrides: |
| 70 void MaybeCreateLoaderFactory( |
| 71 const ResourceRequest& request, |
| 72 ResourceContext* resource_context, |
| 73 base::OnceCallback<void(mojom::URLLoaderFactory*)> callback) override; |
| 74 |
| 61 private: | 75 private: |
| 62 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerControlleeRequestHandlerTest, | 76 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerControlleeRequestHandlerTest, |
| 63 ActivateWaitingVersion); | 77 ActivateWaitingVersion); |
| 64 typedef ServiceWorkerControlleeRequestHandler self; | 78 typedef ServiceWorkerControlleeRequestHandler self; |
| 65 | 79 |
| 66 // For main resource case. | 80 // For main resource case. |
| 67 void PrepareForMainResource(const GURL& url, | 81 void PrepareForMainResource(const GURL& url, |
| 68 const GURL& first_party_for_cookies); | 82 const GURL& first_party_for_cookies); |
| 69 void DidLookupRegistrationForMainResource( | 83 void DidLookupRegistrationForMainResource( |
| 70 ServiceWorkerStatusCode status, | 84 ServiceWorkerStatusCode status, |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 bool use_network_; | 136 bool use_network_; |
| 123 | 137 |
| 124 base::WeakPtrFactory<ServiceWorkerControlleeRequestHandler> weak_factory_; | 138 base::WeakPtrFactory<ServiceWorkerControlleeRequestHandler> weak_factory_; |
| 125 | 139 |
| 126 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerControlleeRequestHandler); | 140 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerControlleeRequestHandler); |
| 127 }; | 141 }; |
| 128 | 142 |
| 129 } // namespace content | 143 } // namespace content |
| 130 | 144 |
| 131 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTROLLEE_REQUEST_HAND
LER_H_ | 145 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTROLLEE_REQUEST_HAND
LER_H_ |
| OLD | NEW |