config_file_watcher.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // Copyright (c) 2012 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. #ifndef REMOTING_HOST_CONFIG_FILE_WATCHER_H_
  5. #define REMOTING_HOST_CONFIG_FILE_WATCHER_H_
  6. #include "base/compiler_specific.h"
  7. #include "base/files/file_path.h"
  8. #include "base/memory/ref_counted.h"
  9. #include "remoting/host/config_watcher.h"
  10. namespace base {
  11. class SingleThreadTaskRunner;
  12. } // namespace base
  13. namespace remoting {
  14. extern const char kHostConfigSwitchName[];
  15. extern const base::FilePath::CharType kDefaultHostConfigFile[];
  16. class ConfigFileWatcherImpl;
  17. class ConfigFileWatcher : public ConfigWatcher {
  18. public:
  19. // Creates a configuration file watcher that lives at the |io_task_runner|
  20. // thread but posts config file updates on on |main_task_runner|.
  21. ConfigFileWatcher(
  22. scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
  23. scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
  24. const base::FilePath& config_path);
  25. ConfigFileWatcher(const ConfigFileWatcher&) = delete;
  26. ConfigFileWatcher& operator=(const ConfigFileWatcher&) = delete;
  27. ~ConfigFileWatcher() override;
  28. // Inherited from ConfigWatcher.
  29. void Watch(Delegate* delegate) override;
  30. private:
  31. scoped_refptr<ConfigFileWatcherImpl> impl_;
  32. };
  33. } // namespace remoting
  34. #endif // REMOTING_HOST_CONFIG_FILE_WATCHER_H_