2010-11-08 Yury Semikhatsky <yurys@chromium.org>
authoryurys@chromium.org <yurys@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 8 Nov 2010 14:05:32 +0000 (14:05 +0000)
committeryurys@chromium.org <yurys@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 8 Nov 2010 14:05:32 +0000 (14:05 +0000)
commit0991ad4c6a6d22722de03ff802f0409718b618fc
tree08b8400e664e2e50dd53bd55f36bccdd351bb340
parent06ef1ef0acffc17d93e6da708ac10d4000deb5b5
2010-11-08  Yury Semikhatsky  <yurys@chromium.org>

        Reviewed by Pavel Feldman.

        Web Inspector: decouple ScriptArguments from ScriptCallStack
        https://bugs.webkit.org/show_bug.cgi?id=48058

        ScriptCallFrame and ScriptCallStack are now the same for both JSC and V8.
        The factory functions that allow to create ScriptCallStack from VM-specific
        objects are defined in ScriptCallStackFactory.cpp.

        ScriptArguments class is used for passing arguments from JS code to the native
        part.

        No new tests. This refactoring is covered with existing Console tests.

        * Android.jscbindings.mk:
        * Android.v8bindings.mk:
        * CMakeLists.txt:
        * GNUmakefile.am:
        * WebCore.gypi:
        * WebCore.pro:
        * WebCore.vcproj/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSBindingsAllInOne.cpp:
        * bindings/js/JSConsoleCustom.cpp:
        (WebCore::JSConsole::profile):
        (WebCore::JSConsole::profileEnd):
        * bindings/js/ScriptCallStackFactory.cpp: Renamed from WebCore/bindings/js/ScriptCallStack.cpp.
        (WebCore::createScriptCallStack):
        (WebCore::createScriptArguments):
        (WebCore::ScriptCallStack::stackTrace):
        * bindings/js/ScriptCallStackFactory.h: Copied from WebCore/bindings/js/ScriptCallFrame.cpp.
        * bindings/js/ScriptState.cpp:
        (WebCore::ScriptStateProtectedPtr::~ScriptStateProtectedPtr):
        (WebCore::ScriptStateProtectedPtr::ScriptStateProtectedPtr):
        (WebCore::ScriptStateProtectedPtr::get):
        * bindings/js/ScriptState.h:
        * bindings/scripts/CodeGeneratorJS.pm:
        * bindings/scripts/CodeGeneratorV8.pm:
        * bindings/scripts/test/JS/JSTestObj.cpp:
        (WebCore::jsTestObjPrototypeFunctionCustomArgsAndException):
        * bindings/scripts/test/V8/V8TestObj.cpp:
        (WebCore::TestObjInternal::customArgsAndExceptionCallback):
        * bindings/v8/ScriptCallFrame.h: Removed.
        * bindings/v8/ScriptCallStack.h: Removed.
        * bindings/v8/ScriptCallStackFactory.cpp: Renamed from WebCore/bindings/v8/ScriptCallStack.cpp.
        (WebCore::toScriptCallFrame):
        (WebCore::toScriptCallFramesVector):
        (WebCore::createScriptCallStack):
        (WebCore::createScriptArguments):
        (WebCore::ScriptCallStack::stackTrace):
        * bindings/v8/ScriptCallStackFactory.h: Copied from WebCore/bindings/js/ScriptCallFrame.cpp.
        * bindings/v8/ScriptController.cpp:
        (WebCore::ScriptController::setCaptureCallStackForUncaughtExceptions):
        * bindings/v8/ScriptState.h:
        (WebCore::ScriptStateProtectedPtr::get):
        * bindings/v8/V8ConsoleMessage.cpp:
        (WebCore::V8ConsoleMessage::handler):
        (WebCore::V8ConsoleMessage::dispatchNow):
        * bindings/v8/V8ConsoleMessage.h:
        * bindings/v8/custom/V8ConsoleCustom.cpp:
        (WebCore::V8Console::traceCallback):
        (WebCore::V8Console::assertCallback):
        (WebCore::V8Console::profileCallback):
        (WebCore::V8Console::profileEndCallback):
        * dom/NodeFilter.h:
        * inspector/ConsoleMessage.cpp:
        (WebCore::ConsoleMessage::ConsoleMessage):
        (WebCore::ConsoleMessage::addToFrontend):
        (WebCore::ConsoleMessage::updateRepeatCountInConsole):
        (WebCore::ConsoleMessage::isEqual):
        * inspector/ConsoleMessage.h:
        * inspector/InspectorController.cpp:
        (WebCore::InspectorController::addMessageToConsole):
        (WebCore::InspectorController::startGroup):
        * inspector/InspectorController.h:
        * inspector/ScriptArguments.cpp: Copied from WebCore/bindings/v8/ScriptCallFrame.cpp.
        (WebCore::ScriptArguments::ScriptArguments):
        (WebCore::ScriptArguments::~ScriptArguments):
        (WebCore::ScriptArguments::argumentAt):
        (WebCore::ScriptArguments::globalState):
        (WebCore::ScriptArguments::getFirstArgumentAsString):
        (WebCore::ScriptArguments::isEqual):
        * inspector/ScriptArguments.h: Copied from WebCore/bindings/js/ScriptCallFrame.h.
        (WebCore::ScriptArguments::argumentCount):
        * inspector/ScriptCallFrame.cpp: Renamed from WebCore/bindings/v8/ScriptCallFrame.cpp.
        (WebCore::ScriptCallFrame::ScriptCallFrame):
        (WebCore::ScriptCallFrame::~ScriptCallFrame):
        (WebCore::ScriptCallFrame::isEqual):
        (WebCore::ScriptCallFrame::buildInspectorObject):
        * inspector/ScriptCallFrame.h: Renamed from WebCore/bindings/js/ScriptCallFrame.h.
        (WebCore::ScriptCallFrame::functionName):
        (WebCore::ScriptCallFrame::sourceURL):
        (WebCore::ScriptCallFrame::lineNumber):
        * inspector/ScriptCallStack.cpp: Renamed from WebCore/bindings/js/ScriptCallFrame.cpp.
        (WebCore::ScriptCallStack::ScriptCallStack):
        (WebCore::ScriptCallStack::~ScriptCallStack):
        (WebCore::ScriptCallStack::at):
        (WebCore::ScriptCallStack::size):
        (WebCore::ScriptCallStack::isEqual):
        (WebCore::ScriptCallStack::buildInspectorObject):
        * inspector/ScriptCallStack.h: Renamed from WebCore/bindings/js/ScriptCallStack.h.
        * page/Console.cpp:
        (WebCore::Console::addMessage):
        (WebCore::Console::debug):
        (WebCore::Console::error):
        (WebCore::Console::info):
        (WebCore::Console::log):
        (WebCore::Console::dir):
        (WebCore::Console::dirxml):
        (WebCore::Console::trace):
        (WebCore::Console::assertCondition):
        (WebCore::Console::count):
        (WebCore::Console::markTimeline):
        (WebCore::Console::profile):
        (WebCore::Console::profileEnd):
        (WebCore::Console::timeEnd):
        (WebCore::Console::group):
        (WebCore::Console::groupCollapsed):
        (WebCore::Console::shouldCaptureFullStackTrace):
        (WebCore::Console::warn):
        * page/Console.h:
        (WebCore::Console::profiles):
        * page/Console.idl:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@71515 268f45cc-cd09-0410-ab3c-d52691b4dbfc
