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

Side by Side Diff: remoting/protocol/channel_dispatcher_base.cc

Issue 1143443003: Fix MessageReader to pass errors to the channel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « remoting/protocol/channel_dispatcher_base.h ('k') | remoting/protocol/channel_multiplexer.h » ('j') | 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 "remoting/protocol/channel_dispatcher_base.h" 5 #include "remoting/protocol/channel_dispatcher_base.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "net/socket/stream_socket.h" 8 #include "net/socket/stream_socket.h"
9 #include "remoting/protocol/session.h" 9 #include "remoting/protocol/session.h"
10 #include "remoting/protocol/session_config.h" 10 #include "remoting/protocol/session_config.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 void ChannelDispatcherBase::OnChannelReady( 51 void ChannelDispatcherBase::OnChannelReady(
52 scoped_ptr<net::StreamSocket> socket) { 52 scoped_ptr<net::StreamSocket> socket) {
53 if (!socket.get()) { 53 if (!socket.get()) {
54 event_handler_->OnChannelError(this, CHANNEL_CONNECTION_ERROR); 54 event_handler_->OnChannelError(this, CHANNEL_CONNECTION_ERROR);
55 return; 55 return;
56 } 56 }
57 57
58 channel_factory_ = nullptr; 58 channel_factory_ = nullptr;
59 channel_ = socket.Pass(); 59 channel_ = socket.Pass();
60 writer_.Init(channel_.get(), base::Bind(&ChannelDispatcherBase::OnWriteFailed, 60 writer_.Init(channel_.get(),
61 base::Unretained(this))); 61 base::Bind(&ChannelDispatcherBase::OnReadWriteFailed,
62 reader_.StartReading(channel_.get()); 62 base::Unretained(this)));
63 reader_.StartReading(channel_.get(),
64 base::Bind(&ChannelDispatcherBase::OnReadWriteFailed,
65 base::Unretained(this)));
63 66
64 event_handler_->OnChannelInitialized(this); 67 event_handler_->OnChannelInitialized(this);
65 } 68 }
66 69
67 void ChannelDispatcherBase::OnWriteFailed(int error) { 70 void ChannelDispatcherBase::OnReadWriteFailed(int error) {
68 event_handler_->OnChannelError(this, CHANNEL_CONNECTION_ERROR); 71 event_handler_->OnChannelError(this, CHANNEL_CONNECTION_ERROR);
69 } 72 }
70 73
71 } // namespace protocol 74 } // namespace protocol
72 } // namespace remoting 75 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/channel_dispatcher_base.h ('k') | remoting/protocol/channel_multiplexer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698