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 |
23 class HostResource; | 23 class HostResource; |
24 | 24 |
25 namespace proxy { | 25 namespace proxy { |
26 | 26 |
27 class PPB_FileSystem_Proxy : public InterfaceProxy { | 27 class PPB_FileSystem_Proxy : public InterfaceProxy { |
28 public: | 28 public: |
29 PPB_FileSystem_Proxy(Dispatcher* dispatcher, const void* target_interface); | 29 PPB_FileSystem_Proxy(Dispatcher* dispatcher); |
30 virtual ~PPB_FileSystem_Proxy(); | 30 virtual ~PPB_FileSystem_Proxy(); |
31 | 31 |
32 static const Info* GetInfo(); | 32 static const Info* GetInfo(); |
33 | 33 |
34 static PP_Resource CreateProxyResource(PP_Instance instance, | 34 static PP_Resource CreateProxyResource(PP_Instance instance, |
35 PP_FileSystemType type); | 35 PP_FileSystemType type); |
36 | 36 |
37 // InterfaceProxy implementation. | 37 // InterfaceProxy implementation. |
38 virtual bool OnMessageReceived(const IPC::Message& msg); | 38 virtual bool OnMessageReceived(const IPC::Message& msg); |
39 | 39 |
| 40 static const InterfaceID kInterfaceID = INTERFACE_ID_PPB_FILE_SYSTEM; |
| 41 |
40 private: | 42 private: |
41 // Message handlers. | 43 // Message handlers. |
42 void OnMsgCreate(PP_Instance instance, | 44 void OnMsgCreate(PP_Instance instance, |
43 int type, | 45 int type, |
44 ppapi::HostResource* result); | 46 ppapi::HostResource* result); |
45 void OnMsgOpen(const ppapi::HostResource& filesystem, | 47 void OnMsgOpen(const ppapi::HostResource& filesystem, |
46 int64_t expected_size); | 48 int64_t expected_size); |
47 | 49 |
48 void OnMsgOpenComplete(const ppapi::HostResource& filesystem, | 50 void OnMsgOpenComplete(const ppapi::HostResource& filesystem, |
49 int32_t result); | 51 int32_t result); |
50 | 52 |
51 void OpenCompleteInHost(int32_t result, | 53 void OpenCompleteInHost(int32_t result, |
52 const ppapi::HostResource& host_resource); | 54 const ppapi::HostResource& host_resource); |
53 | 55 |
54 pp::CompletionCallbackFactory<PPB_FileSystem_Proxy, | 56 pp::CompletionCallbackFactory<PPB_FileSystem_Proxy, |
55 ProxyNonThreadSafeRefCount> callback_factory_; | 57 ProxyNonThreadSafeRefCount> callback_factory_; |
56 | 58 |
57 DISALLOW_COPY_AND_ASSIGN(PPB_FileSystem_Proxy); | 59 DISALLOW_COPY_AND_ASSIGN(PPB_FileSystem_Proxy); |
58 }; | 60 }; |
59 | 61 |
60 } // namespace proxy | 62 } // namespace proxy |
61 } // namespace ppapi | 63 } // namespace ppapi |
62 | 64 |
63 #endif // PPAPI_PROXY_PPB_FILE_SYSTEM_PROXY_H_ | 65 #endif // PPAPI_PROXY_PPB_FILE_SYSTEM_PROXY_H_ |
OLD | NEW |