| Index: chrome/browser/chromeos/file_system_provider/operations/create_file.cc
|
| diff --git a/chrome/browser/chromeos/file_system_provider/operations/create_file.cc b/chrome/browser/chromeos/file_system_provider/operations/create_file.cc
|
| index c2a4953cbd46bdbd75f2fcc1fdaba9c1f6e5a8e5..fcc5934deca43e2332a262914c68bb83adc8ca25 100644
|
| --- a/chrome/browser/chromeos/file_system_provider/operations/create_file.cc
|
| +++ b/chrome/browser/chromeos/file_system_provider/operations/create_file.cc
|
| @@ -13,48 +13,57 @@ namespace chromeos {
|
| namespace file_system_provider {
|
| namespace operations {
|
|
|
| -CreateFile::CreateFile(extensions::EventRouter* event_router,
|
| - const ProvidedFileSystemInfo& file_system_info,
|
| - const base::FilePath& file_path,
|
| - const storage::AsyncFileUtil::StatusCallback& callback)
|
| - : Operation(event_router, file_system_info),
|
| +template <int source>
|
| +CreateFile<source>::CreateFile(
|
| + typename Operation<source>::EventRouterType* event_router,
|
| + const ProvidedFileSystemInfo& file_system_info,
|
| + const base::FilePath& file_path,
|
| + const storage::AsyncFileUtil::StatusCallback& callback)
|
| + : Operation<source>(event_router, file_system_info),
|
| file_path_(file_path),
|
| callback_(callback) {
|
| }
|
|
|
| -CreateFile::~CreateFile() {
|
| +template <int source>
|
| +CreateFile<source>::~CreateFile() {
|
| }
|
|
|
| -bool CreateFile::Execute(int request_id) {
|
| +template <int source>
|
| +bool CreateFile<source>::Execute(int request_id) {
|
| using extensions::api::file_system_provider::CreateFileRequestedOptions;
|
|
|
| - if (!file_system_info_.writable())
|
| + if (!this->file_system_info_.writable())
|
| return false;
|
|
|
| CreateFileRequestedOptions 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.file_path = file_path_.AsUTF8Unsafe();
|
|
|
| - return SendEvent(
|
| + return this->SendEvent(
|
| request_id,
|
| extensions::api::file_system_provider::OnCreateFileRequested::kEventName,
|
| extensions::api::file_system_provider::OnCreateFileRequested::Create(
|
| options));
|
| }
|
|
|
| -void CreateFile::OnSuccess(int /* request_id */,
|
| - scoped_ptr<RequestValue> /* result */,
|
| - bool has_more) {
|
| +template <int source>
|
| +void CreateFile<source>::OnSuccess(int /* request_id */,
|
| + scoped_ptr<RequestValue> /* result */,
|
| + bool has_more) {
|
| callback_.Run(base::File::FILE_OK);
|
| }
|
|
|
| -void CreateFile::OnError(int /* request_id */,
|
| - scoped_ptr<RequestValue> /* result */,
|
| - base::File::Error error) {
|
| +template <int source>
|
| +void CreateFile<source>::OnError(int /* request_id */,
|
| + scoped_ptr<RequestValue> /* result */,
|
| + base::File::Error error) {
|
| callback_.Run(error);
|
| }
|
|
|
| +template class CreateFile<Source_Type::extension>;
|
| +template class CreateFile<Source_Type::plugin>;
|
| +
|
| } // namespace operations
|
| } // namespace file_system_provider
|
| } // namespace chromeos
|
|
|