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_INTERFACE_PROXY_H_ | 5 #ifndef PPAPI_PROXY_INTERFACE_PROXY_H_ |
6 #define PPAPI_PROXY_INTERFACE_PROXY_H_ | 6 #define PPAPI_PROXY_INTERFACE_PROXY_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "ipc/ipc_channel.h" | 9 #include "ipc/ipc_channel.h" |
10 #include "ipc/ipc_message.h" | 10 #include "ipc/ipc_message.h" |
11 #include "ppapi/c/pp_completion_callback.h" | 11 #include "ppapi/c/pp_completion_callback.h" |
12 #include "ppapi/c/pp_resource.h" | 12 #include "ppapi/c/pp_resource.h" |
13 #include "ppapi/c/pp_var.h" | 13 #include "ppapi/c/pp_var.h" |
14 #include "ppapi/proxy/interface_id.h" | 14 #include "ppapi/shared_impl/api_id.h" |
15 #include "ppapi/shared_impl/function_group_base.h" | 15 #include "ppapi/shared_impl/function_group_base.h" |
16 | 16 |
17 namespace ppapi { | 17 namespace ppapi { |
18 namespace proxy { | 18 namespace proxy { |
19 | 19 |
20 class Dispatcher; | 20 class Dispatcher; |
21 | 21 |
22 class InterfaceProxy : public IPC::Channel::Listener, | 22 class InterfaceProxy : public IPC::Channel::Listener, |
23 public IPC::Message::Sender, | 23 public IPC::Message::Sender, |
24 public FunctionGroupBase { | 24 public FunctionGroupBase { |
25 public: | 25 public: |
26 // Factory function type for interfaces. Ownership of the returned pointer | 26 // Factory function type for interfaces. Ownership of the returned pointer |
27 // is transferred to the caller. | 27 // is transferred to the caller. |
28 typedef InterfaceProxy* (*Factory)(Dispatcher* dispatcher); | 28 typedef InterfaceProxy* (*Factory)(Dispatcher* dispatcher); |
29 | 29 |
30 // DEPRECATED: New classes should be registered directly in the interface | 30 // DEPRECATED: New classes should be registered directly in the interface |
31 // list. This is kept around until we convert all the existing code. | 31 // list. This is kept around until we convert all the existing code. |
32 // | 32 // |
33 // Information about the interface. Each interface has a static function to | 33 // Information about the interface. Each interface has a static function to |
34 // return its info, which allows either construction on the target side, and | 34 // return its info, which allows either construction on the target side, and |
35 // getting the proxied interface on the source side (see dispatcher.h for | 35 // getting the proxied interface on the source side (see dispatcher.h for |
36 // terminology). | 36 // terminology). |
37 struct Info { | 37 struct Info { |
38 const void* interface_ptr; | 38 const void* interface_ptr; |
39 | 39 |
40 const char* name; | 40 const char* name; |
41 InterfaceID id; | 41 ApiID id; |
42 | 42 |
43 bool is_trusted; | 43 bool is_trusted; |
44 | 44 |
45 InterfaceProxy::Factory create_proxy; | 45 InterfaceProxy::Factory create_proxy; |
46 }; | 46 }; |
47 | 47 |
48 virtual ~InterfaceProxy(); | 48 virtual ~InterfaceProxy(); |
49 | 49 |
50 Dispatcher* dispatcher() const { return dispatcher_; } | 50 Dispatcher* dispatcher() const { return dispatcher_; } |
51 | 51 |
(...skipping 13 matching lines...) Expand all Loading... |
65 | 65 |
66 private: | 66 private: |
67 Dispatcher* dispatcher_; | 67 Dispatcher* dispatcher_; |
68 }; | 68 }; |
69 | 69 |
70 } // namespace proxy | 70 } // namespace proxy |
71 } // namespace ppapi | 71 } // namespace ppapi |
72 | 72 |
73 #endif // PPAPI_PROXY_INTERFACE_PROXY_H_ | 73 #endif // PPAPI_PROXY_INTERFACE_PROXY_H_ |
74 | 74 |
OLD | NEW |