Changeset 121871 in webkit
- Timestamp:
- Jul 4, 2012 2:36:52 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 17 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r121868 r121871 1 2012-07-04 Anthony Scian <ascian@rim.com> 2 3 Web Inspector [JSC]: Implement ScriptCallStack::stackTrace 4 https://bugs.webkit.org/show_bug.cgi?id=40118 5 6 Reviewed by Yong Li. 7 8 Updated test results now that createScriptCallStack is functional. 9 10 * http/tests/inspector/console-resource-errors-expected.txt: 11 * http/tests/inspector/console-xhr-logging-async-expected.txt: 12 * http/tests/inspector/console-xhr-logging-expected.txt: 13 * http/tests/inspector/network/script-as-text-loading-expected.txt: 14 * inspector/timeline/timeline-animation-frame-expected.txt: 15 * inspector/timeline/timeline-layout-expected.txt: 16 * inspector/timeline/timeline-mark-timeline-expected.txt: 17 * inspector/timeline/timeline-network-resource-expected.txt: 18 * inspector/timeline/timeline-paint-expected.txt: 19 * inspector/timeline/timeline-parse-html-expected.txt: 20 * inspector/timeline/timeline-time-stamp-expected.txt: 21 * inspector/timeline/timeline-timer-expected.txt: 22 * platform/chromium/http/tests/inspector/console-xhr-logging-async-expected.txt: 23 1 24 2012-07-04 Zan Dobersek <zandobersek@gmail.com> 2 25 -
trunk/LayoutTests/http/tests/inspector/console-resource-errors-expected.txt
r110693 r121871 5 5 GET http://127.0.0.1:8000/inspector/non-existent-iframe.html 404 (Not Found) non-existent-iframe.html:1 console-message console-error-level 6 6 GET http://127.0.0.1:8000/inspector/non-existent-script.js 404 (Not Found) console-resource-errors-iframe.html:4 console-message console-error-level 7 GET http://127.0.0.1:8000/inspector/non-existent-xhr 404 (Not Found) non-existent-xhr:1 console-message console-error-level7 GET http://127.0.0.1:8000/inspector/non-existent-xhr 404 (Not Found) [native code]:1send [native code]:1loadXHR console-resource-errors.html:18performActions console-resource-errors.html:10eval codeeval [native code]:1_evaluateOn_evaluateAndWrapevaluate(anonymous function) [native code]:1 console-message console-error-level 8 8 -
trunk/LayoutTests/http/tests/inspector/console-xhr-logging-async-expected.txt
r110693 r121871 4 4 5 5 Bug 79229 6 XHR finished loading: "http://127.0.0.1:8000/inspector/resources/xhr-exists.html". network-test.js:396 XHR finished loading: "http://127.0.0.1:8000/inspector/resources/xhr-exists.html". [native code]:1 7 7 Done. console-xhr-logging-async.html:14 8 8 -
trunk/LayoutTests/http/tests/inspector/console-xhr-logging-expected.txt
r110693 r121871 12 12 13 13 sending a GET request to resources/xhr-exists.html console-xhr-logging.html:10 14 XHR finished loading: "http://127.0.0.1:8000/inspector/resources/xhr-exists.html". 14 XHR finished loading: "http://127.0.0.1:8000/inspector/resources/xhr-exists.html". [native code]:1 15 15 sending a GET request to resources/xhr-does-not-exist.html console-xhr-logging.html:10 16 GET http://127.0.0.1:8000/inspector/resources/xhr-does-not-exist.html 404 (Not Found) resources/xhr-does-not-exist.html:117 XHR finished loading: "http://127.0.0.1:8000/inspector/resources/xhr-does-not-exist.html". 16 GET http://127.0.0.1:8000/inspector/resources/xhr-does-not-exist.html 404 (Not Found) [native code]:1 17 XHR finished loading: "http://127.0.0.1:8000/inspector/resources/xhr-does-not-exist.html". [native code]:1 18 18 sending a POST request to resources/post-target.cgi console-xhr-logging.html:10 19 XHR finished loading: "http://127.0.0.1:8000/inspector/resources/post-target.cgi". 19 XHR finished loading: "http://127.0.0.1:8000/inspector/resources/post-target.cgi". [native code]:1 20 20 sending a GET request to http://localhost:8000/inspector/resources/xhr-exists.html console-xhr-logging.html:10 21 21 XMLHttpRequest cannot load http://localhost:8000/inspector/resources/xhr-exists.html. Origin http://127.0.0.1:8000 is not allowed by Access-Control-Allow-Origin. 22 22 sending a GET request to resources/xhr-exists.html console-xhr-logging.html:10 23 23 sending a GET request to resources/xhr-does-not-exist.html console-xhr-logging.html:10 24 GET http://127.0.0.1:8000/inspector/resources/xhr-does-not-exist.html 404 (Not Found) resources/xhr-does-not-exist.html:124 GET http://127.0.0.1:8000/inspector/resources/xhr-does-not-exist.html 404 (Not Found) [native code]:1 25 25 sending a POST request to resources/post-target.cgi console-xhr-logging.html:10 26 26 sending a GET request to http://localhost:8000/inspector/resources/xhr-exists.html console-xhr-logging.html:10 -
trunk/LayoutTests/http/tests/inspector/network/script-as-text-loading-expected.txt
r102898 r121871 2 2 3 3 Bug 69972 4 Resource interpreted as Script but transferred with MIME type text/plain: "http://127.0.0.1:8000/inspector/network/resources/script-as-text.php". 4 Resource interpreted as Script but transferred with MIME type text/plain: "http://127.0.0.1:8000/inspector/network/resources/script-as-text.php". [native code]:1 5 5 -
trunk/LayoutTests/inspector/timeline/timeline-animation-frame-expected.txt
r119826 r121871 4 4 { 5 5 startTime : <number> 6 stackTrace : <object> 6 7 data : { 7 8 id : <number> … … 30 31 { 31 32 startTime : <number> 33 stackTrace : <object> 32 34 data : { 33 35 id : <number> -
trunk/LayoutTests/inspector/timeline/timeline-layout-expected.txt
r119826 r121871 5 5 { 6 6 startTime : <number> 7 stackTrace : <object> 7 8 data : { 8 9 } -
trunk/LayoutTests/inspector/timeline/timeline-mark-timeline-expected.txt
r109204 r121871 4 4 { 5 5 startTime : <number> 6 stackTrace : <object> 6 7 data : { 7 8 message : "MARK TIMELINE" -
trunk/LayoutTests/inspector/timeline/timeline-network-resource-expected.txt
r119826 r121871 7 7 { 8 8 startTime : <number> 9 stackTrace : <object> 9 10 data : { 10 11 requestId : <string> -
trunk/LayoutTests/inspector/timeline/timeline-paint-expected.txt
r119826 r121871 4 4 { 5 5 startTime : <number> 6 stackTrace : <object> 6 7 data : { 7 8 x : 0 -
trunk/LayoutTests/inspector/timeline/timeline-parse-html-expected.txt
r119826 r121871 5 5 { 6 6 startTime : <number> 7 stackTrace : <object> 7 8 data : { 8 9 length : 9 … … 21 22 { 22 23 startTime : <number> 24 stackTrace : <object> 23 25 data : { 24 26 length : 1 -
trunk/LayoutTests/inspector/timeline/timeline-time-stamp-expected.txt
r109204 r121871 4 4 { 5 5 startTime : <number> 6 stackTrace : <object> 6 7 data : { 7 8 message : "TIME STAMP" -
trunk/LayoutTests/inspector/timeline/timeline-timer-expected.txt
r119826 r121871 4 4 { 5 5 startTime : <number> 6 stackTrace : <object> 6 7 data : { 7 8 timerId : <number> … … 18 19 { 19 20 startTime : <number> 21 stackTrace : <object> 20 22 data : { 21 23 timerId : <number> … … 74 76 { 75 77 startTime : <number> 78 stackTrace : <object> 76 79 data : { 77 80 timerId : <number> -
trunk/Source/JavaScriptCore/ChangeLog
r121869 r121871 1 2012-07-04 Anthony Scian <ascian@rim.com> 2 3 Web Inspector [JSC]: Implement ScriptCallStack::stackTrace 4 https://bugs.webkit.org/show_bug.cgi?id=40118 5 6 Reviewed by Yong Li. 7 8 Added member functions to expose function name, urlString, and line #. 9 Refactored toString to make use of these member functions to reduce 10 duplicated code for future maintenance. 11 12 Manually tested refactoring of toString by tracing thrown exceptions. 13 14 * interpreter/Interpreter.h: 15 (JSC::StackFrame::toString): 16 (JSC::StackFrame::friendlySourceURL): 17 (JSC::StackFrame::friendlyFunctionName): 18 (JSC::StackFrame::friendlyLineNumber): 19 1 20 2012-07-04 Andy Wingo <wingo@igalia.com> 2 21 -
trunk/Source/JavaScriptCore/interpreter/Interpreter.h
r121393 r121871 1 1 /* 2 2 * Copyright (C) 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2012 Research In Motion Limited. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 40 41 41 42 #include <wtf/HashMap.h> 43 #include <wtf/text/StringBuilder.h> 42 44 43 45 namespace JSC { … … 81 83 UString toString(CallFrame* callFrame) const 82 84 { 83 bool hasSourceURLInfo = !sourceURL.isNull() && !sourceURL.isEmpty(); 84 bool hasLineInfo = line > -1; 85 StringBuilder traceBuild; 86 String functionName = friendlyFunctionName(callFrame); 87 String sourceURL = friendlySourceURL(); 88 traceBuild.append(functionName); 89 if (!sourceURL.isEmpty()) { 90 if (!functionName.isEmpty()) 91 traceBuild.append('@'); 92 traceBuild.append(sourceURL); 93 if (line > -1) { 94 traceBuild.append(':'); 95 traceBuild.append(String::number(line)); 96 } 97 } 98 return traceBuild.toString().impl(); 99 } 100 String friendlySourceURL() const 101 { 102 String traceLine; 103 104 switch (codeType) { 105 case StackFrameEvalCode: 106 case StackFrameFunctionCode: 107 case StackFrameGlobalCode: 108 if (!sourceURL.isEmpty()) 109 traceLine = sourceURL.impl(); 110 break; 111 case StackFrameNativeCode: 112 traceLine = "[native code]"; 113 break; 114 } 115 return traceLine.isNull() ? emptyString() : traceLine; 116 } 117 String friendlyFunctionName(CallFrame* callFrame) const 118 { 85 119 String traceLine; 86 120 JSObject* stackFrameCallee = callee.get(); … … 88 122 switch (codeType) { 89 123 case StackFrameEvalCode: 90 if (hasSourceURLInfo) { 91 traceLine = hasLineInfo ? String::format("eval code@%s:%d", sourceURL.ascii().data(), line) 92 : String::format("eval code@%s", sourceURL.ascii().data()); 93 } else 94 traceLine = String::format("eval code"); 95 break; 96 case StackFrameNativeCode: { 97 if (callee) { 98 UString functionName = getCalculatedDisplayName(callFrame, stackFrameCallee); 99 traceLine = String::format("%s@[native code]", functionName.ascii().data()); 100 } else 101 traceLine = "[native code]"; 124 traceLine = "eval code"; 125 break; 126 case StackFrameNativeCode: 127 if (callee) 128 traceLine = getCalculatedDisplayName(callFrame, stackFrameCallee).impl(); 129 break; 130 case StackFrameFunctionCode: 131 traceLine = getCalculatedDisplayName(callFrame, stackFrameCallee).impl(); 132 break; 133 case StackFrameGlobalCode: 134 traceLine = "global code"; 102 135 break; 103 136 } 104 case StackFrameFunctionCode: { 105 UString functionName = getCalculatedDisplayName(callFrame, stackFrameCallee); 106 if (hasSourceURLInfo) { 107 traceLine = hasLineInfo ? String::format("%s@%s:%d", functionName.ascii().data(), sourceURL.ascii().data(), line) 108 : String::format("%s@%s", functionName.ascii().data(), sourceURL.ascii().data()); 109 } else 110 traceLine = String::format("%s\n", functionName.ascii().data()); 111 break; 112 } 113 case StackFrameGlobalCode: 114 if (hasSourceURLInfo) { 115 traceLine = hasLineInfo ? String::format("global code@%s:%d", sourceURL.ascii().data(), line) 116 : String::format("global code@%s", sourceURL.ascii().data()); 117 } else 118 traceLine = String::format("global code"); 119 120 } 121 return traceLine.impl(); 137 return traceLine.isNull() ? emptyString() : traceLine; 138 } 139 unsigned friendlyLineNumber() const 140 { 141 return line > -1 ? line : 0; 122 142 } 123 143 }; -
trunk/Source/WebCore/ChangeLog
r121870 r121871 1 2012-07-04 Anthony Scian <ascian@rim.com> 2 3 Web Inspector [JSC]: Implement ScriptCallStack::stackTrace 4 https://bugs.webkit.org/show_bug.cgi?id=40118 5 6 Reviewed by Yong Li. 7 8 Implemented stub for createScriptCallStack to call into 9 Interpreter and extract the current stack frames, iterate 10 through the frames and create the return result required. 11 12 No new tests, manually tested thrown exception and inspector 13 tracebacks. 14 15 * bindings/js/ScriptCallStackFactory.cpp: 16 (WebCore::createScriptCallStack): 17 1 18 2012-07-04 Dana Jansens <danakj@chromium.org> 2 19 -
trunk/Source/WebCore/bindings/js/ScriptCallStackFactory.cpp
r121393 r121871 1 1 /* 2 2 * Copyright (c) 2010 Google Inc. All rights reserved. 3 * Copyright (C) 2012 Research In Motion Limited. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 34 35 #include "InspectorInstrumentation.h" 35 36 #include "JSDOMBinding.h" 37 #include "JSMainThreadExecState.h" 36 38 #include "ScriptArguments.h" 37 39 #include "ScriptCallFrame.h" … … 52 54 class ScriptExecutionContext; 53 55 54 PassRefPtr<ScriptCallStack> createScriptCallStack(size_t , bool)56 PassRefPtr<ScriptCallStack> createScriptCallStack(size_t maxStackSize, bool emptyIsAllowed) 55 57 { 56 return 0; 58 Vector<ScriptCallFrame> frames; 59 if (JSC::ExecState* exec = JSMainThreadExecState::currentState()) { 60 Vector<StackFrame> stackTrace; 61 Interpreter::getStackTrace(&exec->globalData(), stackTrace); 62 for (Vector<StackFrame>::const_iterator iter = stackTrace.begin(); iter < stackTrace.end(); iter++) { 63 frames.append(ScriptCallFrame(iter->friendlyFunctionName(exec), iter->friendlySourceURL(), iter->friendlyLineNumber())); 64 if (frames.size() >= maxStackSize) 65 break; 66 } 67 } 68 if (frames.isEmpty() && !emptyIsAllowed) { 69 // No frames found. It may happen in the case where 70 // a bound function is called from native code for example. 71 // Fallback to setting lineNumber to 0, and source and function name to "undefined". 72 frames.append(ScriptCallFrame("undefined", "undefined", 0)); 73 } 74 return ScriptCallStack::create(frames); 57 75 } 58 76
Note: See TracChangeset
for help on using the changeset viewer.