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

Unified Diff: chrome/browser/chromeos/file_system_provider/operations/read_directory.cc

Issue 1093383002: [WIP] Provided file system from NACL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved several modules to chromeos folder. Created 5 years, 5 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/operations/read_directory.cc
diff --git a/chrome/browser/chromeos/file_system_provider/operations/read_directory.cc b/chrome/browser/chromeos/file_system_provider/operations/read_directory.cc
index b80e1f60aac21c734feaa73c083156968a518750..c62575817f27e0c8dfd84666d66bc4a616133d11 100644
--- a/chrome/browser/chromeos/file_system_provider/operations/read_directory.cc
+++ b/chrome/browser/chromeos/file_system_provider/operations/read_directory.cc
@@ -55,38 +55,41 @@ bool ConvertRequestValueToEntryList(scoped_ptr<RequestValue> value,
} // namespace
-ReadDirectory::ReadDirectory(
- extensions::EventRouter* event_router,
+template <class DestinationPolicy>
+ReadDirectory<DestinationPolicy>::ReadDirectory(
+ typename DestinationPolicy::EventRouterType* event_router,
const ProvidedFileSystemInfo& file_system_info,
const base::FilePath& directory_path,
const storage::AsyncFileUtil::ReadDirectoryCallback& callback)
- : Operation(event_router, file_system_info),
+ : Operation<DestinationPolicy>(event_router, file_system_info),
directory_path_(directory_path),
callback_(callback) {
}
-ReadDirectory::~ReadDirectory() {
+template <class DestinationPolicy>
+ReadDirectory<DestinationPolicy>::~ReadDirectory() {
}
-bool ReadDirectory::Execute(int request_id) {
+template <class DestinationPolicy>
+bool ReadDirectory<DestinationPolicy>::Execute(int request_id) {
using extensions::api::file_system_provider::ReadDirectoryRequestedOptions;
ReadDirectoryRequestedOptions options;
- options.file_system_id = file_system_info_.file_system_id();
+ options.file_system_id = this->file_system_info_.file_system_id();
options.request_id = request_id;
options.directory_path = directory_path_.AsUTF8Unsafe();
- return SendEvent(
- request_id,
- extensions::api::file_system_provider::OnReadDirectoryRequested::
- kEventName,
+ return this->SendEvent(
+ request_id, extensions::api::file_system_provider::
+ OnReadDirectoryRequested::kEventName,
extensions::api::file_system_provider::OnReadDirectoryRequested::Create(
options));
}
-void ReadDirectory::OnSuccess(int /* request_id */,
- scoped_ptr<RequestValue> result,
- bool has_more) {
+template <class DestinationPolicy>
+void ReadDirectory<DestinationPolicy>::OnSuccess(int /* request_id */,
+ scoped_ptr<RequestValue> result,
+ bool has_more) {
storage::AsyncFileUtil::EntryList entry_list;
const bool convert_result =
ConvertRequestValueToEntryList(result.Pass(), &entry_list);
@@ -103,13 +106,16 @@ void ReadDirectory::OnSuccess(int /* request_id */,
callback_.Run(base::File::FILE_OK, entry_list, has_more);
}
-void ReadDirectory::OnError(int /* request_id */,
- scoped_ptr<RequestValue> /* result */,
- base::File::Error error) {
- callback_.Run(
- error, storage::AsyncFileUtil::EntryList(), false /* has_more */);
+template <class DestinationPolicy>
+void ReadDirectory<DestinationPolicy>::OnError(int /* request_id */,
+ scoped_ptr<RequestValue> /* result */,
+ base::File::Error error) {
+ callback_.Run(error, storage::AsyncFileUtil::EntryList(),
+ false /* has_more */);
}
+FOR_EACH_DESTINATION_SPECIALIZE(ReadDirectory)
+
} // namespace operations
} // namespace file_system_provider
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698