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

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

Issue 8801004: base::Bind: Convert StreamSocket::Connect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fixes Created 9 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 | Annotate | Revision Log
« no previous file with comments | « net/http/http_proxy_client_socket.cc ('k') | net/socket/socket_test_util.h » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/callback.h" 7 #include "base/callback.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_vector.h" 10 #include "base/memory/scoped_vector.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 } 57 }
58 58
59 virtual int Write( 59 virtual int Write(
60 IOBuffer* /* buf */, int len, OldCompletionCallback* /* callback */) { 60 IOBuffer* /* buf */, int len, OldCompletionCallback* /* callback */) {
61 was_used_to_convey_data_ = true; 61 was_used_to_convey_data_ = true;
62 return len; 62 return len;
63 } 63 }
64 virtual bool SetReceiveBufferSize(int32 size) { return true; } 64 virtual bool SetReceiveBufferSize(int32 size) { return true; }
65 virtual bool SetSendBufferSize(int32 size) { return true; } 65 virtual bool SetSendBufferSize(int32 size) { return true; }
66 66
67 // StreamSocket methods: 67 // StreamSocket implementation.
68
69 virtual int Connect(OldCompletionCallback* callback) { 68 virtual int Connect(OldCompletionCallback* callback) {
70 connected_ = true; 69 connected_ = true;
71 return OK; 70 return OK;
72 } 71 }
72 virtual int Connect(const net::CompletionCallback& callback) {
73 connected_ = true;
74 return OK;
75 }
73 76
74 virtual void Disconnect() { connected_ = false; } 77 virtual void Disconnect() { connected_ = false; }
75 virtual bool IsConnected() const { return connected_; } 78 virtual bool IsConnected() const { return connected_; }
76 virtual bool IsConnectedAndIdle() const { return connected_; } 79 virtual bool IsConnectedAndIdle() const { return connected_; }
77 80
78 virtual int GetPeerAddress(AddressList* /* address */) const { 81 virtual int GetPeerAddress(AddressList* /* address */) const {
79 return ERR_UNEXPECTED; 82 return ERR_UNEXPECTED;
80 } 83 }
81 84
82 virtual int GetLocalAddress(IPEndPoint* /* address */) const { 85 virtual int GetLocalAddress(IPEndPoint* /* address */) const {
(...skipping 3265 matching lines...) Expand 10 before | Expand all | Expand 10 after
3348 // The hung connect job should still be there, but everything else should be 3351 // The hung connect job should still be there, but everything else should be
3349 // complete. 3352 // complete.
3350 EXPECT_EQ(1, pool_->NumConnectJobsInGroup("a")); 3353 EXPECT_EQ(1, pool_->NumConnectJobsInGroup("a"));
3351 EXPECT_EQ(0, pool_->IdleSocketCountInGroup("a")); 3354 EXPECT_EQ(0, pool_->IdleSocketCountInGroup("a"));
3352 EXPECT_EQ(1, pool_->NumActiveSocketsInGroup("a")); 3355 EXPECT_EQ(1, pool_->NumActiveSocketsInGroup("a"));
3353 } 3356 }
3354 3357
3355 } // namespace 3358 } // namespace
3356 3359
3357 } // namespace net 3360 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_proxy_client_socket.cc ('k') | net/socket/socket_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698