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

Unified Diff: third_party/WebKit/Source/devtools/front_end/profiler/CPUProfileView.js

Issue 2721663005: [DevTools] Access cpu profiler only when JS capability is present. (Closed)
Patch Set: coverage Created 3 years, 10 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
Index: third_party/WebKit/Source/devtools/front_end/profiler/CPUProfileView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/profiler/CPUProfileView.js b/third_party/WebKit/Source/devtools/front_end/profiler/CPUProfileView.js
index 41c7f04aaa0d149b3572ae6c6a6ccea5229fe191..2114d0a901dcd41c108736e022792ce86044b44f 100644
--- a/third_party/WebKit/Source/devtools/front_end/profiler/CPUProfileView.js
+++ b/third_party/WebKit/Source/devtools/front_end/profiler/CPUProfileView.js
@@ -189,16 +189,16 @@ Profiler.CPUProfileType = class extends Profiler.ProfileType {
}
startRecordingProfile() {
- var target = UI.context.flavor(SDK.Target);
- if (this.profileBeingRecorded() || !target)
+ var cpuProfilerModel = UI.context.flavor(SDK.CPUProfilerModel);
+ if (this.profileBeingRecorded() || !cpuProfilerModel)
return;
- var profile = new Profiler.CPUProfileHeader(target, this);
+ var profile = new Profiler.CPUProfileHeader(cpuProfilerModel.target(), this);
this.setProfileBeingRecorded(profile);
SDK.targetManager.suspendAllTargets();
this.addProfile(profile);
profile.updateStatus(Common.UIString('Recording\u2026'));
this._recording = true;
- target.cpuProfilerModel.startRecording();
+ cpuProfilerModel.startRecording();
}
stopRecordingProfile() {
@@ -231,7 +231,8 @@ Profiler.CPUProfileType = class extends Profiler.ProfileType {
this.profileBeingRecorded()
.target()
alph 2017/02/28 23:59:13 nit: I'd rather write the synchronous part in a si
dgozman 2017/03/01 00:18:41 That's what I did, but formatter thinks differentl
- .cpuProfilerModel.stopRecording()
+ .model(SDK.CPUProfilerModel)
+ .stopRecording()
.then(didStopProfiling.bind(this))
.then(SDK.targetManager.resumeAllTargets.bind(SDK.targetManager))
.then(fireEvent.bind(this));

Powered by Google App Engine
This is Rietveld 408576698