Bug 164682 - Web Inspector: Type Profiler and Code Coverage Profiler should work in Workers
Summary: Web Inspector: Type Profiler and Code Coverage Profiler should work in Workers
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Joseph Pecoraro
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-11-12 11:10 PST by Joseph Pecoraro
Modified: 2016-12-09 16:23 PST (History)
8 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (8.63 KB, patch)
2016-11-12 11:13 PST, Joseph Pecoraro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2016-11-12 11:10:26 PST
Summary:
Type Profiler and Code Coverage Profiler should work in Workers

Enable/Disable for Workers when enabling/disabling for the Page.
Comment 1 Radar WebKit Bug Importer 2016-11-12 11:13:20 PST
<rdar://problem/29234906>
Comment 2 Joseph Pecoraro 2016-11-12 11:13:49 PST
Created attachment 294621 [details]
[PATCH] Proposed Fix
Comment 3 Darin Adler 2016-11-12 21:18:24 PST
Comment on attachment 294621 [details]
[PATCH] Proposed Fix

Is there a way to test this code?
Comment 4 WebKit Commit Bot 2016-11-12 21:42:05 PST
Comment on attachment 294621 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 294621

Committed r208664: <http://trac.webkit.org/changeset/208664>
Comment 5 WebKit Commit Bot 2016-11-12 21:42:09 PST
All reviewed patches have been landed.  Closing bug.
Comment 6 Nikita Vasilyev 2016-12-09 14:12:51 PST
I noticed RuntimeAgent.enableTypeProfiler and RuntimeAgent.enableControlFlowProfiler in WebInspector.loaded method were unchanged. Was it on purpose?

    this.showJavaScriptTypeInformationSetting = new WebInspector.Setting("show-javascript-type-information", false);
    if (this.showJavaScriptTypeInformationSetting.value && window.RuntimeAgent && RuntimeAgent.enableTypeProfiler)
        RuntimeAgent.enableTypeProfiler();

    this.enableControlFlowProfilerSetting = new WebInspector.Setting("enable-control-flow-profiler", false);
    if (this.enableControlFlowProfilerSetting.value && window.RuntimeAgent && RuntimeAgent.enableControlFlowProfiler)
        RuntimeAgent.enableControlFlowProfiler();
Comment 7 Joseph Pecoraro 2016-12-09 16:06:25 PST
(In reply to comment #6)
> I noticed RuntimeAgent.enableTypeProfiler and
> RuntimeAgent.enableControlFlowProfiler in WebInspector.loaded method were
> unchanged. Was it on purpose?
> 
>     this.showJavaScriptTypeInformationSetting = new
> WebInspector.Setting("show-javascript-type-information", false);
>     if (this.showJavaScriptTypeInformationSetting.value &&
> window.RuntimeAgent && RuntimeAgent.enableTypeProfiler)
>         RuntimeAgent.enableTypeProfiler();
> 
>     this.enableControlFlowProfilerSetting = new
> WebInspector.Setting("enable-control-flow-profiler", false);
>     if (this.enableControlFlowProfilerSetting.value && window.RuntimeAgent
> && RuntimeAgent.enableControlFlowProfiler)
>         RuntimeAgent.enableControlFlowProfiler();

That code turns on the feature to match the initial value of the setting.

The code I'm adding toggles the feature based on the setting changing.

Both are necessary.
Comment 8 Joseph Pecoraro 2016-12-09 16:08:00 PST
Oh I'm sorry, I commented thinking this was a different bugzilla bug.

In this code no other Target will exist yet. Only the MainTarget which this is affecting.

When other Targets are added, they run additional code. See WorkerTarget.
Comment 9 Nikita Vasilyev 2016-12-09 16:23:31 PST
(In reply to comment #8)
> Oh I'm sorry, I commented thinking this was a different bugzilla bug.
> 
> In this code no other Target will exist yet. Only the MainTarget which this
> is affecting.
> 
> When other Targets are added, they run additional code. See WorkerTarget.

I see, it makes sense.