OLD | NEW |
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/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 } | 84 } |
85 | 85 |
86 ArrayVar* Var::AsArrayVar() { | 86 ArrayVar* Var::AsArrayVar() { |
87 return NULL; | 87 return NULL; |
88 } | 88 } |
89 | 89 |
90 DictionaryVar* Var::AsDictionaryVar() { | 90 DictionaryVar* Var::AsDictionaryVar() { |
91 return NULL; | 91 return NULL; |
92 } | 92 } |
93 | 93 |
| 94 ResourceVar* Var::AsResourceVar() { |
| 95 return NULL; |
| 96 } |
| 97 |
94 PP_Var Var::GetPPVar() { | 98 PP_Var Var::GetPPVar() { |
95 int32 id = GetOrCreateVarID(); | 99 int32 id = GetOrCreateVarID(); |
96 if (!id) | 100 if (!id) |
97 return PP_MakeNull(); | 101 return PP_MakeNull(); |
98 | 102 |
99 PP_Var result; | 103 PP_Var result; |
100 result.type = GetType(); | 104 result.type = GetType(); |
101 result.padding = 0; | 105 result.padding = 0; |
102 result.value.as_id = id; | 106 result.value.as_id = id; |
103 return result; | 107 return result; |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 return NULL; | 206 return NULL; |
203 scoped_refptr<Var> var_object( | 207 scoped_refptr<Var> var_object( |
204 PpapiGlobals::Get()->GetVarTracker()->GetVar(var)); | 208 PpapiGlobals::Get()->GetVarTracker()->GetVar(var)); |
205 if (!var_object.get()) | 209 if (!var_object.get()) |
206 return NULL; | 210 return NULL; |
207 return var_object->AsArrayBufferVar(); | 211 return var_object->AsArrayBufferVar(); |
208 } | 212 } |
209 | 213 |
210 } // namespace ppapi | 214 } // namespace ppapi |
211 | 215 |
OLD | NEW |