42 files changed:
WebCore/Android.jscbindings.mk
WebCore/Android.v8bindings.mk
WebCore/CMakeLists.txt
WebCore/ChangeLog
WebCore/GNUmakefile.am
WebCore/WebCore.gypi
WebCore/WebCore.pro
WebCore/WebCore.vcproj/WebCore.vcproj
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bindings/js/JSBindingsAllInOne.cpp
WebCore/bindings/js/JSConsoleCustom.cpp
WebCore/bindings/js/ScriptCallStackFactory.cpp [moved from WebCore/bindings/js/ScriptCallStack.cpp with 52% similarity]
WebCore/bindings/js/ScriptCallStackFactory.h [moved from WebCore/bindings/js/ScriptCallFrame.cpp with 64% similarity]
WebCore/bindings/js/ScriptState.cpp
WebCore/bindings/js/ScriptState.h
WebCore/bindings/scripts/CodeGeneratorJS.pm
WebCore/bindings/scripts/CodeGeneratorV8.pm
WebCore/bindings/scripts/test/JS/JSTestObj.cpp
WebCore/bindings/scripts/test/V8/V8TestObj.cpp
WebCore/bindings/v8/ScriptCallFrame.h [deleted file]
WebCore/bindings/v8/ScriptCallStack.h [deleted file]
WebCore/bindings/v8/ScriptCallStackFactory.cpp [moved from WebCore/bindings/v8/ScriptCallStack.cpp with 53% similarity]
WebCore/bindings/v8/ScriptCallStackFactory.h [new file with mode: 0644]
WebCore/bindings/v8/ScriptController.cpp
WebCore/bindings/v8/ScriptState.h
WebCore/bindings/v8/V8ConsoleMessage.cpp
WebCore/bindings/v8/V8ConsoleMessage.h
WebCore/bindings/v8/custom/V8ConsoleCustom.cpp
WebCore/dom/NodeFilter.h
WebCore/inspector/ConsoleMessage.cpp
WebCore/inspector/ConsoleMessage.h
WebCore/inspector/InspectorController.cpp
WebCore/inspector/InspectorController.h
WebCore/inspector/ScriptArguments.cpp [new file with mode: 0644]
WebCore/inspector/ScriptArguments.h [new file with mode: 0644]
WebCore/inspector/ScriptCallFrame.cpp [moved from WebCore/bindings/v8/ScriptCallFrame.cpp with 71% similarity]
WebCore/inspector/ScriptCallFrame.h [moved from WebCore/bindings/js/ScriptCallFrame.h with 80% similarity]
WebCore/inspector/ScriptCallStack.cpp [new file with mode: 0644]
WebCore/inspector/ScriptCallStack.h [moved from WebCore/bindings/js/ScriptCallStack.h with 66% similarity]
WebCore/page/Console.cpp
WebCore/page/Console.h
WebCore/page/Console.idl