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

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: Use the newest interface for every cpp FileRef call. 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..9f0cdbb70f40a7aa2e61f1844f4afc063751415f 100644
--- a/webkit/plugins/ppapi/ppb_file_ref_impl.h
+++ b/webkit/plugins/ppapi/ppb_file_ref_impl.h
@@ -8,7 +8,9 @@
#include <string>
#include "base/files/file_path.h"
+#include "base/memory/weak_ptr.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 +55,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 +72,15 @@ 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:
+ void QueryCallback(PP_FileInfo* info,
+ scoped_refptr< ::ppapi::TrackedCallback> callback,
+ base::PlatformFileError error_code,
+ base::PassPlatformFile passed_file);
+ void GetFileInfoCallback(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.
@@ -82,6 +96,10 @@ class WEBKIT_GLUE_EXPORT PPB_FileRef_Impl
// return the identical string object every time it is requested.
scoped_refptr<StringVar> external_path_var_;
+ // This class makes asynchronous calls to perform file operations to support
+ // Query().
+ base::WeakPtrFactory<PPB_FileRef_Impl> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(PPB_FileRef_Impl);
};

Powered by Google App Engine
This is Rietveld 408576698