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

Side by Side Diff: content/renderer/p2p/ipc_socket_factory.cc

Issue 288923014: Send SignalClose to the clients of P2PSocket, if TCP socket is failed to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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
« no previous file with comments | « no previous file | no next file » | 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) 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
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) {
Sergey Ulanov 2014/05/16 23:49:57 Should we also SignalClose() in the IS_OPEN state?
Mallinath (Gone from Chromium) 2014/05/16 23:58:45 Done.
Mallinath (Gone from Chromium) 2014/05/16 23:58:45 Done.
478 state_ = IS_ERROR;
Sergey Ulanov 2014/05/16 23:49:57 this duplicates line 481. Maybe something like thi
Mallinath (Gone from Chromium) 2014/05/16 23:58:45 Done.
479 SignalClose(this);
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698