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

Side by Side Diff: remoting/host/config_file_watcher.h

Issue 10855249: [Chromoting] The daemon process now starts the networking process and passes the host configuration… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Restore sighup_listener.h/.cc since they are going to be reused by Jamie's CL and ignore SIGHUP for… Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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_DAEMON_CONFIG_WATCHER_H_
6 #define REMOTING_HOST_DAEMON_CONFIG_WATCHER_H_
7
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "base/file_path.h"
11 #include "base/memory/ref_counted.h"
12
13 namespace base {
14 class SingleThreadTaskRunner;
15 } // namespace base
16
17 namespace remoting {
18
19 extern const char kHostConfigSwitchName[];
20 extern const FilePath::CharType kDefaultHostConfigFile[];
21
22 class ConfigFileWatcherImpl;
23
24 class ConfigFileWatcher {
25 public:
26 class Delegate {
27 public:
28 virtual ~Delegate();
29
30 // Called once after starting watching the configuration file and every time
31 // the file changes.
32 virtual void OnConfigUpdated(const std::string& config) = 0;
33
34 // Called when the configuration file watcher encountered an error.
35 virtual void OnConfigWatcherError() = 0;
36 };
37
38 // Creates a configuration file watcher that lives at the |io_task_runner|
39 // thread but posts config file updates on on |main_task_runner|.
40 ConfigFileWatcher(
41 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
42 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
43 Delegate* delegate);
44 virtual ~ConfigFileWatcher();
45
46 // Starts watching |config_path|.
47 void Watch(const FilePath& config_path);
48
49 private:
50 scoped_refptr<ConfigFileWatcherImpl> impl_;
51
52 DISALLOW_COPY_AND_ASSIGN(ConfigFileWatcher);
53 };
54
55 } // namespace remoting
56
57 #endif // REMOTING_HOST_DAEMON_CONFIG_WATCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698