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

Side by Side Diff: chrome/browser/chromeos/file_system_provider/provided_file_system_interface.h

Issue 642023003: [fsp] Allow to create multiple observers for a directory, up to one per origin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 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 CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_INTERF ACE_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_INTERF ACE_H_
6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_INTERF ACE_H_ 6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_INTERF ACE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "base/files/file.h" 12 #include "base/files/file.h"
13 #include "base/files/file_path.h" 13 #include "base/files/file_path.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/memory/weak_ptr.h" 15 #include "base/memory/weak_ptr.h"
16 #include "base/observer_list.h" 16 #include "base/observer_list.h"
17 #include "chrome/browser/chromeos/file_system_provider/observed_entry.h" 17 #include "chrome/browser/chromeos/file_system_provider/observed_entry.h"
18 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_obse rver.h" 18 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_obse rver.h"
19 #include "storage/browser/fileapi/async_file_util.h" 19 #include "storage/browser/fileapi/async_file_util.h"
20 #include "url/gurl.h"
20 21
21 class EventRouter; 22 class EventRouter;
22 23
23 namespace base { 24 namespace base {
24 class Time; 25 class Time;
25 } // namespace base 26 } // namespace base
26 27
27 namespace net { 28 namespace net {
28 class IOBuffer; 29 class IOBuffer;
29 } // namespace net 30 } // namespace net
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 // Requests writing to a file previously opened with |file_handle|. 171 // Requests writing to a file previously opened with |file_handle|.
171 virtual AbortCallback WriteFile( 172 virtual AbortCallback WriteFile(
172 int file_handle, 173 int file_handle,
173 net::IOBuffer* buffer, 174 net::IOBuffer* buffer,
174 int64 offset, 175 int64 offset,
175 int length, 176 int length,
176 const storage::AsyncFileUtil::StatusCallback& callback) = 0; 177 const storage::AsyncFileUtil::StatusCallback& callback) = 0;
177 178
178 // Requests observing a directory. 179 // Requests observing a directory.
179 virtual AbortCallback ObserveDirectory( 180 virtual AbortCallback ObserveDirectory(
181 const GURL& origin,
180 const base::FilePath& directory_path, 182 const base::FilePath& directory_path,
181 bool recursive, 183 bool recursive,
184 bool persistent,
182 const storage::AsyncFileUtil::StatusCallback& callback) = 0; 185 const storage::AsyncFileUtil::StatusCallback& callback) = 0;
183 186
184 // Requests unobserving an entry, which is immediately removed from the 187 // Requests unobserving an entry, which is immediately removed from the
185 // internal list, hence the operation is not abortable. 188 // internal list, hence the operation is not abortable.
186 virtual void UnobserveEntry( 189 virtual void UnobserveEntry(
190 const GURL& origin,
187 const base::FilePath& entry_path, 191 const base::FilePath& entry_path,
188 const storage::AsyncFileUtil::StatusCallback& callback) = 0; 192 const storage::AsyncFileUtil::StatusCallback& callback) = 0;
189 193
190 // Notifies about changes to the observed entries within the file system. 194 // Notifies about changes to the observed entries within the file system.
191 // Invoked by the file system implementation. Returns false if the 195 // Invoked by the file system implementation. Returns false if the
192 // notification arguments are malformed or the entry is not observed anymore. 196 // notification arguments are malformed or the entry is not observed anymore.
193 virtual bool Notify( 197 virtual bool Notify(
194 const base::FilePath& observed_path, 198 const base::FilePath& observed_path,
195 ProvidedFileSystemObserver::ChangeType change_type, 199 ProvidedFileSystemObserver::ChangeType change_type,
196 scoped_ptr<ProvidedFileSystemObserver::ChildChanges> child_changes, 200 scoped_ptr<ProvidedFileSystemObserver::ChildChanges> child_changes,
(...skipping 15 matching lines...) Expand all
212 virtual void RemoveObserver(ProvidedFileSystemObserver* observer) = 0; 216 virtual void RemoveObserver(ProvidedFileSystemObserver* observer) = 0;
213 217
214 // Returns a weak pointer to this object. 218 // Returns a weak pointer to this object.
215 virtual base::WeakPtr<ProvidedFileSystemInterface> GetWeakPtr() = 0; 219 virtual base::WeakPtr<ProvidedFileSystemInterface> GetWeakPtr() = 0;
216 }; 220 };
217 221
218 } // namespace file_system_provider 222 } // namespace file_system_provider
219 } // namespace chromeos 223 } // namespace chromeos
220 224
221 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_INT ERFACE_H_ 225 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_INT ERFACE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698