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

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

Issue 296703013: Change reconnect timer delay to 2 seconds instead of 1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/threading/thread_checker.h" 9 #include "base/threading/thread_checker.h"
10 #include "base/timer/timer.h" 10 #include "base/timer/timer.h"
(...skipping 13 matching lines...) Expand all
24 // ProcessVideoPacket function to provide notification to the client when the 24 // ProcessVideoPacket function to provide notification to the client when the
25 // video channel is connected and forward the packet to the underlying 25 // video channel is connected and forward the packet to the underlying
26 // VideoStub. Multiple decorators can be stacked on top of each other if more 26 // VideoStub. Multiple decorators can be stacked on top of each other if more
27 // functionality is needed in the future. 27 // functionality is needed in the future.
28 class MonitoredVideoStub : public VideoStub { 28 class MonitoredVideoStub : public VideoStub {
29 public: 29 public:
30 // Callback to be called when channel state changes. The Callback should not 30 // Callback to be called when channel state changes. The Callback should not
31 // destroy the MonitoredVideoStub object. 31 // destroy the MonitoredVideoStub object.
32 typedef base::Callback<void(bool connected)> ChannelStateCallback; 32 typedef base::Callback<void(bool connected)> ChannelStateCallback;
33 33
34 static const int kConnectivityCheckDelaySeconds = 1; 34 static const int kConnectivityCheckDelaySeconds = 2;
35 35
36 MonitoredVideoStub( 36 MonitoredVideoStub(
37 VideoStub* video_stub, 37 VideoStub* video_stub,
38 base::TimeDelta connectivity_check_delay, 38 base::TimeDelta connectivity_check_delay,
39 const ChannelStateCallback& callback); 39 const ChannelStateCallback& callback);
40 virtual ~MonitoredVideoStub(); 40 virtual ~MonitoredVideoStub();
41 41
42 // VideoStub implementation. 42 // VideoStub implementation.
43 virtual void ProcessVideoPacket(scoped_ptr<VideoPacket> packet, 43 virtual void ProcessVideoPacket(scoped_ptr<VideoPacket> packet,
44 const base::Closure& done) OVERRIDE; 44 const base::Closure& done) OVERRIDE;
45 45
46 private: 46 private:
47 void OnConnectivityCheckTimeout(); 47 void OnConnectivityCheckTimeout();
48 void NotifyChannelState(bool connected); 48 void NotifyChannelState(bool connected);
49 49
50 VideoStub* video_stub_; 50 VideoStub* video_stub_;
51 ChannelStateCallback callback_; 51 ChannelStateCallback callback_;
52 base::ThreadChecker thread_checker_; 52 base::ThreadChecker thread_checker_;
53 bool is_connected_; 53 bool is_connected_;
54 base::DelayTimer<MonitoredVideoStub> connectivity_check_timer_; 54 base::DelayTimer<MonitoredVideoStub> connectivity_check_timer_;
55 55
56 DISALLOW_COPY_AND_ASSIGN(MonitoredVideoStub); 56 DISALLOW_COPY_AND_ASSIGN(MonitoredVideoStub);
57 }; 57 };
58 58
59 } // namespace protocol 59 } // namespace protocol
60 } // namespace remoting 60 } // namespace remoting
61 61
62 #endif // REMOTING_PROTOCOL_MONITORED_VIDEO_STUB_H_ 62 #endif // REMOTING_PROTOCOL_MONITORED_VIDEO_STUB_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698