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

Side by Side Diff: Source/bindings/dart/DartUtilities.cpp

Issue 26571005: Enforcing that custom tag extensions have correct super classes. (Closed) Base URL: svn://svn.chromium.org/multivm/trunk/webkit
Patch Set: Created 7 years, 2 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 | « Source/bindings/dart/DartUtilities.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « Source/bindings/dart/DartUtilities.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698