| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/chromium_socket_factory.h" | 5 #include "remoting/protocol/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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 | 191 |
| 192 send_queue_.push_back(PendingPacket(data, data_size, endpoint)); | 192 send_queue_.push_back(PendingPacket(data, data_size, endpoint)); |
| 193 send_queue_size_ += data_size; | 193 send_queue_size_ += data_size; |
| 194 | 194 |
| 195 DoSend(); | 195 DoSend(); |
| 196 return data_size; | 196 return data_size; |
| 197 } | 197 } |
| 198 | 198 |
| 199 int UdpPacketSocket::Close() { | 199 int UdpPacketSocket::Close() { |
| 200 state_ = STATE_CLOSED; | 200 state_ = STATE_CLOSED; |
| 201 |
| 202 // This CHECK() was added to debug crbug.com/452121 . |
| 203 // |
| 204 // TODO(sergeyu): Remove once the bug is resolved. |
| 205 CHECK_NE(socket_->Close(), net::ERR_INVALID_HANDLE); |
| 206 |
| 201 socket_.reset(); | 207 socket_.reset(); |
| 202 return 0; | 208 return 0; |
| 203 } | 209 } |
| 204 | 210 |
| 205 rtc::AsyncPacketSocket::State UdpPacketSocket::GetState() const { | 211 rtc::AsyncPacketSocket::State UdpPacketSocket::GetState() const { |
| 206 return state_; | 212 return state_; |
| 207 } | 213 } |
| 208 | 214 |
| 209 int UdpPacketSocket::GetOption(rtc::Socket::Option option, int* value) { | 215 int UdpPacketSocket::GetOption(rtc::Socket::Option option, int* value) { |
| 210 // This method is never called by libjingle. | 216 // This method is never called by libjingle. |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 return nullptr; | 396 return nullptr; |
| 391 } | 397 } |
| 392 | 398 |
| 393 rtc::AsyncResolverInterface* | 399 rtc::AsyncResolverInterface* |
| 394 ChromiumPacketSocketFactory::CreateAsyncResolver() { | 400 ChromiumPacketSocketFactory::CreateAsyncResolver() { |
| 395 return new rtc::AsyncResolver(); | 401 return new rtc::AsyncResolver(); |
| 396 } | 402 } |
| 397 | 403 |
| 398 } // namespace protocol | 404 } // namespace protocol |
| 399 } // namespace remoting | 405 } // namespace remoting |
| OLD | NEW |