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

Unified Diff: chrome/browser/devtools/devtools_file_watcher.h

Issue 1422463007: DevTools: use inotify to pick changes on the filesystem. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: build fix Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/devtools/devtools_file_helper.cc ('k') | chrome/browser/devtools/devtools_file_watcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/devtools/devtools_file_watcher.h
diff --git a/chrome/browser/devtools/devtools_file_watcher.h b/chrome/browser/devtools/devtools_file_watcher.h
new file mode 100644
index 0000000000000000000000000000000000000000..b753af4da638e400c820edfa0670e6f247f25651
--- /dev/null
+++ b/chrome/browser/devtools/devtools_file_watcher.h
@@ -0,0 +1,39 @@
+// Copyright (c) 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_DEVTOOLS_DEVTOOLS_FILE_WATCHER_H_
+#define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_FILE_WATCHER_H_
+
+#include <vector>
+
+#include "base/callback.h"
+#include "base/macros.h"
+
+namespace base {
+class FilePath;
+class FilePathWatcher;
+}
+
+class DevToolsFileWatcher {
+ public:
+ using WatchCallback = base::Callback<void(const std::vector<std::string>&)>;
+ explicit DevToolsFileWatcher(const WatchCallback& callback);
+ ~DevToolsFileWatcher();
+
+ void AddWatch(const base::FilePath& path);
+ void RemoveWatch(const base::FilePath& path);
+
+ private:
+ class SharedFileWatcher;
+ static SharedFileWatcher* s_shared_watcher_;
+
+ void InitSharedWatcher();
+ void FileChanged(const base::FilePath&, int);
+
+ scoped_refptr<SharedFileWatcher> shared_watcher_;
+ WatchCallback callback_;
+ DISALLOW_COPY_AND_ASSIGN(DevToolsFileWatcher);
+};
+
+#endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_FILE_WATCHER_H_
« no previous file with comments | « chrome/browser/devtools/devtools_file_helper.cc ('k') | chrome/browser/devtools/devtools_file_watcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698