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

Side by Side Diff: net/socket/tcp_pinger.h

Issue 1696005: Add net log entries that summarize transmit and receive byte counts. (Closed)
Patch Set: More tests and address comments Created 10 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/socket/tcp_client_socket_win.cc ('k') | net/socket_stream/socket_stream.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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #ifndef NET_SOCKET_TCP_PINGER_H_ 5 #ifndef NET_SOCKET_TCP_PINGER_H_
6 #define NET_SOCKET_TCP_PINGER_H_ 6 #define NET_SOCKET_TCP_PINGER_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/dynamic_annotations.h" 9 #include "base/dynamic_annotations.h"
10 #include "base/ref_counted.h" 10 #include "base/ref_counted.h"
11 #include "base/scoped_ptr.h" 11 #include "base/scoped_ptr.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 public: 79 public:
80 explicit Worker(const net::AddressList& addr) 80 explicit Worker(const net::AddressList& addr)
81 : event_(false, false), 81 : event_(false, false),
82 net_error_(ERR_IO_PENDING), 82 net_error_(ERR_IO_PENDING),
83 addr_(addr), 83 addr_(addr),
84 ALLOW_THIS_IN_INITIALIZER_LIST(connect_callback_(this, 84 ALLOW_THIS_IN_INITIALIZER_LIST(connect_callback_(this,
85 &net::TCPPinger::Worker::ConnectDone)) { 85 &net::TCPPinger::Worker::ConnectDone)) {
86 } 86 }
87 87
88 void DoConnect() { 88 void DoConnect() {
89 sock_.reset(new TCPClientSocket(addr_)); 89 sock_.reset(new TCPClientSocket(addr_, NULL));
90 int rv = sock_->Connect(&connect_callback_, NULL); 90 int rv = sock_->Connect(&connect_callback_);
91 // Regardless of success or failure, if we're done now, 91 // Regardless of success or failure, if we're done now,
92 // signal the customer. 92 // signal the customer.
93 if (rv != ERR_IO_PENDING) 93 if (rv != ERR_IO_PENDING)
94 ConnectDone(rv); 94 ConnectDone(rv);
95 } 95 }
96 96
97 void DoDisconnect() { 97 void DoDisconnect() {
98 sock_.reset(); 98 sock_.reset();
99 event_.Signal(); 99 event_.Signal();
100 } 100 }
(...skipping 30 matching lines...) Expand all
131 }; 131 };
132 132
133 base::Thread io_thread_; 133 base::Thread io_thread_;
134 Worker* worker_; 134 Worker* worker_;
135 DISALLOW_COPY_AND_ASSIGN(TCPPinger); 135 DISALLOW_COPY_AND_ASSIGN(TCPPinger);
136 }; 136 };
137 137
138 } // namespace net 138 } // namespace net
139 139
140 #endif // NET_SOCKET_TCP_PINGER_H_ 140 #endif // NET_SOCKET_TCP_PINGER_H_
OLDNEW
« no previous file with comments | « net/socket/tcp_client_socket_win.cc ('k') | net/socket_stream/socket_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698