Index: chrome/browser/chromeos/file_system_provider/operations/read_file.cc |
diff --git a/chrome/browser/chromeos/file_system_provider/operations/read_file.cc b/chrome/browser/chromeos/file_system_provider/operations/read_file.cc |
index 20bfa46c23d256a08a18a94a5c1e8ad273a572e6..6b86aef4e46e00ecc09c5555b9bd62d67cc73207 100644 |
--- a/chrome/browser/chromeos/file_system_provider/operations/read_file.cc |
+++ b/chrome/browser/chromeos/file_system_provider/operations/read_file.cc |
@@ -44,15 +44,16 @@ int CopyRequestValueToBuffer(scoped_ptr<RequestValue> value, |
} // namespace |
-ReadFile::ReadFile( |
- extensions::EventRouter* event_router, |
+template <int source> |
+ReadFile<source>::ReadFile( |
+ typename Operation<source>::EventRouterType* event_router, |
const ProvidedFileSystemInfo& file_system_info, |
int file_handle, |
scoped_refptr<net::IOBuffer> buffer, |
int64 offset, |
int length, |
const ProvidedFileSystemInterface::ReadChunkReceivedCallback& callback) |
- : Operation(event_router, file_system_info), |
+ : Operation<source>(event_router, file_system_info), |
file_handle_(file_handle), |
buffer_(buffer), |
offset_(offset), |
@@ -61,30 +62,33 @@ ReadFile::ReadFile( |
callback_(callback) { |
} |
-ReadFile::~ReadFile() { |
+template <int source> |
+ReadFile<source>::~ReadFile() { |
} |
-bool ReadFile::Execute(int request_id) { |
+template <int source> |
+bool ReadFile<source>::Execute(int request_id) { |
using extensions::api::file_system_provider::ReadFileRequestedOptions; |
TRACE_EVENT0("file_system_provider", "ReadFile::Execute"); |
ReadFileRequestedOptions 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_; |
options.length = length_; |
- return SendEvent( |
+ return this->SendEvent( |
request_id, |
extensions::api::file_system_provider::OnReadFileRequested::kEventName, |
extensions::api::file_system_provider::OnReadFileRequested::Create( |
options)); |
} |
-void ReadFile::OnSuccess(int /* request_id */, |
- scoped_ptr<RequestValue> result, |
- bool has_more) { |
+template <int source> |
+void ReadFile<source>::OnSuccess(int /* request_id */, |
+ scoped_ptr<RequestValue> result, |
+ bool has_more) { |
TRACE_EVENT0("file_system_provider", "ReadFile::OnSuccess"); |
const int copy_result = CopyRequestValueToBuffer( |
result.Pass(), buffer_, current_offset_, length_); |
@@ -101,13 +105,17 @@ void ReadFile::OnSuccess(int /* request_id */, |
callback_.Run(copy_result, has_more, base::File::FILE_OK); |
} |
-void ReadFile::OnError(int /* request_id */, |
- scoped_ptr<RequestValue> /* result */, |
- base::File::Error error) { |
+template <int source> |
+void ReadFile<source>::OnError(int /* request_id */, |
+ scoped_ptr<RequestValue> /* result */, |
+ base::File::Error error) { |
TRACE_EVENT0("file_system_provider", "ReadFile::OnError"); |
callback_.Run(0 /* chunk_length */, false /* has_more */, error); |
} |
+template class ReadFile<Source_Type::extension>; |
+template class ReadFile<Source_Type::plugin>; |
+ |
} // namespace operations |
} // namespace file_system_provider |
} // namespace chromeos |