blob: ce93770f339781af879cac9f56e5b62cb27e4274 [file] [log] [blame]
[email protected]4d2efd22011-08-18 21:58:021// Copyright (c) 2011 The Chromium Authors. All rights reserved.
[email protected]f6b8a8d2010-11-05 22:13:392// 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
15struct PPB_Var_Deprecated;
16struct PPP_Class_Deprecated;
17
[email protected]4d2efd22011-08-18 21:58:0218namespace ppapi {
[email protected]f6b8a8d2010-11-05 22:13:3919namespace proxy {
20
21class SerializedVar;
22class SerializedVarReceiveInput;
23class SerializedVarVectorReceiveInput;
24class SerializedVarOutParam;
25class SerializedVarReturnValue;
26
27class 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]a95986a82010-12-24 06:19:2843 virtual bool OnMessageReceived(const IPC::Message& msg);
[email protected]f6b8a8d2010-11-05 22:13:3944
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]4d2efd22011-08-18 21:58:0261 std::vector<SerializedVar>* props,
[email protected]f6b8a8d2010-11-05 22:13:3962 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]4d2efd22011-08-18 21:58:0285} // namespace ppapi
[email protected]f6b8a8d2010-11-05 22:13:3986
87#endif // PPAPI_PROXY_PPP_CLASS_PROXY_H_