Convert TestOldCompletionCallback in WebSocketJobTest.
[chromium-blink-merge.git] / ppapi / proxy / proxy_object_var.h
blobe8d7aedddc54bf5254bbb1359fafa21db2479084
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
3 // found in the LICENSE file.
5 #ifndef PPAPI_PROXY_PROXY_OBJECT_VAR_H_
6 #define PPAPI_PROXY_PROXY_OBJECT_VAR_H_
8 #include "base/compiler_specific.h"
9 #include "ppapi/shared_impl/var.h"
11 namespace ppapi {
13 namespace proxy {
14 class PluginDispatcher;
15 } // namespace proxy
17 // Tracks a reference to an object var in the plugin side of the proxy. This
18 // just stores the dispatcher and host var ID, and provides the interface for
19 // integrating this with PP_Var creation.
20 class ProxyObjectVar : public Var {
21 public:
22 ProxyObjectVar(proxy::PluginDispatcher* dispatcher,
23 int32 host_var_id);
25 virtual ~ProxyObjectVar();
27 // Var overrides.
28 virtual ProxyObjectVar* AsProxyObjectVar() OVERRIDE;
29 virtual PP_Var GetPPVar() OVERRIDE;
30 virtual PP_VarType GetType() const OVERRIDE;
32 proxy::PluginDispatcher* dispatcher() const { return dispatcher_; }
33 int32 host_var_id() const { return host_var_id_; }
35 // Expose AssignVarID on Var so the PluginResourceTracker can call us when
36 // it's creating IDs.
37 void AssignVarID(int32 id);
39 private:
40 proxy::PluginDispatcher* dispatcher_;
41 int32 host_var_id_;
43 DISALLOW_COPY_AND_ASSIGN(ProxyObjectVar);
46 } // namespace ppapi
48 #endif // PPAPI_PROXY_PROXY_OBJECT_VAR_H_