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

Side by Side Diff: webkit/browser/fileapi/watcher_manager.h

Issue 539143002: Migrate webkit/browser/ to storage/browser/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix android build Created 6 years, 3 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
« no previous file with comments | « webkit/browser/fileapi/transient_file_util.cc ('k') | webkit/browser/quota/OWNERS » ('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 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 WEBKIT_BROWSER_FILEAPI_WATCHER_MANAGER_H_ 5 #include "storage/browser/fileapi/watcher_manager.h"
6 #define WEBKIT_BROWSER_FILEAPI_WATCHER_MANAGER_H_
7
8 #include <vector>
9
10 #include "base/basictypes.h"
11 #include "base/callback_forward.h"
12 #include "base/files/file.h"
13
14 namespace base {
15 class Time;
16 }
17
18 namespace storage {
19
20 class FileSystemOperationContext;
21 class FileSystemURL;
22
23 // An interface for providing entry observing capability for file system
24 // backends.
25 //
26 // It is NOT valid to give null callback to this class, and implementors
27 // can assume that they don't get any null callbacks.
28 class WatcherManager {
29 public:
30 typedef base::Callback<void(base::File::Error result)> StatusCallback;
31
32 // Observes watched entries.
33 class Observer {
34 public:
35 Observer() {}
36 virtual ~Observer() {}
37
38 // Notifies about an entry represented by |url| being changed.
39 virtual void OnEntryChanged(const FileSystemURL& url) = 0;
40
41 // Notifies about an entry represented by |url| being removed.
42 virtual void OnEntryRemoved(const FileSystemURL& url) = 0;
43 };
44
45 virtual ~WatcherManager() {}
46
47 virtual void AddObserver(Observer* observer) = 0;
48 virtual void RemoveObserver(Observer* observer) = 0;
49 virtual bool HasObserver(Observer* observer) const = 0;
50
51 // Observes a directory entry. If the |recursive| mode is not supported then
52 // FILE_ERROR_INVALID_OPERATION must be returned as an error. If the |url| is
53 // already watched, or setting up the watcher fails, then |callback|
54 // must be called with a specific error code. Otherwise |callback| must be
55 // called with the FILE_OK error code.
56 virtual void WatchDirectory(const FileSystemURL& url,
57 bool recursive,
58 const StatusCallback& callback) = 0;
59
60 // Stops observing an entry represented by |url|.
61 virtual void UnwatchEntry(const FileSystemURL& url,
62 const StatusCallback& callback) = 0;
63 };
64
65 } // namespace storage
66
67 #endif // WEBKIT_BROWSER_FILEAPI_WATCHER_MANAGER_H_
OLDNEW
« no previous file with comments | « webkit/browser/fileapi/transient_file_util.cc ('k') | webkit/browser/quota/OWNERS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698