Commit 5a0204ec authored by timothy@apple.com's avatar timothy@apple.com

Expose the ProfileNode sorting functions on JavaScriptProfileNode.

Reviewed by Kevin McCullough.

* page/JavaScriptProfileNode.cpp:
(WebCore::sortTotalTimeDescending): Call ProfileNode.
(WebCore::sortTotalTimeAscending): Ditto.
(WebCore::sortSelfTimeDescending): Ditto.
(WebCore::sortSelfTimeAscending): Ditto.
(WebCore::sortCallsDescending): Ditto.
(WebCore::sortCallsAscending): Ditto.
(WebCore::ProfileNodeClass): Add static static functions.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@33931 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 7de48b2e
2008-05-19 Timothy Hatcher <timothy@apple.com>
Expose the ProfileNode sorting functions on JavaScriptProfileNode.
Reviewed by Kevin McCullough.
* page/JavaScriptProfileNode.cpp:
(WebCore::sortTotalTimeDescending): Call ProfileNode.
(WebCore::sortTotalTimeAscending): Ditto.
(WebCore::sortSelfTimeDescending): Ditto.
(WebCore::sortSelfTimeAscending): Ditto.
(WebCore::sortCallsDescending): Ditto.
(WebCore::sortCallsAscending): Ditto.
(WebCore::ProfileNodeClass): Add static static functions.
2008-05-19 Timothy Hatcher <timothy@apple.com>
* page/InspectorController.cpp: Change the include for
......@@ -163,6 +163,72 @@ static JSValueRef getChildren(JSContextRef ctx, JSObjectRef thisObject, JSString
return result;
}
static JSValueRef sortTotalTimeDescending(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->sortTotalTimeDescending();
return JSValueMakeUndefined(ctx);
}
static JSValueRef sortTotalTimeAscending(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->sortTotalTimeAscending();
return JSValueMakeUndefined(ctx);
}
static JSValueRef sortSelfTimeDescending(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->sortSelfTimeDescending();
return JSValueMakeUndefined(ctx);
}
static JSValueRef sortSelfTimeAscending(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->sortSelfTimeAscending();
return JSValueMakeUndefined(ctx);
}
static JSValueRef sortCallsDescending(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->sortCallsDescending();
return JSValueMakeUndefined(ctx);
}
static JSValueRef sortCallsAscending(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->sortCallsAscending();
return JSValueMakeUndefined(ctx);
}
static void finalize(JSObjectRef object)
{
ProfileNode* profileNode = static_cast<ProfileNode*>(JSObjectGetPrivate(object));
......@@ -183,8 +249,18 @@ JSClassRef ProfileNodeClass()
{ 0, 0, 0, 0 }
};
static JSStaticFunction staticFunctions[] = {
{ "sortTotalTimeDescending", sortTotalTimeDescending, kJSPropertyAttributeNone },
{ "sortTotalTimeAscending", sortTotalTimeAscending, kJSPropertyAttributeNone },
{ "sortSelfTimeDescending", sortSelfTimeDescending, kJSPropertyAttributeNone },
{ "sortSelfTimeAscending", sortSelfTimeAscending, kJSPropertyAttributeNone },
{ "sortCallsDescending", sortCallsDescending, kJSPropertyAttributeNone },
{ "sortCallsAscending", sortCallsAscending, kJSPropertyAttributeNone },
{ 0, 0, 0 }
};
static JSClassDefinition classDefinition = {
0, kJSClassAttributeNone, "ProfileNode", 0, staticValues, 0,
0, kJSClassAttributeNone, "ProfileNode", 0, staticValues, staticFunctions,
0, finalize, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment