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

Unified Diff: Source/bindings/dart/DartUtilities.cpp

Issue 24294002: Dartium changes for custom element lifecycle events. (Closed) Base URL: svn://svn.chromium.org/multivm/trunk/webkit
Patch Set: Created 7 years, 3 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
Index: Source/bindings/dart/DartUtilities.cpp
diff --git a/Source/bindings/dart/DartUtilities.cpp b/Source/bindings/dart/DartUtilities.cpp
index 04eadb97724e6c11a5924d0486bf0671123335f9..14d39b04c9395cc720d8a8f5b830cd2ed8bc5064 100644
--- a/Source/bindings/dart/DartUtilities.cpp
+++ b/Source/bindings/dart/DartUtilities.cpp
@@ -65,6 +65,7 @@ namespace WebCore {
const char* DartUtilities::htmlLibraryName = "dart:html";
const char* DartUtilities::indexedDBLibraryName = "dart:indexed_db";
+const char* DartUtilities::svgLibraryName = "dart:svg";
static void stringFinalizer(void* peer)
{
@@ -376,6 +377,27 @@ bool DartUtilities::objectIsType(Dart_Handle handle, const char* libraryName, co
return isType;
}
+bool DartUtilities::isTypeSubclassOf(Dart_Handle type, const char* libraryName, const char* typeName)
+{
+ Dart_Handle library = libraryForCurrentIsolate(libraryName);
+ ASSERT(!Dart_IsError(library));
+
+ Dart_Handle other = Dart_GetType(library, Dart_NewStringFromCString(typeName), 0, 0);
+ ASSERT(!Dart_IsError(other));
siva 2013/09/20 20:57:37 Is this typeName one of the predefined 5000 types?
+
+ Dart_Handle args[2] = { type, other };
+ Dart_Handle result = DartUtilities::invokeUtilsMethod("isTypeSubclassOf", 2, args);
+ ASSERT(!Dart_IsError(result));
+ if (Dart_IsError(result))
+ return false;
+
+ Dart_Handle exception = 0;
+ bool boolResult = dartToBool(result, exception);
+ if (exception)
+ return false;
+ return boolResult;
+}
+
bool DartUtilities::isTypedData(Dart_Handle handle)
{
return Dart_GetTypeOfTypedData(handle) != Dart_TypedData_kInvalid || Dart_GetTypeOfExternalTypedData(handle) != Dart_TypedData_kInvalid;

Powered by Google App Engine
This is Rietveld 408576698