Bug 107805

Summary: Web Inspector: [Canvas] REGRESSION: stack traces in the replay log are gone
Product: WebKit Reporter: Andrey Adaikin <aandrey>
Component: Web Inspector (Deprecated)Assignee: Andrey Adaikin <aandrey>
Status: RESOLVED FIXED    
Severity: Normal CC: apavlov, gyuyoung.kim, keishi, loislo, pfeldman, pmuellr, rakuco, vsevik, web-inspector-bugs, webkit.review.bot, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch pfeldman: review+

Description Andrey Adaikin 2013-01-24 02:54:25 PST
Patch to follow.
Comment 1 Andrey Adaikin 2013-01-24 03:17:14 PST
Created attachment 184455 [details]
Patch
Comment 2 Pavel Feldman 2013-01-24 04:32:46 PST
Comment on attachment 184455 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=184455&action=review

> Source/WebCore/inspector/InjectedScriptCanvasModuleSource.js:236
> +    Error.prepareStackTrace = function(error, structuredStackTrace)

Error is a part of the page's context. Why do you need to intercept it?
Comment 3 Andrey Adaikin 2013-01-24 04:38:51 PST
(In reply to comment #2)
> (From update of attachment 184455 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=184455&action=review
> 
> > Source/WebCore/inspector/InjectedScriptCanvasModuleSource.js:236
> > +    Error.prepareStackTrace = function(error, structuredStackTrace)
> 
> Error is a part of the page's context. Why do you need to intercept it?

The canvas calls are also made from the page's context. We want the stack trace of those calls. To get it, we use V8's http://code.google.com/p/v8/wiki/JavaScriptStackTraceApi, namely Error.prepareStackTrace method.
Comment 4 Pavel Feldman 2013-01-24 05:15:22 PST
Comment on attachment 184455 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=184455&action=review

>>> Source/WebCore/inspector/InjectedScriptCanvasModuleSource.js:236
>>> +    Error.prepareStackTrace = function(error, structuredStackTrace)
>> 
>> Error is a part of the page's context. Why do you need to intercept it?
> 
> The canvas calls are also made from the page's context. We want the stack trace of those calls. To get it, we use V8's http://code.google.com/p/v8/wiki/JavaScriptStackTraceApi, namely Error.prepareStackTrace method.

We should not modify user functions if at all possible. Can we use a binding for this?
Comment 5 Andrey Adaikin 2013-01-24 06:15:56 PST
Committed r140679: <http://trac.webkit.org/changeset/140679>