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

Side by Side Diff: ppapi/shared_impl/var.cc

Issue 12387073: Add PPB_VarDictionary_Dev support - part 1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 7 years, 9 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/shared_impl/var.h ('k') | ppapi/shared_impl/var_tracker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "ppapi/shared_impl/var.h" 5 #include "ppapi/shared_impl/var.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 else 49 else
50 result = string->value(); 50 result = string->value();
51 51
52 std::string null; 52 std::string null;
53 null.push_back(0); 53 null.push_back(0);
54 ReplaceSubstringsAfterOffset(&result, 0, null, "\\0"); 54 ReplaceSubstringsAfterOffset(&result, 0, null, "\\0");
55 return result; 55 return result;
56 } 56 }
57 case PP_VARTYPE_OBJECT: 57 case PP_VARTYPE_OBJECT:
58 return "[Object]"; 58 return "[Object]";
59 case PP_VARTYPE_ARRAY:
60 return "[Array]";
61 case PP_VARTYPE_DICTIONARY:
62 return "[Dictionary]";
63 case PP_VARTYPE_ARRAY_BUFFER:
64 return "[Array buffer]";
59 default: 65 default:
60 return "[Invalid var]"; 66 return "[Invalid var]";
61 } 67 }
62 } 68 }
63 69
64 StringVar* Var::AsStringVar() { 70 StringVar* Var::AsStringVar() {
65 return NULL; 71 return NULL;
66 } 72 }
67 73
68 ArrayBufferVar* Var::AsArrayBufferVar() { 74 ArrayBufferVar* Var::AsArrayBufferVar() {
69 return NULL; 75 return NULL;
70 } 76 }
71 77
72 NPObjectVar* Var::AsNPObjectVar() { 78 NPObjectVar* Var::AsNPObjectVar() {
73 return NULL; 79 return NULL;
74 } 80 }
75 81
76 ProxyObjectVar* Var::AsProxyObjectVar() { 82 ProxyObjectVar* Var::AsProxyObjectVar() {
77 return NULL; 83 return NULL;
78 } 84 }
79 85
86 DictionaryVar* Var::AsDictionaryVar() {
87 return NULL;
88 }
89
80 PP_Var Var::GetPPVar() { 90 PP_Var Var::GetPPVar() {
81 int32 id = GetOrCreateVarID(); 91 int32 id = GetOrCreateVarID();
82 if (!id) 92 if (!id)
83 return PP_MakeNull(); 93 return PP_MakeNull();
84 94
85 PP_Var result; 95 PP_Var result;
86 result.type = GetType(); 96 result.type = GetType();
87 result.padding = 0; 97 result.padding = 0;
88 result.value.as_id = id; 98 result.value.as_id = id;
89 return result; 99 return result;
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 return NULL; 198 return NULL;
189 scoped_refptr<Var> var_object( 199 scoped_refptr<Var> var_object(
190 PpapiGlobals::Get()->GetVarTracker()->GetVar(var)); 200 PpapiGlobals::Get()->GetVarTracker()->GetVar(var));
191 if (!var_object) 201 if (!var_object)
192 return NULL; 202 return NULL;
193 return var_object->AsArrayBufferVar(); 203 return var_object->AsArrayBufferVar();
194 } 204 }
195 205
196 } // namespace ppapi 206 } // namespace ppapi
197 207
OLDNEW
« no previous file with comments | « ppapi/shared_impl/var.h ('k') | ppapi/shared_impl/var_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698