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/cpp/completion_callback.h" |
| 15 #include "ppapi/proxy/interface_proxy.h" |
| 16 #include "ppapi/proxy/proxy_non_thread_safe_ref_count.h" |
| 17 |
| 18 struct PPB_FileSystem_Dev; |
| 19 |
| 20 namespace pp { |
| 21 namespace proxy { |
| 22 |
| 23 class HostResource; |
| 24 |
| 25 class PPB_FileSystem_Proxy : public InterfaceProxy { |
| 26 public: |
| 27 PPB_FileSystem_Proxy(Dispatcher* dispatcher, const void* target_interface); |
| 28 virtual ~PPB_FileSystem_Proxy(); |
| 29 |
| 30 static const Info* GetInfo(); |
| 31 |
| 32 const PPB_FileSystem_Dev* ppb_file_system_target() const { |
| 33 return static_cast<const PPB_FileSystem_Dev*>(target_interface()); |
| 34 } |
| 35 |
| 36 // InterfaceProxy implementation. |
| 37 virtual bool OnMessageReceived(const IPC::Message& msg); |
| 38 |
| 39 private: |
| 40 // Message handlers. |
| 41 void OnMsgCreate(PP_Instance instance, |
| 42 int type, |
| 43 HostResource* result); |
| 44 void OnMsgOpen(const HostResource& filesystem, |
| 45 int64_t expected_size); |
| 46 |
| 47 void OnMsgOpenComplete(const HostResource& filesystem, |
| 48 int32_t result); |
| 49 |
| 50 void OpenCompleteInHost(int32_t result, const HostResource& host_resource); |
| 51 |
| 52 CompletionCallbackFactory<PPB_FileSystem_Proxy, |
| 53 ProxyNonThreadSafeRefCount> callback_factory_; |
| 54 |
| 55 DISALLOW_COPY_AND_ASSIGN(PPB_FileSystem_Proxy); |
| 56 }; |
| 57 |
| 58 } // namespace proxy |
| 59 } // namespace pp |
| 60 |
| 61 #endif // PPAPI_PROXY_PPB_FILE_SYSTEM_PROXY_H_ |
OLD | NEW |