Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(265)

Side by Side Diff: ppapi/proxy/proxy_object_var.cc

Issue 7578001: Unify var tracking between webkit and the proxy. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/proxy/proxy_object_var.h ('k') | ppapi/proxy/resource_creation_proxy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
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.
4
5 #include "ppapi/proxy/proxy_object_var.h"
6
7 #include "base/logging.h"
8 #include "ppapi/c/pp_var.h"
9
10 using pp::proxy::PluginDispatcher;
11
12 namespace ppapi {
13
14 ProxyObjectVar::ProxyObjectVar(PluginDispatcher* dispatcher,
15 int32 host_var_id)
16 : Var(0),
17 dispatcher_(dispatcher),
18 host_var_id_(host_var_id) {
19 // Should be given valid objects or we'll crash later.
20 DCHECK(dispatcher_);
21 DCHECK(host_var_id_);
22 }
23
24 ProxyObjectVar::~ProxyObjectVar() {
25 }
26
27 ProxyObjectVar* ProxyObjectVar::AsProxyObjectVar() {
28 return this;
29 }
30
31 PP_Var ProxyObjectVar::GetPPVar() {
32 int32 id = GetOrCreateVarID();
33 if (!id)
34 return PP_MakeNull();
35
36 PP_Var result;
37 result.type = PP_VARTYPE_OBJECT;
38 result.value.as_id = id;
39 return result;
40 }
41
42 PP_VarType ProxyObjectVar::GetType() const {
43 return PP_VARTYPE_OBJECT;
44 }
45
46 void ProxyObjectVar::AssignVarID(int32 id) {
47 return Var::AssignVarID(id);
48 }
49
50 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/proxy_object_var.h ('k') | ppapi/proxy/resource_creation_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698