| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2011 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 PPAPI_PROXY_PPB_FILE_SYSTEM_PROXY_H_ | |
| 6 #define PPAPI_PROXY_PPB_FILE_SYSTEM_PROXY_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/basictypes.h" | |
| 11 #include "ppapi/c/pp_instance.h" | |
| 12 #include "ppapi/c/pp_resource.h" | |
| 13 #include "ppapi/c/pp_time.h" | |
| 14 #include "ppapi/c/ppb_file_system.h" | |
| 15 #include "ppapi/proxy/interface_proxy.h" | |
| 16 #include "ppapi/proxy/proxy_completion_callback_factory.h" | |
| 17 #include "ppapi/utility/completion_callback_factory.h" | |
| 18 | |
| 19 namespace ppapi { | |
| 20 | |
| 21 class HostResource; | |
| 22 | |
| 23 namespace proxy { | |
| 24 | |
| 25 class PPB_FileSystem_Proxy : public InterfaceProxy { | |
| 26 public: | |
| 27 explicit PPB_FileSystem_Proxy(Dispatcher* dispatcher); | |
| 28 virtual ~PPB_FileSystem_Proxy(); | |
| 29 | |
| 30 static const Info* GetInfo(); | |
| 31 | |
| 32 static PP_Resource CreateProxyResource(PP_Instance instance, | |
| 33 PP_FileSystemType type); | |
| 34 | |
| 35 // InterfaceProxy implementation. | |
| 36 virtual bool OnMessageReceived(const IPC::Message& msg); | |
| 37 | |
| 38 static const ApiID kApiID = API_ID_PPB_FILE_SYSTEM; | |
| 39 | |
| 40 private: | |
| 41 // Message handlers. | |
| 42 void OnMsgCreate(PP_Instance instance, | |
| 43 int type, | |
| 44 ppapi::HostResource* result); | |
| 45 void OnMsgOpen(const ppapi::HostResource& filesystem, | |
| 46 int64_t expected_size); | |
| 47 | |
| 48 void OnMsgOpenComplete(const ppapi::HostResource& filesystem, | |
| 49 int32_t result); | |
| 50 | |
| 51 void OpenCompleteInHost(int32_t result, | |
| 52 const ppapi::HostResource& host_resource); | |
| 53 | |
| 54 ProxyCompletionCallbackFactory<PPB_FileSystem_Proxy> callback_factory_; | |
| 55 | |
| 56 DISALLOW_COPY_AND_ASSIGN(PPB_FileSystem_Proxy); | |
| 57 }; | |
| 58 | |
| 59 } // namespace proxy | |
| 60 } // namespace ppapi | |
| 61 | |
| 62 #endif // PPAPI_PROXY_PPB_FILE_SYSTEM_PROXY_H_ | |
| OLD | NEW |