| Index: chrome/browser/chromeos/file_system_provider/operations/write_file.cc
|
| diff --git a/chrome/browser/chromeos/file_system_provider/operations/write_file.cc b/chrome/browser/chromeos/file_system_provider/operations/write_file.cc
|
| index 766e9cdad1ff6c5650e1a995a4dd8753ca118552..a8a52d84d5841905026b81612bec3293036d3a47 100644
|
| --- a/chrome/browser/chromeos/file_system_provider/operations/write_file.cc
|
| +++ b/chrome/browser/chromeos/file_system_provider/operations/write_file.cc
|
| @@ -13,14 +13,16 @@ namespace chromeos {
|
| namespace file_system_provider {
|
| namespace operations {
|
|
|
| -WriteFile::WriteFile(extensions::EventRouter* event_router,
|
| - const ProvidedFileSystemInfo& file_system_info,
|
| - int file_handle,
|
| - scoped_refptr<net::IOBuffer> buffer,
|
| - int64 offset,
|
| - int length,
|
| - const storage::AsyncFileUtil::StatusCallback& callback)
|
| - : Operation(event_router, file_system_info),
|
| +template <class DestinationPolicy>
|
| +WriteFile<DestinationPolicy>::WriteFile(
|
| + typename DestinationPolicy::EventRouterType* event_router,
|
| + const ProvidedFileSystemInfo& file_system_info,
|
| + int file_handle,
|
| + scoped_refptr<net::IOBuffer> buffer,
|
| + int64 offset,
|
| + int length,
|
| + const storage::AsyncFileUtil::StatusCallback& callback)
|
| + : Operation<DestinationPolicy>(event_router, file_system_info),
|
| file_handle_(file_handle),
|
| buffer_(buffer),
|
| offset_(offset),
|
| @@ -28,18 +30,20 @@ WriteFile::WriteFile(extensions::EventRouter* event_router,
|
| callback_(callback) {
|
| }
|
|
|
| -WriteFile::~WriteFile() {
|
| +template <class DestinationPolicy>
|
| +WriteFile<DestinationPolicy>::~WriteFile() {
|
| }
|
|
|
| -bool WriteFile::Execute(int request_id) {
|
| +template <class DestinationPolicy>
|
| +bool WriteFile<DestinationPolicy>::Execute(int request_id) {
|
| TRACE_EVENT0("file_system_provider", "WriteFile::Execute");
|
| using extensions::api::file_system_provider::WriteFileRequestedOptions;
|
|
|
| - if (!file_system_info_.writable())
|
| + if (!this->file_system_info_.writable())
|
| return false;
|
|
|
| WriteFileRequestedOptions 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.open_request_id = file_handle_;
|
| options.offset = offset_;
|
| @@ -55,26 +59,30 @@ bool WriteFile::Execute(int request_id) {
|
| scoped_ptr<base::ListValue> event_args(new base::ListValue);
|
| event_args->Append(options_as_value.release());
|
|
|
| - return SendEvent(
|
| + return this->SendEvent(
|
| request_id,
|
| extensions::api::file_system_provider::OnWriteFileRequested::kEventName,
|
| event_args.Pass());
|
| }
|
|
|
| -void WriteFile::OnSuccess(int /* request_id */,
|
| - scoped_ptr<RequestValue> /* result */,
|
| - bool /* has_more */) {
|
| +template <class DestinationPolicy>
|
| +void WriteFile<DestinationPolicy>::OnSuccess(int /* request_id */,
|
| + scoped_ptr<RequestValue> /* result */,
|
| + bool /* has_more */) {
|
| TRACE_EVENT0("file_system_provider", "WriteFile::OnSuccess");
|
| callback_.Run(base::File::FILE_OK);
|
| }
|
|
|
| -void WriteFile::OnError(int /* request_id */,
|
| - scoped_ptr<RequestValue> /* result */,
|
| - base::File::Error error) {
|
| +template <class DestinationPolicy>
|
| +void WriteFile<DestinationPolicy>::OnError(int /* request_id */,
|
| + scoped_ptr<RequestValue> /* result */,
|
| + base::File::Error error) {
|
| TRACE_EVENT0("file_system_provider", "WriteFile::OnError");
|
| callback_.Run(error);
|
| }
|
|
|
| +FOR_EACH_DESTINATION_SPECIALIZE(WriteFile)
|
| +
|
| } // namespace operations
|
| } // namespace file_system_provider
|
| } // namespace chromeos
|
|
|