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

Side by Side Diff: net/websockets/websocket_stream.cc

Issue 732633002: Adding instrumentation to locate the source of jankiness. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mmenke@ comments Created 6 years, 1 month 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 | « net/url_request/url_fetcher_core.cc ('k') | storage/browser/fileapi/file_writer_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « net/url_request/url_fetcher_core.cc ('k') | storage/browser/fileapi/file_writer_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698