Changeset 69662 in webkit


Ignore:
Timestamp:
Oct 13, 2010 7:43:36 AM (13 years ago)
Author:
yurys@chromium.org
Message:

2010-10-13 Yury Semikhatsky <yurys@chromium.org>

Reviewed by Pavel Feldman.

Web Inspector: stack information is inconsistent between console.trace and runtime errors.
https://bugs.webkit.org/show_bug.cgi?id=47252

  • console.trace() is now formatted the same way as other stack traces
  • If there is @ sourceURL=url line at the end of eval'ed script source the url will be shown in the stack traces for script. That is why ScriptCallFrame::sourceURL type has changed from KURL to String.

Tests: inspector/console-trace-in-eval.html

inspector/console-uncaught-exception-in-eval.html

  • bindings/js/ScriptCallFrame.cpp: (WebCore::ScriptCallFrame::ScriptCallFrame):
  • bindings/js/ScriptCallFrame.h: (WebCore::ScriptCallFrame::sourceURL):
  • bindings/v8/ScriptCallFrame.cpp: (WebCore::ScriptCallFrame::ScriptCallFrame):
  • bindings/v8/ScriptCallFrame.h: (WebCore::ScriptCallFrame::sourceURL):
  • bindings/v8/ScriptCallStack.cpp: (WebCore::getFrameLocation): (WebCore::ScriptCallStack::create):
  • bindings/v8/ScriptCallStack.h:
  • bindings/v8/ScriptController.cpp: (WebCore::ScriptController::setCaptureCallStackForUncaughtExceptions):
  • bindings/v8/custom/V8ConsoleCustom.cpp: (WebCore::V8Console::traceCallback):
  • inspector/ConsoleMessage.cpp: (WebCore::ConsoleMessage::CallFrame::buildInspectorObject): (WebCore::ConsoleMessage::ConsoleMessage):
  • inspector/ConsoleMessage.h:
  • inspector/front-end/ConsoleView.js: (WebInspector.ConsoleMessage.prototype._formatMessage):
  • page/Console.cpp: (WebCore::Console::addMessage): (WebCore::Console::count): (WebCore::Console::timeEnd):

2010-10-13 Yury Semikhatsky <yurys@chromium.org>

Reviewed by Pavel Feldman.

Web Inspector: stack information is inconsistent between console.trace and runtime errors.
https://bugs.webkit.org/show_bug.cgi?id=47252

  • inspector/console-trace-in-eval-expected.txt: Added.
  • inspector/console-trace-in-eval.html: Added.
  • inspector/console-uncaught-exception-in-eval-expected.txt: Added.
  • inspector/console-uncaught-exception-in-eval.html: Added.
  • platform/chromium/console-trace-in-eval-expected.txt: Added.
  • platform/chromium/console-uncaught-exception-in-eval-expected.txt: Added.

2010-10-13 Yury Semikhatsky <yurys@chromium.org>

Reviewed by Pavel Feldman.

Web Inspector: stack information is inconsistent between console.trace and runtime errors.
https://bugs.webkit.org/show_bug.cgi?id=47252

  • DEPS: bump up V8 revision
