OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 "native_client/src/shared/ppapi_proxy/plugin_ppb_var.h" | 5 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_var.h" |
6 | 6 |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 } | 122 } |
123 case PP_VARTYPE_OBJECT: | 123 case PP_VARTYPE_OBJECT: |
124 { | 124 { |
125 char buf[32]; | 125 char buf[32]; |
126 const size_t kBufSize = sizeof(buf); | 126 const size_t kBufSize = sizeof(buf); |
127 SNPRINTF(buf, kBufSize, "%"NACL_PRIu64"", GetVarId(var)); | 127 SNPRINTF(buf, kBufSize, "%"NACL_PRIu64"", GetVarId(var)); |
128 return std::string("##OBJECT##") + buf + "##"; | 128 return std::string("##OBJECT##") + buf + "##"; |
129 } | 129 } |
130 case PP_VARTYPE_ARRAY: | 130 case PP_VARTYPE_ARRAY: |
131 case PP_VARTYPE_DICTIONARY: | 131 case PP_VARTYPE_DICTIONARY: |
| 132 case PP_VARTYPE_ARRAY_BUFFER: |
132 NACL_NOTREACHED(); | 133 NACL_NOTREACHED(); |
133 break; | 134 break; |
134 } | 135 } |
135 ASSERT_MSG(0, "Unexpected type seen"); | 136 ASSERT_MSG(0, "Unexpected type seen"); |
136 return "##ERROR##"; | 137 return "##ERROR##"; |
137 } | 138 } |
138 | 139 |
139 PP_Var PluginVar::StringToPPVar(PP_Module module_id, const std::string& str) { | 140 PP_Var PluginVar::StringToPPVar(PP_Module module_id, const std::string& str) { |
140 static const PPB_Var* ppb_var = NULL; | 141 static const PPB_Var* ppb_var = NULL; |
141 if (ppb_var == NULL) { | 142 if (ppb_var == NULL) { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 std::string str = DebugString(var); | 185 std::string str = DebugString(var); |
185 DebugPrintf("PP_Var(string: '%*s')", | 186 DebugPrintf("PP_Var(string: '%*s')", |
186 static_cast<uint32_t>(str.size()), | 187 static_cast<uint32_t>(str.size()), |
187 str.c_str()); | 188 str.c_str()); |
188 } | 189 } |
189 case PP_VARTYPE_OBJECT: | 190 case PP_VARTYPE_OBJECT: |
190 DebugPrintf("PP_Var(object: %"NACL_PRIu64")", GetVarId(var)); | 191 DebugPrintf("PP_Var(object: %"NACL_PRIu64")", GetVarId(var)); |
191 break; | 192 break; |
192 case PP_VARTYPE_ARRAY: | 193 case PP_VARTYPE_ARRAY: |
193 case PP_VARTYPE_DICTIONARY: | 194 case PP_VARTYPE_DICTIONARY: |
| 195 case PP_VARTYPE_ARRAY_BUFFER: |
194 NACL_NOTREACHED(); | 196 NACL_NOTREACHED(); |
195 break; | 197 break; |
196 } | 198 } |
197 } | 199 } |
198 | 200 |
199 } // namespace ppapi_proxy | 201 } // namespace ppapi_proxy |
OLD | NEW |