summaryrefslogtreecommitdiffstats
path: root/ppapi/thunk
diff options
context:
space:
mode:
authorteravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-02 09:10:41 +0000
committerteravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-02 09:10:41 +0000
commitd4edb10981caaa389d94036be4f522925ea3d159 (patch)
treebf80a6ddc3f546c458cfbe07b22b985c98751a8a /ppapi/thunk
parent9c01b408cf7799799d1a3acec89685510ef94e51 (diff)
downloadchromium_src-d4edb10981caaa389d94036be4f522925ea3d159.zip
chromium_src-d4edb10981caaa389d94036be4f522925ea3d159.tar.gz
chromium_src-d4edb10981caaa389d94036be4f522925ea3d159.tar.bz2
Add Query() support to FileRef.
This change brings Query() support back to FileRef for in-process and out-of-process plugins. I've added testing for a file that exists and one that doesn't. BUG=170721 Review URL: https://chromiumcodereview.appspot.com/12817009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191805 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/thunk')
-rw-r--r--ppapi/thunk/interfaces_ppb_public_stable.h1
-rw-r--r--ppapi/thunk/ppb_file_ref_api.h2
-rw-r--r--ppapi/thunk/ppb_file_ref_thunk.cc32
3 files changed, 33 insertions, 2 deletions
diff --git a/ppapi/thunk/interfaces_ppb_public_stable.h b/ppapi/thunk/interfaces_ppb_public_stable.h
index 3bf9479..588896f 100644
--- a/ppapi/thunk/interfaces_ppb_public_stable.h
+++ b/ppapi/thunk/interfaces_ppb_public_stable.h
@@ -48,6 +48,7 @@ UNPROXIED_API(PPB_AudioConfig)
// Note: Core is special and is registered manually.
PROXIED_IFACE(PPB_Audio, PPB_AUDIO_INTERFACE_1_0, PPB_Audio_1_0)
PROXIED_IFACE(PPB_FileRef, PPB_FILEREF_INTERFACE_1_0, PPB_FileRef_1_0)
+PROXIED_IFACE(PPB_FileRef, PPB_FILEREF_INTERFACE_1_1, PPB_FileRef_1_1)
PROXIED_IFACE(PPB_FileSystem, PPB_FILESYSTEM_INTERFACE_1_0, PPB_FileSystem_1_0)
PROXIED_IFACE(PPB_Graphics3D, PPB_GRAPHICS_3D_INTERFACE_1_0, PPB_Graphics3D_1_0)
PROXIED_IFACE(PPB_ImageData, PPB_IMAGEDATA_INTERFACE_1_0, PPB_ImageData_1_0)
diff --git a/ppapi/thunk/ppb_file_ref_api.h b/ppapi/thunk/ppb_file_ref_api.h
index 0f9bbaa..4ec5314 100644
--- a/ppapi/thunk/ppb_file_ref_api.h
+++ b/ppapi/thunk/ppb_file_ref_api.h
@@ -32,6 +32,8 @@ class PPAPI_THUNK_EXPORT PPB_FileRef_API {
virtual int32_t Delete(scoped_refptr<TrackedCallback> callback) = 0;
virtual int32_t Rename(PP_Resource new_file_ref,
scoped_refptr<TrackedCallback> callback) = 0;
+ virtual int32_t Query(PP_FileInfo* info,
+ scoped_refptr<TrackedCallback> callback) = 0;
// Internal function for use in proxying. Returns the internal CreateInfo
// (the contained resource does not carry a ref on behalf of the caller).
diff --git a/ppapi/thunk/ppb_file_ref_thunk.cc b/ppapi/thunk/ppb_file_ref_thunk.cc
index 74db508..4e61cd6 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() {