Bug 71808 - Web Inspector: function remote objetct should provide access to function position in the script
Summary: Web Inspector: function remote objetct should provide access to function posi...
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: Yury Semikhatsky
URL:
Keywords:
Depends on: 72117
Blocks:
  Show dependency treegraph
 
Reported: 2011-11-08 06:26 PST by Yury Semikhatsky
Modified: 2011-11-14 01:27 PST (History)
17 users (show)

See Also:


Attachments
Patch (17.73 KB, patch)
2011-11-10 07:12 PST, Yury Semikhatsky
no flags Details | Formatted Diff | Diff
Patch (17.72 KB, patch)
2011-11-10 07:16 PST, Yury Semikhatsky
no flags Details | Formatted Diff | Diff
Patch (19.63 KB, patch)
2011-11-10 09:14 PST, Yury Semikhatsky
no flags Details | Formatted Diff | Diff
Patch (19.64 KB, patch)
2011-11-11 00:38 PST, Yury Semikhatsky
no flags Details | Formatted Diff | Diff
Patch (19.04 KB, patch)
2011-11-11 03:51 PST, Yury Semikhatsky
pfeldman: review+
Details | Formatted Diff | Diff
Patch (19.78 KB, patch)
2011-11-11 04:23 PST, Yury Semikhatsky
no flags Details | Formatted Diff | Diff
Patch (19.63 KB, patch)
2011-11-11 04:39 PST, Yury Semikhatsky
no flags Details | Formatted Diff | Diff
Patch (21.41 KB, patch)
2011-11-11 05:54 PST, Yury Semikhatsky
pfeldman: review+
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yury Semikhatsky 2011-11-08 06:26:17 PST
Web Inspector: function remote objetct should provide access to script id and the function position in the script.
Comment 1 Yury Semikhatsky 2011-11-10 07:12:00 PST
Created attachment 114495 [details]
Patch
Comment 2 WebKit Review Bot 2011-11-10 07:14:20 PST
Attachment 114495 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/insp..." exit_code: 1

