| 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 #ifndef REMOTING_PROTOCOL_MONITORED_VIDEO_STUB_H_ | 5 #ifndef REMOTING_PROTOCOL_MONITORED_VIDEO_STUB_H_ |
| 6 #define REMOTING_PROTOCOL_MONITORED_VIDEO_STUB_H_ | 6 #define REMOTING_PROTOCOL_MONITORED_VIDEO_STUB_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/threading/thread_checker.h" | 10 #include "base/threading/thread_checker.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 static const int kConnectivityCheckDelaySeconds = 2; | 35 static const int kConnectivityCheckDelaySeconds = 2; |
| 36 | 36 |
| 37 MonitoredVideoStub( | 37 MonitoredVideoStub( |
| 38 VideoStub* video_stub, | 38 VideoStub* video_stub, |
| 39 base::TimeDelta connectivity_check_delay, | 39 base::TimeDelta connectivity_check_delay, |
| 40 const ChannelStateCallback& callback); | 40 const ChannelStateCallback& callback); |
| 41 ~MonitoredVideoStub() override; | 41 ~MonitoredVideoStub() override; |
| 42 | 42 |
| 43 // VideoStub implementation. | 43 // VideoStub implementation. |
| 44 void ProcessVideoPacket(scoped_ptr<VideoPacket> packet, | 44 void ProcessVideoPacket(std::unique_ptr<VideoPacket> packet, |
| 45 const base::Closure& done) override; | 45 const base::Closure& done) override; |
| 46 | 46 |
| 47 private: | 47 private: |
| 48 void OnConnectivityCheckTimeout(); | 48 void OnConnectivityCheckTimeout(); |
| 49 void NotifyChannelState(bool connected); | 49 void NotifyChannelState(bool connected); |
| 50 | 50 |
| 51 VideoStub* video_stub_; | 51 VideoStub* video_stub_; |
| 52 ChannelStateCallback callback_; | 52 ChannelStateCallback callback_; |
| 53 base::ThreadChecker thread_checker_; | 53 base::ThreadChecker thread_checker_; |
| 54 bool is_connected_; | 54 bool is_connected_; |
| 55 base::DelayTimer connectivity_check_timer_; | 55 base::DelayTimer connectivity_check_timer_; |
| 56 | 56 |
| 57 DISALLOW_COPY_AND_ASSIGN(MonitoredVideoStub); | 57 DISALLOW_COPY_AND_ASSIGN(MonitoredVideoStub); |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 } // namespace protocol | 60 } // namespace protocol |
| 61 } // namespace remoting | 61 } // namespace remoting |
| 62 | 62 |
| 63 #endif // REMOTING_PROTOCOL_MONITORED_VIDEO_STUB_H_ | 63 #endif // REMOTING_PROTOCOL_MONITORED_VIDEO_STUB_H_ |
| OLD | NEW |