This CL sets a maximum session duration only for Linux Me2Me, and hard-codes it to 12 hours.
A follow-up CL will get the maximum session duration from a
policy.
BUG=132678
Review URL: https://chromiumcodereview.appspot.com/10629016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143767 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/remoting/host/client_session.h b/remoting/host/client_session.h
index e15793ad..0fb8532 100644
--- a/remoting/host/client_session.h
+++ b/remoting/host/client_session.h
@@ -8,6 +8,7 @@
#include <list>
#include "base/time.h"
+#include "base/timer.h"
#include "base/threading/non_thread_safe.h"
#include "remoting/host/remote_input_filter.h"
#include "remoting/protocol/clipboard_echo_filter.h"
@@ -67,7 +68,8 @@
ClientSession(EventHandler* event_handler,
scoped_ptr<protocol::ConnectionToClient> connection,
protocol::HostEventStub* host_event_stub,
- Capturer* capturer);
+ Capturer* capturer,
+ const base::TimeDelta& max_duration);
virtual ~ClientSession();
// protocol::ClipboardStub interface.
@@ -167,6 +169,14 @@
// area, out of this class (crbug.com/96508).
Capturer* capturer_;
+ // The maximum duration of this session.
+ // There is no maximum if this value is <= 0.
+ base::TimeDelta max_duration_;
+
+ // A timer that triggers a disconnect when the maximum session duration
+ // is reached.
+ base::OneShotTimer<ClientSession> max_duration_timer_;
+
DISALLOW_COPY_AND_ASSIGN(ClientSession);
};