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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 return "[Dictionary]"; | 64 return "[Dictionary]"; |
65 case PP_VARTYPE_ARRAY_BUFFER: | 65 case PP_VARTYPE_ARRAY_BUFFER: |
66 return "[Array buffer]"; | 66 return "[Array buffer]"; |
67 case PP_VARTYPE_RESOURCE: { | 67 case PP_VARTYPE_RESOURCE: { |
68 ResourceVar* resource(ResourceVar::FromPPVar(var)); | 68 ResourceVar* resource(ResourceVar::FromPPVar(var)); |
69 if (!resource) | 69 if (!resource) |
70 return "[Invalid resource]"; | 70 return "[Invalid resource]"; |
71 | 71 |
72 if (resource->IsPending()) { | 72 if (resource->IsPending()) { |
73 return base::StringPrintf("[Pending resource]"); | 73 return base::StringPrintf("[Pending resource]"); |
74 } else if (resource->pp_resource()) { | 74 } else if (resource->GetPPResource()) { |
75 return base::StringPrintf("[Resource %d]", resource->pp_resource()); | 75 return base::StringPrintf("[Resource %d]", resource->GetPPResource()); |
76 } else { | 76 } else { |
77 return "[Null resource]"; | 77 return "[Null resource]"; |
78 } | 78 } |
79 } | 79 } |
80 default: | 80 default: |
81 return "[Invalid var]"; | 81 return "[Invalid var]"; |
82 } | 82 } |
83 } | 83 } |
84 | 84 |
85 StringVar* Var::AsStringVar() { | 85 StringVar* Var::AsStringVar() { |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 return NULL; | 221 return NULL; |
222 scoped_refptr<Var> var_object( | 222 scoped_refptr<Var> var_object( |
223 PpapiGlobals::Get()->GetVarTracker()->GetVar(var)); | 223 PpapiGlobals::Get()->GetVarTracker()->GetVar(var)); |
224 if (!var_object.get()) | 224 if (!var_object.get()) |
225 return NULL; | 225 return NULL; |
226 return var_object->AsArrayBufferVar(); | 226 return var_object->AsArrayBufferVar(); |
227 } | 227 } |
228 | 228 |
229 } // namespace ppapi | 229 } // namespace ppapi |
230 | 230 |
OLD | NEW |