[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.16-1409-g5afdf4d
pfeldman at chromium.org
pfeldman at chromium.org
Thu Dec 3 13:35:35 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit c86f7f0fba47ce86664c996ffe3820493bd58944
Author: pfeldman at chromium.org <pfeldman at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Nov 13 09:51:49 2009 +0000
2009-11-13 Mikhail Naganov <mnaganov at chromium.org>
Reviewed by Timothy Hatcher.
Enable 'console.profile()' and 'console.profileEnd()'
regardless of JAVASCRIPT_DEBUGGER.
https://bugs.webkit.org/show_bug.cgi?id=31293
* WebCore.gypi:
* bindings/js/JSConsoleCustom.cpp:
(WebCore::JSConsole::profile):
(WebCore::JSConsole::profileEnd):
* bindings/v8/custom/V8ConsoleCustom.cpp: Added.
(WebCore::CALLBACK_FUNC_DECL):
* bindings/v8/custom/V8CustomBinding.h:
* page/Console.idl:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50933 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index c80a199..3634a9e 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2009-11-13 Mikhail Naganov <mnaganov at chromium.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Enable 'console.profile()' and 'console.profileEnd()'
+ regardless of JAVASCRIPT_DEBUGGER.
+
+ https://bugs.webkit.org/show_bug.cgi?id=31293
+
+ * WebCore.gypi:
+ * bindings/js/JSConsoleCustom.cpp:
+ (WebCore::JSConsole::profile):
+ (WebCore::JSConsole::profileEnd):
+ * bindings/v8/custom/V8ConsoleCustom.cpp: Added.
+ (WebCore::CALLBACK_FUNC_DECL):
+ * bindings/v8/custom/V8CustomBinding.h:
+ * page/Console.idl:
+
2009-11-12 David Levin <levin at chromium.org>
Reviewed by NOBODY.
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index bddcac2..0bc9996 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -649,6 +649,7 @@
'bindings/v8/custom/V8ClientRectListCustom.cpp',
'bindings/v8/custom/V8ClipboardCustom.cpp',
'bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp',
+ 'bindings/v8/custom/V8ConsoleCustom.cpp',
'bindings/v8/custom/V8CustomBinding.cpp',
'bindings/v8/custom/V8CustomBinding.h',
'bindings/v8/custom/V8CustomEventListener.cpp',
diff --git a/WebCore/bindings/js/JSConsoleCustom.cpp b/WebCore/bindings/js/JSConsoleCustom.cpp
index 9c48467..8366b39 100644
--- a/WebCore/bindings/js/JSConsoleCustom.cpp
+++ b/WebCore/bindings/js/JSConsoleCustom.cpp
@@ -26,6 +26,7 @@
#include "config.h"
#include "JSConsole.h"
#include "JavaScriptProfile.h"
+#include "ScriptCallStack.h"
#include <runtime/JSArray.h>
#include "Console.h"
@@ -50,6 +51,22 @@ JSValue JSConsole::profiles(ExecState* exec) const
return constructArray(exec, list);
}
+JSValue JSConsole::profile(ExecState* exec, const ArgList& args)
+{
+ ScriptCallStack callStack(exec, args, 1);
+ const UString title = valueToStringWithUndefinedOrNullCheck(exec, args.at(0));
+ impl()->profile(title, &callStack);
+ return jsUndefined();
+}
+
+JSValue JSConsole::profileEnd(ExecState* exec, const ArgList& args)
+{
+ ScriptCallStack callStack(exec, args, 1);
+ const UString title = valueToStringWithUndefinedOrNullCheck(exec, args.at(0));
+ impl()->profileEnd(title, &callStack);
+ return jsUndefined();
+}
+
#endif
} // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8ConsoleCustom.cpp b/WebCore/bindings/v8/custom/V8ConsoleCustom.cpp
new file mode 100644
index 0000000..b44e074
--- /dev/null
+++ b/WebCore/bindings/v8/custom/V8ConsoleCustom.cpp
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include "V8Binding.h"
+#include "V8CustomBinding.h"
+#include "V8Proxy.h"
+#include <v8.h>
+
+namespace WebCore {
+
+CALLBACK_FUNC_DECL(ConsoleProfile)
+{
+ INC_STATS("console.profile()");
+ v8::HandleScope scope;
+ v8::Context::Scope context_scope(v8::Context::GetCurrent());
+ v8::V8::ResumeProfiler();
+ return v8::Undefined();
+}
+
+CALLBACK_FUNC_DECL(ConsoleProfileEnd)
+{
+ INC_STATS("console.profileEnd()");
+ v8::V8::PauseProfiler();
+ return v8::Undefined();
+}
+
+} // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8CustomBinding.h b/WebCore/bindings/v8/custom/V8CustomBinding.h
index 8d96aae..c29f491 100644
--- a/WebCore/bindings/v8/custom/V8CustomBinding.h
+++ b/WebCore/bindings/v8/custom/V8CustomBinding.h
@@ -493,6 +493,9 @@ namespace WebCore {
#endif
DECLARE_CALLBACK(InspectorBackendWrapCallback);
+ DECLARE_CALLBACK(ConsoleProfile);
+ DECLARE_CALLBACK(ConsoleProfileEnd);
+
DECLARE_CALLBACK(NodeIteratorNextNode);
DECLARE_CALLBACK(NodeIteratorPreviousNode);
diff --git a/WebCore/page/Console.idl b/WebCore/page/Console.idl
index 31500e6..577dc7f 100644
--- a/WebCore/page/Console.idl
+++ b/WebCore/page/Console.idl
@@ -50,10 +50,8 @@ module window {
[DontEnum] DOMString lastWMLErrorMessage();
#endif
-#if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER
- [CustomArgumentHandling] void profile(in [ConvertUndefinedOrNullToNullString] DOMString title);
- [CustomArgumentHandling] void profileEnd(in [ConvertUndefinedOrNullToNullString] DOMString title);
-#endif
+ [Custom] void profile(in [ConvertUndefinedOrNullToNullString] DOMString title);
+ [Custom] void profileEnd(in [ConvertUndefinedOrNullToNullString] DOMString title);
void time(in [ConvertUndefinedOrNullToNullString] DOMString title);
[CustomArgumentHandling] void timeEnd(in [ConvertUndefinedOrNullToNullString] DOMString title);
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list