OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_value_conversions.h" | 5 #include "ppapi/shared_impl/var_value_conversions.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <set> | 8 #include <set> |
9 #include <stack> | 9 #include <stack> |
10 | 10 |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 return false; | 124 return false; |
125 | 125 |
126 base::BinaryValue* binary_value = | 126 base::BinaryValue* binary_value = |
127 base::BinaryValue::CreateWithCopiedBuffer( | 127 base::BinaryValue::CreateWithCopiedBuffer( |
128 static_cast<const char*>(array_buffer->Map()), | 128 static_cast<const char*>(array_buffer->Map()), |
129 array_buffer->ByteLength()); | 129 array_buffer->ByteLength()); |
130 array_buffer->Unmap(); | 130 array_buffer->Unmap(); |
131 value->reset(binary_value); | 131 value->reset(binary_value); |
132 return true; | 132 return true; |
133 } | 133 } |
| 134 case PP_VARTYPE_RESOURCE: { |
| 135 return false; |
| 136 } |
134 } | 137 } |
135 NOTREACHED(); | 138 NOTREACHED(); |
136 return false; | 139 return false; |
137 } | 140 } |
138 | 141 |
139 // Helper function for CreateVarFromValue(). It only looks at |value| but not | 142 // Helper function for CreateVarFromValue(). It only looks at |value| but not |
140 // its descendants. The conversion result is stored in |var|. If |value| is list | 143 // its descendants. The conversion result is stored in |var|. If |value| is list |
141 // or dictionary, a new node is pushed onto |state|. | 144 // or dictionary, a new node is pushed onto |state|. |
142 // | 145 // |
143 // Returns false on failure. | 146 // Returns false on failure. |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 iter != result.end(); | 385 iter != result.end(); |
383 ++iter) { | 386 ++iter) { |
384 vars->push_back(iter->Release()); | 387 vars->push_back(iter->Release()); |
385 } | 388 } |
386 | 389 |
387 return true; | 390 return true; |
388 } | 391 } |
389 | 392 |
390 } // namespace ppapi | 393 } // namespace ppapi |
391 | 394 |
OLD | NEW |