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

Side by Side Diff: Source/devtools/front_end/profiler/ProfilesPanel.js

Issue 614323003: DevTools: enable by default disableAgentsWhenProfile experiment (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: unnecessary line was removed Created 6 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 { 230 {
231 return this._profileBeingRecorded; 231 return this._profileBeingRecorded;
232 }, 232 },
233 233
234 /** 234 /**
235 * @param {?WebInspector.ProfileHeader} profile 235 * @param {?WebInspector.ProfileHeader} profile
236 */ 236 */
237 setProfileBeingRecorded: function(profile) 237 setProfileBeingRecorded: function(profile)
238 { 238 {
239 if (this._profileBeingRecorded && this._profileBeingRecorded.target()) 239 if (this._profileBeingRecorded && this._profileBeingRecorded.target())
240 WebInspector.profilingLock().release(); 240 WebInspector.targetManager.resumeAllTargets();
241 if (profile && profile.target()) 241 if (profile && profile.target())
242 WebInspector.profilingLock().acquire(); 242 WebInspector.targetManager.suspendAllTargets();
243 this._profileBeingRecorded = profile; 243 this._profileBeingRecorded = profile;
244 }, 244 },
245 245
246 profileBeingRecordedRemoved: function() 246 profileBeingRecordedRemoved: function()
247 { 247 {
248 }, 248 },
249 249
250 _reset: function() 250 _reset: function()
251 { 251 {
252 var profiles = this._profiles.slice(0); 252 var profiles = this._profiles.slice(0);
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 for (var i = 0; i < types.length; i++) 484 for (var i = 0; i < types.length; i++)
485 this._registerProfileType(types[i]); 485 this._registerProfileType(types[i]);
486 this._launcherView.restoreSelectedProfileType(); 486 this._launcherView.restoreSelectedProfileType();
487 this.profilesItemTreeElement.select(); 487 this.profilesItemTreeElement.select();
488 this._showLauncherView(); 488 this._showLauncherView();
489 489
490 this._createFileSelectorElement(); 490 this._createFileSelectorElement();
491 this.element.addEventListener("contextmenu", this._handleContextMenuEvent.bi nd(this), true); 491 this.element.addEventListener("contextmenu", this._handleContextMenuEvent.bi nd(this), true);
492 this._registerShortcuts(); 492 this._registerShortcuts();
493 493
494 WebInspector.profilingLock().addEventListener(WebInspector.Lock.Events.State Changed, this._onProfilingStateChanged, this); 494 WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Event s.SuspendStateChanged, this._onSuspendStateChanged, this);
495 } 495 }
496 496
497 WebInspector.ProfilesPanel.prototype = { 497 WebInspector.ProfilesPanel.prototype = {
498 /** 498 /**
499 * @return {!WebInspector.SearchableView} 499 * @return {!WebInspector.SearchableView}
500 */ 500 */
501 searchableView: function() 501 searchableView: function()
502 { 502 {
503 return this._searchableView; 503 return this._searchableView;
504 }, 504 },
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 if (isProfiling) { 572 if (isProfiling) {
573 this._launcherView.profileStarted(); 573 this._launcherView.profileStarted();
574 if (type.hasTemporaryView()) 574 if (type.hasTemporaryView())
575 this.showProfile(type.profileBeingRecorded()); 575 this.showProfile(type.profileBeingRecorded());
576 } else { 576 } else {
577 this._launcherView.profileFinished(); 577 this._launcherView.profileFinished();
578 } 578 }
579 return true; 579 return true;
580 }, 580 },
581 581
582 _onProfilingStateChanged: function() 582 _onSuspendStateChanged: function()
583 { 583 {
584 this._updateRecordButton(this.recordButton.toggled); 584 this._updateRecordButton(this.recordButton.toggled);
585 }, 585 },
586 586
587 /** 587 /**
588 * @param {boolean} toggled 588 * @param {boolean} toggled
589 */ 589 */
590 _updateRecordButton: function(toggled) 590 _updateRecordButton: function(toggled)
591 { 591 {
592 if (Runtime.experiments.isEnabled("disableAgentsWhenProfile")) 592 var enable = toggled || !WebInspector.targetManager.allTargetsSuspended( );
593 WebInspector.inspectorView.setCurrentPanelLocked(toggled);
594 var isAcquiredInSomeTarget = WebInspector.profilingLock().isAcquired();
595 var enable = toggled || !isAcquiredInSomeTarget;
596 this.recordButton.setEnabled(enable); 593 this.recordButton.setEnabled(enable);
597 this.recordButton.toggled = toggled; 594 this.recordButton.toggled = toggled;
598 if (enable) 595 if (enable)
599 this.recordButton.title = this._selectedProfileType ? this._selected ProfileType.buttonTooltip : ""; 596 this.recordButton.title = this._selectedProfileType ? this._selected ProfileType.buttonTooltip : "";
600 else 597 else
601 this.recordButton.title = WebInspector.anotherProfilerActiveLabel(); 598 this.recordButton.title = WebInspector.anotherProfilerActiveLabel();
602 if (this._selectedProfileType) 599 if (this._selectedProfileType)
603 this._launcherView.updateProfileType(this._selectedProfileType, enab le); 600 this._launcherView.updateProfileType(this._selectedProfileType, enab le);
604 }, 601 },
605 602
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
1324 1321
1325 WebInspector.ProfilesPanelFactory.prototype = { 1322 WebInspector.ProfilesPanelFactory.prototype = {
1326 /** 1323 /**
1327 * @return {!WebInspector.Panel} 1324 * @return {!WebInspector.Panel}
1328 */ 1325 */
1329 createPanel: function() 1326 createPanel: function()
1330 { 1327 {
1331 return WebInspector.ProfilesPanel._instance(); 1328 return WebInspector.ProfilesPanel._instance();
1332 } 1329 }
1333 } 1330 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698