- Revision
- 208664
- Author
- [email protected]
- Date
- 2016-11-12 21:38:58 -0800 (Sat, 12 Nov 2016)
Log Message
Web Inspector: Type Profiler and Code Coverage Profiler should work in Workers
https://bugs.webkit.org/show_bug.cgi?id=164682
Patch by Joseph Pecoraro <[email protected]> on 2016-11-12
Reviewed by Darin Adler.
* UserInterface/Controllers/BasicBlockAnnotator.js:
* UserInterface/Models/ScriptSyntaxTree.js:
(WebInspector.ScriptSyntaxTree.prototype.updateTypes):
Use the target associated with the Script.
* UserInterface/Protocol/Target.js:
(WebInspector.WorkerTarget.prototype.initialize):
When initializing a Worker Target, match the existing state
of the Page for these profilers.
* UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
* UserInterface/Views/SourceCodeTextEditor.js:
(WebInspector.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedJavaScriptTypeInformation):
(WebInspector.SourceCodeTextEditor.prototype.willDismissPopover):
Use the correct target for this Script / Resource.
(WebInspector.SourceCodeTextEditor.prototype._setTypeTokenAnnotatorEnabledState):
(WebInspector.SourceCodeTextEditor.prototype.set _basicBlockAnnotatorEnabled):
Enable / disable for all targets when toggling profilers.
Modified Paths
Diff
Modified: trunk/Source/WebInspectorUI/ChangeLog (208663 => 208664)
--- trunk/Source/WebInspectorUI/ChangeLog 2016-11-13 04:52:31 UTC (rev 208663)
+++ trunk/Source/WebInspectorUI/ChangeLog 2016-11-13 05:38:58 UTC (rev 208664)
@@ -1,3 +1,30 @@
+2016-11-12 Joseph Pecoraro <[email protected]>
+
+ Web Inspector: Type Profiler and Code Coverage Profiler should work in Workers
+ https://bugs.webkit.org/show_bug.cgi?id=164682
+
+ Reviewed by Darin Adler.
+
+ * UserInterface/Controllers/BasicBlockAnnotator.js:
+ * UserInterface/Models/ScriptSyntaxTree.js:
+ (WebInspector.ScriptSyntaxTree.prototype.updateTypes):
+ Use the target associated with the Script.
+
+ * UserInterface/Protocol/Target.js:
+ (WebInspector.WorkerTarget.prototype.initialize):
+ When initializing a Worker Target, match the existing state
+ of the Page for these profilers.
+
+ * UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
+ * UserInterface/Views/SourceCodeTextEditor.js:
+ (WebInspector.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedJavaScriptTypeInformation):
+ (WebInspector.SourceCodeTextEditor.prototype.willDismissPopover):
+ Use the correct target for this Script / Resource.
+
+ (WebInspector.SourceCodeTextEditor.prototype._setTypeTokenAnnotatorEnabledState):
+ (WebInspector.SourceCodeTextEditor.prototype.set _basicBlockAnnotatorEnabled):
+ Enable / disable for all targets when toggling profilers.
+
2016-11-11 Anthony Ricaud <[email protected]>
Web Inspector: Whitespace in Editor should be less visible than regular content
Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/BasicBlockAnnotator.js (208663 => 208664)
--- trunk/Source/WebInspectorUI/UserInterface/Controllers/BasicBlockAnnotator.js 2016-11-13 04:52:31 UTC (rev 208663)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/BasicBlockAnnotator.js 2016-11-13 05:38:58 UTC (rev 208664)
@@ -56,7 +56,7 @@
var sourceID = this._script.id;
var startTime = Date.now();
- RuntimeAgent.getBasicBlocks(sourceID, function(error, basicBlocks) {
+ this._script.target.RuntimeAgent.getBasicBlocks(sourceID, function(error, basicBlocks) {
if (error) {
console.error("Error in getting basic block locations: " + error);
return;
Modified: trunk/Source/WebInspectorUI/UserInterface/Models/ScriptSyntaxTree.js (208663 => 208664)
--- trunk/Source/WebInspectorUI/UserInterface/Models/ScriptSyntaxTree.js 2016-11-13 04:52:31 UTC (rev 208663)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/ScriptSyntaxTree.js 2016-11-13 05:38:58 UTC (rev 208664)
@@ -253,7 +253,7 @@
callback(allRequestNodes);
}
- RuntimeAgent.getRuntimeTypesForVariablesAtOffsets(allRequests, handleTypes);
+ this._script.target.RuntimeAgent.getRuntimeTypesForVariablesAtOffsets(allRequests, handleTypes);
}
// Private
Modified: trunk/Source/WebInspectorUI/UserInterface/Protocol/Target.js (208663 => 208664)
--- trunk/Source/WebInspectorUI/UserInterface/Protocol/Target.js 2016-11-13 04:52:31 UTC (rev 208663)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/Target.js 2016-11-13 05:38:58 UTC (rev 208664)
@@ -142,10 +142,12 @@
WebInspector.frameResourceManager.adoptOrphanedResourcesForTarget(this);
if (this.RuntimeAgent) {
+ this._executionContext = new WebInspector.ExecutionContext(this, WebInspector.RuntimeManager.TopLevelContextExecutionIdentifier, this.displayName, false, null);
this.RuntimeAgent.enable();
- this._executionContext = new WebInspector.ExecutionContext(this, WebInspector.RuntimeManager.TopLevelContextExecutionIdentifier, this.displayName, false, null);
- // FIXME: Enable Type Profiler
- // FIXME: Enable Code Coverage Profiler
+ if (WebInspector.showJavaScriptTypeInformationSetting && WebInspector.showJavaScriptTypeInformationSetting.value)
+ this.RuntimeAgent.enableTypeProfiler();
+ if (WebInspector.enableControlFlowProfilerSetting && WebInspector.enableControlFlowProfilerSetting.value)
+ this.RuntimeAgent.enableControlFlowProfiler();
}
if (this.DebuggerAgent)
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.js (208663 => 208664)
--- trunk/Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.js 2016-11-13 04:52:31 UTC (rev 208663)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.js 2016-11-13 05:38:58 UTC (rev 208664)
@@ -268,12 +268,14 @@
if (!watchExpressions.length) {
if (this._usedWatchExpressionsObjectGroup) {
this._usedWatchExpressionsObjectGroup = false;
- RuntimeAgent.releaseObjectGroup(WebInspector.ScopeChainDetailsSidebarPanel.WatchExpressionsObjectGroupName);
+ for (let target of WebInspector.targets)
+ target.RuntimeAgent.releaseObjectGroup(WebInspector.ScopeChainDetailsSidebarPanel.WatchExpressionsObjectGroupName);
}
return Promise.resolve(null);
}
- RuntimeAgent.releaseObjectGroup(WebInspector.ScopeChainDetailsSidebarPanel.WatchExpressionsObjectGroupName);
+ for (let target of WebInspector.targets)
+ target.RuntimeAgent.releaseObjectGroup(WebInspector.ScopeChainDetailsSidebarPanel.WatchExpressionsObjectGroupName);
this._usedWatchExpressionsObjectGroup = true;
let watchExpressionsRemoteObject = WebInspector.RemoteObject.createFakeRemoteObject();
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js (208663 => 208664)
--- trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js 2016-11-13 04:52:31 UTC (rev 208663)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js 2016-11-13 05:38:58 UTC (rev 208664)
@@ -1589,7 +1589,7 @@
}
}
- RuntimeAgent.getRuntimeTypesForVariablesAtOffsets(allRequests, handler.bind(this));
+ this.target.RuntimeAgent.getRuntimeTypesForVariablesAtOffsets(allRequests, handler.bind(this));
}
_showPopover(content, bounds)
@@ -1731,7 +1731,7 @@
{
this.tokenTrackingController.removeHighlightedRange();
- RuntimeAgent.releaseObjectGroup("popover");
+ this.target.RuntimeAgent.releaseObjectGroup("popover");
}
_dismissPopover()
@@ -1870,13 +1870,18 @@
if (shouldActivate) {
console.assert(this.visible, "Annotators should not be enabled if the TextEditor is not visible");
- RuntimeAgent.enableTypeProfiler();
+
+ for (let target of WebInspector.targets)
+ target.RuntimeAgent.enableTypeProfiler();
+
this._typeTokenAnnotator.reset();
if (!this._typeTokenScrollHandler)
this._enableScrollEventsForTypeTokenAnnotator();
} else {
- RuntimeAgent.disableTypeProfiler();
+ for (let target of WebInspector.targets)
+ target.RuntimeAgent.disableTypeProfiler();
+
this._typeTokenAnnotator.clear();
if (this._typeTokenScrollHandler)
@@ -1896,7 +1901,8 @@
if (shouldActivate) {
console.assert(this.visible, "Annotators should not be enabled if the TextEditor is not visible");
- RuntimeAgent.enableControlFlowProfiler();
+ for (let target of WebInspector.targets)
+ target.RuntimeAgent.enableControlFlowProfiler();
console.assert(!this._basicBlockAnnotator.isActive());
this._basicBlockAnnotator.reset();
@@ -1904,7 +1910,9 @@
if (!this._controlFlowScrollHandler)
this._enableScrollEventsForControlFlowAnnotator();
} else {
- RuntimeAgent.disableControlFlowProfiler();
+ for (let target of WebInspector.targets)
+ target.RuntimeAgent.disableControlFlowProfiler();
+
this._basicBlockAnnotator.clear();
if (this._controlFlowScrollHandler)