Chromium Code Reviews| 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 "content/renderer/p2p/ipc_socket_factory.h" | 5 #include "content/renderer/p2p/ipc_socket_factory.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <deque> | 8 #include <deque> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 467 TraceSendThrottlingState(); | 467 TraceSendThrottlingState(); |
| 468 | 468 |
| 469 if (writable_signal_expected_ && send_bytes_available_ > 0) { | 469 if (writable_signal_expected_ && send_bytes_available_ > 0) { |
| 470 SignalReadyToSend(this); | 470 SignalReadyToSend(this); |
| 471 writable_signal_expected_ = false; | 471 writable_signal_expected_ = false; |
| 472 } | 472 } |
| 473 } | 473 } |
| 474 | 474 |
| 475 void IpcPacketSocket::OnError() { | 475 void IpcPacketSocket::OnError() { |
| 476 DCHECK_EQ(base::MessageLoop::current(), message_loop_); | 476 DCHECK_EQ(base::MessageLoop::current(), message_loop_); |
| 477 if (state_ == IS_OPENING && IsTcpClientSocket(type_)) { | |
|
Sergey Ulanov
2014/05/16 23:03:21
Do you need this condition? Maybe call SignalClose
Mallinath (Gone from Chromium)
2014/05/16 23:34:57
actually we don't need, but only TCP sockets are l
| |
| 478 SignalClose(this); | |
| 479 } | |
| 480 | |
| 477 state_ = IS_ERROR; | 481 state_ = IS_ERROR; |
| 478 error_ = ECONNABORTED; | 482 error_ = ECONNABORTED; |
| 479 } | 483 } |
| 480 | 484 |
| 481 void IpcPacketSocket::OnDataReceived(const net::IPEndPoint& address, | 485 void IpcPacketSocket::OnDataReceived(const net::IPEndPoint& address, |
| 482 const std::vector<char>& data, | 486 const std::vector<char>& data, |
| 483 const base::TimeTicks& timestamp) { | 487 const base::TimeTicks& timestamp) { |
| 484 DCHECK_EQ(base::MessageLoop::current(), message_loop_); | 488 DCHECK_EQ(base::MessageLoop::current(), message_loop_); |
| 485 | 489 |
| 486 talk_base::SocketAddress address_lj; | 490 talk_base::SocketAddress address_lj; |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 628 } | 632 } |
| 629 | 633 |
| 630 talk_base::AsyncResolverInterface* | 634 talk_base::AsyncResolverInterface* |
| 631 IpcPacketSocketFactory::CreateAsyncResolver() { | 635 IpcPacketSocketFactory::CreateAsyncResolver() { |
| 632 scoped_ptr<AsyncAddressResolverImpl> resolver( | 636 scoped_ptr<AsyncAddressResolverImpl> resolver( |
| 633 new AsyncAddressResolverImpl(socket_dispatcher_)); | 637 new AsyncAddressResolverImpl(socket_dispatcher_)); |
| 634 return resolver.release(); | 638 return resolver.release(); |
| 635 } | 639 } |
| 636 | 640 |
| 637 } // namespace content | 641 } // namespace content |
| OLD | NEW |