OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "net/websockets/websocket_stream.h" | 5 #include "net/websockets/websocket_stream.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/metrics/sparse_histogram.h" | 10 #include "base/metrics/sparse_histogram.h" |
| 11 #include "base/profiler/scoped_tracker.h" |
11 #include "base/time/time.h" | 12 #include "base/time/time.h" |
12 #include "base/timer/timer.h" | 13 #include "base/timer/timer.h" |
13 #include "net/base/load_flags.h" | 14 #include "net/base/load_flags.h" |
14 #include "net/http/http_request_headers.h" | 15 #include "net/http/http_request_headers.h" |
15 #include "net/http/http_response_headers.h" | 16 #include "net/http/http_response_headers.h" |
16 #include "net/http/http_status_code.h" | 17 #include "net/http/http_status_code.h" |
17 #include "net/url_request/redirect_info.h" | 18 #include "net/url_request/redirect_info.h" |
18 #include "net/url_request/url_request.h" | 19 #include "net/url_request/url_request.h" |
19 #include "net/url_request/url_request_context.h" | 20 #include "net/url_request/url_request_context.h" |
20 #include "net/websockets/websocket_errors.h" | 21 #include "net/websockets/websocket_errors.h" |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 | 216 |
216 void ContinueSSLRequest() override { | 217 void ContinueSSLRequest() override { |
217 url_request_->ContinueDespiteLastError(); | 218 url_request_->ContinueDespiteLastError(); |
218 } | 219 } |
219 | 220 |
220 private: | 221 private: |
221 URLRequest* url_request_; | 222 URLRequest* url_request_; |
222 }; | 223 }; |
223 | 224 |
224 void Delegate::OnResponseStarted(URLRequest* request) { | 225 void Delegate::OnResponseStarted(URLRequest* request) { |
| 226 // TODO(vadimt): Remove ScopedTracker below once crbug.com/423948 is fixed. |
| 227 tracked_objects::ScopedTracker tracking_profile( |
| 228 FROM_HERE_WITH_EXPLICIT_FUNCTION("423948 Delegate::OnResponseStarted")); |
| 229 |
225 // All error codes, including OK and ABORTED, as with | 230 // All error codes, including OK and ABORTED, as with |
226 // Net.ErrorCodesForMainFrame3 | 231 // Net.ErrorCodesForMainFrame3 |
227 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.WebSocket.ErrorCodes", | 232 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.WebSocket.ErrorCodes", |
228 -request->status().error()); | 233 -request->status().error()); |
229 if (!request->status().is_success()) { | 234 if (!request->status().is_success()) { |
230 DVLOG(3) << "OnResponseStarted (request failed)"; | 235 DVLOG(3) << "OnResponseStarted (request failed)"; |
231 owner_->ReportFailure(); | 236 owner_->ReportFailure(); |
232 return; | 237 return; |
233 } | 238 } |
234 const int response_code = request->GetResponseCode(); | 239 const int response_code = request->GetResponseCode(); |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 connect_delegate->OnFinishOpeningHandshake(make_scoped_ptr( | 352 connect_delegate->OnFinishOpeningHandshake(make_scoped_ptr( |
348 new WebSocketHandshakeResponseInfo(url, | 353 new WebSocketHandshakeResponseInfo(url, |
349 headers->response_code(), | 354 headers->response_code(), |
350 headers->GetStatusText(), | 355 headers->GetStatusText(), |
351 headers, | 356 headers, |
352 response_time))); | 357 response_time))); |
353 } | 358 } |
354 } | 359 } |
355 | 360 |
356 } // namespace net | 361 } // namespace net |
OLD | NEW |