Index: ppapi/cpp/dev/filesystem_provider.h |
diff --git a/ppapi/cpp/dev/filesystem_provider.h b/ppapi/cpp/dev/filesystem_provider.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c1660e4b0b537c1304af6946e6279d812f78cae5 |
--- /dev/null |
+++ b/ppapi/cpp/dev/filesystem_provider.h |
@@ -0,0 +1,74 @@ |
+// Copyright 2015 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. |
+#ifndef FILESYSTEM_PROVIDER_H |
+#define FILESYSTEM_PROVIDER_H |
+ |
+#include <string> |
+#include <vector> |
+ |
+#include "ppapi/c/dev/ppb_filesystemprovider_dev.h" |
+#include "ppapi/cpp/resource.h" |
+#include "ppapi/cpp/var_dictionary.h" |
+#include "ppapi/cpp/var_array.h" |
+ |
+namespace pp{ |
+ |
+class CompletionCallback; |
+template <class T> class CompletionCallbackWithOutput; |
+class InstanceHandle; |
+class Instance; |
+ |
+class Filesystem_Provider_Dev : Resource { |
+ public: |
+ // Creates it but doesn't mount it |
+ Filesystem_Provider_Dev( pp::Instance *instance ); |
+ virtual ~Filesystem_Provider_Dev(); |
+ static bool IsAvailable(); |
+ |
+ // PPB_FilesystemProvider interfaces |
+ int32_t Mount( |
+ const std::string& filesystem_id, |
+ const std::string& display_name, |
+ bool writable, |
+ int32_t opened_files_limit, |
+ const CompletionCallback& cc ); |
+ int32_t Unmount( |
+ const std::string& filesystem_id, |
+ const CompletionCallback& cc ); |
+ int32_t Notify(const VarDictionary& options_notify); |
+ |
+ // Response for requests |
+ int32_t SendSuccessResponse( |
+ const PP_OperationType_Dev operation_type, |
+ int32_t request_id); |
+ int32_t SendErrorResponse( |
+ const PP_OperationType_Dev& operation_type, |
+ int32_t error, |
+ int32_t request_id); |
+ // Special Responses |
+ int32_t SendMetadataSuccessResponse( |
+ const VarDictionary& metadata, |
+ int32_t request_id); |
+ int32_t SendReadDirectorySuccessResponse( |
+ const VarArray& entries, |
+ bool has_more, |
+ int32_t request_id ); |
+ int32_t SendReadFileSuccessResponse( |
+ uint32_t data_size, |
+ const char* data, |
+ bool has_more, |
+ int32_t request_id ); |
+ int32_t GetNextRequest( |
+ const CompletionCallbackWithOutput<PP_FilesystemRequest>& cc); |
+ int32_t ReleaseRequestBuffer(int32_t request_id); |
+ |
+protected: |
+ InstanceHandle associated_instance_; |
+ |
+}; // class Filesystem_Provider_Dev |
+ |
+} // namespace pp |
+ |
+#endif // FILESYSTEM_PROVIDER_H |
+ |