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

Unified Diff: chrome/browser/chromeos/file_system_provider/fake_provided_file_system.h

Issue 625463002: [fsp] Add support for observing entries and notifying about changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More implementation. 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/file_system_provider/fake_provided_file_system.h
diff --git a/chrome/browser/chromeos/file_system_provider/fake_provided_file_system.h b/chrome/browser/chromeos/file_system_provider/fake_provided_file_system.h
index f9dd955fa9e6b3aafefbd450a6ca0136ea218395..28a5f6b06742b7e1d49cd8cf455f687ab6d5e55e 100644
--- a/chrome/browser/chromeos/file_system_provider/fake_provided_file_system.h
+++ b/chrome/browser/chromeos/file_system_provider/fake_provided_file_system.h
@@ -12,9 +12,11 @@
#include "base/callback.h"
#include "base/memory/linked_ptr.h"
#include "base/memory/weak_ptr.h"
+#include "base/observer_list.h"
#include "base/task/cancelable_task_tracker.h"
#include "chrome/browser/chromeos/file_system_provider/provided_file_system_info.h"
#include "chrome/browser/chromeos/file_system_provider/provided_file_system_interface.h"
+#include "chrome/browser/chromeos/file_system_provider/provided_file_system_observer.h"
class Profile;
@@ -122,8 +124,23 @@ class FakeProvidedFileSystem : public ProvidedFileSystemInterface {
int64 offset,
int length,
const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE;
+ virtual AbortCallback ObserveDirectory(
mtomasz 2014/10/03 04:22:47 Currently we support observing directories only, n
+ const base::FilePath& directory_path,
+ bool recursive,
+ const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE;
+ virtual AbortCallback UnobserveEntry(
mtomasz 2014/10/03 04:22:47 Method for unobserving files would have the same s
+ const base::FilePath& entry_path,
+ const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE;
virtual const ProvidedFileSystemInfo& GetFileSystemInfo() const OVERRIDE;
virtual RequestManager* GetRequestManager() OVERRIDE;
+ virtual ObservedEntries* GetObservedEntries() OVERRIDE;
+ virtual void AddObserver(ProvidedFileSystemObserver* observer) OVERRIDE;
mtomasz 2014/10/03 04:22:47 Cache implementation will add itself as an observe
+ virtual void RemoveObserver(ProvidedFileSystemObserver* observer) OVERRIDE;
+ virtual bool Notify(
mtomasz 2014/10/03 04:22:47 This is called from file_system_provider_api.cc, s
+ const base::FilePath& observed_path,
+ ProvidedFileSystemObserver::ChangeType change_type,
+ const ProvidedFileSystemObserver::ChildChanges& child_changes,
+ const std::string& tag) OVERRIDE;
virtual base::WeakPtr<ProvidedFileSystemInterface> GetWeakPtr() OVERRIDE;
// Factory callback, to be used in Service::SetFileSystemFactory(). The
@@ -156,6 +173,7 @@ class FakeProvidedFileSystem : public ProvidedFileSystemInterface {
OpenedFilesMap opened_files_;
int last_file_handle_;
base::CancelableTaskTracker tracker_;
+ ObserverList<ProvidedFileSystemObserver> observers_;
base::WeakPtrFactory<FakeProvidedFileSystem> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(FakeProvidedFileSystem);

Powered by Google App Engine
This is Rietveld 408576698