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 |
| 5 #ifndef PEPPERFILESYSTEMPROVIDERHOST_H |
| 6 #define PEPPERFILESYSTEMPROVIDERHOST_H |
| 7 |
| 8 #include "ppapi/host/host_message_context.h" |
| 9 #include "ppapi/host/resource_host.h" |
| 10 |
| 11 namespace content { |
| 12 |
| 13 class PepperFilesystemProviderBackend { |
| 14 public: |
| 15 virtual ~PepperFilesystemProviderBackend(); |
| 16 // Messages that interface with the provided filesystem backend |
| 17 virtual int32_t SendMountRequest( |
| 18 ppapi::host::HostMessageContext *context, |
| 19 const base::ListValue&)=0; |
| 20 virtual int32_t SendUnmountRequest( |
| 21 ppapi::host::HostMessageContext* context, |
| 22 std::string )=0; |
| 23 virtual int32_t OnPluginResponse( |
| 24 ppapi::host::HostMessageContext* context, |
| 25 const base::ListValue&)=0; |
| 26 virtual int32_t OnPluginWriteAck( |
| 27 ppapi::host::HostMessageContext* context)=0; |
| 28 }; |
| 29 |
| 30 |
| 31 class BrowserPpapiHost; |
| 32 |
| 33 class PepperFilesystemProviderHost : |
| 34 public ppapi::host::ResourceHost |
| 35 { |
| 36 public: |
| 37 PepperFilesystemProviderHost( BrowserPpapiHost *host, |
| 38 PP_Instance instance, |
| 39 PP_Resource resource); |
| 40 ~PepperFilesystemProviderHost()override; |
| 41 private: |
| 42 scoped_ptr<PepperFilesystemProviderBackend> backend_; |
| 43 |
| 44 // ResourceMessageHandler interface |
| 45 protected: |
| 46 int32_t OnResourceMessageReceived( |
| 47 const IPC::Message& msg, ppapi::host::HostMessageContext*context)override; |
| 48 // Messages that interface with the provided filesystem backend |
| 49 int32_t OnHostMsgMount(ppapi::host::HostMessageContext *context, |
| 50 const base::ListValue&); |
| 51 int32_t OnHostMsgUnmount(ppapi::host::HostMessageContext* context, |
| 52 std::string ); |
| 53 int32_t OnHostMsgPluginResponse( ppapi::host::HostMessageContext* context, |
| 54 const base::ListValue& ); |
| 55 int32_t OnHostMsgPluginWriteAck(ppapi::host::HostMessageContext* context); |
| 56 }; |
| 57 } // namespace content |
| 58 |
| 59 #endif // PEPPERFILESYSTEMPROVIDERHOST_H |
OLD | NEW |