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

Unified Diff: ppapi/thunk/ppb_file_ref_thunk.cc

Issue 12817009: Add Query() support to FileRef (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits, more callback ref shuffling. 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/thunk/ppb_file_ref_thunk.cc
diff --git a/ppapi/thunk/ppb_file_ref_thunk.cc b/ppapi/thunk/ppb_file_ref_thunk.cc
index 74db50869580a21c025083e5df3d1ab5b3c50c89..4e61cd666d895100514d2a24aca0dd8e57f7ec93 100644
--- a/ppapi/thunk/ppb_file_ref_thunk.cc
+++ b/ppapi/thunk/ppb_file_ref_thunk.cc
@@ -105,6 +105,16 @@ int32_t Rename(PP_Resource file_ref,
enter.callback()));
}
+int32_t Query(PP_Resource file_ref,
+ PP_FileInfo* info,
+ PP_CompletionCallback callback) {
+ EnterFileRef enter(file_ref, callback, true);
+ if (enter.failed())
+ return enter.retval();
+ return enter.SetResult(enter.object()->Query(info,
+ enter.callback()));
+}
+
PP_Var GetAbsolutePath(PP_Resource file_ref) {
EnterFileRef enter(file_ref, true);
if (enter.failed())
@@ -112,7 +122,7 @@ PP_Var GetAbsolutePath(PP_Resource file_ref) {
return enter.object()->GetAbsolutePath();
}
-const PPB_FileRef g_ppb_file_ref_thunk = {
+const PPB_FileRef_1_0 g_ppb_file_ref_thunk_1_0 = {
&Create,
&IsFileRef,
&GetFileSystemType,
@@ -125,6 +135,20 @@ const PPB_FileRef g_ppb_file_ref_thunk = {
&Rename
};
+const PPB_FileRef_1_1 g_ppb_file_ref_thunk_1_1 = {
+ &Create,
+ &IsFileRef,
+ &GetFileSystemType,
+ &GetName,
+ &GetPath,
+ &GetParent,
+ &MakeDirectory,
+ &Touch,
+ &Delete,
+ &Rename,
+ &Query
+};
+
const PPB_FileRefPrivate g_ppb_file_ref_private_thunk = {
&GetAbsolutePath
};
@@ -132,7 +156,11 @@ const PPB_FileRefPrivate g_ppb_file_ref_private_thunk = {
} // namespace
const PPB_FileRef_1_0* GetPPB_FileRef_1_0_Thunk() {
- return &g_ppb_file_ref_thunk;
+ return &g_ppb_file_ref_thunk_1_0;
+}
+
+const PPB_FileRef_1_1* GetPPB_FileRef_1_1_Thunk() {
+ return &g_ppb_file_ref_thunk_1_1;
}
const PPB_FileRefPrivate_0_1* GetPPB_FileRefPrivate_0_1_Thunk() {

Powered by Google App Engine
This is Rietveld 408576698