Bug 107805 - Web Inspector: [Canvas] REGRESSION: stack traces in the replay log are gone
Summary: Web Inspector: [Canvas] REGRESSION: stack traces in the replay log are gone
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Andrey Adaikin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-24 02:54 PST by Andrey Adaikin
Modified: 2013-01-24 06:15 PST (History)
11 users (show)

See Also:


Attachments
Patch (15.18 KB, patch)
2013-01-24 03:17 PST, Andrey Adaikin
pfeldman: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>