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

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

Issue 11419224: Add missing (and remove superfluous) 'explicit' from constructors. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + remove non-straightforward changes Created 7 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « net/socket/client_socket_pool_histograms.h ('k') | net/spdy/spdy_session_spdy2_unittest.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/transport_client_socket_pool.h" 5 #include "net/socket/transport_client_socket_pool.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 29 matching lines...) Expand all
40 } 40 }
41 41
42 void SetIPv6Address(IPEndPoint* address) { 42 void SetIPv6Address(IPEndPoint* address) {
43 IPAddressNumber number; 43 IPAddressNumber number;
44 CHECK(ParseIPLiteralToNumber("1:abcd::3:4:ff", &number)); 44 CHECK(ParseIPLiteralToNumber("1:abcd::3:4:ff", &number));
45 *address = IPEndPoint(number, 80); 45 *address = IPEndPoint(number, 80);
46 } 46 }
47 47
48 class MockClientSocket : public StreamSocket { 48 class MockClientSocket : public StreamSocket {
49 public: 49 public:
50 MockClientSocket(const AddressList& addrlist) 50 explicit MockClientSocket(const AddressList& addrlist)
51 : connected_(false), 51 : connected_(false),
52 addrlist_(addrlist) {} 52 addrlist_(addrlist) {}
53 53
54 // StreamSocket implementation. 54 // StreamSocket implementation.
55 virtual int Connect(const CompletionCallback& callback) { 55 virtual int Connect(const CompletionCallback& callback) {
56 connected_ = true; 56 connected_ = true;
57 return OK; 57 return OK;
58 } 58 }
59 virtual void Disconnect() { 59 virtual void Disconnect() {
60 connected_ = false; 60 connected_ = false;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 virtual bool SetSendBufferSize(int32 size) { return true; } 112 virtual bool SetSendBufferSize(int32 size) { return true; }
113 113
114 private: 114 private:
115 bool connected_; 115 bool connected_;
116 const AddressList addrlist_; 116 const AddressList addrlist_;
117 BoundNetLog net_log_; 117 BoundNetLog net_log_;
118 }; 118 };
119 119
120 class MockFailingClientSocket : public StreamSocket { 120 class MockFailingClientSocket : public StreamSocket {
121 public: 121 public:
122 MockFailingClientSocket(const AddressList& addrlist) : addrlist_(addrlist) {} 122 explicit MockFailingClientSocket(const AddressList& addrlist)
123 : addrlist_(addrlist) {}
123 124
124 // StreamSocket implementation. 125 // StreamSocket implementation.
125 virtual int Connect(const CompletionCallback& callback) { 126 virtual int Connect(const CompletionCallback& callback) {
126 return ERR_CONNECTION_FAILED; 127 return ERR_CONNECTION_FAILED;
127 } 128 }
128 129
129 virtual void Disconnect() {} 130 virtual void Disconnect() {}
130 131
131 virtual bool IsConnected() const { 132 virtual bool IsConnected() const {
132 return false; 133 return false;
(...skipping 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after
1274 EXPECT_TRUE(handle.socket()); 1275 EXPECT_TRUE(handle.socket());
1275 IPEndPoint endpoint; 1276 IPEndPoint endpoint;
1276 handle.socket()->GetLocalAddress(&endpoint); 1277 handle.socket()->GetLocalAddress(&endpoint);
1277 EXPECT_EQ(kIPv4AddressSize, endpoint.address().size()); 1278 EXPECT_EQ(kIPv4AddressSize, endpoint.address().size());
1278 EXPECT_EQ(1, client_socket_factory_.allocation_count()); 1279 EXPECT_EQ(1, client_socket_factory_.allocation_count());
1279 } 1280 }
1280 1281
1281 } // namespace 1282 } // namespace
1282 1283
1283 } // namespace net 1284 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/client_socket_pool_histograms.h ('k') | net/spdy/spdy_session_spdy2_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698