OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef PPAPI_PROXY_PPB_FILE_SYSTEM_PROXY_H_ | 5 #ifndef PPAPI_PROXY_PPB_FILE_SYSTEM_PROXY_H_ |
6 #define PPAPI_PROXY_PPB_FILE_SYSTEM_PROXY_H_ | 6 #define PPAPI_PROXY_PPB_FILE_SYSTEM_PROXY_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "ppapi/c/pp_instance.h" | 11 #include "ppapi/c/pp_instance.h" |
12 #include "ppapi/c/pp_resource.h" | 12 #include "ppapi/c/pp_resource.h" |
13 #include "ppapi/c/pp_time.h" | 13 #include "ppapi/c/pp_time.h" |
14 #include "ppapi/c/ppb_file_system.h" | 14 #include "ppapi/c/ppb_file_system.h" |
15 #include "ppapi/cpp/completion_callback.h" | 15 #include "ppapi/cpp/completion_callback.h" |
16 #include "ppapi/proxy/interface_proxy.h" | 16 #include "ppapi/proxy/interface_proxy.h" |
17 #include "ppapi/proxy/proxy_non_thread_safe_ref_count.h" | 17 #include "ppapi/proxy/proxy_non_thread_safe_ref_count.h" |
18 | 18 |
19 struct PPB_FileSystem_Dev; | 19 struct PPB_FileSystem_Dev; |
20 | 20 |
21 namespace ppapi { | 21 namespace ppapi { |
| 22 |
22 class HostResource; | 23 class HostResource; |
23 } | |
24 | 24 |
25 namespace pp { | |
26 namespace proxy { | 25 namespace proxy { |
27 | 26 |
28 class PPB_FileSystem_Proxy : public InterfaceProxy { | 27 class PPB_FileSystem_Proxy : public InterfaceProxy { |
29 public: | 28 public: |
30 PPB_FileSystem_Proxy(Dispatcher* dispatcher, const void* target_interface); | 29 PPB_FileSystem_Proxy(Dispatcher* dispatcher, const void* target_interface); |
31 virtual ~PPB_FileSystem_Proxy(); | 30 virtual ~PPB_FileSystem_Proxy(); |
32 | 31 |
33 static const Info* GetInfo(); | 32 static const Info* GetInfo(); |
34 | 33 |
35 static PP_Resource CreateProxyResource(PP_Instance instance, | 34 static PP_Resource CreateProxyResource(PP_Instance instance, |
36 PP_FileSystemType type); | 35 PP_FileSystemType type); |
37 | 36 |
38 // InterfaceProxy implementation. | 37 // InterfaceProxy implementation. |
39 virtual bool OnMessageReceived(const IPC::Message& msg); | 38 virtual bool OnMessageReceived(const IPC::Message& msg); |
40 | 39 |
41 private: | 40 private: |
42 // Message handlers. | 41 // Message handlers. |
43 void OnMsgCreate(PP_Instance instance, | 42 void OnMsgCreate(PP_Instance instance, |
44 int type, | 43 int type, |
45 ppapi::HostResource* result); | 44 ppapi::HostResource* result); |
46 void OnMsgOpen(const ppapi::HostResource& filesystem, | 45 void OnMsgOpen(const ppapi::HostResource& filesystem, |
47 int64_t expected_size); | 46 int64_t expected_size); |
48 | 47 |
49 void OnMsgOpenComplete(const ppapi::HostResource& filesystem, | 48 void OnMsgOpenComplete(const ppapi::HostResource& filesystem, |
50 int32_t result); | 49 int32_t result); |
51 | 50 |
52 void OpenCompleteInHost(int32_t result, | 51 void OpenCompleteInHost(int32_t result, |
53 const ppapi::HostResource& host_resource); | 52 const ppapi::HostResource& host_resource); |
54 | 53 |
55 CompletionCallbackFactory<PPB_FileSystem_Proxy, | 54 pp::CompletionCallbackFactory<PPB_FileSystem_Proxy, |
56 ProxyNonThreadSafeRefCount> callback_factory_; | 55 ProxyNonThreadSafeRefCount> callback_factory_; |
57 | 56 |
58 DISALLOW_COPY_AND_ASSIGN(PPB_FileSystem_Proxy); | 57 DISALLOW_COPY_AND_ASSIGN(PPB_FileSystem_Proxy); |
59 }; | 58 }; |
60 | 59 |
61 } // namespace proxy | 60 } // namespace proxy |
62 } // namespace pp | 61 } // namespace ppapi |
63 | 62 |
64 #endif // PPAPI_PROXY_PPB_FILE_SYSTEM_PROXY_H_ | 63 #endif // PPAPI_PROXY_PPB_FILE_SYSTEM_PROXY_H_ |
OLD | NEW |