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..90762ce2f0bb292fa0beac5be961df617e8a2a0a 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 <int source> |
+ReadDirectory<source>::ReadDirectory( |
+ typename Operation<source>::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<source>(event_router, file_system_info), |
directory_path_(directory_path), |
callback_(callback) { |
} |
-ReadDirectory::~ReadDirectory() { |
+template <int source> |
+ReadDirectory<source>::~ReadDirectory() { |
} |
-bool ReadDirectory::Execute(int request_id) { |
+template <int source> |
+bool ReadDirectory<source>::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 <int source> |
+void ReadDirectory<source>::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,17 @@ 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 <int source> |
+void ReadDirectory<source>::OnError(int /* request_id */, |
+ scoped_ptr<RequestValue> /* result */, |
+ base::File::Error error) { |
+ callback_.Run(error, storage::AsyncFileUtil::EntryList(), |
+ false /* has_more */); |
} |
+template class ReadDirectory<Source_Type::extension>; |
+template class ReadDirectory<Source_Type::plugin>; |
+ |
} // namespace operations |
} // namespace file_system_provider |
} // namespace chromeos |