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

Unified Diff: remoting/host/linux/certificate_watcher_inhibitor.h

Issue 1838313002: Restart the host when the third party auth certificate changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: remoting/host/linux/certificate_watcher_inhibitor.h
diff --git a/remoting/host/linux/certificate_watcher_inhibitor.h b/remoting/host/linux/certificate_watcher_inhibitor.h
new file mode 100644
index 0000000000000000000000000000000000000000..022628d0777e0710f113d1f756c47f619b2ec266
--- /dev/null
+++ b/remoting/host/linux/certificate_watcher_inhibitor.h
@@ -0,0 +1,40 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef REMOTING_HOST_LINUX_CERTIFICATE_WATCHER_INHIBITOR_H_
+#define REMOTING_HOST_LINUX_CERTIFICATE_WATCHER_INHIBITOR_H_
+
+#include "base/macros.h"
+#include "remoting/host/host_status_observer.h"
+#include "remoting/host/linux/certificate_watcher.h"
+
+namespace remoting {
+
+/**
Sergey Ulanov 2016/03/29 19:40:04 Use C++ style comments please: // Blah blah.
Yuwei 2016/03/29 19:57:02 Acknowledged.
+ * This class observes host status changes and inhibits the certificate watcher
+ * when the client connects and uninhibits when the client disconnects so that
+ * the host will not be killed when the connection is established. When the
+ * client disconnects, the host will be killed if the certificate was changed
+ * during the session.
+ */
+class CertificateWatcherInhibitor : public remoting::HostStatusObserver {
Sergey Ulanov 2016/03/29 19:40:04 Why does this need to be separate from Certificate
Yuwei 2016/03/29 19:57:02 Will merge them and use temp files to test
+ public:
+ // constructs CertificateWatcherInhibitor.
+ // Will not take ownership of cert_watcher
+ CertificateWatcherInhibitor(CertificateWatcher& cert_watcher);
+
+ // inhibits CertificateWatcher when the client connects
+ void OnClientConnected(const std::string& jid) override;
+
+ // uninhibits CertificateWatcher when the client disconnects
+ void OnClientDisconnected(const std::string& jid) override;
+
+ private:
+ CertificateWatcher& cert_watcher_;
+ DISALLOW_COPY_AND_ASSIGN(CertificateWatcherInhibitor);
+};
+
+}
+
+#endif // REMOTING_HOST_LINUX_CERTIFICATE_WATCHER_INHIBITOR_H_

Powered by Google App Engine
This is Rietveld 408576698