OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 #ifndef FILESYSTEM_PROVIDER_H |
| 5 #define FILESYSTEM_PROVIDER_H |
| 6 |
| 7 #include <string> |
| 8 #include <vector> |
| 9 |
| 10 #include "ppapi/c/dev/ppb_filesystemprovider_dev.h" |
| 11 #include "ppapi/cpp/resource.h" |
| 12 |
| 13 namespace pp{ |
| 14 |
| 15 template <typename T> class CompletionCallbackWithOutput; |
| 16 class InstanceHandle; |
| 17 class Instance; |
| 18 |
| 19 class Filesystem_Provider_Dev : Resource { |
| 20 public: |
| 21 // Creates it but doesn't mount it |
| 22 Filesystem_Provider_Dev( pp::Instance *instance ); |
| 23 virtual ~Filesystem_Provider_Dev(); |
| 24 static bool IsAvailable(); |
| 25 |
| 26 // PPB_FilesystemProvider interfaces |
| 27 int32_t Mount( |
| 28 const std::string& filesystem_id, |
| 29 const std::string& display_name, |
| 30 bool writable, int32_t opened_files_limit, |
| 31 const CompletionCallbackWithOutput<PP_ProviderError_Dev>& cc ); |
| 32 int32_t Unmount( |
| 33 const std::string& filesystem_id, |
| 34 const CompletionCallbackWithOutput<PP_ProviderError_Dev>& cc ); |
| 35 // Response for requests |
| 36 int32_t SendSuccessResponse( |
| 37 const PP_OperationType_Dev operation_type, |
| 38 int32_t request_id); |
| 39 int32_t SendErrorResponse( |
| 40 const PP_OperationType_Dev& operation_type, |
| 41 const PP_ProviderError_Dev& error, |
| 42 int32_t request_id); |
| 43 // Special Responses |
| 44 int32_t SendMetadataSuccessResponse( |
| 45 const PP_EntryMetadata_Dev& metadata, |
| 46 int32_t request_id); |
| 47 int32_t SendReadDirectorySuccessResponse( |
| 48 const std::vector<PP_EntryMetadata_Dev>& entries, |
| 49 bool has_more, |
| 50 int32_t request_id ); |
| 51 int32_t SendReadFileSuccessResponse( |
| 52 uint32_t data_size, |
| 53 const char* data, |
| 54 bool has_more, |
| 55 int32_t request_id ); |
| 56 int32_t GetNextRequest( |
| 57 const CompletionCallbackWithOutput<PP_FilesystemRequest>& cc); |
| 58 int32_t FreeWriteRequestBuffer(const void *buffer); |
| 59 |
| 60 protected: |
| 61 InstanceHandle associated_instance_; |
| 62 |
| 63 }; // class Filesystem_Provider_Dev |
| 64 |
| 65 } // namespace pp |
| 66 |
| 67 #endif // FILESYSTEM_PROVIDER_H |
| 68 |
OLD | NEW |