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

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

Issue 2292833002: Refactoring: service worker: Factor out some duplicated code. (Closed)
Patch Set: Created 4 years, 3 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
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 <string> 12 #include <string>
12 13
13 #include "base/macros.h" 14 #include "base/macros.h"
14 #include "base/memory/ref_counted.h" 15 #include "base/memory/ref_counted.h"
15 #include "base/memory/weak_ptr.h" 16 #include "base/memory/weak_ptr.h"
16 #include "base/time/time.h" 17 #include "base/time/time.h"
17 #include "content/browser/service_worker/embedded_worker_status.h" 18 #include "content/browser/service_worker/embedded_worker_status.h"
18 #include "content/browser/service_worker/service_worker_metrics.h" 19 #include "content/browser/service_worker/service_worker_metrics.h"
19 #include "content/browser/streams/stream_read_observer.h" 20 #include "content/browser/streams/stream_read_observer.h"
20 #include "content/browser/streams/stream_register_observer.h" 21 #include "content/browser/streams/stream_register_observer.h"
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 // This must not be called until all blobs in |body_| finished construction. 189 // This must not be called until all blobs in |body_| finished construction.
189 void CreateRequestBodyBlob(std::string* blob_uuid, uint64_t* blob_size); 190 void CreateRequestBodyBlob(std::string* blob_uuid, uint64_t* blob_size);
190 191
191 // For FORWARD_TO_SERVICE_WORKER case. 192 // For FORWARD_TO_SERVICE_WORKER case.
192 void DidPrepareFetchEvent(scoped_refptr<ServiceWorkerVersion> version); 193 void DidPrepareFetchEvent(scoped_refptr<ServiceWorkerVersion> version);
193 void DidDispatchFetchEvent( 194 void DidDispatchFetchEvent(
194 ServiceWorkerStatusCode status, 195 ServiceWorkerStatusCode status,
195 ServiceWorkerFetchEventResult fetch_result, 196 ServiceWorkerFetchEventResult fetch_result,
196 const ServiceWorkerResponse& response, 197 const ServiceWorkerResponse& response,
197 const scoped_refptr<ServiceWorkerVersion>& version); 198 const scoped_refptr<ServiceWorkerVersion>& version);
199 void SetResponse(const ServiceWorkerResponse& response);
198 200
199 // Populates |http_response_headers_|. 201 // Populates |http_response_headers_|.
200 void CreateResponseHeader(int status_code, 202 void CreateResponseHeader(int status_code,
201 const std::string& status_text, 203 const std::string& status_text,
202 const ServiceWorkerHeaderMap& headers); 204 const ServiceWorkerHeaderMap& headers);
203 205
204 // Creates |http_response_info_| using |http_response_headers_| and calls 206 // Creates |http_response_info_| using |http_response_headers_| and calls
205 // NotifyHeadersComplete. 207 // NotifyHeadersComplete.
206 void CommitResponseHeader(); 208 void CommitResponseHeader();
207 209
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 EmbeddedWorkerStatus initial_worker_status_ = EmbeddedWorkerStatus::STOPPED; 309 EmbeddedWorkerStatus initial_worker_status_ = EmbeddedWorkerStatus::STOPPED;
308 310
309 base::WeakPtrFactory<ServiceWorkerURLRequestJob> weak_factory_; 311 base::WeakPtrFactory<ServiceWorkerURLRequestJob> weak_factory_;
310 312
311 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerURLRequestJob); 313 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerURLRequestJob);
312 }; 314 };
313 315
314 } // namespace content 316 } // namespace content
315 317
316 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_ 318 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698