Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(307)

Side by Side Diff: content/browser/service_worker/service_worker_url_request_job.h

Issue 2897063002: Network service: Implement URLLoader chaining for interceptors (Closed)
Patch Set: documentation Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/browser/service_worker/service_worker_url_job_wrapper.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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>
11 #include <memory> 11 #include <memory>
12 #include <string> 12 #include <string>
13 #include <vector> 13 #include <vector>
14 14
15 #include "base/macros.h" 15 #include "base/macros.h"
16 #include "base/memory/ref_counted.h" 16 #include "base/memory/ref_counted.h"
17 #include "base/memory/weak_ptr.h" 17 #include "base/memory/weak_ptr.h"
18 #include "base/optional.h" 18 #include "base/optional.h"
19 #include "base/time/time.h" 19 #include "base/time/time.h"
20 #include "content/browser/service_worker/embedded_worker_status.h" 20 #include "content/browser/service_worker/embedded_worker_status.h"
21 #include "content/browser/service_worker/service_worker_metrics.h" 21 #include "content/browser/service_worker/service_worker_metrics.h"
22 #include "content/browser/service_worker/service_worker_response_type.h"
22 #include "content/common/content_export.h" 23 #include "content/common/content_export.h"
23 #include "content/common/service_worker/service_worker_event_dispatcher.mojom.h" 24 #include "content/common/service_worker/service_worker_event_dispatcher.mojom.h"
24 #include "content/common/service_worker/service_worker_status_code.h" 25 #include "content/common/service_worker/service_worker_status_code.h"
25 #include "content/common/service_worker/service_worker_types.h" 26 #include "content/common/service_worker/service_worker_types.h"
26 #include "content/public/common/request_context_frame_type.h" 27 #include "content/public/common/request_context_frame_type.h"
27 #include "content/public/common/request_context_type.h" 28 #include "content/public/common/request_context_type.h"
28 #include "content/public/common/resource_type.h" 29 #include "content/public/common/resource_type.h"
29 #include "mojo/public/cpp/system/data_pipe.h" 30 #include "mojo/public/cpp/system/data_pipe.h"
30 #include "net/http/http_byte_range.h" 31 #include "net/http/http_byte_range.h"
31 #include "net/url_request/url_request.h" 32 #include "net/url_request/url_request.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 virtual void RecordResult(ServiceWorkerMetrics::URLRequestJobResult result); 147 virtual void RecordResult(ServiceWorkerMetrics::URLRequestJobResult result);
147 //---------------------------------------------------------------------------- 148 //----------------------------------------------------------------------------
148 149
149 base::WeakPtr<ServiceWorkerURLRequestJob> GetWeakPtr(); 150 base::WeakPtr<ServiceWorkerURLRequestJob> GetWeakPtr();
150 151
151 private: 152 private:
152 class FileSizeResolver; 153 class FileSizeResolver;
153 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerControlleeRequestHandlerTest, 154 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerControlleeRequestHandlerTest,
154 LostActiveVersion); 155 LostActiveVersion);
155 156
156 enum ResponseType { 157 using ResponseType = ServiceWorkerResponseType;
157 NOT_DETERMINED,
158 FAIL_DUE_TO_LOST_CONTROLLER,
159 FALLBACK_TO_NETWORK,
160 FALLBACK_TO_RENDERER, // Use this when falling back with CORS check
161 FORWARD_TO_SERVICE_WORKER
162 };
163 158
164 enum ResponseBodyType { 159 enum ResponseBodyType {
165 UNKNOWN, 160 UNKNOWN,
166 BLOB, 161 BLOB,
167 STREAM, 162 STREAM,
168 }; 163 };
169 164
170 // We start processing the request if Start() is called AND response_type_ 165 // We start processing the request if Start() is called AND response_type_
171 // is determined. 166 // is determined.
172 void MaybeStartRequest(); 167 void MaybeStartRequest();
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 std::unique_ptr<FileSizeResolver> file_size_resolver_; 328 std::unique_ptr<FileSizeResolver> file_size_resolver_;
334 329
335 base::WeakPtrFactory<ServiceWorkerURLRequestJob> weak_factory_; 330 base::WeakPtrFactory<ServiceWorkerURLRequestJob> weak_factory_;
336 331
337 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerURLRequestJob); 332 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerURLRequestJob);
338 }; 333 };
339 334
340 } // namespace content 335 } // namespace content
341 336
342 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_ 337 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_
OLDNEW
« no previous file with comments | « content/browser/service_worker/service_worker_url_job_wrapper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698