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

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

Issue 703123003: [fsp] Pass more detailed errors to the providing extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed a bug. Created 6 years, 1 month 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 <string> 8 #include <string>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 virtual void RemoveWatcher( 149 virtual void RemoveWatcher(
150 const GURL& origin, 150 const GURL& origin,
151 const base::FilePath& entry_path, 151 const base::FilePath& entry_path,
152 bool recursive, 152 bool recursive,
153 const storage::AsyncFileUtil::StatusCallback& callback) override; 153 const storage::AsyncFileUtil::StatusCallback& callback) override;
154 virtual const ProvidedFileSystemInfo& GetFileSystemInfo() const override; 154 virtual const ProvidedFileSystemInfo& GetFileSystemInfo() const override;
155 virtual RequestManager* GetRequestManager() override; 155 virtual RequestManager* GetRequestManager() override;
156 virtual Watchers* GetWatchers() override; 156 virtual Watchers* GetWatchers() override;
157 virtual void AddObserver(ProvidedFileSystemObserver* observer) override; 157 virtual void AddObserver(ProvidedFileSystemObserver* observer) override;
158 virtual void RemoveObserver(ProvidedFileSystemObserver* observer) override; 158 virtual void RemoveObserver(ProvidedFileSystemObserver* observer) override;
159 virtual bool Notify(const base::FilePath& entry_path, 159 virtual void Notify(
160 bool recursive, 160 const base::FilePath& entry_path,
161 storage::WatcherManager::ChangeType change_type, 161 bool recursive,
162 scoped_ptr<ProvidedFileSystemObserver::Changes> changes, 162 storage::WatcherManager::ChangeType change_type,
163 const std::string& tag) override; 163 scoped_ptr<ProvidedFileSystemObserver::Changes> changes,
164 const std::string& tag,
165 const storage::AsyncFileUtil::StatusCallback& callback) override;
164 virtual base::WeakPtr<ProvidedFileSystemInterface> GetWeakPtr() override; 166 virtual base::WeakPtr<ProvidedFileSystemInterface> GetWeakPtr() override;
165 167
166 private: 168 private:
167 // Aborts an operation executed with a request id equal to 169 // Aborts an operation executed with a request id equal to
168 // |operation_request_id|. The request is removed immediately on the C++ side 170 // |operation_request_id|. The request is removed immediately on the C++ side
169 // despite being handled by the providing extension or not. 171 // despite being handled by the providing extension or not.
170 void Abort(int operation_request_id, 172 void Abort(int operation_request_id,
171 const storage::AsyncFileUtil::StatusCallback& callback); 173 const storage::AsyncFileUtil::StatusCallback& callback);
172 174
173 // Called when adding a watcher is completed with either success or en error. 175 // Called when adding a watcher is completed with either success or en error.
174 void OnAddWatcherCompleted( 176 void OnAddWatcherCompleted(
175 const base::FilePath& entry_path, 177 const base::FilePath& entry_path,
176 bool recursive, 178 bool recursive,
177 const Subscriber& subscriber, 179 const Subscriber& subscriber,
178 const storage::AsyncFileUtil::StatusCallback& callback, 180 const storage::AsyncFileUtil::StatusCallback& callback,
179 base::File::Error result); 181 base::File::Error result);
180 182
181 // Called when all observers finished handling the change notification. It 183 // Called when all observers finished handling the change notification. It
182 // updates the tag from |last_tag| to |tag| for the entry at |entry_path|. 184 // updates the tag to |tag| for the entry at |entry_path|.
183 void OnNotifyCompleted( 185 void OnNotifyCompleted(
184 const base::FilePath& entry_path, 186 const base::FilePath& entry_path,
185 bool recursive, 187 bool recursive,
186 storage::WatcherManager::ChangeType change_type, 188 storage::WatcherManager::ChangeType change_type,
187 scoped_ptr<ProvidedFileSystemObserver::Changes> changes, 189 scoped_ptr<ProvidedFileSystemObserver::Changes> changes,
188 const std::string& last_tag, 190 const std::string& tag,
189 const std::string& tag); 191 const storage::AsyncFileUtil::StatusCallback& callback);
190 192
191 Profile* profile_; // Not owned. 193 Profile* profile_; // Not owned.
192 extensions::EventRouter* event_router_; // Not owned. May be NULL. 194 extensions::EventRouter* event_router_; // Not owned. May be NULL.
193 ProvidedFileSystemInfo file_system_info_; 195 ProvidedFileSystemInfo file_system_info_;
194 scoped_ptr<NotificationManagerInterface> notification_manager_; 196 scoped_ptr<NotificationManagerInterface> notification_manager_;
195 scoped_ptr<RequestManager> request_manager_; 197 scoped_ptr<RequestManager> request_manager_;
196 Watchers watchers_; 198 Watchers watchers_;
197 ObserverList<ProvidedFileSystemObserver> observers_; 199 ObserverList<ProvidedFileSystemObserver> observers_;
198 200
199 base::WeakPtrFactory<ProvidedFileSystem> weak_ptr_factory_; 201 base::WeakPtrFactory<ProvidedFileSystem> weak_ptr_factory_;
200 DISALLOW_COPY_AND_ASSIGN(ProvidedFileSystem); 202 DISALLOW_COPY_AND_ASSIGN(ProvidedFileSystem);
201 }; 203 };
202 204
203 } // namespace file_system_provider 205 } // namespace file_system_provider
204 } // namespace chromeos 206 } // namespace chromeos
205 207
206 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_H_ 208 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698