[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.20-204-g221d8e8

eric at webkit.org eric at webkit.org
Wed Feb 10 22:10:48 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit adfcca1233fc67f3907e204be42faf7815eabd4a
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Feb 3 10:54:28 2010 +0000

    2010-02-03  Mikhail Naganov  <mnaganov at chromium.org>
    
            Reviewed by Pavel Feldman.
    
            Start unforking debugger and profiler code.
    
            Remove custom implementation of Console.
            Add 'ScriptProfiler' and 'ScriptProfile' types.
            Start migration to engine-neutral types in InspectorController.
    
            https://bugs.webkit.org/show_bug.cgi?id=34481
    
            * GNUmakefile.am:
            * WebCore.gypi:
            * WebCore.pro:
            * WebCore.xcodeproj/project.pbxproj:
            * bindings/js/JSBindingsAllInOne.cpp:
            * bindings/js/JSConsoleCustom.cpp:
            * bindings/js/ScriptProfile.h: Added.
            * bindings/js/ScriptProfiler.cpp: Added.
            (WebCore::ScriptProfiler::start):
            (WebCore::ScriptProfiler::stop):
            * bindings/js/ScriptProfiler.h: Added.
            * bindings/scripts/CodeGeneratorV8.pm:
            * bindings/v8/ScriptProfile.h: Added.
            (WebCore::ScriptProfile::create):
            (WebCore::ScriptProfile::~ScriptProfile):
            (WebCore::ScriptProfile::title):
            (WebCore::ScriptProfile::uid):
            (WebCore::ScriptProfile::ScriptProfile):
            * bindings/v8/ScriptProfiler.cpp: Added.
            (WebCore::ScriptProfiler::start):
            (WebCore::ScriptProfiler::stop):
            * bindings/v8/ScriptProfiler.h: Added.
            * bindings/v8/custom/V8ConsoleCustom.cpp: Removed.
            * inspector/InspectorController.cpp:
            (WebCore::InspectorController::endGroup):
            (WebCore::InspectorController::show):
            (WebCore::InspectorController::setDOMStorageItem):
            (WebCore::InspectorController::addProfile):
            (WebCore::InspectorController::addProfileFinishedMessageToConsole):
            (WebCore::InspectorController::addStartProfilingMessageToConsole):
            (WebCore::InspectorController::createProfileHeader):
            (WebCore::InspectorController::getCurrentUserInitiatedProfileName):
            (WebCore::InspectorController::startUserInitiatedProfiling):
            (WebCore::InspectorController::stopUserInitiatedProfiling):
            (WebCore::InspectorController::enableDebugger):
            (WebCore::InspectorController::specialPanelForJSName):
            * inspector/InspectorController.h:
            (WebCore::InspectorController::searchingForNodeInPage):
            * page/Console.cpp:
            (WebCore::Console::profile):
            (WebCore::Console::profileEnd):
            * page/Console.h:
            (WebCore::):
            (WebCore::Console::create):
            (WebCore::Console::profiles):
            * page/Console.idl:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54277 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 01ae591..fa328c4 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,62 @@
+2010-02-03  Mikhail Naganov  <mnaganov at chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Start unforking debugger and profiler code.
+
+        Remove custom implementation of Console.
+        Add 'ScriptProfiler' and 'ScriptProfile' types.
+        Start migration to engine-neutral types in InspectorController.
+
+        https://bugs.webkit.org/show_bug.cgi?id=34481
+
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSBindingsAllInOne.cpp:
+        * bindings/js/JSConsoleCustom.cpp:
+        * bindings/js/ScriptProfile.h: Added.
+        * bindings/js/ScriptProfiler.cpp: Added.
+        (WebCore::ScriptProfiler::start):
+        (WebCore::ScriptProfiler::stop):
+        * bindings/js/ScriptProfiler.h: Added.
+        * bindings/scripts/CodeGeneratorV8.pm:
+        * bindings/v8/ScriptProfile.h: Added.
+        (WebCore::ScriptProfile::create):
+        (WebCore::ScriptProfile::~ScriptProfile):
+        (WebCore::ScriptProfile::title):
+        (WebCore::ScriptProfile::uid):
+        (WebCore::ScriptProfile::ScriptProfile):
+        * bindings/v8/ScriptProfiler.cpp: Added.
+        (WebCore::ScriptProfiler::start):
+        (WebCore::ScriptProfiler::stop):
+        * bindings/v8/ScriptProfiler.h: Added.
+        * bindings/v8/custom/V8ConsoleCustom.cpp: Removed.
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::endGroup):
+        (WebCore::InspectorController::show):
+        (WebCore::InspectorController::setDOMStorageItem):
+        (WebCore::InspectorController::addProfile):
+        (WebCore::InspectorController::addProfileFinishedMessageToConsole):
+        (WebCore::InspectorController::addStartProfilingMessageToConsole):
+        (WebCore::InspectorController::createProfileHeader):
+        (WebCore::InspectorController::getCurrentUserInitiatedProfileName):
+        (WebCore::InspectorController::startUserInitiatedProfiling):
+        (WebCore::InspectorController::stopUserInitiatedProfiling):
+        (WebCore::InspectorController::enableDebugger):
+        (WebCore::InspectorController::specialPanelForJSName):
+        * inspector/InspectorController.h:
+        (WebCore::InspectorController::searchingForNodeInPage):
+        * page/Console.cpp:
+        (WebCore::Console::profile):
+        (WebCore::Console::profileEnd):
+        * page/Console.h:
+        (WebCore::):
+        (WebCore::Console::create):
+        (WebCore::Console::profiles):
+        * page/Console.idl:
+
 2010-02-02  Kent Tamura  <tkent at chromium.org>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am
