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

Unified Diff: ppapi/cpp/dev/filesystem_provider.h

Issue 1093383002: [WIP] Provided file system from NACL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Various cleanups Created 5 years, 7 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: 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..3430612824acdfbbf86dc9314f26306aee4bb86a
--- /dev/null
+++ b/ppapi/cpp/dev/filesystem_provider.h
@@ -0,0 +1,68 @@
+// 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"
+
+namespace pp{
+
+template <typename 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 CompletionCallbackWithOutput<PP_ProviderError_Dev>& cc );
+ int32_t Unmount(
+ const std::string& filesystem_id,
+ const CompletionCallbackWithOutput<PP_ProviderError_Dev>& cc );
+ // 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,
+ const PP_ProviderError_Dev& error,
+ int32_t request_id);
+ // Special Responses
+ int32_t SendMetadataSuccessResponse(
+ const PP_EntryMetadata_Dev& metadata,
+ int32_t request_id);
+ int32_t SendReadDirectorySuccessResponse(
+ const std::vector<PP_EntryMetadata_Dev>& 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 FreeWriteRequestBuffer(const void *buffer);
+
+protected:
+ InstanceHandle associated_instance_;
+
+}; // class Filesystem_Provider_Dev
+
+} // namespace pp
+
+#endif // FILESYSTEM_PROVIDER_H
+

Powered by Google App Engine
This is Rietveld 408576698