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

Side by Side Diff: base/directory_watcher.h

Issue 42388: Enable non-recursive watches for Windows DirectoryWatcher.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: fix the typo Created 11 years, 9 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
« no previous file with comments | « no previous file | base/directory_watcher_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 // This module provides a way to monitor a directory for changes. 5 // This module provides a way to monitor a directory for changes.
6 6
7 #ifndef BASE_DIRECTORY_WATCHER_H_ 7 #ifndef BASE_DIRECTORY_WATCHER_H_
8 #define BASE_DIRECTORY_WATCHER_H_ 8 #define BASE_DIRECTORY_WATCHER_H_
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 11 matching lines...) Expand all
22 virtual void OnDirectoryChanged(const FilePath& path) = 0; 22 virtual void OnDirectoryChanged(const FilePath& path) = 0;
23 }; 23 };
24 24
25 DirectoryWatcher(); 25 DirectoryWatcher();
26 ~DirectoryWatcher() {} 26 ~DirectoryWatcher() {}
27 27
28 // Register interest in any changes in the directory |path|. 28 // Register interest in any changes in the directory |path|.
29 // OnDirectoryChanged will be called back for each change within the dir. 29 // OnDirectoryChanged will be called back for each change within the dir.
30 // If |recursive| is true, the delegate will be notified for each change 30 // If |recursive| is true, the delegate will be notified for each change
31 // within the directory tree starting at |path|. Returns false on error. 31 // within the directory tree starting at |path|. Returns false on error.
32 //
33 // Note: on Windows the non-recursive watch will also send a notification
34 // when you create a file in a subdirectory (but won't send notifications
35 // for further modifications).
32 bool Watch(const FilePath& path, Delegate* delegate, bool recursive) { 36 bool Watch(const FilePath& path, Delegate* delegate, bool recursive) {
33 return impl_->Watch(path, delegate, recursive); 37 return impl_->Watch(path, delegate, recursive);
34 } 38 }
35 39
36 // Used internally to encapsulate different members on different platforms. 40 // Used internally to encapsulate different members on different platforms.
37 class PlatformDelegate : public base::RefCounted<PlatformDelegate> { 41 class PlatformDelegate : public base::RefCounted<PlatformDelegate> {
38 public: 42 public:
39 virtual ~PlatformDelegate() {} 43 virtual ~PlatformDelegate() {}
40 virtual bool Watch(const FilePath& path, Delegate* delegate, 44 virtual bool Watch(const FilePath& path, Delegate* delegate,
41 bool recursive) = 0; 45 bool recursive) = 0;
42 }; 46 };
43 47
44 private: 48 private:
45 scoped_refptr<PlatformDelegate> impl_; 49 scoped_refptr<PlatformDelegate> impl_;
46 50
47 DISALLOW_COPY_AND_ASSIGN(DirectoryWatcher); 51 DISALLOW_COPY_AND_ASSIGN(DirectoryWatcher);
48 }; 52 };
49 53
50 #endif // BASE_DIRECTORY_WATCHER_H_ 54 #endif // BASE_DIRECTORY_WATCHER_H_
OLDNEW
« no previous file with comments | « no previous file | base/directory_watcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698