index 2680a80..9f973da 100644
--- a/WebCore/GNUmakefile.am
+++ b/WebCore/GNUmakefile.am
@@ -484,6 +484,9 @@ webcore_sources += \
 	WebCore/bindings/js/ScriptInstance.h \
 	WebCore/bindings/js/ScriptObject.cpp \
 	WebCore/bindings/js/ScriptObject.h \
+	WebCore/bindings/js/ScriptProfile.h \
+	WebCore/bindings/js/ScriptProfiler.cpp \
+	WebCore/bindings/js/ScriptProfiler.h \
 	WebCore/bindings/js/ScriptSourceCode.h \
 	WebCore/bindings/js/ScriptSourceProvider.h \
 	WebCore/bindings/js/ScriptState.cpp \
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index d82a4e1..ed49e83 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -674,7 +674,6 @@
             'bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp',
             'bindings/v8/custom/V8CSSStyleSheetCustom.cpp',
             'bindings/v8/custom/V8CSSValueCustom.cpp',
-            'bindings/v8/custom/V8ConsoleCustom.cpp',
             'bindings/v8/custom/V8CustomBinding.h',
             'bindings/v8/custom/V8CustomEventListener.cpp',
             'bindings/v8/custom/V8CustomEventListener.h',
@@ -810,6 +809,9 @@
             'bindings/v8/ScriptInstance.h',
             'bindings/v8/ScriptObject.cpp',
             'bindings/v8/ScriptObject.h',
+            'bindings/v8/ScriptProfile.h',
+            'bindings/v8/ScriptProfiler.cpp',
+            'bindings/v8/ScriptProfiler.h',
             'bindings/v8/ScriptScope.cpp',
             'bindings/v8/ScriptScope.h',
             'bindings/v8/ScriptSourceCode.h',
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index dacb8d5..61e8c3c 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -346,6 +346,7 @@ SOURCES += \
     bindings/js/ScriptEventListener.cpp \
     bindings/js/ScriptFunctionCall.cpp \
     bindings/js/ScriptObject.cpp \
+    bindings/js/ScriptProfiler.cpp \
     bindings/js/ScriptState.cpp \
     bindings/js/ScriptValue.cpp \
     bindings/js/ScheduledAction.cpp \
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index 283268f..4b34eb0 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -2455,6 +2455,9 @@
 		97DD4D860FDF4D6E00ECF9A4 /* XSSAuditor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97DD4D840FDF4D6D00ECF9A4 /* XSSAuditor.cpp */; };
 		97DD4D870FDF4D6E00ECF9A4 /* XSSAuditor.h in Headers */ = {isa = PBXBuildFile; fileRef = 97DD4D850FDF4D6E00ECF9A4 /* XSSAuditor.h */; };
 		97EF7DFE107E55B700D7C49C /* ScriptControllerBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97EF7DFD107E55B700D7C49C /* ScriptControllerBase.cpp */; };
