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

Unified Diff: ppapi/cpp/file_ref.cc

Issue 12817009: Add Query() support to FileRef (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 9 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: ppapi/cpp/file_ref.cc
diff --git a/ppapi/cpp/file_ref.cc b/ppapi/cpp/file_ref.cc
index fbfd49b489b3723a25e76eafca9a8331688cf1ab..ac2490c3990c5101504374f3e72d60bd94e2cbf7 100644
--- a/ppapi/cpp/file_ref.cc
+++ b/ppapi/cpp/file_ref.cc
@@ -18,6 +18,10 @@ template <> const char* interface_name<PPB_FileRef_1_0>() {
return PPB_FILEREF_INTERFACE_1_0;
}
+template <> const char* interface_name<PPB_FileRef_1_1>() {
+ return PPB_FILEREF_INTERFACE_1_1;
+}
+
} // namespace
FileRef::FileRef(PP_Resource resource) : Resource(resource) {
@@ -109,4 +113,12 @@ int32_t FileRef::Rename(const FileRef& new_file_ref,
pp_resource(), new_file_ref.pp_resource(), cc.pp_completion_callback());
}
+int32_t FileRef::Query(const CompletionCallbackWithOutput<PP_FileInfo>& cc) {
+ if (!has_interface<PPB_FileRef_1_1>())
+ return cc.MayForce(PP_ERROR_NOINTERFACE);
+ return get_interface<PPB_FileRef_1_1>()->Query(
+ pp_resource(), cc.output(), cc.pp_completion_callback());
+}
+
+
} // namespace pp

Powered by Google App Engine
This is Rietveld 408576698