Location:
trunk
Files:
6 added
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r69658 r69662  
     12010-10-13  Yury Semikhatsky  <yurys@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        Web Inspector: stack information is inconsistent between console.trace and runtime errors.
     6        https://bugs.webkit.org/show_bug.cgi?id=47252
     7
     8        * inspector/console-trace-in-eval-expected.txt: Added.
     9        * inspector/console-trace-in-eval.html: Added.
     10        * inspector/console-uncaught-exception-in-eval-expected.txt: Added.
     11        * inspector/console-uncaught-exception-in-eval.html: Added.
     12        * platform/chromium/console-trace-in-eval-expected.txt: Added.
     13        * platform/chromium/console-uncaught-exception-in-eval-expected.txt: Added.
     14
    1152010-10-13  Csaba Osztrogonác  <ossy@webkit.org>
    216
  • trunk/WebCore/ChangeLog

    r69660 r69662  
     12010-10-13  Yury Semikhatsky  <yurys@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        Web Inspector: stack information is inconsistent between console.trace and runtime errors.
     6        https://bugs.webkit.org/show_bug.cgi?id=47252
     7
     8        * console.trace() is now formatted the same way as other stack traces
     9
     10        * If there is //@ sourceURL=url line at the end of eval'ed script source
     11        the url will be shown in the stack traces for script. That is why ScriptCallFrame::sourceURL
     12        type has changed from KURL to String.
     13
     14        Tests: inspector/console-trace-in-eval.html
     15               inspector/console-uncaught-exception-in-eval.html
     16
     17        * bindings/js/ScriptCallFrame.cpp:
     18        (WebCore::ScriptCallFrame::ScriptCallFrame):
     19        * bindings/js/ScriptCallFrame.h:
     20        (WebCore::ScriptCallFrame::sourceURL):
     21        * bindings/v8/ScriptCallFrame.cpp:
     22        (WebCore::ScriptCallFrame::ScriptCallFrame):
     23        * bindings/v8/ScriptCallFrame.h:
     24        (WebCore::ScriptCallFrame::sourceURL):
     25        * bindings/v8/ScriptCallStack.cpp:
     26        (WebCore::getFrameLocation):
     27        (WebCore::ScriptCallStack::create):
     28        * bindings/v8/ScriptCallStack.h:
     29        * bindings/v8/ScriptController.cpp:
     30        (WebCore::ScriptController::setCaptureCallStackForUncaughtExceptions):
     31        * bindings/v8/custom/V8ConsoleCustom.cpp:
     32        (WebCore::V8Console::traceCallback):
     33        * inspector/ConsoleMessage.cpp:
     34        (WebCore::ConsoleMessage::CallFrame::buildInspectorObject):
     35        (WebCore::ConsoleMessage::ConsoleMessage):
     36        * inspector/ConsoleMessage.h:
     37        * inspector/front-end/ConsoleView.js:
     38        (WebInspector.ConsoleMessage.prototype._formatMessage):
     39        * page/Console.cpp:
     40        (WebCore::Console::addMessage):
     41        (WebCore::Console::count):
     42        (WebCore::Console::timeEnd):
     43
    1442010-10-13  Kent Tamura  <tkent@chromium.org>
    245
  • trunk/WebCore/bindings/js/ScriptCallFrame.cpp

    r60392 r69662  
    4141ScriptCallFrame::ScriptCallFrame(const UString& functionName, const UString& urlString, int lineNumber, ExecState* exec, unsigned skipArgumentCount)
    4242    : m_functionName(functionName)
    43     , m_sourceURL(ParsedURLString, ustringToString(urlString))
     43    , m_sourceURL(ustringToString(urlString))
    4444    , m_lineNumber(lineNumber)
    4545{
  • trunk/WebCore/bindings/js/ScriptCallFrame.h

    r60392 r69662  
    3232#define ScriptCallFrame_h
    3333
    34 #include "KURL.h"
    3534#include <runtime/ArgList.h>
    3635#include "ScriptString.h"
     
    5554
    5655        const ScriptString& functionName() const { return m_functionName; }
    57         const KURL& sourceURL() const { return m_sourceURL; }
     56        const String& sourceURL() const { return m_sourceURL; }
    5857        unsigned lineNumber() const { return m_lineNumber; }
    5958
     
    6463    private:
    6564        ScriptString m_functionName;
    66         KURL m_sourceURL;
     65        String m_sourceURL;
    6766        unsigned m_lineNumber;
    6867
  • trunk/WebCore/bindings/v8/ScriptCallFrame.cpp

    r63548 r69662  
    4343ScriptCallFrame::ScriptCallFrame(const String& functionName, const String& urlString, int lineNumber, const v8::Arguments& arguments, unsigned skipArgumentCount)
    4444    : m_functionName(functionName)
    45     , m_sourceURL(ParsedURLString, urlString)
     45    , m_sourceURL(urlString)
    4646    , m_lineNumber(lineNumber)
    4747{
     
    5252ScriptCallFrame::ScriptCallFrame(const String& functionName, const String& urlString, int lineNumber)
    5353    : m_functionName(functionName)
    54     , m_sourceURL(ParsedURLString, urlString)
     54    , m_sourceURL(urlString)
    5555    , m_lineNumber(lineNumber)
    5656{
  • trunk/WebCore/bindings/v8/ScriptCallFrame.h

    r63548 r69662  
    5555
    5656        const ScriptString& functionName() const { return m_functionName; }
    57         const KURL& sourceURL() const { return m_sourceURL; }
     57        const String& sourceURL() const { return m_sourceURL; }
    5858        unsigned lineNumber() const { return m_lineNumber; }
    5959
     
    6464    private:
    6565        ScriptString m_functionName;
    66         KURL m_sourceURL;
     66        String m_sourceURL;
    6767        unsigned m_lineNumber;
    6868
  • trunk/WebCore/bindings/v8/ScriptCallStack.cpp

    r65320 r69662  
    4545{
    4646    ASSERT(!frame.IsEmpty());
    47     v8::Local<v8::String> sourceNameValue(frame->GetScriptName());
     47    v8::Local<v8::String> sourceNameValue(frame->GetScriptNameOrSourceURL());
    4848    v8::Local<v8::String> functionNameValue(frame->GetFunctionName());
    4949    *sourceName = sourceNameValue.IsEmpty() ? "" : toWebCoreString(sourceNameValue);
     
    8686
    8787const int ScriptCallStack::maxCallStackSizeToCapture = 200;
     88const v8::StackTrace::StackTraceOptions ScriptCallStack::stackTraceOptions = static_cast<v8::StackTrace::StackTraceOptions>(
     89     v8::StackTrace::kLineNumber
     90    | v8::StackTrace::kColumnOffset
     91    | v8::StackTrace::kScriptNameOrSourceURL
     92    | v8::StackTrace::kFunctionName);
     93
    8894
    8995PassOwnPtr<ScriptCallStack> ScriptCallStack::create(const v8::Arguments& arguments, unsigned skipArgumentCount, int framCountLimit)
     
    9298    v8::Local<v8::Context> context = v8::Context::GetCurrent();
    9399    v8::Context::Scope contextScope(context);
    94     v8::Handle<v8::StackTrace> stackTrace(v8::StackTrace::CurrentStackTrace(framCountLimit));
     100    v8::Handle<v8::StackTrace> stackTrace(v8::StackTrace::CurrentStackTrace(framCountLimit, ScriptCallStack::stackTraceOptions));
    95101
    96102    if (stackTrace.IsEmpty())
  • trunk/WebCore/bindings/v8/ScriptCallStack.h

    r64735 r69662  
    4949public:
    5050    static const int maxCallStackSizeToCapture;
     51    static const v8::StackTrace::StackTraceOptions stackTraceOptions;
    5152
    5253    static PassOwnPtr<ScriptCallStack> create(const v8::Arguments&, unsigned skipArgumentCount = 0, int framCountLimit = 1);
  • trunk/WebCore/bindings/v8/ScriptController.cpp

    r68630 r69662  
    467467
    468468#if ENABLE(INSPECTOR)
    469 void ScriptController::setCaptureCallStackForUncaughtExceptions(bool)
    470 {
    471     v8::V8::SetCaptureStackTraceForUncaughtExceptions(true, ScriptCallStack::maxCallStackSizeToCapture);
     469void ScriptController::setCaptureCallStackForUncaughtExceptions(bool value)
     470{
     471    v8::V8::SetCaptureStackTraceForUncaughtExceptions(value, ScriptCallStack::maxCallStackSizeToCapture, ScriptCallStack::stackTraceOptions);
    472472}
    473473#endif
  • trunk/WebCore/bindings/v8/custom/V8ConsoleCustom.cpp

    r63805 r69662  
    6565    v8::HandleScope handleScope;
    6666    ScriptState* scriptState = ScriptState::current();
    67     v8::Local<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace(ScriptCallStack::maxCallStackSizeToCapture);
     67    v8::Local<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace(ScriptCallStack::maxCallStackSizeToCapture, ScriptCallStack::stackTraceOptions);
    6868    OwnPtr<ScriptCallStack> callStack(ScriptCallStack::create(scriptState, stackTrace));
    6969    imp->trace(callStack.get());
  • trunk/WebCore/inspector/ConsoleMessage.cpp

    r65891 r69662  
    6868    RefPtr<InspectorObject> frame = InspectorObject::create();
    6969    frame->setString("functionName", m_functionName);
    70     frame->setString("sourceURL", m_sourceURL.string());
     70    frame->setString("sourceURL", m_sourceURL);
    7171    frame->setNumber("lineNumber", m_lineNumber);
    7272    return frame;
     
    101101    const ScriptCallFrame& lastCaller = callStack->at(0);
    102102    m_line = lastCaller.lineNumber();
    103     m_url = lastCaller.sourceURL().string();
     103    m_url = lastCaller.sourceURL();
    104104
    105105    if (storeTrace) {
  • trunk/WebCore/inspector/ConsoleMessage.h

    r65891 r69662  
    7373    private:
    7474        String m_functionName;
    75         KURL m_sourceURL;
     75        String m_sourceURL;
    7676        unsigned m_lineNumber;
    7777    };
  • trunk/WebCore/inspector/front-end/ConsoleView.js

    r69010 r69662  
    680680                var ol = document.createElement("ol");
    681681                ol.addStyleClass("stack-trace");
     682                var treeOutline = new TreeOutline(ol);
     683                var messageText;
     684                if (this.type === WebInspector.ConsoleMessage.MessageType.Assert)
     685                    messageText = this._format(this._parameters);
     686                else if (this.type === WebInspector.ConsoleMessage.MessageType.Trace)
     687                    messageText = document.createTextNode("console.trace()");
     688                else
     689                    messageText = document.createTextNode(this._messageText);
     690
     691                var content = document.createElement("div");
     692                this._addMessageHeader(content, messageText);
     693                var root = new TreeElement(content, null, true);
     694                content.treeElementForTest = root;
     695                treeOutline.appendChild(root);
    682696                if (this.type === WebInspector.ConsoleMessage.MessageType.Trace)
    683                     ol.addStyleClass("trace-message");
    684                 var treeOutline = new TreeOutline(ol);
    685 
    686                 var root = treeOutline;
    687                 if (this.type === WebInspector.ConsoleMessage.MessageType.UncaughtException ||
    688                     this.type === WebInspector.ConsoleMessage.MessageType.Assert) {
    689                     var messageText;
    690                     if (this.type === WebInspector.ConsoleMessage.MessageType.Assert)
    691                         messageText = this._format(this._parameters);
    692                     else
    693                         messageText = document.createTextNode(this._messageText);
    694 
    695                     var content = document.createElement("div");
    696                     this._addMessageHeader(content, messageText);
    697                     root = new TreeElement(content, null, true);
    698                     content.treeElementForTest = root;
    699                     treeOutline.appendChild(root);
    700                 }
     697                    root.expand();
    701698
    702699                this._populateStackTraceTreeElement(root);
  • trunk/WebCore/page/Console.cpp

    r65506 r69662  
    183183    String message;
    184184    if (getFirstArgumentAsString(callStack->state(), lastCaller, message))
    185         page->chrome()->client()->addMessageToConsole(JSMessageSource, type, level, message, lastCaller.lineNumber(), lastCaller.sourceURL().prettyURL());
     185        page->chrome()->client()->addMessageToConsole(JSMessageSource, type, level, message, lastCaller.lineNumber(), lastCaller.sourceURL());
    186186
    187187#if ENABLE(INSPECTOR)
     
    192192        return;
    193193
    194     printSourceURLAndLine(lastCaller.sourceURL().prettyURL(), 0);
     194    printSourceURLAndLine(lastCaller.sourceURL(), 0);
    195195    printMessageSourceAndLevelPrefix(JSMessageSource, level);
    196196
     
    270270    getFirstArgumentAsString(callStack->state(), lastCaller, title);
    271271
    272     page->inspectorController()->count(title, lastCaller.lineNumber(), lastCaller.sourceURL().string());
     272    page->inspectorController()->count(title, lastCaller.lineNumber(), lastCaller.sourceURL());
    273273#else
    274274    UNUSED_PARAM(callStack);
     
    414414
    415415    const ScriptCallFrame& lastCaller = callStack->at(0);
    416     page->inspectorController()->addMessageToConsole(JSMessageSource, LogMessageType, LogMessageLevel, message, lastCaller.lineNumber(), lastCaller.sourceURL().string());
     416    page->inspectorController()->addMessageToConsole(JSMessageSource, LogMessageType, LogMessageLevel, message, lastCaller.lineNumber(), lastCaller.sourceURL());
    417417#else
    418418    UNUSED_PARAM(title);
  • trunk/WebKit/chromium/ChangeLog

    r69633 r69662  
     12010-10-13  Yury Semikhatsky  <yurys@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        Web Inspector: stack information is inconsistent between console.trace and runtime errors.
     6        https://bugs.webkit.org/show_bug.cgi?id=47252
     7
     8        * DEPS: bump up V8 revision
     9
    1102010-10-12  Kenneth Russell  <kbr@google.com>
    211
  • trunk/WebKit/chromium/DEPS

    r69617 r69662  
    3333vars = {
    3434  'chromium_svn': 'http://src.chromium.org/svn/trunk/src',
    35   'chromium_rev': '62349',
     35  'chromium_rev': '62399',
    3636}
    3737
Note: See TracChangeset for help on using the changeset viewer.