OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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_HOST_LINUX_CERTIFICATE_WATCHER_H_ | 5 #ifndef REMOTING_HOST_LINUX_CERTIFICATE_WATCHER_H_ |
6 #define REMOTING_HOST_LINUX_CERTIFICATE_WATCHER_H_ | 6 #define REMOTING_HOST_LINUX_CERTIFICATE_WATCHER_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
9 #include "base/files/file_path_watcher.h" | 11 #include "base/files/file_path_watcher.h" |
10 #include "base/macros.h" | 12 #include "base/macros.h" |
11 #include "base/memory/scoped_ptr.h" | |
12 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
13 #include "base/timer/timer.h" | 14 #include "base/timer/timer.h" |
14 #include "remoting/host/host_status_monitor.h" | 15 #include "remoting/host/host_status_monitor.h" |
15 #include "remoting/host/host_status_observer.h" | 16 #include "remoting/host/host_status_observer.h" |
16 | 17 |
17 namespace remoting { | 18 namespace remoting { |
18 | 19 |
19 // This class watches the cert database and notifies the host to restart when | 20 // This class watches the cert database and notifies the host to restart when |
20 // a change of the database is detected. The runner script will restart the host | 21 // a change of the database is detected. The runner script will restart the host |
21 // when the host is killed then the new host will capture any new changes of the | 22 // when the host is killed then the new host will capture any new changes of the |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; | 85 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
85 | 86 |
86 bool inhibit_mode_ = false; | 87 bool inhibit_mode_ = false; |
87 | 88 |
88 bool restart_pending_ = false; | 89 bool restart_pending_ = false; |
89 | 90 |
90 // Path of the certificate files/directories. | 91 // Path of the certificate files/directories. |
91 base::FilePath cert_watch_path_; | 92 base::FilePath cert_watch_path_; |
92 | 93 |
93 // The file watcher to watch changes inside the certificate folder. | 94 // The file watcher to watch changes inside the certificate folder. |
94 scoped_ptr<base::FilePathWatcher> file_watcher_; | 95 std::unique_ptr<base::FilePathWatcher> file_watcher_; |
95 | 96 |
96 // The time to wait to restart when it is scheduled. | 97 // The time to wait to restart when it is scheduled. |
97 base::TimeDelta delay_; | 98 base::TimeDelta delay_; |
98 | 99 |
99 // Timer to delay the restart action. | 100 // Timer to delay the restart action. |
100 scoped_ptr<base::DelayTimer> restart_timer_; | 101 std::unique_ptr<base::DelayTimer> restart_timer_; |
101 | 102 |
102 base::WeakPtrFactory<CertificateWatcher> weak_factory_; | 103 base::WeakPtrFactory<CertificateWatcher> weak_factory_; |
103 | 104 |
104 DISALLOW_COPY_AND_ASSIGN(CertificateWatcher); | 105 DISALLOW_COPY_AND_ASSIGN(CertificateWatcher); |
105 }; | 106 }; |
106 | 107 |
107 } // namespace remoting | 108 } // namespace remoting |
108 | 109 |
109 #endif // REMOTING_HOST_LINUX_CERTIFICATE_WATCHER_H_ | 110 #endif // REMOTING_HOST_LINUX_CERTIFICATE_WATCHER_H_ |
OLD | NEW |