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

Side by Side Diff: remoting/protocol/fake_session.h

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 | « remoting/jingle_glue/ssl_socket_adapter.cc ('k') | remoting/protocol/fake_session.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) 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 #ifndef REMOTING_PROTOCOL_FAKE_SESSION_H_ 5 #ifndef REMOTING_PROTOCOL_FAKE_SESSION_H_
6 #define REMOTING_PROTOCOL_FAKE_SESSION_H_ 6 #define REMOTING_PROTOCOL_FAKE_SESSION_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 19 matching lines...) Expand all
30 public: 30 public:
31 FakeSocket(); 31 FakeSocket();
32 virtual ~FakeSocket(); 32 virtual ~FakeSocket();
33 33
34 const std::string& written_data() const { return written_data_; } 34 const std::string& written_data() const { return written_data_; }
35 35
36 void AppendInputData(const char* data, int data_size); 36 void AppendInputData(const char* data, int data_size);
37 int input_pos() const { return input_pos_; } 37 int input_pos() const { return input_pos_; }
38 bool read_pending() const { return read_pending_; } 38 bool read_pending() const { return read_pending_; }
39 39
40 // net::Socket interface. 40 // net::Socket implementation.
41 virtual int Read(net::IOBuffer* buf, int buf_len, 41 virtual int Read(net::IOBuffer* buf, int buf_len,
42 net::OldCompletionCallback* callback) OVERRIDE; 42 net::OldCompletionCallback* callback) OVERRIDE;
43 virtual int Write(net::IOBuffer* buf, int buf_len, 43 virtual int Write(net::IOBuffer* buf, int buf_len,
44 net::OldCompletionCallback* callback) OVERRIDE; 44 net::OldCompletionCallback* callback) OVERRIDE;
45 45
46 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; 46 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE;
47 virtual bool SetSendBufferSize(int32 size) OVERRIDE; 47 virtual bool SetSendBufferSize(int32 size) OVERRIDE;
48 48
49 // net::StreamSocket interface. 49 // net::StreamSocket implementation.
50 virtual int Connect(net::OldCompletionCallback* callback) OVERRIDE; 50 virtual int Connect(net::OldCompletionCallback* callback) OVERRIDE;
51 virtual int Connect(const net::CompletionCallback& callback) OVERRIDE;
51 virtual void Disconnect() OVERRIDE; 52 virtual void Disconnect() OVERRIDE;
52 virtual bool IsConnected() const OVERRIDE; 53 virtual bool IsConnected() const OVERRIDE;
53 virtual bool IsConnectedAndIdle() const OVERRIDE; 54 virtual bool IsConnectedAndIdle() const OVERRIDE;
54 virtual int GetPeerAddress(net::AddressList* address) const OVERRIDE; 55 virtual int GetPeerAddress(net::AddressList* address) const OVERRIDE;
55 virtual int GetLocalAddress(net::IPEndPoint* address) const OVERRIDE; 56 virtual int GetLocalAddress(net::IPEndPoint* address) const OVERRIDE;
56 virtual const net::BoundNetLog& NetLog() const OVERRIDE; 57 virtual const net::BoundNetLog& NetLog() const OVERRIDE;
57 virtual void SetSubresourceSpeculation() OVERRIDE; 58 virtual void SetSubresourceSpeculation() OVERRIDE;
58 virtual void SetOmniboxSpeculation() OVERRIDE; 59 virtual void SetOmniboxSpeculation() OVERRIDE;
59 virtual bool WasEverUsed() const OVERRIDE; 60 virtual bool WasEverUsed() const OVERRIDE;
60 virtual bool UsingTCPFastOpen() const OVERRIDE; 61 virtual bool UsingTCPFastOpen() const OVERRIDE;
(...skipping 25 matching lines...) Expand all
86 FakeUdpSocket(); 87 FakeUdpSocket();
87 virtual ~FakeUdpSocket(); 88 virtual ~FakeUdpSocket();
88 89
89 const std::vector<std::string>& written_packets() const { 90 const std::vector<std::string>& written_packets() const {
90 return written_packets_; 91 return written_packets_;
91 } 92 }
92 93
93 void AppendInputPacket(const char* data, int data_size); 94 void AppendInputPacket(const char* data, int data_size);
94 int input_pos() const { return input_pos_; } 95 int input_pos() const { return input_pos_; }
95 96
96 // net::Socket interface. 97 // net::Socket implementation.
97 virtual int Read(net::IOBuffer* buf, int buf_len, 98 virtual int Read(net::IOBuffer* buf, int buf_len,
98 net::OldCompletionCallback* callback) OVERRIDE; 99 net::OldCompletionCallback* callback) OVERRIDE;
99 virtual int Write(net::IOBuffer* buf, int buf_len, 100 virtual int Write(net::IOBuffer* buf, int buf_len,
100 net::OldCompletionCallback* callback) OVERRIDE; 101 net::OldCompletionCallback* callback) OVERRIDE;
101 102
102 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; 103 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE;
103 virtual bool SetSendBufferSize(int32 size) OVERRIDE; 104 virtual bool SetSendBufferSize(int32 size) OVERRIDE;
104 105
105 private: 106 private:
106 bool read_pending_; 107 bool read_pending_;
(...skipping 23 matching lines...) Expand all
130 message_loop_ = message_loop; 131 message_loop_ = message_loop;
131 } 132 }
132 133
133 void set_error(Session::Error error) { error_ = error; } 134 void set_error(Session::Error error) { error_ = error; }
134 135
135 bool is_closed() const { return closed_; } 136 bool is_closed() const { return closed_; }
136 137
137 FakeSocket* GetStreamChannel(const std::string& name); 138 FakeSocket* GetStreamChannel(const std::string& name);
138 FakeUdpSocket* GetDatagramChannel(const std::string& name); 139 FakeUdpSocket* GetDatagramChannel(const std::string& name);
139 140
140 // Session interface. 141 // Session implementation.
141 virtual void SetStateChangeCallback( 142 virtual void SetStateChangeCallback(
142 const StateChangeCallback& callback) OVERRIDE; 143 const StateChangeCallback& callback) OVERRIDE;
143 144
144 virtual Session::Error error() OVERRIDE; 145 virtual Session::Error error() OVERRIDE;
145 146
146 virtual void CreateStreamChannel( 147 virtual void CreateStreamChannel(
147 const std::string& name, const StreamChannelCallback& callback) OVERRIDE; 148 const std::string& name, const StreamChannelCallback& callback) OVERRIDE;
148 virtual void CreateDatagramChannel( 149 virtual void CreateDatagramChannel(
149 const std::string& name, 150 const std::string& name,
150 const DatagramChannelCallback& callback) OVERRIDE; 151 const DatagramChannelCallback& callback) OVERRIDE;
(...skipping 21 matching lines...) Expand all
172 Session::Error error_; 173 Session::Error error_;
173 bool closed_; 174 bool closed_;
174 175
175 DISALLOW_COPY_AND_ASSIGN(FakeSession); 176 DISALLOW_COPY_AND_ASSIGN(FakeSession);
176 }; 177 };
177 178
178 } // namespace protocol 179 } // namespace protocol
179 } // namespace remoting 180 } // namespace remoting
180 181
181 #endif // REMOTING_PROTOCOL_FAKE_SESSION_H_ 182 #endif // REMOTING_PROTOCOL_FAKE_SESSION_H_
OLDNEW
« no previous file with comments | « remoting/jingle_glue/ssl_socket_adapter.cc ('k') | remoting/protocol/fake_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698