| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PPP_CLASS_PROXY_H_ | 5 #ifndef PPAPI_PROXY_PPP_CLASS_PROXY_H_ |
| 6 #define PPAPI_PROXY_PPP_CLASS_PROXY_H_ | 6 #define PPAPI_PROXY_PPP_CLASS_PROXY_H_ |
| 7 | 7 |
| 8 #include <stdint.h> |
| 9 |
| 8 #include <vector> | 10 #include <vector> |
| 9 | 11 |
| 10 #include "base/basictypes.h" | 12 #include "base/macros.h" |
| 11 #include "ppapi/c/pp_instance.h" | 13 #include "ppapi/c/pp_instance.h" |
| 12 #include "ppapi/c/pp_var.h" | 14 #include "ppapi/c/pp_var.h" |
| 13 #include "ppapi/proxy/interface_proxy.h" | 15 #include "ppapi/proxy/interface_proxy.h" |
| 14 | 16 |
| 15 struct PPB_Var_Deprecated; | 17 struct PPB_Var_Deprecated; |
| 16 | 18 |
| 17 namespace ppapi { | 19 namespace ppapi { |
| 18 namespace proxy { | 20 namespace proxy { |
| 19 | 21 |
| 20 class SerializedVar; | 22 class SerializedVar; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 32 | 34 |
| 33 // Factory function used for registration (normal code can just use the | 35 // Factory function used for registration (normal code can just use the |
| 34 // constructor). | 36 // constructor). |
| 35 static InterfaceProxy* Create(Dispatcher* dispatcher); | 37 static InterfaceProxy* Create(Dispatcher* dispatcher); |
| 36 | 38 |
| 37 // Creates a proxied object in the browser process. This takes the browser's | 39 // Creates a proxied object in the browser process. This takes the browser's |
| 38 // PPB_Var_Deprecated interface to use to create the object. The class and | 40 // PPB_Var_Deprecated interface to use to create the object. The class and |
| 39 static PP_Var CreateProxiedObject(const PPB_Var_Deprecated* var, | 41 static PP_Var CreateProxiedObject(const PPB_Var_Deprecated* var, |
| 40 Dispatcher* dispatcher, | 42 Dispatcher* dispatcher, |
| 41 PP_Instance instance_id, | 43 PP_Instance instance_id, |
| 42 int64 ppp_class, | 44 int64_t ppp_class, |
| 43 int64 class_data); | 45 int64_t class_data); |
| 44 | 46 |
| 45 static PP_Bool IsInstanceOf(const PPB_Var_Deprecated* ppb_var_impl, | 47 static PP_Bool IsInstanceOf(const PPB_Var_Deprecated* ppb_var_impl, |
| 46 const PP_Var& var, | 48 const PP_Var& var, |
| 47 int64 ppp_class, | 49 int64_t ppp_class, |
| 48 int64* ppp_class_data); | 50 int64_t* ppp_class_data); |
| 49 | 51 |
| 50 // InterfaceProxy implementation. | 52 // InterfaceProxy implementation. |
| 51 virtual bool OnMessageReceived(const IPC::Message& msg); | 53 virtual bool OnMessageReceived(const IPC::Message& msg); |
| 52 | 54 |
| 53 private: | 55 private: |
| 54 // IPC message handlers. | 56 // IPC message handlers. |
| 55 void OnMsgHasProperty(int64 ppp_class, int64 object, | 57 void OnMsgHasProperty(int64_t ppp_class, |
| 58 int64_t object, |
| 56 SerializedVarReceiveInput property, | 59 SerializedVarReceiveInput property, |
| 57 SerializedVarOutParam exception, | 60 SerializedVarOutParam exception, |
| 58 bool* result); | 61 bool* result); |
| 59 void OnMsgHasMethod(int64 ppp_class, int64 object, | 62 void OnMsgHasMethod(int64_t ppp_class, |
| 63 int64_t object, |
| 60 SerializedVarReceiveInput property, | 64 SerializedVarReceiveInput property, |
| 61 SerializedVarOutParam exception, | 65 SerializedVarOutParam exception, |
| 62 bool* result); | 66 bool* result); |
| 63 void OnMsgGetProperty(int64 ppp_class, int64 object, | 67 void OnMsgGetProperty(int64_t ppp_class, |
| 68 int64_t object, |
| 64 SerializedVarReceiveInput property, | 69 SerializedVarReceiveInput property, |
| 65 SerializedVarOutParam exception, | 70 SerializedVarOutParam exception, |
| 66 SerializedVarReturnValue result); | 71 SerializedVarReturnValue result); |
| 67 void OnMsgEnumerateProperties( | 72 void OnMsgEnumerateProperties(int64_t ppp_class, |
| 68 int64 ppp_class, int64 object, | 73 int64_t object, |
| 69 std::vector<SerializedVar>* props, | 74 std::vector<SerializedVar>* props, |
| 70 SerializedVarOutParam exception); | 75 SerializedVarOutParam exception); |
| 71 void OnMsgSetProperty(int64 ppp_class, int64 object, | 76 void OnMsgSetProperty(int64_t ppp_class, |
| 77 int64_t object, |
| 72 SerializedVarReceiveInput property, | 78 SerializedVarReceiveInput property, |
| 73 SerializedVarReceiveInput value, | 79 SerializedVarReceiveInput value, |
| 74 SerializedVarOutParam exception); | 80 SerializedVarOutParam exception); |
| 75 void OnMsgRemoveProperty(int64 ppp_class, int64 object, | 81 void OnMsgRemoveProperty(int64_t ppp_class, |
| 82 int64_t object, |
| 76 SerializedVarReceiveInput property, | 83 SerializedVarReceiveInput property, |
| 77 SerializedVarOutParam exception); | 84 SerializedVarOutParam exception); |
| 78 void OnMsgCall(int64 ppp_class, int64 object, | 85 void OnMsgCall(int64_t ppp_class, |
| 86 int64_t object, |
| 79 SerializedVarReceiveInput method_name, | 87 SerializedVarReceiveInput method_name, |
| 80 SerializedVarVectorReceiveInput arg_vector, | 88 SerializedVarVectorReceiveInput arg_vector, |
| 81 SerializedVarOutParam exception, | 89 SerializedVarOutParam exception, |
| 82 SerializedVarReturnValue result); | 90 SerializedVarReturnValue result); |
| 83 void OnMsgConstruct(int64 ppp_class, int64 object, | 91 void OnMsgConstruct(int64_t ppp_class, |
| 92 int64_t object, |
| 84 SerializedVarVectorReceiveInput arg_vector, | 93 SerializedVarVectorReceiveInput arg_vector, |
| 85 SerializedVarOutParam exception, | 94 SerializedVarOutParam exception, |
| 86 SerializedVarReturnValue result); | 95 SerializedVarReturnValue result); |
| 87 void OnMsgDeallocate(int64 ppp_class, int64 object); | 96 void OnMsgDeallocate(int64_t ppp_class, int64_t object); |
| 88 | 97 |
| 89 // Returns true if the given class/data points to a plugin-implemented | 98 // Returns true if the given class/data points to a plugin-implemented |
| 90 // object. On failure, the exception, if non-NULL, will also be set. | 99 // object. On failure, the exception, if non-NULL, will also be set. |
| 91 bool ValidateUserData(int64 ppp_class, int64 class_data, | 100 bool ValidateUserData(int64_t ppp_class, |
| 101 int64_t class_data, |
| 92 SerializedVarOutParam* exception); | 102 SerializedVarOutParam* exception); |
| 93 | 103 |
| 94 DISALLOW_COPY_AND_ASSIGN(PPP_Class_Proxy); | 104 DISALLOW_COPY_AND_ASSIGN(PPP_Class_Proxy); |
| 95 }; | 105 }; |
| 96 | 106 |
| 97 } // namespace proxy | 107 } // namespace proxy |
| 98 } // namespace ppapi | 108 } // namespace ppapi |
| 99 | 109 |
| 100 #endif // PPAPI_PROXY_PPP_CLASS_PROXY_H_ | 110 #endif // PPAPI_PROXY_PPP_CLASS_PROXY_H_ |
| OLD | NEW |