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

Side by Side Diff: net/socket/client_socket_pool_base.cc

Issue 2533953005: Standardize "net" category trace events (Closed)
Patch Set: self review Created 4 years 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/socket/client_socket_pool_base.h" 5 #include "net/socket/client_socket_pool_base.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/format_macros.h" 11 #include "base/format_macros.h"
12 #include "base/location.h" 12 #include "base/location.h"
13 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "base/metrics/histogram_macros.h" 14 #include "base/metrics/histogram_macros.h"
15 #include "base/single_thread_task_runner.h" 15 #include "base/single_thread_task_runner.h"
16 #include "base/strings/string_util.h" 16 #include "base/strings/string_util.h"
17 #include "base/threading/thread_task_runner_handle.h" 17 #include "base/threading/thread_task_runner_handle.h"
18 #include "base/time/time.h" 18 #include "base/time/time.h"
19 #include "base/trace_event/trace_event.h" 19 #include "base/trace_event/trace_event.h"
20 #include "base/values.h" 20 #include "base/values.h"
21 #include "net/base/net_errors.h" 21 #include "net/base/net_errors.h"
22 #include "net/log/net_log.h" 22 #include "net/log/net_log.h"
23 #include "net/log/net_log_event_type.h" 23 #include "net/log/net_log_event_type.h"
24 #include "net/log/net_log_source.h" 24 #include "net/log/net_log_source.h"
25 #include "net/log/trace_constants.h"
25 26
26 using base::TimeDelta; 27 using base::TimeDelta;
27 28
28 namespace net { 29 namespace net {
29 30
30 namespace { 31 namespace {
31 32
32 // Indicate whether or not we should establish a new transport layer connection 33 // Indicate whether or not we should establish a new transport layer connection
33 // after a certain timeout has passed without receiving an ACK. 34 // after a certain timeout has passed without receiving an ACK.
34 bool g_connect_backup_jobs_enabled = true; 35 bool g_connect_backup_jobs_enabled = true;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 122
122 void ConnectJob::SetSocket(std::unique_ptr<StreamSocket> socket) { 123 void ConnectJob::SetSocket(std::unique_ptr<StreamSocket> socket) {
123 if (socket) { 124 if (socket) {
124 net_log().AddEvent(NetLogEventType::CONNECT_JOB_SET_SOCKET, 125 net_log().AddEvent(NetLogEventType::CONNECT_JOB_SET_SOCKET,
125 socket->NetLog().source().ToEventParametersCallback()); 126 socket->NetLog().source().ToEventParametersCallback());
126 } 127 }
127 socket_ = std::move(socket); 128 socket_ = std::move(socket);
128 } 129 }
129 130
130 void ConnectJob::NotifyDelegateOfCompletion(int rv) { 131 void ConnectJob::NotifyDelegateOfCompletion(int rv) {
131 TRACE_EVENT0("net", "ConnectJob::NotifyDelegateOfCompletion"); 132 TRACE_EVENT0(kNetTracingCategory, "ConnectJob::NotifyDelegateOfCompletion");
132 // The delegate will own |this|. 133 // The delegate will own |this|.
133 Delegate* delegate = delegate_; 134 Delegate* delegate = delegate_;
134 delegate_ = NULL; 135 delegate_ = NULL;
135 136
136 LogConnectCompletion(rv); 137 LogConnectCompletion(rv);
137 delegate->OnConnectJobComplete(rv, this); 138 delegate->OnConnectJobComplete(rv, this);
138 } 139 }
139 140
140 void ConnectJob::ResetTimer(base::TimeDelta remaining_time) { 141 void ConnectJob::ResetTimer(base::TimeDelta remaining_time) {
141 timer_.Stop(); 142 timer_.Stop();
(...skipping 1242 matching lines...) Expand 10 before | Expand all | Expand 10 after
1384 // If there are no more requests, kill the backup timer. 1385 // If there are no more requests, kill the backup timer.
1385 if (pending_requests_.empty()) 1386 if (pending_requests_.empty())
1386 backup_job_timer_.Stop(); 1387 backup_job_timer_.Stop();
1387 request->CrashIfInvalid(); 1388 request->CrashIfInvalid();
1388 return request; 1389 return request;
1389 } 1390 }
1390 1391
1391 } // namespace internal 1392 } // namespace internal
1392 1393
1393 } // namespace net 1394 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698