| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 STORAGE_BROWSER_FILEAPI_WATCHER_MANAGER_H_ | 5 #ifndef STORAGE_BROWSER_FILEAPI_WATCHER_MANAGER_H_ |
| 6 #define STORAGE_BROWSER_FILEAPI_WATCHER_MANAGER_H_ | 6 #define STORAGE_BROWSER_FILEAPI_WATCHER_MANAGER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| 11 #include "base/files/file.h" | 11 #include "base/files/file.h" |
| 12 | 12 |
| 13 namespace storage { | 13 namespace storage { |
| 14 | 14 |
| 15 class FileSystemURL; | 15 class FileSystemURL; |
| 16 | 16 |
| 17 // An interface for providing entry observing capability for file system | 17 // An interface for providing entry observing capability for file system |
| 18 // backends. | 18 // backends. |
| 19 // | 19 // |
| 20 // All member functions must be called on the IO thread. Callbacks will be |
| 21 // called on the IO thread. |
| 22 // |
| 20 // It is NOT valid to give null callback to this class, and implementors | 23 // It is NOT valid to give null callback to this class, and implementors |
| 21 // can assume that they don't get any null callbacks. | 24 // can assume that they don't get any null callbacks. |
| 22 class WatcherManager { | 25 class WatcherManager { |
| 23 public: | 26 public: |
| 24 enum ChangeType { CHANGED, DELETED }; | 27 enum ChangeType { CHANGED, DELETED }; |
| 25 | 28 |
| 26 typedef base::Callback<void(base::File::Error result)> StatusCallback; | 29 typedef base::Callback<void(base::File::Error result)> StatusCallback; |
| 27 typedef base::Callback<void(ChangeType change_type)> NotificationCallback; | 30 typedef base::Callback<void(ChangeType change_type)> NotificationCallback; |
| 28 | 31 |
| 29 virtual ~WatcherManager() {} | 32 virtual ~WatcherManager() {} |
| (...skipping 17 matching lines...) Expand all Loading... |
| 47 | 50 |
| 48 // Removes a watcher represented by |url| in |recursive| mode. | 51 // Removes a watcher represented by |url| in |recursive| mode. |
| 49 virtual void RemoveWatcher(const FileSystemURL& url, | 52 virtual void RemoveWatcher(const FileSystemURL& url, |
| 50 bool recursive, | 53 bool recursive, |
| 51 const StatusCallback& callback) = 0; | 54 const StatusCallback& callback) = 0; |
| 52 }; | 55 }; |
| 53 | 56 |
| 54 } // namespace storage | 57 } // namespace storage |
| 55 | 58 |
| 56 #endif // STORAGE_BROWSER_FILEAPI_WATCHER_MANAGER_H_ | 59 #endif // STORAGE_BROWSER_FILEAPI_WATCHER_MANAGER_H_ |
| OLD | NEW |