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

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

Issue 8831001: base::Bind: Convert Socket::Write. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix alignment. 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/protocol/fake_session.h ('k') | remoting/protocol/pepper_transport_socket_adapter.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 "remoting/protocol/fake_session.h" 5 #include "remoting/protocol/fake_session.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "net/base/io_buffer.h" 8 #include "net/base/io_buffer.h"
9 #include "net/base/net_errors.h" 9 #include "net/base/net_errors.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 } 79 }
80 } 80 }
81 81
82 int FakeSocket::Write(net::IOBuffer* buf, int buf_len, 82 int FakeSocket::Write(net::IOBuffer* buf, int buf_len,
83 net::OldCompletionCallback* callback) { 83 net::OldCompletionCallback* callback) {
84 EXPECT_EQ(message_loop_, MessageLoop::current()); 84 EXPECT_EQ(message_loop_, MessageLoop::current());
85 written_data_.insert(written_data_.end(), 85 written_data_.insert(written_data_.end(),
86 buf->data(), buf->data() + buf_len); 86 buf->data(), buf->data() + buf_len);
87 return buf_len; 87 return buf_len;
88 } 88 }
89 int FakeSocket::Write(net::IOBuffer* buf, int buf_len,
90 const net::CompletionCallback& callback) {
91 EXPECT_EQ(message_loop_, MessageLoop::current());
92 written_data_.insert(written_data_.end(),
93 buf->data(), buf->data() + buf_len);
94 return buf_len;
95 }
89 96
90 bool FakeSocket::SetReceiveBufferSize(int32 size) { 97 bool FakeSocket::SetReceiveBufferSize(int32 size) {
91 NOTIMPLEMENTED(); 98 NOTIMPLEMENTED();
92 return false; 99 return false;
93 } 100 }
94 bool FakeSocket::SetSendBufferSize(int32 size) { 101 bool FakeSocket::SetSendBufferSize(int32 size) {
95 NOTIMPLEMENTED(); 102 NOTIMPLEMENTED();
96 return false; 103 return false;
97 } 104 }
98 105
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 } 236 }
230 } 237 }
231 238
232 int FakeUdpSocket::Write(net::IOBuffer* buf, int buf_len, 239 int FakeUdpSocket::Write(net::IOBuffer* buf, int buf_len,
233 net::OldCompletionCallback* callback) { 240 net::OldCompletionCallback* callback) {
234 EXPECT_EQ(message_loop_, MessageLoop::current()); 241 EXPECT_EQ(message_loop_, MessageLoop::current());
235 written_packets_.push_back(std::string()); 242 written_packets_.push_back(std::string());
236 written_packets_.back().assign(buf->data(), buf->data() + buf_len); 243 written_packets_.back().assign(buf->data(), buf->data() + buf_len);
237 return buf_len; 244 return buf_len;
238 } 245 }
246 int FakeUdpSocket::Write(net::IOBuffer* buf, int buf_len,
247 const net::CompletionCallback& callback) {
248 EXPECT_EQ(message_loop_, MessageLoop::current());
249 written_packets_.push_back(std::string());
250 written_packets_.back().assign(buf->data(), buf->data() + buf_len);
251 return buf_len;
252 }
239 253
240 bool FakeUdpSocket::SetReceiveBufferSize(int32 size) { 254 bool FakeUdpSocket::SetReceiveBufferSize(int32 size) {
241 NOTIMPLEMENTED(); 255 NOTIMPLEMENTED();
242 return false; 256 return false;
243 } 257 }
244 bool FakeUdpSocket::SetSendBufferSize(int32 size) { 258 bool FakeUdpSocket::SetSendBufferSize(int32 size) {
245 NOTIMPLEMENTED(); 259 NOTIMPLEMENTED();
246 return false; 260 return false;
247 } 261 }
248 262
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 void FakeSession::set_config(const SessionConfig& config) { 319 void FakeSession::set_config(const SessionConfig& config) {
306 config_ = config; 320 config_ = config;
307 } 321 }
308 322
309 void FakeSession::Close() { 323 void FakeSession::Close() {
310 closed_ = true; 324 closed_ = true;
311 } 325 }
312 326
313 } // namespace protocol 327 } // namespace protocol
314 } // namespace remoting 328 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/fake_session.h ('k') | remoting/protocol/pepper_transport_socket_adapter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698