#include "remoting/host/config_file_watcher.h"
#include <memory>
#include <string>
#include "base/files/file_path_watcher.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/logging.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/task/single_thread_task_runner.h"
#include "base/timer/timer.h"
#include "build/build_config.h"
namespace remoting {
const char kHostConfigSwitchName[] = …;
const base::FilePath::CharType kDefaultHostConfigFile[] = …);
#if BUILDFLAG(IS_WIN)
const int kMaxRetries = 3;
#endif
class ConfigFileWatcherImpl
: public base::RefCountedThreadSafe<ConfigFileWatcherImpl> { … };
ConfigFileWatcher::ConfigFileWatcher(
scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
const base::FilePath& config_path)
: … { … }
ConfigFileWatcher::~ConfigFileWatcher() { … }
void ConfigFileWatcher::Watch(ConfigWatcher::Delegate* delegate) { … }
ConfigFileWatcherImpl::ConfigFileWatcherImpl(
scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
const base::FilePath& config_path)
: … { … }
void ConfigFileWatcherImpl::Watch(ConfigWatcher::Delegate* delegate) { … }
void ConfigFileWatcherImpl::WatchOnIoThread() { … }
void ConfigFileWatcherImpl::StopWatching() { … }
ConfigFileWatcherImpl::~ConfigFileWatcherImpl() { … }
void ConfigFileWatcherImpl::FinishStopping() { … }
void ConfigFileWatcherImpl::OnConfigUpdated(const base::FilePath& path,
bool error) { … }
void ConfigFileWatcherImpl::NotifyError() { … }
void ConfigFileWatcherImpl::NotifyUpdate(const std::string& config) { … }
void ConfigFileWatcherImpl::ReloadConfig() { … }
}