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

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

Issue 2176443002: Add client and host dispatchers for video_stats channel to send video stats from host to client. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@simple_channel
Patch Set: . Created 4 years, 5 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
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/base/compound_buffer.h" 10 #include "remoting/base/compound_buffer.h"
11 #include "remoting/protocol/message_channel_factory.h" 11 #include "remoting/protocol/message_channel_factory.h"
12 #include "remoting/protocol/message_pipe.h" 12 #include "remoting/protocol/message_pipe.h"
13 13
14 namespace remoting { 14 namespace remoting {
15 namespace protocol { 15 namespace protocol {
16 16
17 ChannelDispatcherBase::ChannelDispatcherBase(const char* channel_name) 17 ChannelDispatcherBase::ChannelDispatcherBase(const std::string& channel_name)
18 : channel_name_(channel_name) {} 18 : channel_name_(channel_name) {}
19 19
20 ChannelDispatcherBase::~ChannelDispatcherBase() { 20 ChannelDispatcherBase::~ChannelDispatcherBase() {
21 if (channel_factory_) 21 if (channel_factory_)
22 channel_factory_->CancelChannelCreation(channel_name_); 22 channel_factory_->CancelChannelCreation(channel_name_);
23 } 23 }
24 24
25 void ChannelDispatcherBase::Init(MessageChannelFactory* channel_factory, 25 void ChannelDispatcherBase::Init(MessageChannelFactory* channel_factory,
26 EventHandler* event_handler) { 26 EventHandler* event_handler) {
27 channel_factory_ = channel_factory; 27 channel_factory_ = channel_factory;
(...skipping 22 matching lines...) Expand all
50 event_handler_->OnChannelInitialized(this); 50 event_handler_->OnChannelInitialized(this);
51 } 51 }
52 52
53 void ChannelDispatcherBase::OnMessageReceived( 53 void ChannelDispatcherBase::OnMessageReceived(
54 std::unique_ptr<CompoundBuffer> message) { 54 std::unique_ptr<CompoundBuffer> message) {
55 OnIncomingMessage(std::move(message)); 55 OnIncomingMessage(std::move(message));
56 } 56 }
57 57
58 void ChannelDispatcherBase::OnMessagePipeClosed() { 58 void ChannelDispatcherBase::OnMessagePipeClosed() {
59 is_connected_ = false; 59 is_connected_ = false;
60 message_pipe_.reset();
60 event_handler_->OnChannelClosed(this); 61 event_handler_->OnChannelClosed(this);
61 } 62 }
62 63
63 } // namespace protocol 64 } // namespace protocol
64 } // namespace remoting 65 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698