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

Unified Diff: Source/bindings/dart/DartCustomElementWrapper.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/bindings/dart/DartDOMData.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/dart/DartCustomElementWrapper.cpp
===================================================================
--- Source/bindings/dart/DartCustomElementWrapper.cpp (revision 1437)
+++ Source/bindings/dart/DartCustomElementWrapper.cpp (working copy)
@@ -114,13 +114,10 @@
Dart_Handle newInstance = Dart_Allocate(customType);
ASSERT(!Dart_IsError(newInstance));
+ DartDOMWrapper::writeNativePointer(newInstance, element, DartHTMLElement::dartClassId);
- Dart_Handle result = Dart_SetNativeInstanceField(newInstance, 0, reinterpret_cast<intptr_t>(element));
- UNUSED_PARAM(result);
- ASSERT(!Dart_IsError(result));
+ Dart_Handle result = Dart_InvokeConstructor(newInstance, Dart_NewStringFromCString("created"), 0, 0);
- result = Dart_InvokeConstructor(newInstance, Dart_NewStringFromCString("created"), 0, 0);
-
if (Dart_IsError(result)) {
DartUtilities::reportProblem(domData->scriptExecutionContext(), result);
@@ -136,10 +133,7 @@
Dart_Handle fallbackWrapper = createUpgradeCandidateWrapper(element, createSpecificWrapper);
DartDOMWrapper::associateWrapper<DartHTMLElement>(domData, element, fallbackWrapper);
- Dart_Handle result = Dart_SetNativeInstanceField(fallbackWrapper, 0, reinterpret_cast<intptr_t>(element));
- UNUSED_PARAM(result);
- ASSERT(!Dart_IsError(result));
-
+ DartDOMWrapper::writeNativePointer(fallbackWrapper, element, DartHTMLElement::dartClassId);
return fallbackWrapper;
}
return newInstance;
« no previous file with comments | « no previous file | Source/bindings/dart/DartDOMData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698