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

Unified Diff: Source/bindings/dart/DartDOMWrapper.h

Issue 27140002: Use Dart_InstanceIsSubtypeOf to check if instance is a direct subtype of specified type. (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/DartUtilities.cpp » ('j') | Source/bindings/dart/DartUtilities.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/dart/DartDOMWrapper.h
===================================================================
--- Source/bindings/dart/DartDOMWrapper.h (revision 1430)
+++ Source/bindings/dart/DartDOMWrapper.h (working copy)
@@ -142,8 +142,7 @@
if (Dart_IsNull(wrapper))
return 0;
- // FIXME: support cross-domain wrappers.
- if (!instanceOf<BindingsClass>(domData, wrapper)) {
+ if (!subtypeOf<BindingsClass>(domData, wrapper)) {
String message = String("Invalid class: expected instance of ") + BindingsClass::dartImplementationClassName;
exception = DartUtilities::stringToDartString(message);
return 0;
@@ -163,13 +162,14 @@
}
template <class BindingsClass>
- static bool instanceOf(DartDOMData* domData, Dart_Handle wrapper)
+ static bool subtypeOf(DartDOMData* domData, Dart_Handle wrapper)
{
Dart_PersistentHandle type = dartClass<BindingsClass>(domData);
- bool isInstanceOf = false;
- Dart_Handle result = Dart_ObjectIsType(wrapper, type, &isInstanceOf);
vsm 2013/10/14 15:44:09 Siva: Just curious, what's the semantic difference
siva 2013/10/14 15:55:06 Dart_InstanceIsSubtypeOf just does a straight sub
- return isInstanceOf;
+ bool isSubtypeOf = false;
+ Dart_Handle result = Dart_InstanceIsSubtypeOf(wrapper, type, &isSubtypeOf);
+ ASSERT(!Dart_IsError(result));
+ return isSubtypeOf;
}
template <class WebKitClass>
« no previous file with comments | « no previous file | Source/bindings/dart/DartUtilities.cpp » ('j') | Source/bindings/dart/DartUtilities.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698