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

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

Issue 8889036: Revert 113699 - base::Bind: Convert Socket::Write. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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 }
96 89
97 bool FakeSocket::SetReceiveBufferSize(int32 size) { 90 bool FakeSocket::SetReceiveBufferSize(int32 size) {
98 NOTIMPLEMENTED(); 91 NOTIMPLEMENTED();
99 return false; 92 return false;
100 } 93 }
101 bool FakeSocket::SetSendBufferSize(int32 size) { 94 bool FakeSocket::SetSendBufferSize(int32 size) {
102 NOTIMPLEMENTED(); 95 NOTIMPLEMENTED();
103 return false; 96 return false;
104 } 97 }
105 98
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 } 229 }
237 } 230 }
238 231
239 int FakeUdpSocket::Write(net::IOBuffer* buf, int buf_len, 232 int FakeUdpSocket::Write(net::IOBuffer* buf, int buf_len,
240 net::OldCompletionCallback* callback) { 233 net::OldCompletionCallback* callback) {
241 EXPECT_EQ(message_loop_, MessageLoop::current()); 234 EXPECT_EQ(message_loop_, MessageLoop::current());
242 written_packets_.push_back(std::string()); 235 written_packets_.push_back(std::string());
243 written_packets_.back().assign(buf->data(), buf->data() + buf_len); 236 written_packets_.back().assign(buf->data(), buf->data() + buf_len);
244 return buf_len; 237 return buf_len;
245 } 238 }
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 }
253 239
254 bool FakeUdpSocket::SetReceiveBufferSize(int32 size) { 240 bool FakeUdpSocket::SetReceiveBufferSize(int32 size) {
255 NOTIMPLEMENTED(); 241 NOTIMPLEMENTED();
256 return false; 242 return false;
257 } 243 }
258 bool FakeUdpSocket::SetSendBufferSize(int32 size) { 244 bool FakeUdpSocket::SetSendBufferSize(int32 size) {
259 NOTIMPLEMENTED(); 245 NOTIMPLEMENTED();
260 return false; 246 return false;
261 } 247 }
262 248
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 void FakeSession::set_config(const SessionConfig& config) { 305 void FakeSession::set_config(const SessionConfig& config) {
320 config_ = config; 306 config_ = config;
321 } 307 }
322 308
323 void FakeSession::Close() { 309 void FakeSession::Close() {
324 closed_ = true; 310 closed_ = true;
325 } 311 }
326 312
327 } // namespace protocol 313 } // namespace protocol
328 } // namespace remoting 314 } // 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