| 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..caf1913d685d6b712bab98f0853e3a7b55fb1b34 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 <class DestinationPolicy>
|
| +OpenFile<DestinationPolicy>::OpenFile(
|
| + typename DestinationPolicy::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<DestinationPolicy>(event_router, file_system_info),
|
| file_path_(file_path),
|
| mode_(mode),
|
| callback_(callback) {
|
| }
|
|
|
| -OpenFile::~OpenFile() {
|
| +template <class DestinationPolicy>
|
| +OpenFile<DestinationPolicy>::~OpenFile() {
|
| }
|
|
|
| -bool OpenFile::Execute(int request_id) {
|
| +template <class DestinationPolicy>
|
| +bool OpenFile<DestinationPolicy>::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,30 @@ 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 <class DestinationPolicy>
|
| +void OpenFile<DestinationPolicy>::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 <class DestinationPolicy>
|
| +void OpenFile<DestinationPolicy>::OnError(int /* request_id */,
|
| + scoped_ptr<RequestValue> /* result */,
|
| + base::File::Error error) {
|
| callback_.Run(0 /* file_handle */, error);
|
| }
|
|
|
| +FOR_EACH_DESTINATION_SPECIALIZE(OpenFile)
|
| +
|
| } // namespace operations
|
| } // namespace file_system_provider
|
| } // namespace chromeos
|
|
|