OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/monitored_video_stub.h" | 5 #include "remoting/protocol/monitored_video_stub.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "remoting/proto/video.pb.h" | 9 #include "remoting/proto/video.pb.h" |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 } | 28 } |
29 | 29 |
30 void MonitoredVideoStub::ProcessVideoPacket(scoped_ptr<VideoPacket> packet, | 30 void MonitoredVideoStub::ProcessVideoPacket(scoped_ptr<VideoPacket> packet, |
31 const base::Closure& done) { | 31 const base::Closure& done) { |
32 DCHECK(thread_checker_.CalledOnValidThread()); | 32 DCHECK(thread_checker_.CalledOnValidThread()); |
33 | 33 |
34 connectivity_check_timer_.Reset(); | 34 connectivity_check_timer_.Reset(); |
35 | 35 |
36 NotifyChannelState(true); | 36 NotifyChannelState(true); |
37 | 37 |
38 video_stub_->ProcessVideoPacket(packet.Pass(), done); | 38 video_stub_->ProcessVideoPacket(std::move(packet), done); |
39 } | 39 } |
40 | 40 |
41 void MonitoredVideoStub::OnConnectivityCheckTimeout() { | 41 void MonitoredVideoStub::OnConnectivityCheckTimeout() { |
42 DCHECK(thread_checker_.CalledOnValidThread()); | 42 DCHECK(thread_checker_.CalledOnValidThread()); |
43 NotifyChannelState(false); | 43 NotifyChannelState(false); |
44 } | 44 } |
45 | 45 |
46 void MonitoredVideoStub::NotifyChannelState(bool connected) { | 46 void MonitoredVideoStub::NotifyChannelState(bool connected) { |
47 if (is_connected_ != connected) { | 47 if (is_connected_ != connected) { |
48 is_connected_ = connected; | 48 is_connected_ = connected; |
49 callback_.Run(is_connected_); | 49 callback_.Run(is_connected_); |
50 } | 50 } |
51 } | 51 } |
52 | 52 |
53 } // namespace protocol | 53 } // namespace protocol |
54 } // namespace remoting | 54 } // namespace remoting |
OLD | NEW |