[email protected] | 4d2efd2 | 2011-08-18 21:58:02 | [diff] [blame^] | 1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
[email protected] | f6b8a8d | 2010-11-05 22:13:39 | [diff] [blame] | 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_PPP_CLASS_PROXY_H_ |
| 6 | #define PPAPI_PROXY_PPP_CLASS_PROXY_H_ |
| 7 | |
| 8 | #include <vector> |
| 9 | |
| 10 | #include "base/basictypes.h" |
| 11 | #include "ppapi/c/pp_module.h" |
| 12 | #include "ppapi/c/pp_var.h" |
| 13 | #include "ppapi/proxy/interface_proxy.h" |
| 14 | |
| 15 | struct PPB_Var_Deprecated; |
| 16 | struct PPP_Class_Deprecated; |
| 17 | |
[email protected] | 4d2efd2 | 2011-08-18 21:58:02 | [diff] [blame^] | 18 | namespace ppapi { |
[email protected] | f6b8a8d | 2010-11-05 22:13:39 | [diff] [blame] | 19 | namespace proxy { |
| 20 | |
| 21 | class SerializedVar; |
| 22 | class SerializedVarReceiveInput; |
| 23 | class SerializedVarVectorReceiveInput; |
| 24 | class SerializedVarOutParam; |
| 25 | class SerializedVarReturnValue; |
| 26 | |
| 27 | class PPP_Class_Proxy : public InterfaceProxy { |
| 28 | public: |
| 29 | // PPP_Class isn't a normal interface that you can query for, so this |
| 30 | // constructor doesn't take an interface pointer. |
| 31 | PPP_Class_Proxy(Dispatcher* dispatcher); |
| 32 | virtual ~PPP_Class_Proxy(); |
| 33 | |
| 34 | // Creates a proxied object in the browser process. This takes the browser's |
| 35 | // PPB_Var_Deprecated interface to use to create the object. The class and |
| 36 | static PP_Var CreateProxiedObject(const PPB_Var_Deprecated* var, |
| 37 | Dispatcher* dispatcher, |
| 38 | PP_Module module_id, |
| 39 | int64 ppp_class, |
| 40 | int64 class_data); |
| 41 | |
| 42 | // InterfaceProxy implementation. |
[email protected] | a95986a8 | 2010-12-24 06:19:28 | [diff] [blame] | 43 | virtual bool OnMessageReceived(const IPC::Message& msg); |
[email protected] | f6b8a8d | 2010-11-05 22:13:39 | [diff] [blame] | 44 | |
| 45 | private: |
| 46 | // IPC message handlers. |
| 47 | void OnMsgHasProperty(int64 ppp_class, int64 object, |
| 48 | SerializedVarReceiveInput property, |
| 49 | SerializedVarOutParam exception, |
| 50 | bool* result); |
| 51 | void OnMsgHasMethod(int64 ppp_class, int64 object, |
| 52 | SerializedVarReceiveInput property, |
| 53 | SerializedVarOutParam exception, |
| 54 | bool* result); |
| 55 | void OnMsgGetProperty(int64 ppp_class, int64 object, |
| 56 | SerializedVarReceiveInput property, |
| 57 | SerializedVarOutParam exception, |
| 58 | SerializedVarReturnValue result); |
| 59 | void OnMsgEnumerateProperties( |
| 60 | int64 ppp_class, int64 object, |
[email protected] | 4d2efd2 | 2011-08-18 21:58:02 | [diff] [blame^] | 61 | std::vector<SerializedVar>* props, |
[email protected] | f6b8a8d | 2010-11-05 22:13:39 | [diff] [blame] | 62 | SerializedVarOutParam exception); |
| 63 | void OnMsgSetProperty(int64 ppp_class, int64 object, |
| 64 | SerializedVarReceiveInput property, |
| 65 | SerializedVarReceiveInput value, |
| 66 | SerializedVarOutParam exception); |
| 67 | void OnMsgRemoveProperty(int64 ppp_class, int64 object, |
| 68 | SerializedVarReceiveInput property, |
| 69 | SerializedVarOutParam exception); |
| 70 | void OnMsgCall(int64 ppp_class, int64 object, |
| 71 | SerializedVarReceiveInput method_name, |
| 72 | SerializedVarVectorReceiveInput arg_vector, |
| 73 | SerializedVarOutParam exception, |
| 74 | SerializedVarReturnValue result); |
| 75 | void OnMsgConstruct(int64 ppp_class, int64 object, |
| 76 | SerializedVarVectorReceiveInput arg_vector, |
| 77 | SerializedVarOutParam exception, |
| 78 | SerializedVarReturnValue result); |
| 79 | void OnMsgDeallocate(int64 ppp_class, int64 object); |
| 80 | |
| 81 | DISALLOW_COPY_AND_ASSIGN(PPP_Class_Proxy); |
| 82 | }; |
| 83 | |
| 84 | } // namespace proxy |
[email protected] | 4d2efd2 | 2011-08-18 21:58:02 | [diff] [blame^] | 85 | } // namespace ppapi |
[email protected] | f6b8a8d | 2010-11-05 22:13:39 | [diff] [blame] | 86 | |
| 87 | #endif // PPAPI_PROXY_PPP_CLASS_PROXY_H_ |