+		9F72304F11184B4100AD0126 /* ScriptProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F72304C11184B4100AD0126 /* ScriptProfile.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		9F72305011184B4100AD0126 /* ScriptProfiler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9F72304D11184B4100AD0126 /* ScriptProfiler.cpp */; };
+		9F72305111184B4100AD0126 /* ScriptProfiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F72304E11184B4100AD0126 /* ScriptProfiler.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		A17C81220F2A5CF7005DAAEB /* HTMLElementFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A17C81200F2A5CF7005DAAEB /* HTMLElementFactory.cpp */; };
 		A17C81230F2A5CF7005DAAEB /* HTMLElementFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = A17C81210F2A5CF7005DAAEB /* HTMLElementFactory.h */; };
 		A718760E0B2A120100A16ECE /* DragActions.h in Headers */ = {isa = PBXBuildFile; fileRef = A718760D0B2A120100A16ECE /* DragActions.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -7789,6 +7792,9 @@
 		97DD4D840FDF4D6D00ECF9A4 /* XSSAuditor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XSSAuditor.cpp; sourceTree = "<group>"; };
 		97DD4D850FDF4D6E00ECF9A4 /* XSSAuditor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XSSAuditor.h; sourceTree = "<group>"; };
 		97EF7DFD107E55B700D7C49C /* ScriptControllerBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptControllerBase.cpp; sourceTree = "<group>"; };
+		9F72304C11184B4100AD0126 /* ScriptProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptProfile.h; sourceTree = "<group>"; };
+		9F72304D11184B4100AD0126 /* ScriptProfiler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptProfiler.cpp; sourceTree = "<group>"; };
+		9F72304E11184B4100AD0126 /* ScriptProfiler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptProfiler.h; sourceTree = "<group>"; };
 		A17C81200F2A5CF7005DAAEB /* HTMLElementFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLElementFactory.cpp; sourceTree = "<group>"; };
 		A17C81210F2A5CF7005DAAEB /* HTMLElementFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLElementFactory.h; sourceTree = "<group>"; };
 		A718760D0B2A120100A16ECE /* DragActions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DragActions.h; sourceTree = "<group>"; };
@@ -14621,6 +14627,9 @@
 				934CC1160EDCAC7300A658F2 /* ScriptInstance.h */,
 				41F066E30F64BCF600A07EAC /* ScriptObject.cpp */,
 				41F066E20F64BCF600A07EAC /* ScriptObject.h */,
+				9F72304C11184B4100AD0126 /* ScriptProfile.h */,
+				9F72304D11184B4100AD0126 /* ScriptProfiler.cpp */,
+				9F72304E11184B4100AD0126 /* ScriptProfiler.h */,
 				934CC1090EDB223900A658F2 /* ScriptSourceCode.h */,
 				CE54FD371016D9A6008B44C8 /* ScriptSourceProvider.h */,
 				4127D5360F8AAB1D00E424F5 /* ScriptState.cpp */,
@@ -18487,6 +18496,8 @@
 				97DD4D870FDF4D6E00ECF9A4 /* XSSAuditor.h in Headers */,
 				84D0C4061115F1EA0018AA34 /* AffineTransform.h in Headers */,
 				B71FE6DF11091CB300DAEF77 /* PrintContext.h in Headers */,
+				9F72304F11184B4100AD0126 /* ScriptProfile.h in Headers */,
+				9F72305111184B4100AD0126 /* ScriptProfiler.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -20663,6 +20674,7 @@
 				97DD4D860FDF4D6E00ECF9A4 /* XSSAuditor.cpp in Sources */,
 				84D0C4041115F1D40018AA34 /* AffineTransform.cpp in Sources */,
 				B776D43D1104527500BEB0EC /* PrintContext.cpp in Sources */,
+				9F72305011184B4100AD0126 /* ScriptProfiler.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/WebCore/bindings/js/JSBindingsAllInOne.cpp b/WebCore/bindings/js/JSBindingsAllInOne.cpp
index e539042..8a918a3 100644
--- a/WebCore/bindings/js/JSBindingsAllInOne.cpp
+++ b/WebCore/bindings/js/JSBindingsAllInOne.cpp
@@ -142,6 +142,7 @@
 #include "ScriptControllerWin.cpp"
 #include "ScriptEventListener.cpp"
 #include "ScriptFunctionCall.cpp"
+#include "ScriptProfiler.cpp"
 #include "ScriptState.cpp"
 #include "SerializedScriptValue.cpp"
 #include "WorkerScriptController.cpp"
diff --git a/WebCore/bindings/js/JSConsoleCustom.cpp b/WebCore/bindings/js/JSConsoleCustom.cpp
index 8366b39..b631cdd 100644
--- a/WebCore/bindings/js/JSConsoleCustom.cpp
+++ b/WebCore/bindings/js/JSConsoleCustom.cpp
@@ -24,13 +24,14 @@
  */
 
 #include "config.h"
+
 #include "JSConsole.h"
+
+#include "Console.h"
 #include "JavaScriptProfile.h"
 #include "ScriptCallStack.h"
 #include <runtime/JSArray.h>
 
-#include "Console.h"
-
 using namespace JSC;
 
 namespace WebCore {
@@ -51,22 +52,6 @@ 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/js/ScriptProfile.h b/WebCore/bindings/js/ScriptProfile.h
new file mode 100644
index 0000000..32095e3
--- /dev/null
+++ b/WebCore/bindings/js/ScriptProfile.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 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:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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.
+ */
+
+#ifndef ScriptProfile_h
+#define ScriptProfile_h
+
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+#include <profiler/Profile.h>
+
+namespace WebCore {
+
+typedef JSC::Profile ScriptProfile;
+
+} // namespace WebCore
+
+#endif // ENABLE(JAVASCRIPT_DEBUGGER)
+
+#endif // ScriptProfile_h
diff --git a/WebCore/bindings/js/ScriptProfiler.cpp b/WebCore/bindings/js/ScriptProfiler.cpp
new file mode 100644
index 0000000..789e3d3
--- /dev/null
+++ b/WebCore/bindings/js/ScriptProfiler.cpp
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 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:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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"
+
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+
+#include "ScriptProfiler.h"
+
+#include <profiler/Profiler.h>
+
+namespace WebCore {
+
+void ScriptProfiler::start(ScriptState* state, const String& title)
+{
+    JSC::Profiler::profiler()->startProfiling(state, title);
+}
+
+PassRefPtr<ScriptProfile> ScriptProfiler::stop(ScriptState* state, const String& title)
+{
+    return JSC::Profiler::profiler()->stopProfiling(state, title);
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(JAVASCRIPT_DEBUGGER)
diff --git a/WebCore/bindings/js/ScriptProfiler.h b/WebCore/bindings/js/ScriptProfiler.h
new file mode 100644
index 0000000..a86bcfb
--- /dev/null
+++ b/WebCore/bindings/js/ScriptProfiler.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 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:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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.
+ */
+
+#ifndef ScriptProfiler_h
+#define ScriptProfiler_h
+
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+#include "ScriptProfile.h"
+#include "ScriptState.h"
+
+#include <wtf/Noncopyable.h>
+
+namespace WebCore {
+
+class ScriptProfiler : public Noncopyable {
+public:
+    static void start(ScriptState* state, const String& title);
+    static PassRefPtr<ScriptProfile> stop(ScriptState* state, const String& title);
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(JAVASCRIPT_DEBUGGER)
+
+#endif // ScriptProfiler_h
diff --git a/WebCore/bindings/scripts/CodeGeneratorV8.pm b/WebCore/bindings/scripts/CodeGeneratorV8.pm
index 59ffffc..edbbd0c 100644
--- a/WebCore/bindings/scripts/CodeGeneratorV8.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorV8.pm
@@ -2056,7 +2056,6 @@ sub HasCustomToV8Implementation {
     return 1 if $interfaceName eq "BarInfo";
     return 1 if $interfaceName eq "CSSStyleSheet";
     return 1 if $interfaceName eq "CanvasPixelArray";
-    return 1 if $interfaceName eq "Console";
     return 1 if $interfaceName eq "DOMSelection";
     return 1 if $interfaceName eq "DOMWindow";
     return 1 if $interfaceName eq "Element";
diff --git a/WebCore/bindings/v8/ScriptProfile.h b/WebCore/bindings/v8/ScriptProfile.h
new file mode 100644
index 0000000..1a4d677
--- /dev/null
+++ b/WebCore/bindings/v8/ScriptProfile.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2010, 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.
+ */
+
+#ifndef ScriptProfile_h
+#define ScriptProfile_h
+
+#include "PlatformString.h"
+
+namespace WebCore {
+
+class ScriptProfile : public RefCounted<ScriptProfile> {
+public:
+    static PassRefPtr<ScriptProfile> create(const String& title, unsigned uid)
+    {
+      return adoptRef(new ScriptProfile(title, uid));
+    }
+    virtual ~ScriptProfile() {}
+
+    String title() const { return m_title; }
+    unsigned int uid() const { return m_uid; }
+
+protected:
+    ScriptProfile(const String& title, unsigned uid)
+        : m_title(title)
+        , m_uid(uid)
+    {}
+
+private:
+    String m_title;
+    unsigned int m_uid;
+};
+
+} // namespace WebCore
+
+#endif // ScriptProfile_h
diff --git a/WebCore/bindings/v8/ScriptProfiler.cpp b/WebCore/bindings/v8/ScriptProfiler.cpp
new file mode 100644
index 0000000..f238f6f
--- /dev/null
+++ b/WebCore/bindings/v8/ScriptProfiler.cpp
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2010, 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 "ScriptProfiler.h"
+
+namespace WebCore {
+
+void ScriptProfiler::start(ScriptState* state, const String& title)
+{
+    v8::HandleScope scope;
+    v8::Context::Scope contextScope(v8::Context::GetCurrent());
+    v8::V8::ResumeProfiler();
+}
+
+PassRefPtr<ScriptProfile> ScriptProfiler::stop(ScriptState* state, const String& title)
+{
+    v8::V8::PauseProfiler();
+    return 0;
+}
+
+} // namespace WebCore
diff --git a/WebCore/bindings/v8/ScriptProfiler.h b/WebCore/bindings/v8/ScriptProfiler.h
new file mode 100644
index 0000000..c02cc32
--- /dev/null
+++ b/WebCore/bindings/v8/ScriptProfiler.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2010, 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.
+ */
+
+#ifndef ScriptProfiler_h
+#define ScriptProfiler_h
+
+#include "PlatformString.h"
+#include "ScriptProfile.h"
+#include "ScriptState.h"
+
+#include <wtf/Noncopyable.h>
+
+namespace WebCore {
+
+class ScriptProfiler : public Noncopyable {
+public:
+    static void start(ScriptState* state, const String& title);
+    static PassRefPtr<ScriptProfile> stop(ScriptState* state, const String& title);
+};
+
+} // namespace WebCore
+
+#endif // ScriptProfiler_h
diff --git a/WebCore/bindings/v8/custom/V8ConsoleCustom.cpp b/WebCore/bindings/v8/custom/V8ConsoleCustom.cpp
deleted file mode 100644
index 45cc222..0000000
--- a/WebCore/bindings/v8/custom/V8ConsoleCustom.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * 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 "V8Console.h"
-
-#include "V8Binding.h"
-#include "V8DOMWindow.h"
-#include "V8Proxy.h"
-#include <v8.h>
-
-namespace WebCore {
-
-v8::Handle<v8::Value> V8Console::profileCallback(const v8::Arguments& args)
-{
-    INC_STATS("console.profile()");
-    v8::HandleScope scope;
-    v8::Context::Scope context_scope(v8::Context::GetCurrent());
-    v8::V8::ResumeProfiler();
-    return v8::Undefined();
-}
-
-v8::Handle<v8::Value> V8Console::profileEndCallback(const v8::Arguments& args)
-{
-    INC_STATS("console.profileEnd()");
-    v8::V8::PauseProfiler();
-    return v8::Undefined();
-}
-
-v8::Handle<v8::Value> toV8(Console* impl)
-{
-    if (!impl)
-        return v8::Null();
-    v8::Handle<v8::Object> wrapper = getDOMObjectMap().get(impl);
-    if (wrapper.IsEmpty()) {
-        wrapper = V8Console::wrap(impl);
-        if (!wrapper.IsEmpty())
-            V8DOMWrapper::setHiddenWindowReference(impl->frame(), V8DOMWindow::consoleIndex, wrapper);
-    }
-    return wrapper;
-}
-
-} // namespace WebCore
diff --git a/WebCore/inspector/InspectorController.cpp b/WebCore/inspector/InspectorController.cpp
index 5ab1354..4e3b423 100644
--- a/WebCore/inspector/InspectorController.cpp
+++ b/WebCore/inspector/InspectorController.cpp
@@ -39,9 +39,9 @@
 #include "ConsoleMessage.h"
 #include "Cookie.h"
 #include "CookieJar.h"
+#include "DOMWindow.h"
 #include "Document.h"
 #include "DocumentLoader.h"
-#include "DOMWindow.h"
 #include "Element.h"
 #include "FloatConversion.h"
 #include "FloatQuad.h"
@@ -53,16 +53,16 @@
 #include "GraphicsContext.h"
 #include "HTMLFrameOwnerElement.h"
 #include "HitTestResult.h"
-#include "InspectorBackend.h"
 #include "InjectedScriptHost.h"
+#include "InspectorBackend.h"
 #include "InspectorClient.h"
-#include "InspectorFrontend.h"
-#include "InspectorFrontendHost.h"
-#include "InspectorDatabaseResource.h"
 #include "InspectorDOMAgent.h"
 #include "InspectorDOMStorageResource.h"
-#include "InspectorTimelineAgent.h"
+#include "InspectorDatabaseResource.h"
+#include "InspectorFrontend.h"
+#include "InspectorFrontendHost.h"
 #include "InspectorResource.h"
+#include "InspectorTimelineAgent.h"
 #include "JavaScriptProfile.h"
 #include "Page.h"
 #include "ProgressTracker.h"
@@ -73,6 +73,8 @@
 #include "ScriptCallStack.h"
 #include "ScriptFunctionCall.h"
 #include "ScriptObject.h"
+#include "ScriptProfile.h"
+#include "ScriptProfiler.h"
 #include "ScriptString.h"
 #include "SecurityOrigin.h"
 #include "Settings.h"
@@ -94,14 +96,11 @@
 #endif
 
 #if ENABLE(JAVASCRIPT_DEBUGGER)
+#include "JSJavaScriptCallFrame.h"
 #include "JavaScriptCallFrame.h"
 #include "JavaScriptDebugServer.h"
-#include "JSJavaScriptCallFrame.h"
 
-#include <profiler/Profile.h>
-#include <profiler/Profiler.h>
 #include <runtime/JSLock.h>
-#include <runtime/StringBuilder.h>
 #include <runtime/UString.h>
 
 using namespace JSC;
@@ -390,7 +389,7 @@ void InspectorController::startGroup(MessageSource source, ScriptCallStack* call
 
 void InspectorController::endGroup(MessageSource source, unsigned lineNumber, const String& sourceURL)
 {
-    if (m_groupLevel == 0)
+    if (!m_groupLevel)
         return;
 
     --m_groupLevel;
@@ -558,7 +557,7 @@ void InspectorController::show()
     
     if (!m_page) {
         if (m_frontend)
-            return;  // We are using custom frontend - no need to create page.
+            return; // We are using custom frontend - no need to create page.
 
         m_page = m_client->createPage();
         if (!m_page)
@@ -1306,7 +1305,7 @@ void InspectorController::setDOMStorageItem(long callId, long storageId, const S
     if (storageResource) {
         ExceptionCode exception = 0;
         storageResource->domStorage()->setItem(key, value, exception);
-        success = (exception == 0);
+        success = !exception;
     }
     m_frontend->didSetDOMStorageItem(callId, success);
 }
@@ -1345,12 +1344,12 @@ void InspectorController::moveWindowBy(float x, float y) const
 }
 
 #if ENABLE(JAVASCRIPT_DEBUGGER)
-void InspectorController::addProfile(PassRefPtr<Profile> prpProfile, unsigned lineNumber, const UString& sourceURL)
+void InspectorController::addProfile(PassRefPtr<ScriptProfile> prpProfile, unsigned lineNumber, const String& sourceURL)
 {
     if (!enabled())
         return;
 
-    RefPtr<Profile> profile = prpProfile;
+    RefPtr<ScriptProfile> profile = prpProfile;
     m_profiles.add(profile->uid(), profile);
 
     if (m_frontend) {
@@ -1361,30 +1360,18 @@ void InspectorController::addProfile(PassRefPtr<Profile> prpProfile, unsigned li
     addProfileFinishedMessageToConsole(profile, lineNumber, sourceURL);
 }
 
-void InspectorController::addProfileFinishedMessageToConsole(PassRefPtr<Profile> prpProfile, unsigned lineNumber, const UString& sourceURL)
+void InspectorController::addProfileFinishedMessageToConsole(PassRefPtr<ScriptProfile> prpProfile, unsigned lineNumber, const String& sourceURL)
 {
-    RefPtr<Profile> profile = prpProfile;
+    RefPtr<ScriptProfile> profile = prpProfile;
 
-    JSC::StringBuilder message;
-    message.append("Profile \"webkit-profile://");
-    message.append((UString)encodeWithURLEscapeSequences(CPUProfileType));
-    message.append("/");
-    message.append((UString)encodeWithURLEscapeSequences(profile->title()));
-    message.append("#");
-    message.append(UString::from(profile->uid()));
-    message.append("\" finished.");
-    addMessageToConsole(JSMessageSource, LogMessageType, LogMessageLevel, message.release(), lineNumber, sourceURL);
+    String message = String::format("Profile \"webkit-profile://%s/%s#%d\" finished.", CPUProfileType, encodeWithURLEscapeSequences(profile->title()).utf8().data(), profile->uid());
+    addMessageToConsole(JSMessageSource, LogMessageType, LogMessageLevel, message, lineNumber, sourceURL);
 }
 
-void InspectorController::addStartProfilingMessageToConsole(const UString& title, unsigned lineNumber, const UString& sourceURL)
+void InspectorController::addStartProfilingMessageToConsole(const String& title, unsigned lineNumber, const String& sourceURL)
 {
-    JSC::StringBuilder message;
-    message.append("Profile \"webkit-profile://");
-    message.append(encodeWithURLEscapeSequences(CPUProfileType));
-    message.append("/");
-    message.append(encodeWithURLEscapeSequences(title));
-    message.append("#0\" started.");
-    addMessageToConsole(JSMessageSource, LogMessageType, LogMessageLevel, message.release(), lineNumber, sourceURL);
+    String message = String::format("Profile \"webkit-profile://%s/%s#0\" started.", CPUProfileType, encodeWithURLEscapeSequences(title).utf8().data());
+    addMessageToConsole(JSMessageSource, LogMessageType, LogMessageLevel, message, lineNumber, sourceURL);
 }
 
 void InspectorController::getProfileHeaders(long callId)
@@ -1408,26 +1395,21 @@ void InspectorController::getProfile(long callId, unsigned uid)
         m_frontend->didGetProfile(callId, toJS(m_scriptState, it->second.get()));
 }
 
-ScriptObject InspectorController::createProfileHeader(const JSC::Profile& profile)
+ScriptObject InspectorController::createProfileHeader(const ScriptProfile& profile)
 {
     ScriptObject header = m_frontend->newScriptObject();
     header.set("title", profile.title());
     header.set("uid", profile.uid());
-    header.set("typeId", UString(CPUProfileType));
+    header.set("typeId", String(CPUProfileType));
     return header;
 }
 
-UString InspectorController::getCurrentUserInitiatedProfileName(bool incrementProfileNumber = false)
+String InspectorController::getCurrentUserInitiatedProfileName(bool incrementProfileNumber = false)
 {
     if (incrementProfileNumber)
         m_currentUserInitiatedProfileNumber = m_nextUserInitiatedProfileNumber++;        
 
-    JSC::StringBuilder title;
-    title.append(UserInitiatedProfileName);
-    title.append(".");
-    title.append(UString::from(m_currentUserInitiatedProfileNumber));
-    
-    return title.release();
+    return String::format("%s.%d", UserInitiatedProfileName, m_currentUserInitiatedProfileNumber);
 }
 
 void InspectorController::startUserInitiatedProfilingSoon()
@@ -1447,12 +1429,12 @@ void InspectorController::startUserInitiatedProfiling(Timer<InspectorController>
 
     m_recordingUserInitiatedProfile = true;
 
-    UString title = getCurrentUserInitiatedProfileName(true);
+    String title = getCurrentUserInitiatedProfileName(true);
 
     ExecState* scriptState = toJSDOMWindow(m_inspectedPage->mainFrame(), debuggerWorld())->globalExec();
-    Profiler::profiler()->startProfiling(scriptState, title);
+    ScriptProfiler::start(scriptState, title);
 
-    addStartProfilingMessageToConsole(title, 0, UString());
+    addStartProfilingMessageToConsole(title, 0, String());
 
     toggleRecordButton(true);
 }
@@ -1464,12 +1446,12 @@ void InspectorController::stopUserInitiatedProfiling()
 
     m_recordingUserInitiatedProfile = false;
 
-    UString title = getCurrentUserInitiatedProfileName();
+    String title = getCurrentUserInitiatedProfileName();
 
     ExecState* scriptState = toJSDOMWindow(m_inspectedPage->mainFrame(), debuggerWorld())->globalExec();
-    RefPtr<Profile> profile = Profiler::profiler()->stopProfiling(scriptState, title);
+    RefPtr<ScriptProfile> profile = ScriptProfiler::stop(scriptState, title);
     if (profile)
-        addProfile(profile, 0, UString());
+        addProfile(profile, 0, String());
 
     toggleRecordButton(false);
 }
@@ -1536,9 +1518,9 @@ void InspectorController::enableDebugger()
     if (m_debuggerEnabled)
         return;
 
-    if (!m_scriptState || !m_frontend) {
+    if (!m_scriptState || !m_frontend)
         m_attachDebuggerWhenShown = true;
-    } else {
+    else {
         m_frontend->attachDebuggerWhenShown();
         m_attachDebuggerWhenShown = false;
     }
@@ -1803,20 +1785,19 @@ InspectorController::SpecialPanels InspectorController::specialPanelForJSName(co
 {
     if (panelName == "elements")
         return ElementsPanel;
-    else if (panelName == "resources")
+    if (panelName == "resources")
         return ResourcesPanel;
-    else if (panelName == "scripts")
+    if (panelName == "scripts")
         return ScriptsPanel;
-    else if (panelName == "timeline")
+    if (panelName == "timeline")
         return TimelinePanel;
-    else if (panelName == "profiles")
+    if (panelName == "profiles")
         return ProfilesPanel;
-    else if (panelName == "storage" || panelName == "databases")
+    if (panelName == "storage" || panelName == "databases")
         return StoragePanel;
-    else if (panelName == "console")
+    if (panelName == "console")
         return ConsolePanel;
-    else
-        return ElementsPanel;
+    return ElementsPanel;
 }
 
 void InspectorController::deleteCookie(const String& cookieName, const String& domain)
diff --git a/WebCore/inspector/InspectorController.h b/WebCore/inspector/InspectorController.h
index 860bf49..9ef202f 100644
--- a/WebCore/inspector/InspectorController.h
+++ b/WebCore/inspector/InspectorController.h
@@ -35,6 +35,7 @@
 #include "PlatformString.h"
 #include "ScriptArray.h"
 #include "ScriptObject.h"
+#include "ScriptProfile.h"
 #include "ScriptState.h"
 #include "ScriptValue.h"
 #include "StringHash.h"
@@ -50,8 +51,7 @@
 #include "JavaScriptDebugListener.h"
 
 namespace JSC {
-    class Profile;
-    class UString;
+class UString;
 }
 #endif
 
@@ -149,7 +149,7 @@ public:
     void detachWindow();
 
     void toggleSearchForNodeInPage();
-    bool searchingForNodeInPage() { return m_searchingForNode; };
+    bool searchingForNodeInPage() const { return m_searchingForNode; }
     void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags);
     void handleMousePressOnNode(Node*);
 
@@ -220,13 +220,13 @@ public:
     void markTimeline(const String& message); 
 
 #if ENABLE(JAVASCRIPT_DEBUGGER)
-    void addProfile(PassRefPtr<JSC::Profile>, unsigned lineNumber, const JSC::UString& sourceURL);
-    void addProfileFinishedMessageToConsole(PassRefPtr<JSC::Profile>, unsigned lineNumber, const JSC::UString& sourceURL);
-    void addStartProfilingMessageToConsole(const JSC::UString& title, unsigned lineNumber, const JSC::UString& sourceURL);
+    void addProfile(PassRefPtr<ScriptProfile>, unsigned lineNumber, const String& sourceURL);
+    void addProfileFinishedMessageToConsole(PassRefPtr<ScriptProfile>, unsigned lineNumber, const String& sourceURL);
+    void addStartProfilingMessageToConsole(const String& title, unsigned lineNumber, const String& sourceURL);
 
     bool isRecordingUserInitiatedProfile() const { return m_recordingUserInitiatedProfile; }
 
-    JSC::UString getCurrentUserInitiatedProfileName(bool incrementProfileNumber);
+    String getCurrentUserInitiatedProfileName(bool incrementProfileNumber);
     void startUserInitiatedProfiling(Timer<InspectorController>* = 0);
     void stopUserInitiatedProfiling();
 
@@ -268,14 +268,14 @@ private:
     void deleteCookie(const String& cookieName, const String& domain);
 
 #if ENABLE(JAVASCRIPT_DEBUGGER)
-    typedef HashMap<unsigned int, RefPtr<JSC::Profile> > ProfilesMap;
+    typedef HashMap<unsigned int, RefPtr<ScriptProfile> > ProfilesMap;
 
     void startUserInitiatedProfilingSoon();
     void toggleRecordButton(bool);
     void enableDebuggerFromFrontend(bool always);
     void getProfileHeaders(long callId);
     void getProfile(long callId, unsigned uid);
-    ScriptObject createProfileHeader(const JSC::Profile& profile);
+    ScriptObject createProfileHeader(const ScriptProfile& profile);
 #endif
 #if ENABLE(DATABASE)
     void selectDatabase(Database* database);
diff --git a/WebCore/page/Console.cpp b/WebCore/page/Console.cpp
index 2273a5e..8f55c78 100644
--- a/WebCore/page/Console.cpp
+++ b/WebCore/page/Console.cpp
@@ -41,11 +41,9 @@
 #include "PageGroup.h"
 #include "PlatformString.h"
 
-#if ENABLE(JAVASCRIPT_DEBUGGER)
-#include <profiler/Profiler.h>
-#endif
-
 #include "ScriptCallStack.h"
+#include "ScriptProfile.h"
+#include "ScriptProfiler.h"
 #include <stdio.h>
 #include <wtf/UnusedParam.h>
 
@@ -314,38 +312,40 @@ String Console::lastWMLErrorMessage() const
 }
 #endif
 
-#if ENABLE(JAVASCRIPT_DEBUGGER)
+// FIXME: "USE(V8)" and "USE(JSC)" below are temporary measures until JAVASCRIPT_DEBUGGER is
+// enabled when building Chromium.
+#if ENABLE(JAVASCRIPT_DEBUGGER) || USE(V8)
 
-void Console::profile(const JSC::UString& title, ScriptCallStack* callStack)
+void Console::profile(const String& title, ScriptCallStack* callStack)
 {
     Page* page = this->page();
     if (!page)
         return;
 
-#if ENABLE(INSPECTOR)
+#if ENABLE(INSPECTOR) && USE(JSC)
     InspectorController* controller = page->inspectorController();
     // FIXME: log a console message when profiling is disabled.
     if (!controller->profilerEnabled())
         return;
 #endif
 
-    JSC::UString resolvedTitle = title;
-    if (title.isNull())   // no title so give it the next user initiated profile title.
-#if ENABLE(INSPECTOR)
+    String resolvedTitle = title;
+    if (title.isNull()) // no title so give it the next user initiated profile title.
+#if ENABLE(INSPECTOR) && USE(JSC)
         resolvedTitle = controller->getCurrentUserInitiatedProfileName(true);
 #else
         resolvedTitle = "";
 #endif
 
-    JSC::Profiler::profiler()->startProfiling(callStack->state(), resolvedTitle);
+    ScriptProfiler::start(callStack->state(), resolvedTitle);
 
-#if ENABLE(INSPECTOR)
+#if ENABLE(INSPECTOR) && USE(JSC)
     const ScriptCallFrame& lastCaller = callStack->at(0);
     controller->addStartProfilingMessageToConsole(resolvedTitle, lastCaller.lineNumber(), lastCaller.sourceURL());
 #endif
 }
 
-void Console::profileEnd(const JSC::UString& title, ScriptCallStack* callStack)
+void Console::profileEnd(const String& title, ScriptCallStack* callStack)
 {
     Page* page = this->page();
     if (!page)
@@ -354,19 +354,19 @@ void Console::profileEnd(const JSC::UString& title, ScriptCallStack* callStack)
     if (!this->page())
         return;
 
-#if ENABLE(INSPECTOR)
+#if ENABLE(INSPECTOR) && USE(JSC)
     InspectorController* controller = page->inspectorController();
     if (!controller->profilerEnabled())
         return;
 #endif
 
-    RefPtr<JSC::Profile> profile = JSC::Profiler::profiler()->stopProfiling(callStack->state(), title);
+    RefPtr<ScriptProfile> profile = ScriptProfiler::stop(callStack->state(), title);
     if (!profile)
         return;
 
     m_profiles.append(profile);
 
-#if ENABLE(INSPECTOR)
+#if ENABLE(INSPECTOR) && USE(JSC)
     const ScriptCallFrame& lastCaller = callStack->at(0);
     controller->addProfile(profile, lastCaller.lineNumber(), lastCaller.sourceURL());
 #endif
diff --git a/WebCore/page/Console.h b/WebCore/page/Console.h
index ea3a161..bbf2ac7 100644
--- a/WebCore/page/Console.h
+++ b/WebCore/page/Console.h
@@ -31,101 +31,101 @@
 
 #include "PlatformString.h"
 
-#if ENABLE(JAVASCRIPT_DEBUGGER)
-#include <profiler/Profile.h>
-#endif
+#include "ScriptProfile.h"
 
-#include <wtf/RefCounted.h>
 #include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
 
 namespace WebCore {
 
-#if ENABLE(JAVASCRIPT_DEBUGGER)
-    typedef Vector<RefPtr<JSC::Profile> > ProfilesArray;
+// FIXME: "USE(V8)" and "USE(JSC)" below are temporary measures until JAVASCRIPT_DEBUGGER is
+// enabled when building Chromium.
+#if ENABLE(JAVASCRIPT_DEBUGGER) || USE(V8)
+typedef Vector<RefPtr<ScriptProfile> > ProfilesArray;
 #endif
 
-    class Frame;
-    class Page;
-    class String;
-    class ScriptCallStack;
-
-    // Keep in sync with inspector/front-end/Console.js
-    enum MessageSource {
-        HTMLMessageSource,
-        WMLMessageSource,
-        XMLMessageSource,
-        JSMessageSource,
-        CSSMessageSource,
-        OtherMessageSource
-    };
-
-    enum MessageType {
-        LogMessageType,
-        ObjectMessageType,
-        TraceMessageType,
-        StartGroupMessageType,
-        EndGroupMessageType,
-        AssertMessageType
-    };
-
-    enum MessageLevel {
-        TipMessageLevel,
-        LogMessageLevel,
-        WarningMessageLevel,
-        ErrorMessageLevel,
-        DebugMessageLevel
-    };
-
-    class Console : public RefCounted<Console> {
-    public:
-        static PassRefPtr<Console> create(Frame* frame) { return adoptRef(new Console(frame)); }
-
-        Frame* frame() const;
-        void disconnectFrame();
-
-        void addMessage(MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String& sourceURL);
-
-        void debug(ScriptCallStack*);
-        void error(ScriptCallStack*);
-        void info(ScriptCallStack*);
-        void log(ScriptCallStack*);
-        void warn(ScriptCallStack*);
-        void dir(ScriptCallStack*);
-        void dirxml(ScriptCallStack*);
-        void trace(ScriptCallStack*);
-        void assertCondition(bool condition, ScriptCallStack*);
-        void count(ScriptCallStack*);
-        void markTimeline(ScriptCallStack*);
+class Frame;
+class Page;
+class String;
+class ScriptCallStack;
+
+// Keep in sync with inspector/front-end/Console.js
+enum MessageSource {
+    HTMLMessageSource,
+    WMLMessageSource,
+    XMLMessageSource,
+    JSMessageSource,
+    CSSMessageSource,
+    OtherMessageSource
+};
+
+enum MessageType {
+    LogMessageType,
+    ObjectMessageType,
+    TraceMessageType,
+    StartGroupMessageType,
+    EndGroupMessageType,
+    AssertMessageType
+};
+
+enum MessageLevel {
+    TipMessageLevel,
+    LogMessageLevel,
+    WarningMessageLevel,
+    ErrorMessageLevel,
+    DebugMessageLevel
+};
+
+class Console : public RefCounted<Console> {
+public:
+    static PassRefPtr<Console> create(Frame* frame) { return adoptRef(new Console(frame)); }
+
+    Frame* frame() const;
+    void disconnectFrame();
+
+    void addMessage(MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String& sourceURL);
+
+    void debug(ScriptCallStack*);
+    void error(ScriptCallStack*);
+    void info(ScriptCallStack*);
+    void log(ScriptCallStack*);
+    void warn(ScriptCallStack*);
+    void dir(ScriptCallStack*);
+    void dirxml(ScriptCallStack*);
+    void trace(ScriptCallStack*);
+    void assertCondition(bool condition, ScriptCallStack*);
+    void count(ScriptCallStack*);
+    void markTimeline(ScriptCallStack*);
 #if ENABLE(WML)
-        String lastWMLErrorMessage() const;
+    String lastWMLErrorMessage() const;
 #endif
-#if ENABLE(JAVASCRIPT_DEBUGGER)
-        void profile(const JSC::UString&, ScriptCallStack*);
-        void profileEnd(const JSC::UString&, ScriptCallStack*);
+#if ENABLE(JAVASCRIPT_DEBUGGER) || USE(V8)
+    void profile(const String&, ScriptCallStack*);
+    void profileEnd(const String&, ScriptCallStack*);
 #endif
-        void time(const String&);
-        void timeEnd(const String&, ScriptCallStack*);
-        void group(ScriptCallStack*);
-        void groupEnd();
+    void time(const String&);
+    void timeEnd(const String&, ScriptCallStack*);
+    void group(ScriptCallStack*);
+    void groupEnd();
 
-        static bool shouldPrintExceptions();
-        static void setShouldPrintExceptions(bool);
+    static bool shouldPrintExceptions();
+    static void setShouldPrintExceptions(bool);
 
 #if ENABLE(JAVASCRIPT_DEBUGGER)
-        const ProfilesArray& profiles() const { return m_profiles; }
+    const ProfilesArray& profiles() const { return m_profiles; }
 #endif
 
-    private:
-        inline Page* page() const;
-        void addMessage(MessageType, MessageLevel, ScriptCallStack*, bool acceptNoArguments = false);
+private:
+    inline Page* page() const;
+    void addMessage(MessageType, MessageLevel, ScriptCallStack*, bool acceptNoArguments = false);
 
-        Console(Frame*);
+    Console(Frame*);
 
-        Frame* m_frame;
-#if ENABLE(JAVASCRIPT_DEBUGGER)
-        ProfilesArray m_profiles;
+    Frame* m_frame;
+#if ENABLE(JAVASCRIPT_DEBUGGER) || USE(V8)
+    ProfilesArray m_profiles;
 #endif
-    };
+};
 
 } // namespace WebCore
 
diff --git a/WebCore/page/Console.idl b/WebCore/page/Console.idl
index b9c0a57..290235b 100644
--- a/WebCore/page/Console.idl
+++ b/WebCore/page/Console.idl
@@ -51,8 +51,8 @@ module window {
 #endif
 
 #if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER || defined(V8_BINDING) && V8_BINDING
-        [Custom] void profile(in [ConvertUndefinedOrNullToNullString] DOMString title);
-        [Custom] void profileEnd(in [ConvertUndefinedOrNullToNullString] DOMString title);
+        [CustomArgumentHandling] void profile(in [ConvertUndefinedOrNullToNullString] DOMString title);
+        [CustomArgumentHandling] void profileEnd(in [ConvertUndefinedOrNullToNullString] DOMString title);
 #endif
 
         void time(in [ConvertUndefinedOrNullToNullString] DOMString title);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list