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

Side by Side Diff: remoting/protocol/channel_multiplexer.h

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.cc ('k') | remoting/protocol/channel_multiplexer.cc » ('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 #ifndef REMOTING_PROTOCOL_CHANNEL_MULTIPLEXER_H_ 5 #ifndef REMOTING_PROTOCOL_CHANNEL_MULTIPLEXER_H_
6 #define REMOTING_PROTOCOL_CHANNEL_MULTIPLEXER_H_ 6 #define REMOTING_PROTOCOL_CHANNEL_MULTIPLEXER_H_
7 7
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "remoting/base/buffered_socket_writer.h" 9 #include "remoting/base/buffered_socket_writer.h"
10 #include "remoting/proto/mux.pb.h" 10 #include "remoting/proto/mux.pb.h"
(...skipping 26 matching lines...) Expand all
37 37
38 // Callback for |base_channel_| creation. 38 // Callback for |base_channel_| creation.
39 void OnBaseChannelReady(scoped_ptr<net::StreamSocket> socket); 39 void OnBaseChannelReady(scoped_ptr<net::StreamSocket> socket);
40 40
41 // Helper to create channels asynchronously. 41 // Helper to create channels asynchronously.
42 void DoCreatePendingChannels(); 42 void DoCreatePendingChannels();
43 43
44 // Helper method used to create channels. 44 // Helper method used to create channels.
45 MuxChannel* GetOrCreateChannel(const std::string& name); 45 MuxChannel* GetOrCreateChannel(const std::string& name);
46 46
47 // Error handling callback for |writer_|. 47 // Error handling callback for |reader_| and |writer_|.
48 void OnWriteFailed(int error); 48 void OnBaseChannelError(int error);
49 49
50 // Failed write notifier, queued asynchronously by OnWriteFailed(). 50 // Propagates base channel error to channel |name|, queued asynchronously by
51 void NotifyWriteFailed(const std::string& name); 51 // OnBaseChannelError().
52 void NotifyBaseChannelError(const std::string& name, int error);
52 53
53 // Callback for |reader_; 54 // Callback for |reader_;
54 void OnIncomingPacket(scoped_ptr<MultiplexPacket> packet, 55 void OnIncomingPacket(scoped_ptr<MultiplexPacket> packet,
55 const base::Closure& done_task); 56 const base::Closure& done_task);
56 57
57 // Called by MuxChannel. 58 // Called by MuxChannel.
58 bool DoWrite(scoped_ptr<MultiplexPacket> packet, 59 bool DoWrite(scoped_ptr<MultiplexPacket> packet,
59 const base::Closure& done_task); 60 const base::Closure& done_task);
60 61
61 // Factory used to create |base_channel_|. Set to nullptr once creation is 62 // Factory used to create |base_channel_|. Set to nullptr once creation is
(...skipping 23 matching lines...) Expand all
85 base::WeakPtrFactory<ChannelMultiplexer> weak_factory_; 86 base::WeakPtrFactory<ChannelMultiplexer> weak_factory_;
86 87
87 DISALLOW_COPY_AND_ASSIGN(ChannelMultiplexer); 88 DISALLOW_COPY_AND_ASSIGN(ChannelMultiplexer);
88 }; 89 };
89 90
90 } // namespace protocol 91 } // namespace protocol
91 } // namespace remoting 92 } // namespace remoting
92 93
93 94
94 #endif // REMOTING_PROTOCOL_CHANNEL_MULTIPLEXER_H_ 95 #endif // REMOTING_PROTOCOL_CHANNEL_MULTIPLEXER_H_
OLDNEW
« no previous file with comments | « remoting/protocol/channel_dispatcher_base.cc ('k') | remoting/protocol/channel_multiplexer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698