Changeset 33936

Show
Ignore:
Timestamp:
05/20/08 10:12:40 (6 months ago)
Author:
timothy@apple.com
Message:

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.

Location:
trunk/WebCore
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r33934 r33936  
     12008-05-20  Timothy Hatcher  <timothy@apple.com> 
     2 
     3        Expose the ProfileNode functionName sorting functions on 
     4        JavaScriptProfileNode. 
     5 
     6        Reviewed by Kevin McCullough. 
     7 
     8        * page/JavaScriptProfileNode.cpp: 
     9        (WebCore::sortFunctionNameDescending): Call ProfileNode. 
     10        (WebCore::sortFunctionNameAscending): Ditto. 
     11        (WebCore::ProfileNodeClass): Add static functions. 
     12 
    1132008-05-20  Darin Adler  <darin@apple.com> 
    214 
     
    8698        (WebCore::sortCallsDescending): Ditto. 
    8799        (WebCore::sortCallsAscending): Ditto. 
    88         (WebCore::ProfileNodeClass): Add static static functions. 
     100        (WebCore::ProfileNodeClass): Add static functions. 
    89101 
    901022008-05-19  Timothy Hatcher  <timothy@apple.com> 
  • trunk/WebCore/page/JavaScriptProfileNode.cpp

    r33931 r33936  
    230230} 
    231231 
     232static JSValueRef sortFunctionNameDescending(JSContextRef ctx, JSObjectRef /*function*/, JSObjectRef thisObject, size_t /*argumentCount*/, const JSValueRef[] /*arguments*/, JSValueRef* /*exception*/) 
     233{ 
     234    if (!JSValueIsObjectOfClass(ctx, thisObject, ProfileNodeClass())) 
     235        return JSValueMakeUndefined(ctx); 
     236 
     237    ProfileNode* profileNode = static_cast<ProfileNode*>(JSObjectGetPrivate(thisObject)); 
     238    profileNode->sortFunctionNameDescending(); 
     239 
     240    return JSValueMakeUndefined(ctx); 
     241} 
     242 
     243static JSValueRef sortFunctionNameAscending(JSContextRef ctx, JSObjectRef /*function*/, JSObjectRef thisObject, size_t /*argumentCount*/, const JSValueRef[] /*arguments*/, JSValueRef* /*exception*/) 
     244{ 
     245    if (!JSValueIsObjectOfClass(ctx, thisObject, ProfileNodeClass())) 
     246        return JSValueMakeUndefined(ctx); 
     247 
     248    ProfileNode* profileNode = static_cast<ProfileNode*>(JSObjectGetPrivate(thisObject)); 
     249    profileNode->sortFunctionNameAscending(); 
     250 
     251    return JSValueMakeUndefined(ctx); 
     252} 
     253 
    232254static void finalize(JSObjectRef object) 
    233255{ 
     
    257279        { "sortCallsDescending", sortCallsDescending, kJSPropertyAttributeNone }, 
    258280        { "sortCallsAscending", sortCallsAscending, kJSPropertyAttributeNone }, 
     281        { "sortFunctionNameDescending", sortFunctionNameDescending, kJSPropertyAttributeNone }, 
     282        { "sortFunctionNameAscending", sortFunctionNameAscending, kJSPropertyAttributeNone }, 
    259283        { 0, 0, 0 } 
    260284    };