Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef REMOTING_HOST_LINUX_CERTIFICATE_WATCHER_INHIBITOR_H_ | |
| 6 #define REMOTING_HOST_LINUX_CERTIFICATE_WATCHER_INHIBITOR_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "remoting/host/host_status_observer.h" | |
| 10 #include "remoting/host/linux/certificate_watcher.h" | |
| 11 | |
| 12 namespace remoting { | |
| 13 | |
| 14 /** | |
|
Sergey Ulanov
2016/03/29 19:40:04
Use C++ style comments please:
// Blah blah.
Yuwei
2016/03/29 19:57:02
Acknowledged.
| |
| 15 * This class observes host status changes and inhibits the certificate watcher | |
| 16 * when the client connects and uninhibits when the client disconnects so that | |
| 17 * the host will not be killed when the connection is established. When the | |
| 18 * client disconnects, the host will be killed if the certificate was changed | |
| 19 * during the session. | |
| 20 */ | |
| 21 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
| |
| 22 public: | |
| 23 // constructs CertificateWatcherInhibitor. | |
| 24 // Will not take ownership of cert_watcher | |
| 25 CertificateWatcherInhibitor(CertificateWatcher& cert_watcher); | |
| 26 | |
| 27 // inhibits CertificateWatcher when the client connects | |
| 28 void OnClientConnected(const std::string& jid) override; | |
| 29 | |
| 30 // uninhibits CertificateWatcher when the client disconnects | |
| 31 void OnClientDisconnected(const std::string& jid) override; | |
| 32 | |
| 33 private: | |
| 34 CertificateWatcher& cert_watcher_; | |
| 35 DISALLOW_COPY_AND_ASSIGN(CertificateWatcherInhibitor); | |
| 36 }; | |
| 37 | |
| 38 } | |
| 39 | |
| 40 #endif // REMOTING_HOST_LINUX_CERTIFICATE_WATCHER_INHIBITOR_H_ | |
| OLD | NEW |