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

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

Issue 26789007: Add a native subtype of function that uses the native C++ class hierarchy to check if an element (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') | Source/bindings/dart/custom/DartBlobCustom.cpp » ('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 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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 332
333 return DartUtilities::dartToDouble(asDouble, exception); 333 return DartUtilities::dartToDouble(asDouble, exception);
334 } 334 }
335 335
336 double DartUtilities::dartToDate(Dart_NativeArguments args, int idx, Dart_Handle & exception) 336 double DartUtilities::dartToDate(Dart_NativeArguments args, int idx, Dart_Handle & exception)
337 { 337 {
338 Dart_Handle object = Dart_GetNativeArgument(args, idx); 338 Dart_Handle object = Dart_GetNativeArgument(args, idx);
339 return dartToDate(object, exception); 339 return dartToDate(object, exception);
340 } 340 }
341 341
342 bool DartUtilities::isHtmlElement(DartDOMData* domData, Dart_Handle handle)
343 {
344 ASSERT(domData);
345 return DartDOMWrapper::instanceOf<DartHTMLElement>(domData, handle);
346 }
347
348 bool DartUtilities::isDateTime(DartDOMData* domData, Dart_Handle handle) 342 bool DartUtilities::isDateTime(DartDOMData* domData, Dart_Handle handle)
349 { 343 {
350 ASSERT(domData); 344 ASSERT(domData);
351 Dart_Handle type = DartDOMWrapper::dartClass( 345 Dart_Handle type = DartDOMWrapper::dartClass(
352 domData, "DateTime", DartCoreLibraryId, _DateTimeClassId); 346 domData, "DateTime", DartCoreLibraryId, _DateTimeClassId);
353 ASSERT(!Dart_IsError(type)); 347 ASSERT(!Dart_IsError(type));
354 return objectIsType(handle, type); 348 return objectIsType(handle, type);
355 } 349 }
356 350
357 bool DartUtilities::isBlob(DartDOMData* domData, Dart_Handle handle) 351 bool DartUtilities::isBlob(DartDOMData* domData, Dart_Handle handle)
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after
1099 Dart_PersistentHandle library = domData->htmlLibrary(); 1093 Dart_PersistentHandle library = domData->htmlLibrary();
1100 ASSERT(!Dart_IsError(library)); 1094 ASSERT(!Dart_IsError(library));
1101 1095
1102 Dart_Handle utilsClass = Dart_GetType(library, Dart_NewStringFromCString("_U tils"), 0, 0); 1096 Dart_Handle utilsClass = Dart_GetType(library, Dart_NewStringFromCString("_U tils"), 0, 0);
1103 ASSERT(!Dart_IsError(utilsClass)); 1097 ASSERT(!Dart_IsError(utilsClass));
1104 1098
1105 return Dart_Invoke(utilsClass, Dart_NewStringFromCString(methodName), argCou nt, args); 1099 return Dart_Invoke(utilsClass, Dart_NewStringFromCString(methodName), argCou nt, args);
1106 } 1100 }
1107 1101
1108 } 1102 }
OLDNEW
« no previous file with comments | « Source/bindings/dart/DartUtilities.h ('k') | Source/bindings/dart/custom/DartBlobCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698