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

Unified Diff: webkit/plugins/ppapi/ppb_file_ref_impl.h

Issue 12817009: Add Query() support to FileRef (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Take ref on PPB_FileRef_Impl instead of PluginInstance. 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: webkit/plugins/ppapi/ppb_file_ref_impl.h
diff --git a/webkit/plugins/ppapi/ppb_file_ref_impl.h b/webkit/plugins/ppapi/ppb_file_ref_impl.h
index a1856c0ce0f2607076936a43d8d2412fa9a19992..27a8ee85af5af0f4f2088ce71779933d8d063bbe 100644
--- a/webkit/plugins/ppapi/ppb_file_ref_impl.h
+++ b/webkit/plugins/ppapi/ppb_file_ref_impl.h
@@ -9,6 +9,7 @@
#include "base/files/file_path.h"
#include "googleurl/src/gurl.h"
+#include "ppapi/c/pp_file_info.h"
#include "ppapi/c/ppb_file_ref.h"
#include "ppapi/shared_impl/ppb_file_ref_shared.h"
#include "ppapi/shared_impl/var.h"
@@ -53,6 +54,9 @@ class WEBKIT_GLUE_EXPORT PPB_FileRef_Impl
virtual int32_t Rename(
PP_Resource new_file_ref,
scoped_refptr< ::ppapi::TrackedCallback> callback) OVERRIDE;
+ virtual int32_t Query(
+ PP_FileInfo* info,
+ scoped_refptr< ::ppapi::TrackedCallback> callback) OVERRIDE;
virtual PP_Var GetAbsolutePath();
PPB_FileSystem_Impl* file_system() const { return file_system_.get(); }
@@ -67,6 +71,17 @@ class WEBKIT_GLUE_EXPORT PPB_FileRef_Impl
// Checks if file ref has file system instance and if the instance is opened.
bool HasValidFileSystem() const;
private:
+ // Callbacks to support FileRef::Query.
+ void QueryCallback(PP_FileInfo* info,
+ scoped_refptr< ::ppapi::TrackedCallback> callback,
+ base::PlatformFileError error_code,
+ base::PassPlatformFile passed_file);
+ void GetFileInfoCallback(base::PlatformFile file,
+ PP_FileInfo* info,
+ scoped_refptr< ::ppapi::TrackedCallback> callback,
+ base::PlatformFileError error_code,
+ const base::PlatformFileInfo& file_info);
+
// Many mutation functions are allow only to non-external filesystems, This
// function returns true if the filesystem is opened and isn't external as an
// access check for these functions.

Powered by Google App Engine
This is Rietveld 408576698