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

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

Issue 1834273002: Add TRACE_EVENT macros to net. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and address comments. Created 4 years, 8 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
« no previous file with comments | « net/quic/quic_stream_factory.cc ('k') | net/socket/client_socket_pool_base.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 (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_handle.h" 5 #include "net/socket/client_socket_handle.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/trace_event/trace_event.h"
13 #include "net/base/net_errors.h" 14 #include "net/base/net_errors.h"
14 #include "net/socket/client_socket_pool.h" 15 #include "net/socket/client_socket_pool.h"
15 16
16 namespace net { 17 namespace net {
17 18
18 ClientSocketHandle::ClientSocketHandle() 19 ClientSocketHandle::ClientSocketHandle()
19 : is_initialized_(false), 20 : is_initialized_(false),
20 pool_(NULL), 21 pool_(NULL),
21 higher_pool_(NULL), 22 higher_pool_(NULL),
22 reuse_type_(ClientSocketHandle::UNUSED), 23 reuse_type_(ClientSocketHandle::UNUSED),
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 134
134 load_timing_info->connect_timing = connect_timing_; 135 load_timing_info->connect_timing = connect_timing_;
135 return true; 136 return true;
136 } 137 }
137 138
138 void ClientSocketHandle::SetSocket(scoped_ptr<StreamSocket> s) { 139 void ClientSocketHandle::SetSocket(scoped_ptr<StreamSocket> s) {
139 socket_ = std::move(s); 140 socket_ = std::move(s);
140 } 141 }
141 142
142 void ClientSocketHandle::OnIOComplete(int result) { 143 void ClientSocketHandle::OnIOComplete(int result) {
144 TRACE_EVENT0("net", "ClientSocketHandle::OnIOComplete");
143 CompletionCallback callback = user_callback_; 145 CompletionCallback callback = user_callback_;
144 user_callback_.Reset(); 146 user_callback_.Reset();
145 HandleInitCompletion(result); 147 HandleInitCompletion(result);
146 callback.Run(result); 148 callback.Run(result);
147 } 149 }
148 150
149 scoped_ptr<StreamSocket> ClientSocketHandle::PassSocket() { 151 scoped_ptr<StreamSocket> ClientSocketHandle::PassSocket() {
150 return std::move(socket_); 152 return std::move(socket_);
151 } 153 }
152 154
(...skipping 14 matching lines...) Expand all
167 // TODO(eroman): This logging is not complete, in particular set_socket() and 169 // TODO(eroman): This logging is not complete, in particular set_socket() and
168 // release() socket. It ends up working though, since those methods are being 170 // release() socket. It ends up working though, since those methods are being
169 // used to layer sockets (and the destination sources are the same). 171 // used to layer sockets (and the destination sources are the same).
170 DCHECK(socket_.get()); 172 DCHECK(socket_.get());
171 socket_->NetLog().BeginEvent( 173 socket_->NetLog().BeginEvent(
172 NetLog::TYPE_SOCKET_IN_USE, 174 NetLog::TYPE_SOCKET_IN_USE,
173 requesting_source_.ToEventParametersCallback()); 175 requesting_source_.ToEventParametersCallback());
174 } 176 }
175 177
176 } // namespace net 178 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_stream_factory.cc ('k') | net/socket/client_socket_pool_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698