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

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

Issue 1977963002: [remoting host] Only watch for material changes to NSS DB files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: remoting/host/linux/certificate_watcher.h
diff --git a/remoting/host/linux/certificate_watcher.h b/remoting/host/linux/certificate_watcher.h
index 5dee61d3cff6d6e6f1274751e996d94c36228613..958e2ab4479cc56751393fa0138b0fff467ce69f 100644
--- a/remoting/host/linux/certificate_watcher.h
+++ b/remoting/host/linux/certificate_watcher.h
@@ -17,6 +17,8 @@
namespace remoting {
+class CertificateWatcherImpl;
+
// This class watches the cert database and notifies the host to restart when
// a change of the database is detected. The runner script will restart the host
// when the host is killed then the new host will capture any new changes of the
@@ -56,17 +58,13 @@ class CertificateWatcher : public remoting::HostStatusObserver {
void SetWatchPathForTests(const base::FilePath& watch_path);
private:
+ friend class CertificateWatcherImpl;
+
// Returns true if the watcher has started.
bool is_started() const;
- // Callback passed to |file_watcher_|. Runs in IO thread.
- static void OnCertDirectoryChanged(
- scoped_refptr<base::SingleThreadTaskRunner> network_task_runner,
- base::WeakPtr<CertificateWatcher> watcher_, const base::FilePath& path,
- bool error);
-
// Runs in the caller's thread.
- void DirectoryChanged(const base::FilePath& path, bool error);
+ void DatabaseChanged(const base::FilePath& path, bool error);
// Called by |restart_timer_| when it's time to reset the host.
// It will defer restart if |inhibit_restart_scheduled_| flag is set to true.
@@ -91,8 +89,8 @@ class CertificateWatcher : public remoting::HostStatusObserver {
// Path of the certificate files/directories.
base::FilePath cert_watch_path_;
- // The file watcher to watch changes inside the certificate folder.
- std::unique_ptr<base::FilePathWatcher> file_watcher_;
+ // The watcher implementation that watches the files on the IO thread.
+ std::unique_ptr<CertificateWatcherImpl> watcher_impl_;
// The time to wait to restart when it is scheduled.
base::TimeDelta delay_;
« no previous file with comments | « no previous file | remoting/host/linux/certificate_watcher.cc » ('j') | remoting/host/linux/certificate_watcher.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698