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