| Index: chrome/browser/chromeos/file_system_provider/operations/get_metadata.cc
|
| diff --git a/chrome/browser/chromeos/file_system_provider/operations/get_metadata.cc b/chrome/browser/chromeos/file_system_provider/operations/get_metadata.cc
|
| index b67c0ebc35c4d2227ec4fd1cf3a9fc175ad0f42a..1a5eedcf3164ebbc4442991cc5e194d09f377ce6 100644
|
| --- a/chrome/browser/chromeos/file_system_provider/operations/get_metadata.cc
|
| +++ b/chrome/browser/chromeos/file_system_provider/operations/get_metadata.cc
|
| @@ -94,42 +94,45 @@ bool ValidateName(const std::string& name, bool root_entry) {
|
| return name.empty();
|
| return !name.empty() && name.find('/') == std::string::npos;
|
| }
|
| -
|
| -GetMetadata::GetMetadata(
|
| - extensions::EventRouter* event_router,
|
| +template <int source>
|
| +GetMetadata<source>::GetMetadata(
|
| + typename Operation<source>::EventRouterType* event_router,
|
| const ProvidedFileSystemInfo& file_system_info,
|
| const base::FilePath& entry_path,
|
| ProvidedFileSystemInterface::MetadataFieldMask fields,
|
| const ProvidedFileSystemInterface::GetMetadataCallback& callback)
|
| - : Operation(event_router, file_system_info),
|
| + : Operation<source>(event_router, file_system_info),
|
| entry_path_(entry_path),
|
| fields_(fields),
|
| callback_(callback) {
|
| }
|
|
|
| -GetMetadata::~GetMetadata() {
|
| +template <int source>
|
| +GetMetadata<source>::~GetMetadata() {
|
| }
|
|
|
| -bool GetMetadata::Execute(int request_id) {
|
| +template <int source>
|
| +bool GetMetadata<source>::Execute(int request_id) {
|
| using extensions::api::file_system_provider::GetMetadataRequestedOptions;
|
|
|
| GetMetadataRequestedOptions 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.entry_path = entry_path_.AsUTF8Unsafe();
|
| options.thumbnail =
|
| fields_ & ProvidedFileSystemInterface::METADATA_FIELD_THUMBNAIL;
|
|
|
| - return SendEvent(
|
| + return this->SendEvent(
|
| request_id,
|
| extensions::api::file_system_provider::OnGetMetadataRequested::kEventName,
|
| extensions::api::file_system_provider::OnGetMetadataRequested::Create(
|
| options));
|
| }
|
|
|
| -void GetMetadata::OnSuccess(int /* request_id */,
|
| - scoped_ptr<RequestValue> result,
|
| - bool has_more) {
|
| +template <int source>
|
| +void GetMetadata<source>::OnSuccess(int /* request_id */,
|
| + scoped_ptr<RequestValue> result,
|
| + bool has_more) {
|
| scoped_ptr<EntryMetadata> metadata(new EntryMetadata);
|
| const bool convert_result = ConvertRequestValueToFileInfo(
|
| result.Pass(), entry_path_.AsUTF8Unsafe() == FILE_PATH_LITERAL("/"),
|
| @@ -145,11 +148,16 @@ void GetMetadata::OnSuccess(int /* request_id */,
|
| callback_.Run(metadata.Pass(), base::File::FILE_OK);
|
| }
|
|
|
| -void GetMetadata::OnError(int /* request_id */,
|
| - scoped_ptr<RequestValue> /* result */,
|
| - base::File::Error error) {
|
| +template <int source>
|
| +void GetMetadata<source>::OnError(int /* request_id */,
|
| + scoped_ptr<RequestValue> /* result */,
|
| + base::File::Error error) {
|
| callback_.Run(make_scoped_ptr<EntryMetadata>(NULL), error);
|
| }
|
| +
|
| +template class GetMetadata<Source_Type::extension>;
|
| +template class GetMetadata<Source_Type::plugin>;
|
| +
|
| } // namespace operations
|
| } // namespace file_system_provider
|
| } // namespace chromeos
|
|
|