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

Side by Side Diff: runtime/bin/dartutils.h

Issue 14046011: Fix wrong ASSERT (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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 | « no previous file | samples/sample_extension/sample_extension.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 Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef BIN_DARTUTILS_H_ 5 #ifndef BIN_DARTUTILS_H_
6 #define BIN_DARTUTILS_H_ 6 #define BIN_DARTUTILS_H_
7 7
8 #include "bin/builtin.h" 8 #include "bin/builtin.h"
9 #include "bin/utils.h" 9 #include "bin/utils.h"
10 #include "include/dart_api.h" 10 #include "include/dart_api.h"
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 DISALLOW_ALLOCATION(); 199 DISALLOW_ALLOCATION();
200 DISALLOW_IMPLICIT_CONSTRUCTORS(DartUtils); 200 DISALLOW_IMPLICIT_CONSTRUCTORS(DartUtils);
201 }; 201 };
202 202
203 203
204 class CObject { 204 class CObject {
205 public: 205 public:
206 explicit CObject(Dart_CObject *cobject) : cobject_(cobject) {} 206 explicit CObject(Dart_CObject *cobject) : cobject_(cobject) {}
207 Dart_CObject::Type type() { return cobject_->type; } 207 Dart_CObject::Type type() { return cobject_->type; }
208 Dart_CObject::TypedDataType byte_array_type() { 208 Dart_CObject::TypedDataType byte_array_type() {
209 ASSERT(type() == Dart_CObject::kTypedData); 209 ASSERT(type() == Dart_CObject::kTypedData ||
210 type() == Dart_CObject::kExternalTypedData);
210 return cobject_->value.as_typed_data.type; 211 return cobject_->value.as_typed_data.type;
211 } 212 }
212 213
213 bool IsNull() { return type() == Dart_CObject::kNull; } 214 bool IsNull() { return type() == Dart_CObject::kNull; }
214 bool IsBool() { return type() == Dart_CObject::kBool; } 215 bool IsBool() { return type() == Dart_CObject::kBool; }
215 bool IsInt32() { return type() == Dart_CObject::kInt32; } 216 bool IsInt32() { return type() == Dart_CObject::kInt32; }
216 bool IsInt64() { return type() == Dart_CObject::kInt64; } 217 bool IsInt64() { return type() == Dart_CObject::kInt64; }
217 bool IsInt32OrInt64() { return IsInt32() || IsInt64(); } 218 bool IsInt32OrInt64() { return IsInt32() || IsInt64(); }
218 bool IsIntptr() { return IsInt32OrInt64(); } 219 bool IsIntptr() { return IsInt32OrInt64(); }
219 bool IsBigint() { return type() == Dart_CObject::kBigint; } 220 bool IsBigint() { return type() == Dart_CObject::kBigint; }
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 void* Peer() const { return cobject_->value.as_external_typed_data.peer; } 488 void* Peer() const { return cobject_->value.as_external_typed_data.peer; }
488 Dart_WeakPersistentHandleFinalizer Callback() const { 489 Dart_WeakPersistentHandleFinalizer Callback() const {
489 return cobject_->value.as_external_typed_data.callback; 490 return cobject_->value.as_external_typed_data.callback;
490 } 491 }
491 492
492 private: 493 private:
493 DISALLOW_COPY_AND_ASSIGN(CObjectExternalUint8Array); 494 DISALLOW_COPY_AND_ASSIGN(CObjectExternalUint8Array);
494 }; 495 };
495 496
496 #endif // BIN_DARTUTILS_H_ 497 #endif // BIN_DARTUTILS_H_
OLDNEW
« no previous file with comments | « no previous file | samples/sample_extension/sample_extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698