Expose the ProfileNode functionName sorting functions on
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 May 2008 17:12:40 +0000 (17:12 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 May 2008 17:12:40 +0000 (17:12 +0000)
JavaScriptProfileNode.

Reviewed by Kevin McCullough.

* page/JavaScriptProfileNode.cpp:
(WebCore::sortFunctionNameDescending): Call ProfileNode.
(WebCore::sortFunctionNameAscending): Ditto.
(WebCore::ProfileNodeClass): Add static functions.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@33936 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/page/JavaScriptProfileNode.cpp

index 31f6741..35bfd36 100644 (file)
@@ -1,3 +1,15 @@
+2008-05-20  Timothy Hatcher  <timothy@apple.com>
+
+        Expose the ProfileNode functionName sorting functions on
+        JavaScriptProfileNode.
+
+        Reviewed by Kevin McCullough.
+
+        * page/JavaScriptProfileNode.cpp:
+        (WebCore::sortFunctionNameDescending): Call ProfileNode.
+        (WebCore::sortFunctionNameAscending): Ditto.
+        (WebCore::ProfileNodeClass): Add static functions.
+
 2008-05-20  Darin Adler  <darin@apple.com>
 
         Reviewed by Mitz.
@@ -85,7 +97,7 @@
         (WebCore::sortSelfTimeAscending): Ditto.
         (WebCore::sortCallsDescending): Ditto.
         (WebCore::sortCallsAscending): Ditto.
-        (WebCore::ProfileNodeClass): Add static static functions.
+        (WebCore::ProfileNodeClass): Add static functions.
 
 2008-05-19  Timothy Hatcher  <timothy@apple.com>
 
index 4a1be73..a6b0cf3 100644 (file)
@@ -229,6 +229,28 @@ static JSValueRef sortCallsAscending(JSContextRef ctx, JSObjectRef /*function*/,
     return JSValueMakeUndefined(ctx);
 }
 
+static JSValueRef sortFunctionNameDescending(JSContextRef ctx, JSObjectRef /*function*/, JSObjectRef thisObject, size_t /*argumentCount*/, const JSValueRef[] /*arguments*/, JSValueRef* /*exception*/)
+{
+    if (!JSValueIsObjectOfClass(ctx, thisObject, ProfileNodeClass()))
+        return JSValueMakeUndefined(ctx);
+
+    ProfileNode* profileNode = static_cast<ProfileNode*>(JSObjectGetPrivate(thisObject));
+    profileNode->sortFunctionNameDescending();
+
+    return JSValueMakeUndefined(ctx);
+}
+
+static JSValueRef sortFunctionNameAscending(JSContextRef ctx, JSObjectRef /*function*/, JSObjectRef thisObject, size_t /*argumentCount*/, const JSValueRef[] /*arguments*/, JSValueRef* /*exception*/)
+{
+    if (!JSValueIsObjectOfClass(ctx, thisObject, ProfileNodeClass()))
+        return JSValueMakeUndefined(ctx);
+
+    ProfileNode* profileNode = static_cast<ProfileNode*>(JSObjectGetPrivate(thisObject));
+    profileNode->sortFunctionNameAscending();
+
+    return JSValueMakeUndefined(ctx);
+}
+
 static void finalize(JSObjectRef object)
 {
     ProfileNode* profileNode = static_cast<ProfileNode*>(JSObjectGetPrivate(object));
@@ -256,6 +278,8 @@ JSClassRef ProfileNodeClass()
         { "sortSelfTimeAscending", sortSelfTimeAscending, kJSPropertyAttributeNone },
         { "sortCallsDescending", sortCallsDescending, kJSPropertyAttributeNone },
         { "sortCallsAscending", sortCallsAscending, kJSPropertyAttributeNone },
+        { "sortFunctionNameDescending", sortFunctionNameDescending, kJSPropertyAttributeNone },
+        { "sortFunctionNameAscending", sortFunctionNameAscending, kJSPropertyAttributeNone },
         { 0, 0, 0 }
     };