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

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

Issue 1795863006: service worker: Attribute purpose to start worker attempts for UMA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: patch for landing? Created 4 years, 9 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>
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 96
97 ServiceWorkerURLRequestJob( 97 ServiceWorkerURLRequestJob(
98 net::URLRequest* request, 98 net::URLRequest* request,
99 net::NetworkDelegate* network_delegate, 99 net::NetworkDelegate* network_delegate,
100 const std::string& client_id, 100 const std::string& client_id,
101 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, 101 base::WeakPtr<storage::BlobStorageContext> blob_storage_context,
102 const ResourceContext* resource_context, 102 const ResourceContext* resource_context,
103 FetchRequestMode request_mode, 103 FetchRequestMode request_mode,
104 FetchCredentialsMode credentials_mode, 104 FetchCredentialsMode credentials_mode,
105 FetchRedirectMode redirect_mode, 105 FetchRedirectMode redirect_mode,
106 bool is_main_resource_load, 106 ResourceType resource_type,
107 RequestContextType request_context_type, 107 RequestContextType request_context_type,
108 RequestContextFrameType frame_type, 108 RequestContextFrameType frame_type,
109 scoped_refptr<ResourceRequestBody> body, 109 scoped_refptr<ResourceRequestBody> body,
110 ServiceWorkerFetchType fetch_type, 110 ServiceWorkerFetchType fetch_type,
111 Delegate* delegate); 111 Delegate* delegate);
112 112
113 ~ServiceWorkerURLRequestJob() override; 113 ~ServiceWorkerURLRequestJob() override;
114 114
115 // Sets the response type. 115 // Sets the response type.
116 void FallbackToNetwork(); 116 void FallbackToNetwork();
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 220
221 // Invoke callbacks before invoking corresponding URLRequestJob methods. 221 // Invoke callbacks before invoking corresponding URLRequestJob methods.
222 void NotifyHeadersComplete(); 222 void NotifyHeadersComplete();
223 void NotifyStartError(net::URLRequestStatus status); 223 void NotifyStartError(net::URLRequestStatus status);
224 void NotifyRestartRequired(); 224 void NotifyRestartRequired();
225 225
226 // Wrapper that gathers parameters to |on_start_completed_callback_| and then 226 // Wrapper that gathers parameters to |on_start_completed_callback_| and then
227 // calls it. 227 // calls it.
228 void OnStartCompleted() const; 228 void OnStartCompleted() const;
229 229
230 bool IsMainResourceLoad() const;
231
230 // Not owned. 232 // Not owned.
231 Delegate* delegate_; 233 Delegate* delegate_;
232 234
233 // Timing info to show on the popup in Devtools' Network tab. 235 // Timing info to show on the popup in Devtools' Network tab.
234 net::LoadTimingInfo load_timing_info_; 236 net::LoadTimingInfo load_timing_info_;
235 base::TimeTicks worker_start_time_; 237 base::TimeTicks worker_start_time_;
236 base::TimeTicks worker_ready_time_; 238 base::TimeTicks worker_ready_time_;
237 base::Time response_time_; 239 base::Time response_time_;
238 240
239 ResponseType response_type_; 241 ResponseType response_type_;
(...skipping 14 matching lines...) Expand all
254 const ResourceContext* resource_context_; 256 const ResourceContext* resource_context_;
255 scoped_ptr<net::URLRequest> blob_request_; 257 scoped_ptr<net::URLRequest> blob_request_;
256 scoped_refptr<Stream> stream_; 258 scoped_refptr<Stream> stream_;
257 GURL waiting_stream_url_; 259 GURL waiting_stream_url_;
258 scoped_refptr<net::IOBuffer> stream_pending_buffer_; 260 scoped_refptr<net::IOBuffer> stream_pending_buffer_;
259 int stream_pending_buffer_size_; 261 int stream_pending_buffer_size_;
260 262
261 FetchRequestMode request_mode_; 263 FetchRequestMode request_mode_;
262 FetchCredentialsMode credentials_mode_; 264 FetchCredentialsMode credentials_mode_;
263 FetchRedirectMode redirect_mode_; 265 FetchRedirectMode redirect_mode_;
264 const bool is_main_resource_load_; 266 const ResourceType resource_type_;
265 RequestContextType request_context_type_; 267 RequestContextType request_context_type_;
266 RequestContextFrameType frame_type_; 268 RequestContextFrameType frame_type_;
267 bool fall_back_required_; 269 bool fall_back_required_;
268 // ResourceRequestBody has a collection of BlobDataHandles attached to it 270 // ResourceRequestBody has a collection of BlobDataHandles attached to it
269 // using the userdata mechanism. So we have to keep it not to free the blobs. 271 // using the userdata mechanism. So we have to keep it not to free the blobs.
270 scoped_refptr<ResourceRequestBody> body_; 272 scoped_refptr<ResourceRequestBody> body_;
271 scoped_ptr<storage::BlobDataHandle> request_body_blob_data_handle_; 273 scoped_ptr<storage::BlobDataHandle> request_body_blob_data_handle_;
272 scoped_refptr<ServiceWorkerVersion> streaming_version_; 274 scoped_refptr<ServiceWorkerVersion> streaming_version_;
273 ServiceWorkerFetchType fetch_type_; 275 ServiceWorkerFetchType fetch_type_;
274 276
275 ResponseBodyType response_body_type_ = UNKNOWN; 277 ResponseBodyType response_body_type_ = UNKNOWN;
276 bool did_record_result_ = false; 278 bool did_record_result_ = false;
277 279
278 base::WeakPtrFactory<ServiceWorkerURLRequestJob> weak_factory_; 280 base::WeakPtrFactory<ServiceWorkerURLRequestJob> weak_factory_;
279 281
280 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerURLRequestJob); 282 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerURLRequestJob);
281 }; 283 };
282 284
283 } // namespace content 285 } // namespace content
284 286
285 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_ 287 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698