OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2015 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 CHROME_BROWSER_DEVTOOLS_DEVTOOLS_FILE_WATCHER_H_ |
| 6 #define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_FILE_WATCHER_H_ |
| 7 |
| 8 #include <vector> |
| 9 |
| 10 #include "base/callback.h" |
| 11 #include "base/macros.h" |
| 12 |
| 13 namespace base { |
| 14 class FilePath; |
| 15 class FilePathWatcher; |
| 16 } |
| 17 |
| 18 class DevToolsFileWatcher { |
| 19 public: |
| 20 using WatchCallback = base::Callback<void(const std::vector<std::string>&)>; |
| 21 explicit DevToolsFileWatcher(const WatchCallback& callback); |
| 22 ~DevToolsFileWatcher(); |
| 23 |
| 24 void AddWatch(const base::FilePath& path); |
| 25 void RemoveWatch(const base::FilePath& path); |
| 26 |
| 27 private: |
| 28 class SharedFileWatcher; |
| 29 static SharedFileWatcher* s_shared_watcher_; |
| 30 |
| 31 void InitSharedWatcher(); |
| 32 void FileChanged(const base::FilePath&, int); |
| 33 |
| 34 scoped_refptr<SharedFileWatcher> shared_watcher_; |
| 35 WatchCallback callback_; |
| 36 DISALLOW_COPY_AND_ASSIGN(DevToolsFileWatcher); |
| 37 }; |
| 38 |
| 39 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_FILE_WATCHER_H_ |
OLD | NEW |