| Index: chrome/browser/chromeos/file_system_provider/operations/open_file.cc
|
| diff --git a/chrome/browser/chromeos/file_system_provider/operations/open_file.cc b/chrome/browser/chromeos/file_system_provider/operations/open_file.cc
|
| index ecd626f8b533d0273697480d1bfec982c532d706..1b8ce03c0b2fee78a3dc2fc463abc773d8eae2cb 100644
|
| --- a/chrome/browser/chromeos/file_system_provider/operations/open_file.cc
|
| +++ b/chrome/browser/chromeos/file_system_provider/operations/open_file.cc
|
| @@ -13,30 +13,33 @@ namespace chromeos {
|
| namespace file_system_provider {
|
| namespace operations {
|
|
|
| -OpenFile::OpenFile(
|
| - extensions::EventRouter* event_router,
|
| +template <int source>
|
| +OpenFile<source>::OpenFile(
|
| + typename Operation<source>::EventRouterType* event_router,
|
| const ProvidedFileSystemInfo& file_system_info,
|
| const base::FilePath& file_path,
|
| OpenFileMode mode,
|
| const ProvidedFileSystemInterface::OpenFileCallback& callback)
|
| - : Operation(event_router, file_system_info),
|
| + : Operation<source>(event_router, file_system_info),
|
| file_path_(file_path),
|
| mode_(mode),
|
| callback_(callback) {
|
| }
|
|
|
| -OpenFile::~OpenFile() {
|
| +template <int source>
|
| +OpenFile<source>::~OpenFile() {
|
| }
|
|
|
| -bool OpenFile::Execute(int request_id) {
|
| +template <int source>
|
| +bool OpenFile<source>::Execute(int request_id) {
|
| using extensions::api::file_system_provider::OpenFileRequestedOptions;
|
|
|
| - if (!file_system_info_.writable() && mode_ == OPEN_FILE_MODE_WRITE) {
|
| + if (!this->file_system_info_.writable() && mode_ == OPEN_FILE_MODE_WRITE) {
|
| return false;
|
| }
|
|
|
| OpenFileRequestedOptions 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();
|
|
|
| @@ -50,26 +53,31 @@ bool OpenFile::Execute(int request_id) {
|
| break;
|
| }
|
|
|
| - return SendEvent(
|
| + return this->SendEvent(
|
| request_id,
|
| extensions::api::file_system_provider::OnOpenFileRequested::kEventName,
|
| extensions::api::file_system_provider::OnOpenFileRequested::Create(
|
| options));
|
| }
|
|
|
| -void OpenFile::OnSuccess(int request_id,
|
| - scoped_ptr<RequestValue> result,
|
| - bool has_more) {
|
| +template <int source>
|
| +void OpenFile<source>::OnSuccess(int request_id,
|
| + scoped_ptr<RequestValue> result,
|
| + bool has_more) {
|
| // File handle is the same as request id of the OpenFile operation.
|
| callback_.Run(request_id, base::File::FILE_OK);
|
| }
|
|
|
| -void OpenFile::OnError(int /* request_id */,
|
| - scoped_ptr<RequestValue> /* result */,
|
| - base::File::Error error) {
|
| +template <int source>
|
| +void OpenFile<source>::OnError(int /* request_id */,
|
| + scoped_ptr<RequestValue> /* result */,
|
| + base::File::Error error) {
|
| callback_.Run(0 /* file_handle */, error);
|
| }
|
|
|
| +template class OpenFile<Source_Type::extension>;
|
| +template class OpenFile<Source_Type::plugin>;
|
| +
|
| } // namespace operations
|
| } // namespace file_system_provider
|
| } // namespace chromeos
|
|
|