Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(765)

Unified Diff: Source/devtools/front_end/ProfilesPanel.js

Issue 23690005: Allow configuring CPU profiler sampling interval (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/inspector/InspectorProfilerAgent.cpp ('k') | Source/devtools/front_end/Settings.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/ProfilesPanel.js
diff --git a/Source/devtools/front_end/ProfilesPanel.js b/Source/devtools/front_end/ProfilesPanel.js
index d4897e273f57707d56948f608ed700e3b6c87cda..ef5fe9d6a094fc6653de4e97c0f0c10cb5c25068 100644
--- a/Source/devtools/front_end/ProfilesPanel.js
+++ b/Source/devtools/front_end/ProfilesPanel.js
@@ -435,6 +435,9 @@ WebInspector.ProfilesPanel = function(name, type)
this._registerShortcuts();
WebInspector.ContextMenu.registerProvider(this);
+
+ this._configureCpuProfilerSamplingInterval();
+ WebInspector.settings.highResolutionCpuProfiling.addChangeListener(this._configureCpuProfilerSamplingInterval, this);
}
WebInspector.ProfilesPanel.prototype = {
@@ -472,6 +475,17 @@ WebInspector.ProfilesPanel.prototype = {
this.registerShortcuts(WebInspector.ProfilesPanelDescriptor.ShortcutKeys.StartStopRecording, this.toggleRecordButton.bind(this));
},
+ _configureCpuProfilerSamplingInterval: function()
+ {
+ var intervalUs = WebInspector.settings.highResolutionCpuProfiling.get() ? 100 : 1000;
+ ProfilerAgent.setSamplingInterval(intervalUs, didChangeInterval.bind(this));
+ function didChangeInterval(error)
+ {
+ if (error)
+ WebInspector.showErrorMessage(error)
+ }
+ },
+
/**
* @param {!File} file
*/
« no previous file with comments | « Source/core/inspector/InspectorProfilerAgent.cpp ('k') | Source/devtools/front_end/Settings.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698