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

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

Issue 515753003: Add ServiceWorker timing information on the popup panel in DevTools's Network tab (2/2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporate the review Created 6 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 <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 return response_type_ == FORWARD_TO_SERVICE_WORKER; 50 return response_type_ == FORWARD_TO_SERVICE_WORKER;
51 } 51 }
52 52
53 // net::URLRequestJob overrides: 53 // net::URLRequestJob overrides:
54 virtual void Start() OVERRIDE; 54 virtual void Start() OVERRIDE;
55 virtual void Kill() OVERRIDE; 55 virtual void Kill() OVERRIDE;
56 virtual net::LoadState GetLoadState() const OVERRIDE; 56 virtual net::LoadState GetLoadState() const OVERRIDE;
57 virtual bool GetCharset(std::string* charset) OVERRIDE; 57 virtual bool GetCharset(std::string* charset) OVERRIDE;
58 virtual bool GetMimeType(std::string* mime_type) const OVERRIDE; 58 virtual bool GetMimeType(std::string* mime_type) const OVERRIDE;
59 virtual void GetResponseInfo(net::HttpResponseInfo* info) OVERRIDE; 59 virtual void GetResponseInfo(net::HttpResponseInfo* info) OVERRIDE;
60 virtual void GetLoadTimingInfo(net::LoadTimingInfo* load_timing_info)
61 const OVERRIDE;
mmenke 2014/09/02 19:10:43 nit: 4 space indent.
mmenke 2014/09/02 19:10:43 nit: Close parentheses and const/OVERRIDE should
shimazu 2014/09/04 03:32:41 Done.
60 virtual int GetResponseCode() const OVERRIDE; 62 virtual int GetResponseCode() const OVERRIDE;
61 virtual void SetExtraRequestHeaders( 63 virtual void SetExtraRequestHeaders(
62 const net::HttpRequestHeaders& headers) OVERRIDE; 64 const net::HttpRequestHeaders& headers) OVERRIDE;
63 virtual bool ReadRawData(net::IOBuffer* buf, 65 virtual bool ReadRawData(net::IOBuffer* buf,
64 int buf_size, 66 int buf_size,
65 int *bytes_read) OVERRIDE; 67 int *bytes_read) OVERRIDE;
66 68
67 // net::URLRequest::Delegate overrides that read the blob from the 69 // net::URLRequest::Delegate overrides that read the blob from the
68 // ServiceWorkerFetchResponse. 70 // ServiceWorkerFetchResponse.
69 virtual void OnReceivedRedirect(net::URLRequest* request, 71 virtual void OnReceivedRedirect(net::URLRequest* request,
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 126
125 // Creates |http_response_info_| using |http_response_headers_| and calls 127 // Creates |http_response_info_| using |http_response_headers_| and calls
126 // NotifyHeadersComplete. 128 // NotifyHeadersComplete.
127 void CommitResponseHeader(); 129 void CommitResponseHeader();
128 130
129 // Creates and commits a response header indicating error. 131 // Creates and commits a response header indicating error.
130 void DeliverErrorResponse(); 132 void DeliverErrorResponse();
131 133
132 base::WeakPtr<ServiceWorkerProviderHost> provider_host_; 134 base::WeakPtr<ServiceWorkerProviderHost> provider_host_;
133 135
136 net::LoadTimingInfo load_timing_info_;
137 base::Time response_time_;
134 ResponseType response_type_; 138 ResponseType response_type_;
135 bool is_started_; 139 bool is_started_;
136 140
137 net::HttpByteRange byte_range_; 141 net::HttpByteRange byte_range_;
138 scoped_ptr<net::HttpResponseInfo> range_response_info_; 142 scoped_ptr<net::HttpResponseInfo> range_response_info_;
139 scoped_ptr<net::HttpResponseInfo> http_response_info_; 143 scoped_ptr<net::HttpResponseInfo> http_response_info_;
140 // Headers that have not yet been committed to |http_response_info_|. 144 // Headers that have not yet been committed to |http_response_info_|.
141 scoped_refptr<net::HttpResponseHeaders> http_response_headers_; 145 scoped_refptr<net::HttpResponseHeaders> http_response_headers_;
142 GURL response_url_; 146 GURL response_url_;
143 147
144 // Used when response type is FORWARD_TO_SERVICE_WORKER. 148 // Used when response type is FORWARD_TO_SERVICE_WORKER.
145 scoped_ptr<ServiceWorkerFetchDispatcher> fetch_dispatcher_; 149 scoped_ptr<ServiceWorkerFetchDispatcher> fetch_dispatcher_;
146 base::WeakPtr<storage::BlobStorageContext> blob_storage_context_; 150 base::WeakPtr<storage::BlobStorageContext> blob_storage_context_;
147 scoped_ptr<net::URLRequest> blob_request_; 151 scoped_ptr<net::URLRequest> blob_request_;
148 // ResourceRequestBody has a collection of BlobDataHandles attached to it 152 // ResourceRequestBody has a collection of BlobDataHandles attached to it
149 // using the userdata mechanism. So we have to keep it not to free the blobs. 153 // using the userdata mechanism. So we have to keep it not to free the blobs.
150 scoped_refptr<ResourceRequestBody> body_; 154 scoped_refptr<ResourceRequestBody> body_;
151 scoped_ptr<storage::BlobDataHandle> request_body_blob_data_handle_; 155 scoped_ptr<storage::BlobDataHandle> request_body_blob_data_handle_;
152 156
153 base::WeakPtrFactory<ServiceWorkerURLRequestJob> weak_factory_; 157 base::WeakPtrFactory<ServiceWorkerURLRequestJob> weak_factory_;
154 158
155 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerURLRequestJob); 159 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerURLRequestJob);
156 }; 160 };
157 161
158 } // namespace content 162 } // namespace content
159 163
160 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_ 164 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698