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

Side by Side Diff: content/browser/renderer_host/p2p/socket_host_test_utils.cc

Issue 227473008: make SetReceiveBufferSize and SetSendBufferSize return net error codes (instead of bools) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix linux typo Created 6 years, 8 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "content/browser/renderer_host/p2p/socket_host_test_utils.h" 5 #include "content/browser/renderer_host/p2p/socket_host_test_utils.h"
6 6
7 #include "base/sys_byteorder.h" 7 #include "base/sys_byteorder.h"
8 #include "base/thread_task_runner_handle.h" 8 #include "base/thread_task_runner_handle.h"
9 #include "net/base/completion_callback.h" 9 #include "net/base/completion_callback.h"
10 #include "net/base/io_buffer.h" 10 #include "net/base/io_buffer.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 const net::CompletionCallback& callback) { 96 const net::CompletionCallback& callback) {
97 write_pending_ = false; 97 write_pending_ = false;
98 98
99 if (written_data_) { 99 if (written_data_) {
100 written_data_->insert(written_data_->end(), 100 written_data_->insert(written_data_->end(),
101 buf->data(), buf->data() + buf_len); 101 buf->data(), buf->data() + buf_len);
102 } 102 }
103 callback.Run(buf_len); 103 callback.Run(buf_len);
104 } 104 }
105 105
106 bool FakeSocket::SetReceiveBufferSize(int32 size) { 106 int FakeSocket::SetReceiveBufferSize(int32 size) {
107 NOTIMPLEMENTED(); 107 NOTIMPLEMENTED();
108 return false; 108 return net::ERR_NOT_IMPLEMENTED;
109 } 109 }
110 bool FakeSocket::SetSendBufferSize(int32 size) { 110
111 int FakeSocket::SetSendBufferSize(int32 size) {
111 NOTIMPLEMENTED(); 112 NOTIMPLEMENTED();
112 return false; 113 return net::ERR_NOT_IMPLEMENTED;
113 } 114 }
114 115
115 int FakeSocket::Connect(const net::CompletionCallback& callback) { 116 int FakeSocket::Connect(const net::CompletionCallback& callback) {
116 return 0; 117 return 0;
117 } 118 }
118 119
119 void FakeSocket::Disconnect() { 120 void FakeSocket::Disconnect() {
120 NOTREACHED(); 121 NOTREACHED();
121 } 122 }
122 123
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 202
202 void CreateStunError(std::vector<char>* packet) { 203 void CreateStunError(std::vector<char>* packet) {
203 CreateStunPacket(packet, kStunBindingError); 204 CreateStunPacket(packet, kStunBindingError);
204 } 205 }
205 206
206 net::IPEndPoint ParseAddress(const std::string ip_str, int port) { 207 net::IPEndPoint ParseAddress(const std::string ip_str, int port) {
207 net::IPAddressNumber ip; 208 net::IPAddressNumber ip;
208 EXPECT_TRUE(net::ParseIPLiteralToNumber(ip_str, &ip)); 209 EXPECT_TRUE(net::ParseIPLiteralToNumber(ip_str, &ip));
209 return net::IPEndPoint(ip, port); 210 return net::IPEndPoint(ip, port);
210 } 211 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698