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

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

Issue 1654513003: Simplify message parsing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@no_done
Patch Set: Created 4 years, 10 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 <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "remoting/protocol/p2p_stream_socket.h" 10 #include "remoting/protocol/p2p_stream_socket.h"
(...skipping 29 matching lines...) Expand all
40 return; 40 return;
41 } 41 }
42 42
43 channel_factory_ = nullptr; 43 channel_factory_ = nullptr;
44 channel_ = std::move(socket); 44 channel_ = std::move(socket);
45 writer_.Start( 45 writer_.Start(
46 base::Bind(&P2PStreamSocket::Write, base::Unretained(channel_.get())), 46 base::Bind(&P2PStreamSocket::Write, base::Unretained(channel_.get())),
47 base::Bind(&ChannelDispatcherBase::OnReadWriteFailed, 47 base::Bind(&ChannelDispatcherBase::OnReadWriteFailed,
48 base::Unretained(this))); 48 base::Unretained(this)));
49 reader_.StartReading(channel_.get(), 49 reader_.StartReading(channel_.get(),
50 base::Bind(&ChannelDispatcherBase::OnIncomingMessage,
51 base::Unretained(this)),
50 base::Bind(&ChannelDispatcherBase::OnReadWriteFailed, 52 base::Bind(&ChannelDispatcherBase::OnReadWriteFailed,
51 base::Unretained(this))); 53 base::Unretained(this)));
52 54
53 event_handler_->OnChannelInitialized(this); 55 event_handler_->OnChannelInitialized(this);
54 } 56 }
55 57
56 void ChannelDispatcherBase::OnReadWriteFailed(int error) { 58 void ChannelDispatcherBase::OnReadWriteFailed(int error) {
57 event_handler_->OnChannelError(this, CHANNEL_CONNECTION_ERROR); 59 event_handler_->OnChannelError(this, CHANNEL_CONNECTION_ERROR);
58 } 60 }
59 61
60 } // namespace protocol 62 } // namespace protocol
61 } // namespace remoting 63 } // 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