summaryrefslogtreecommitdiffstats
path: root/WebCore/bindings/js/JSConsoleCustom.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/bindings/js/JSConsoleCustom.cpp')
-rw-r--r--WebCore/bindings/js/JSConsoleCustom.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/WebCore/bindings/js/JSConsoleCustom.cpp b/WebCore/bindings/js/JSConsoleCustom.cpp
index f0419c7..6df88f6 100644
--- a/WebCore/bindings/js/JSConsoleCustom.cpp
+++ b/WebCore/bindings/js/JSConsoleCustom.cpp
@@ -29,8 +29,11 @@
#include "Console.h"
#include "JSScriptProfile.h"
+#include "ScriptCallStack.h"
+#include "ScriptCallStackFactory.h"
#include "ScriptProfile.h"
#include <runtime/JSArray.h>
+#include <wtf/OwnPtr.h>
using namespace JSC;
@@ -52,6 +55,28 @@ JSValue JSConsole::profiles(ExecState* exec) const
return constructArray(exec, list);
}
+JSValue JSConsole::profile(ExecState* exec)
+{
+ OwnPtr<ScriptCallStack> callStack(createScriptCallStack(exec, 1));
+ const String& title = valueToStringWithUndefinedOrNullCheck(exec, exec->argument(0));
+ if (exec->hadException())
+ return jsUndefined();
+
+ impl()->profile(title, exec, callStack.release());
+ return jsUndefined();
+}
+
+JSValue JSConsole::profileEnd(ExecState* exec)
+{
+ OwnPtr<ScriptCallStack> callStack(createScriptCallStack(exec, 1));
+ const String& title = valueToStringWithUndefinedOrNullCheck(exec, exec->argument(0));
+ if (exec->hadException())
+ return jsUndefined();
+
+ impl()->profileEnd(title, exec, callStack.release());
+ return jsUndefined();
+}
+
#endif
} // namespace WebCore