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

Side by Side Diff: chrome/browser/devtools/devtools_file_watcher.h

Issue 2384343002: DevTools: improve DevTools file watcher to send added and removed paths (Closed)
Patch Set: go above and beyond Created 4 years, 2 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
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_DEVTOOLS_DEVTOOLS_FILE_WATCHER_H_ 5 #ifndef CHROME_BROWSER_DEVTOOLS_DEVTOOLS_FILE_WATCHER_H_
6 #define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_FILE_WATCHER_H_ 6 #define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_FILE_WATCHER_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 12
13 namespace base { 13 namespace base {
14 class FilePath; 14 class FilePath;
15 class FilePathWatcher; 15 class FilePathWatcher;
16 } 16 }
17 17
18 class DevToolsFileWatcher { 18 class DevToolsFileWatcher {
19 public: 19 public:
20 using WatchCallback = base::Callback<void(const std::vector<std::string>&)>; 20 using WatchCallback = base::Callback<void(const std::vector<std::string>&,
21 const std::vector<std::string>&,
22 const std::vector<std::string>&)>;
21 explicit DevToolsFileWatcher(const WatchCallback& callback); 23 explicit DevToolsFileWatcher(const WatchCallback& callback);
22 ~DevToolsFileWatcher(); 24 ~DevToolsFileWatcher();
23 25
24 void AddWatch(const base::FilePath& path); 26 void AddWatch(const base::FilePath& path);
25 void RemoveWatch(const base::FilePath& path); 27 void RemoveWatch(const base::FilePath& path);
26 28
27 private: 29 private:
28 class SharedFileWatcher; 30 class SharedFileWatcher;
29 static SharedFileWatcher* s_shared_watcher_; 31 static SharedFileWatcher* s_shared_watcher_;
30 32
31 void InitSharedWatcher(); 33 void InitSharedWatcher();
32 void FileChanged(const base::FilePath&, int); 34 void FileChanged(const base::FilePath&, int);
33 35
34 scoped_refptr<SharedFileWatcher> shared_watcher_; 36 scoped_refptr<SharedFileWatcher> shared_watcher_;
35 WatchCallback callback_; 37 WatchCallback callback_;
36 DISALLOW_COPY_AND_ASSIGN(DevToolsFileWatcher); 38 DISALLOW_COPY_AND_ASSIGN(DevToolsFileWatcher);
37 }; 39 };
38 40
39 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_FILE_WATCHER_H_ 41 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_FILE_WATCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698