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

Side by Side Diff: chrome/browser/chromeos/file_system_provider/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: 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_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_H_
6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_H_ 6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_H_
7 7
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "base/observer_list.h"
9 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_info .h" 10 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_info .h"
10 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_inte rface.h" 11 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_inte rface.h"
11 #include "chrome/browser/chromeos/file_system_provider/request_manager.h" 12 #include "chrome/browser/chromeos/file_system_provider/request_manager.h"
12 #include "storage/browser/fileapi/async_file_util.h" 13 #include "storage/browser/fileapi/async_file_util.h"
13 14
14 class Profile; 15 class Profile;
15 16
16 namespace net { 17 namespace net {
17 class IOBuffer; 18 class IOBuffer;
18 } // namespace net 19 } // namespace net
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 virtual AbortCallback Truncate( 83 virtual AbortCallback Truncate(
83 const base::FilePath& file_path, 84 const base::FilePath& file_path,
84 int64 length, 85 int64 length,
85 const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE; 86 const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE;
86 virtual AbortCallback WriteFile( 87 virtual AbortCallback WriteFile(
87 int file_handle, 88 int file_handle,
88 net::IOBuffer* buffer, 89 net::IOBuffer* buffer,
89 int64 offset, 90 int64 offset,
90 int length, 91 int length,
91 const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE; 92 const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE;
93 virtual AbortCallback ObserveDirectory(
94 const base::FilePath& directory_path,
95 bool recursive,
96 const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE;
97 virtual AbortCallback UnobserveEntry(
98 const base::FilePath& entry_path,
99 const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE;
92 virtual const ProvidedFileSystemInfo& GetFileSystemInfo() const OVERRIDE; 100 virtual const ProvidedFileSystemInfo& GetFileSystemInfo() const OVERRIDE;
93 virtual RequestManager* GetRequestManager() OVERRIDE; 101 virtual RequestManager* GetRequestManager() OVERRIDE;
102 virtual ObservedEntries* GetObservedEntries() OVERRIDE;
103 virtual void AddObserver(Observer* observer) OVERRIDE;
104 virtual void RemoveObserver(Observer* observer) OVERRIDE;
105 virtual ObserverList<Observer>* GetObservers() OVERRIDE;
94 virtual base::WeakPtr<ProvidedFileSystemInterface> GetWeakPtr() OVERRIDE; 106 virtual base::WeakPtr<ProvidedFileSystemInterface> GetWeakPtr() OVERRIDE;
95 107
96 private: 108 private:
97 // Aborts an operation executed with a request id equal to 109 // Aborts an operation executed with a request id equal to
98 // |operation_request_id|. The request is removed immediately on the C++ side 110 // |operation_request_id|. The request is removed immediately on the C++ side
99 // despite being handled by the providing extension or not. 111 // despite being handled by the providing extension or not.
100 void Abort(int operation_request_id, 112 void Abort(int operation_request_id,
101 const storage::AsyncFileUtil::StatusCallback& callback); 113 const storage::AsyncFileUtil::StatusCallback& callback);
102 114
115 // Called when a directory becomes watched successfully.
116 void OnObserveDirectoryCompleted(
117 const base::FilePath& directory_path,
118 bool recursive,
119 const storage::AsyncFileUtil::StatusCallback& callback,
120 base::File::Error result);
121
103 Profile* profile_; // Not owned. 122 Profile* profile_; // Not owned.
104 extensions::EventRouter* event_router_; // Not owned. May be NULL. 123 extensions::EventRouter* event_router_; // Not owned. May be NULL.
105 ProvidedFileSystemInfo file_system_info_; 124 ProvidedFileSystemInfo file_system_info_;
106 scoped_ptr<NotificationManagerInterface> notification_manager_; 125 scoped_ptr<NotificationManagerInterface> notification_manager_;
107 RequestManager request_manager_; 126 RequestManager request_manager_;
127 ObservedEntries observed_entries_;
128 ObserverList<Observer> observers_;
108 129
109 base::WeakPtrFactory<ProvidedFileSystem> weak_ptr_factory_; 130 base::WeakPtrFactory<ProvidedFileSystem> weak_ptr_factory_;
110 DISALLOW_COPY_AND_ASSIGN(ProvidedFileSystem); 131 DISALLOW_COPY_AND_ASSIGN(ProvidedFileSystem);
111 }; 132 };
112 133
113 } // namespace file_system_provider 134 } // namespace file_system_provider
114 } // namespace chromeos 135 } // namespace chromeos
115 136
116 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_H_ 137 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698