Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(933)

Unified Diff: chrome/browser/chromeos/file_system_provider/operations/get_metadata.cc

Issue 1093383002: [WIP] Provided file system from NACL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved several modules to chromeos folder. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..82c204097aa2a53c5adbe8c5e61180358bd4307a 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 <class DestinationPolicy>
+GetMetadata<DestinationPolicy>::GetMetadata(
+ typename DestinationPolicy::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<DestinationPolicy>(event_router, file_system_info),
entry_path_(entry_path),
fields_(fields),
callback_(callback) {
}
-GetMetadata::~GetMetadata() {
+template <class DestinationPolicy>
+GetMetadata<DestinationPolicy>::~GetMetadata() {
}
-bool GetMetadata::Execute(int request_id) {
+template <class DestinationPolicy>
+bool GetMetadata<DestinationPolicy>::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 <class DestinationPolicy>
+void GetMetadata<DestinationPolicy>::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,15 @@ 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 <class DestinationPolicy>
+void GetMetadata<DestinationPolicy>::OnError(int /* request_id */,
+ scoped_ptr<RequestValue> /* result */,
+ base::File::Error error) {
callback_.Run(make_scoped_ptr<EntryMetadata>(NULL), error);
}
+
+FOR_EACH_DESTINATION_SPECIALIZE(GetMetadata)
+
} // namespace operations
} // namespace file_system_provider
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698