blob: b22d86a04d5ae4a85bdf693d52dc6c9fd813eead [file] [log] [blame]
[email protected]f6b8a8d2010-11-05 22:13:391// Copyright (c) 2010 The Chromium Authors. All rights reserved.
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
15struct PPB_Var_Deprecated;
16struct PPP_Class_Deprecated;
17
18namespace pp {
19namespace 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.
43 virtual const void* GetSourceInterface() const;
44 virtual InterfaceID GetInterfaceId() const;
45 virtual void OnMessageReceived(const IPC::Message& msg);
46
47 private:
48 // IPC message handlers.
49 void OnMsgHasProperty(int64 ppp_class, int64 object,
50 SerializedVarReceiveInput property,
51 SerializedVarOutParam exception,
52 bool* result);
53 void OnMsgHasMethod(int64 ppp_class, int64 object,
54 SerializedVarReceiveInput property,
55 SerializedVarOutParam exception,
56 bool* result);
57 void OnMsgGetProperty(int64 ppp_class, int64 object,
58 SerializedVarReceiveInput property,
59 SerializedVarOutParam exception,
60 SerializedVarReturnValue result);
61 void OnMsgEnumerateProperties(
62 int64 ppp_class, int64 object,
63 std::vector<pp::proxy::SerializedVar>* props,
64 SerializedVarOutParam exception);
65 void OnMsgSetProperty(int64 ppp_class, int64 object,
66 SerializedVarReceiveInput property,
67 SerializedVarReceiveInput value,
68 SerializedVarOutParam exception);
69 void OnMsgRemoveProperty(int64 ppp_class, int64 object,
70 SerializedVarReceiveInput property,
71 SerializedVarOutParam exception);
72 void OnMsgCall(int64 ppp_class, int64 object,
73 SerializedVarReceiveInput method_name,
74 SerializedVarVectorReceiveInput arg_vector,
75 SerializedVarOutParam exception,
76 SerializedVarReturnValue result);
77 void OnMsgConstruct(int64 ppp_class, int64 object,
78 SerializedVarVectorReceiveInput arg_vector,
79 SerializedVarOutParam exception,
80 SerializedVarReturnValue result);
81 void OnMsgDeallocate(int64 ppp_class, int64 object);
82
83 DISALLOW_COPY_AND_ASSIGN(PPP_Class_Proxy);
84};
85
86} // namespace proxy
87} // namespace pp
88
89#endif // PPAPI_PROXY_PPP_CLASS_PROXY_H_