Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011, Google Inc. | 1 // Copyright 2011, Google Inc. |
| 2 // All rights reserved. | 2 // All rights reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // met: |
| 7 // | 7 // |
| 8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
| 9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
| 10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 396 if (Dart_IsError(result)) | 396 if (Dart_IsError(result)) |
| 397 return false; | 397 return false; |
| 398 | 398 |
| 399 Dart_Handle exception = 0; | 399 Dart_Handle exception = 0; |
| 400 bool boolResult = dartToBool(result, exception); | 400 bool boolResult = dartToBool(result, exception); |
| 401 if (exception) | 401 if (exception) |
| 402 return false; | 402 return false; |
| 403 return boolResult; | 403 return boolResult; |
| 404 } | 404 } |
| 405 | 405 |
| 406 bool DartUtilities::isTypeSubclassOfTag(Dart_Handle type, const String& tagName) | |
| 407 { | |
| 408 Dart_Handle args[2] = { type, stringToDartString(tagName) }; | |
| 409 Dart_Handle result = DartUtilities::invokeUtilsMethod("isTypeSubclassOfTag", 2, args); | |
| 410 ASSERT(!Dart_IsError(result)); | |
| 411 if (Dart_IsError(result)) | |
|
vsm
2013/10/14 18:25:33
Move ASSERT into the if as ASSERT_NOT_REACHED?
blois
2013/10/14 19:24:13
Done.
| |
| 412 return false; | |
| 413 | |
| 414 Dart_Handle exception = 0; | |
| 415 bool boolResult = dartToBool(result, exception); | |
| 416 if (exception) | |
| 417 return false; | |
| 418 return boolResult; | |
| 419 } | |
| 420 | |
| 406 bool DartUtilities::isTypedData(Dart_Handle handle) | 421 bool DartUtilities::isTypedData(Dart_Handle handle) |
| 407 { | 422 { |
| 408 return (Dart_GetTypeOfTypedData(handle) != Dart_TypedData_kInvalid) | 423 return (Dart_GetTypeOfTypedData(handle) != Dart_TypedData_kInvalid) |
| 409 || (Dart_GetTypeOfExternalTypedData(handle) != Dart_TypedData_kInvalid); | 424 || (Dart_GetTypeOfExternalTypedData(handle) != Dart_TypedData_kInvalid); |
| 410 } | 425 } |
| 411 | 426 |
| 412 static Dart_TypedData_Type typedDataTypeFromViewType(ArrayBufferView::ViewType t ype) | 427 static Dart_TypedData_Type typedDataTypeFromViewType(ArrayBufferView::ViewType t ype) |
| 413 { | 428 { |
| 414 switch (type) { | 429 switch (type) { |
| 415 case ArrayBufferView::TypeInt8: | 430 case ArrayBufferView::TypeInt8: |
| (...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1081 Dart_PersistentHandle library = domData->htmlLibrary(); | 1096 Dart_PersistentHandle library = domData->htmlLibrary(); |
| 1082 ASSERT(!Dart_IsError(library)); | 1097 ASSERT(!Dart_IsError(library)); |
| 1083 | 1098 |
| 1084 Dart_Handle utilsClass = Dart_GetType(library, Dart_NewStringFromCString("_U tils"), 0, 0); | 1099 Dart_Handle utilsClass = Dart_GetType(library, Dart_NewStringFromCString("_U tils"), 0, 0); |
| 1085 ASSERT(!Dart_IsError(utilsClass)); | 1100 ASSERT(!Dart_IsError(utilsClass)); |
| 1086 | 1101 |
| 1087 return Dart_Invoke(utilsClass, Dart_NewStringFromCString(methodName), argCou nt, args); | 1102 return Dart_Invoke(utilsClass, Dart_NewStringFromCString(methodName), argCou nt, args); |
| 1088 } | 1103 } |
| 1089 | 1104 |
| 1090 } | 1105 } |
| OLD | NEW |