summaryrefslogtreecommitdiffstats
path: root/ppapi/c/dev
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-21 23:49:16 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-21 23:49:16 +0000
commitce482dfe397df7f7c06901ade9f35b10fd32aa94 (patch)
tree88e2dca000032b47b12edfa908c8e8ec0f4ddab3 /ppapi/c/dev
parent563532cca9b9c670f77c16b70034e4fe2aad7e7e (diff)
downloadchromium_src-ce482dfe397df7f7c06901ade9f35b10fd32aa94.zip
chromium_src-ce482dfe397df7f7c06901ade9f35b10fd32aa94.tar.gz
chromium_src-ce482dfe397df7f7c06901ade9f35b10fd32aa94.tar.bz2
Implement the filesystem proxy. This allows the FileRef tests (the ones which
don't use FileIO which isn't don yet) to pass in the proxy. Hook up the code from the URLLoader that downloads to a file. This allows all URLLoader tests to pass in the proxy. Change code in dispatcher that zeros out the array to take into account padding. It was only zero-filling half of the array since sizeof(enum) * # elts seems to be half as large as the actual array due to padding on 64-bit systems. Make the aborted completion callbacks run asynchronously. This was caught by one of the file ref tests. We really need a system for doing this better, but I don't want to do that in this patch. TEST=ppapi_tests run under proxy Review URL: http://codereview.chromium.org/6543028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75566 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/c/dev')
-rw-r--r--ppapi/c/dev/pp_file_info_dev.h1
-rw-r--r--ppapi/c/dev/ppb_file_ref_dev.h3
-rw-r--r--ppapi/c/dev/ppb_file_system_dev.h27
3 files changed, 25 insertions, 6 deletions
diff --git a/ppapi/c/dev/pp_file_info_dev.h b/ppapi/c/dev/pp_file_info_dev.h
index dd247fc..782b4f9 100644
--- a/ppapi/c/dev/pp_file_info_dev.h
+++ b/ppapi/c/dev/pp_file_info_dev.h
@@ -17,6 +17,7 @@ typedef enum {
PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_FileType_Dev, 4);
typedef enum {
+ PP_FILESYSTEMTYPE_INVALID = 0, /* For identifying invalid return values. */
PP_FILESYSTEMTYPE_EXTERNAL,
PP_FILESYSTEMTYPE_LOCALPERSISTENT,
PP_FILESYSTEMTYPE_LOCALTEMPORARY
diff --git a/ppapi/c/dev/ppb_file_ref_dev.h b/ppapi/c/dev/ppb_file_ref_dev.h
index 4799b34..24cb21d 100644
--- a/ppapi/c/dev/ppb_file_ref_dev.h
+++ b/ppapi/c/dev/ppb_file_ref_dev.h
@@ -24,7 +24,8 @@ struct PPB_FileRef_Dev {
// resource is invalid or some type other than a FileRef.
PP_Bool (*IsFileRef)(PP_Resource resource);
- // Returns the file system identifier of this file.
+ // Returns the file system identifier of this file, or
+ // PP_FILESYSTEMTYPE_INVALID if the file ref is invalid.
PP_FileSystemType_Dev (*GetFileSystemType)(PP_Resource file_ref);
// Returns the name of the file. The value returned by this function does not
diff --git a/ppapi/c/dev/ppb_file_system_dev.h b/ppapi/c/dev/ppb_file_system_dev.h
index 69b18bd..768c35f 100644
--- a/ppapi/c/dev/ppb_file_system_dev.h
+++ b/ppapi/c/dev/ppb_file_system_dev.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010 The Chromium Authors. All rights reserved.
+/* Copyright (c) 2011 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
@@ -6,6 +6,7 @@
#define PPAPI_C_DEV_PPB_FILE_SYSTEM_DEV_H_
#include "ppapi/c/dev/pp_file_info_dev.h"
+#include "ppapi/c/pp_bool.h"
#include "ppapi/c/pp_instance.h"
#include "ppapi/c/pp_resource.h"
#include "ppapi/c/pp_stdint.h"
@@ -13,17 +14,33 @@
struct PP_CompletionCallback;
-#define PPB_FILESYSTEM_DEV_INTERFACE "PPB_FileSystem(Dev);0.3"
+#define PPB_FILESYSTEM_DEV_INTERFACE "PPB_FileSystem(Dev);0.4"
struct PPB_FileSystem_Dev {
- // Creates a weak pointer to the filesystem of the given type.
+ /** Creates a filesystem object of the given type. */
PP_Resource (*Create)(PP_Instance instance, PP_FileSystemType_Dev type);
- // Opens the file system. A file system must be opened before running any
- // other operation on it.
+ /** Returns PP_TRUE if the given resource is a FileSystem. */
+ PP_Bool (*IsFileSystem)(PP_Resource resource);
+
+ /**
+ * Opens the file system. A file system must be opened before running any
+ * other operation on it.
+ *
+ * TODO(brettw) clarify whether this must have completed before a file can
+ * be opened in it. Clarify what it means to be "completed."
+ */
int32_t (*Open)(PP_Resource file_system,
int64_t expected_size,
struct PP_CompletionCallback callback);
+
+ /**
+ * Returns the type of the given file system.
+ *
+ * Returns PP_FILESYSTEMTYPE_INVALID if the given resource is not a valid
+ * filesystem. It is valid to call this function even before Open completes.
+ */
+ PP_FileSystemType_Dev (*GetType)(PP_Resource file_system);
};
#endif /* PPAPI_C_DEV_PPB_FILE_SYSTEM_DEV_H_ */