Source/WebCore/inspector/InjectedScript.cpp:91:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InspectorDebuggerAgent.cpp:357:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InspectorDebuggerAgent.h:87:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InjectedScript.h:81:  The parameter name "errorString" adds no information, so it should be removed.  [readability/parameter_name] [5]
Source/WebCore/inspector/InjectedScript.h:81:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Total errors found: 5 in 14 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Yury Semikhatsky 2011-11-10 07:14:58 PST
(In reply to comment #1)
> Created an attachment (id=114495) [details]
> Patch

Note that this patch depends on this V8 change which has not been pushed to trunk yet: http://code.google.com/p/v8/source/detail?r=9935
Comment 4 Yury Semikhatsky 2011-11-10 07:16:02 PST
Created attachment 114496 [details]
Patch
Comment 5 WebKit Review Bot 2011-11-10 07:19:50 PST
Attachment 114496 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/insp..." exit_code: 1

Source/WebCore/inspector/InjectedScript.cpp:91:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InspectorDebuggerAgent.cpp:357:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InspectorDebuggerAgent.h:87:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InjectedScript.h:81:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Total errors found: 4 in 14 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 6 WebKit Review Bot 2011-11-10 07:28:31 PST
Comment on attachment 114496 [details]
Patch

Attachment 114496 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/10400334
Comment 7 Pavel Feldman 2011-11-10 08:30:28 PST
Comment on attachment 114496 [details]
Patch

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

r- for failing JSC bots.

> LayoutTests/inspector/debugger/function-location-expected.txt:9
> +columnNumber: -1

You should not provide columnNumber in case it is not known.
Comment 8 Yury Semikhatsky 2011-11-10 09:14:36 PST
Created attachment 114518 [details]
Patch
Comment 9 WebKit Review Bot 2011-11-10 09:16:59 PST
Attachment 114518 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/insp..." exit_code: 1

Source/WebCore/inspector/InjectedScript.cpp:91:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InspectorDebuggerAgent.cpp:357:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InspectorDebuggerAgent.h:87:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InjectedScript.h:81:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Total errors found: 4 in 16 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 10 Yury Semikhatsky 2011-11-11 00:38:12 PST
Created attachment 114640 [details]
Patch
Comment 11 WebKit Review Bot 2011-11-11 00:40:04 PST
Attachment 114640 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/insp..." exit_code: 1

Source/WebCore/inspector/InjectedScript.cpp:91:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InspectorDebuggerAgent.cpp:357:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InspectorDebuggerAgent.h:87:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InjectedScript.h:81:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Total errors found: 4 in 16 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 12 Yury Semikhatsky 2011-11-11 03:51:47 PST
Created attachment 114664 [details]
Patch
Comment 13 WebKit Review Bot 2011-11-11 03:54:58 PST
Attachment 114664 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/insp..." exit_code: 1

Source/WebCore/inspector/InjectedScript.cpp:91:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InspectorDebuggerAgent.cpp:357:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InspectorDebuggerAgent.h:87:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InjectedScript.h:81:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Total errors found: 4 in 16 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 14 Yury Semikhatsky 2011-11-11 04:23:18 PST
Created attachment 114667 [details]
Patch
Comment 15 WebKit Review Bot 2011-11-11 04:26:00 PST
Attachment 114667 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/insp..." exit_code: 1

Source/WebCore/inspector/InjectedScript.cpp:91:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InspectorDebuggerAgent.cpp:357:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InspectorDebuggerAgent.h:87:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InjectedScript.h:81:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Total errors found: 4 in 17 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 16 Pavel Feldman 2011-11-11 04:36:21 PST
Comment on attachment 114664 [details]
Patch

Inspector part looks good, please check with JSC folks whether exposing SourceCode on JSFunction is Ok.
Comment 17 Yury Semikhatsky 2011-11-11 04:39:35 PST
Created attachment 114671 [details]
Patch
Comment 18 WebKit Review Bot 2011-11-11 04:41:20 PST
Attachment 114671 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/insp..." exit_code: 1

Source/WebCore/inspector/InjectedScript.cpp:91:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InspectorDebuggerAgent.cpp:357:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InspectorDebuggerAgent.h:87:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InjectedScript.h:81:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Total errors found: 4 in 17 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 19 Yury Semikhatsky 2011-11-11 05:06:29 PST
Committed r99950: <http://trac.webkit.org/changeset/99950>
Comment 20 Yury Semikhatsky 2011-11-11 05:16:32 PST
Landed this patch instead of another one by mistake which is why the bug was closed, reopening.
Comment 21 Yury Semikhatsky 2011-11-11 05:54:21 PST
Created attachment 114686 [details]
Patch
Comment 22 WebKit Review Bot 2011-11-11 05:56:49 PST
Attachment 114686 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/insp..." exit_code: 1

Source/WebCore/inspector/InjectedScript.cpp:91:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InspectorDebuggerAgent.cpp:357:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InspectorDebuggerAgent.h:87:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InjectedScript.h:81:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Total errors found: 4 in 19 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 23 Yury Semikhatsky 2011-11-11 07:27:05 PST
Alexei or Geoffrey could you look at the JSC-related changes, in particular

1. If you are fine with adding JSFunction::sourceCode getter which is used to avoid direct access to runtime/Executable.h that is not visible from WebCore.
2. In JSInjectedScriptHost::functionLocation new JSObject is created and kept as a raw pointer. I've seen such code in other bindings but I'm not sure if I have to create a handle to the object to protect it from being GC'ed or can assume that GC won't run while I'm in that method.
Comment 24 Geoffrey Garen 2011-11-11 08:54:27 PST
> 1. If you are fine with adding JSFunction::sourceCode getter which is used to avoid direct access to runtime/Executable.h that is not visible from WebCore.

Seems fine.

> 2. In JSInjectedScriptHost::functionLocation new JSObject is created and kept as a raw pointer. I've seen such code in other bindings but I'm not sure if I have to create a handle to the object to protect it from being GC'ed or can assume that GC won't run while I'm in that method.

This code is also fine. For future reference, the reason this is OK is not that GC won't run. (You're allocating a string, so GC might run.) Rather, it's OK because the collector scans the C++ stack, and you have a reference to your new object on the C++ stack.
Comment 25 Yury Semikhatsky 2011-11-11 09:08:15 PST
(In reply to comment #24)
> > 2. In JSInjectedScriptHost::functionLocation new JSObject is created and kept as a raw pointer. I've seen such code in other bindings but I'm not sure if I have to create a handle to the object to protect it from being GC'ed or can assume that GC won't run while I'm in that method.
> 
> This code is also fine. For future reference, the reason this is OK is not that GC won't run. (You're allocating a string, so GC might run.) Rather, it's OK because the collector scans the C++ stack, and you have a reference to your new object on the C++ stack.

That is what I suspected, thanks for the explanation!
Comment 26 WebKit Review Bot 2011-11-11 18:46:49 PST
Comment on attachment 114686 [details]
Patch

Attachment 114686 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/10448611
Comment 27 Yury Semikhatsky 2011-11-14 01:27:51 PST
Committed r100113: <http://trac.webkit.org/changeset/100113>