OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/jingle_glue/chromium_socket_factory.h" | 5 #include "remoting/jingle_glue/chromium_socket_factory.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "jingle/glue/utils.h" | 10 #include "jingle/glue/utils.h" |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 NOTREACHED(); | 218 NOTREACHED(); |
219 return EINVAL; | 219 return EINVAL; |
220 } | 220 } |
221 | 221 |
222 switch (option) { | 222 switch (option) { |
223 case talk_base::Socket::OPT_DONTFRAGMENT: | 223 case talk_base::Socket::OPT_DONTFRAGMENT: |
224 NOTIMPLEMENTED(); | 224 NOTIMPLEMENTED(); |
225 return -1; | 225 return -1; |
226 | 226 |
227 case talk_base::Socket::OPT_RCVBUF: { | 227 case talk_base::Socket::OPT_RCVBUF: { |
228 bool success = socket_->SetReceiveBufferSize(value); | 228 int net_error = socket_->SetReceiveBufferSize(value); |
229 return success ? 0 : -1; | 229 return (net_error == net::OK) ? 0 : -1; |
230 } | 230 } |
231 | 231 |
232 case talk_base::Socket::OPT_SNDBUF: { | 232 case talk_base::Socket::OPT_SNDBUF: { |
233 bool success = socket_->SetSendBufferSize(value); | 233 int net_error = socket_->SetSendBufferSize(value); |
234 return success ? 0 : -1; | 234 return (net_error == net::OK) ? 0 : -1; |
235 } | 235 } |
236 | 236 |
237 case talk_base::Socket::OPT_NODELAY: | 237 case talk_base::Socket::OPT_NODELAY: |
238 // OPT_NODELAY is only for TCP sockets. | 238 // OPT_NODELAY is only for TCP sockets. |
239 NOTREACHED(); | 239 NOTREACHED(); |
240 return -1; | 240 return -1; |
241 | 241 |
242 case talk_base::Socket::OPT_IPV6_V6ONLY: | 242 case talk_base::Socket::OPT_IPV6_V6ONLY: |
243 NOTIMPLEMENTED(); | 243 NOTIMPLEMENTED(); |
244 return -1; | 244 return -1; |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 NOTREACHED(); | 376 NOTREACHED(); |
377 return NULL; | 377 return NULL; |
378 } | 378 } |
379 | 379 |
380 talk_base::AsyncResolverInterface* | 380 talk_base::AsyncResolverInterface* |
381 ChromiumPacketSocketFactory::CreateAsyncResolver() { | 381 ChromiumPacketSocketFactory::CreateAsyncResolver() { |
382 return new talk_base::AsyncResolver(); | 382 return new talk_base::AsyncResolver(); |
383 } | 383 } |
384 | 384 |
385 } // namespace remoting | 385 } // namespace remoting |
OLD | NEW |