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

Side by Side Diff: net/socket/websocket_transport_client_socket_pool.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 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 #include "net/socket/websocket_transport_client_socket_pool.h" 5 #include "net/socket/websocket_transport_client_socket_pool.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/location.h" 11 #include "base/location.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/numerics/safe_conversions.h" 13 #include "base/numerics/safe_conversions.h"
14 #include "base/single_thread_task_runner.h" 14 #include "base/single_thread_task_runner.h"
15 #include "base/strings/string_util.h" 15 #include "base/strings/string_util.h"
16 #include "base/threading/thread_task_runner_handle.h" 16 #include "base/threading/thread_task_runner_handle.h"
17 #include "base/time/time.h" 17 #include "base/time/time.h"
18 #include "base/trace_event/trace_event.h" 18 #include "base/trace_event/trace_event.h"
19 #include "base/values.h" 19 #include "base/values.h"
20 #include "net/base/net_errors.h" 20 #include "net/base/net_errors.h"
21 #include "net/log/net_log_event_type.h" 21 #include "net/log/net_log_event_type.h"
22 #include "net/log/net_log_source.h" 22 #include "net/log/net_log_source.h"
23 #include "net/log/net_log_source_type.h" 23 #include "net/log/net_log_source_type.h"
24 #include "net/log/trace_constants.h"
24 #include "net/socket/client_socket_handle.h" 25 #include "net/socket/client_socket_handle.h"
25 #include "net/socket/client_socket_pool_base.h" 26 #include "net/socket/client_socket_pool_base.h"
26 #include "net/socket/websocket_endpoint_lock_manager.h" 27 #include "net/socket/websocket_endpoint_lock_manager.h"
27 #include "net/socket/websocket_transport_connect_sub_job.h" 28 #include "net/socket/websocket_transport_connect_sub_job.h"
28 29
29 namespace net { 30 namespace net {
30 31
31 WebSocketTransportConnectJob::WebSocketTransportConnectJob( 32 WebSocketTransportConnectJob::WebSocketTransportConnectJob(
32 const std::string& group_name, 33 const std::string& group_name,
33 RequestPriority priority, 34 RequestPriority priority,
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 connect_timing_.dns_start = base::TimeTicks::Now(); 117 connect_timing_.dns_start = base::TimeTicks::Now();
117 118
118 return resolver_->Resolve( 119 return resolver_->Resolve(
119 params_->destination(), priority(), &addresses_, 120 params_->destination(), priority(), &addresses_,
120 base::Bind(&WebSocketTransportConnectJob::OnIOComplete, 121 base::Bind(&WebSocketTransportConnectJob::OnIOComplete,
121 base::Unretained(this)), 122 base::Unretained(this)),
122 &request_, net_log()); 123 &request_, net_log());
123 } 124 }
124 125
125 int WebSocketTransportConnectJob::DoResolveHostComplete(int result) { 126 int WebSocketTransportConnectJob::DoResolveHostComplete(int result) {
126 TRACE_EVENT0("net", "WebSocketTransportConnectJob::DoResolveHostComplete"); 127 TRACE_EVENT0(kNetTracingCategory,
128 "WebSocketTransportConnectJob::DoResolveHostComplete");
127 connect_timing_.dns_end = base::TimeTicks::Now(); 129 connect_timing_.dns_end = base::TimeTicks::Now();
128 // Overwrite connection start time, since for connections that do not go 130 // Overwrite connection start time, since for connections that do not go
129 // through proxies, |connect_start| should not include dns lookup time. 131 // through proxies, |connect_start| should not include dns lookup time.
130 connect_timing_.connect_start = connect_timing_.dns_end; 132 connect_timing_.connect_start = connect_timing_.dns_end;
131 133
132 if (result != OK) 134 if (result != OK)
133 return result; 135 return result;
134 136
135 // Invoke callback, and abort if it fails. 137 // Invoke callback, and abort if it fails.
136 if (!params_->host_resolution_callback().is_null()) { 138 if (!params_->host_resolution_callback().is_null()) {
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 handle(handle), 696 handle(handle),
695 callback(callback), 697 callback(callback),
696 net_log(net_log) {} 698 net_log(net_log) {}
697 699
698 WebSocketTransportClientSocketPool::StalledRequest::StalledRequest( 700 WebSocketTransportClientSocketPool::StalledRequest::StalledRequest(
699 const StalledRequest& other) = default; 701 const StalledRequest& other) = default;
700 702
701 WebSocketTransportClientSocketPool::StalledRequest::~StalledRequest() {} 703 WebSocketTransportClientSocketPool::StalledRequest::~StalledRequest() {}
702 704
703 } // namespace net 705 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698