OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 Loading... | |
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 areTargetsSuspended = WebInspector.targetManager.areTargetsSuspended (); |
aandrey
2014/10/15 18:14:06
nit: areTargetsSuspended -> allTargetsSuspended
ni
loislo
2014/10/16 09:08:22
Done.
| |
593 WebInspector.inspectorView.setCurrentPanelLocked(toggled); | 593 var enable = toggled || !areTargetsSuspended; |
yurys
2014/10/15 14:07:34
Should this be
toggled && !areTargetsSuspended ?
loislo
2014/10/15 15:38:47
we mark the button as enabled if no-one records a
| |
594 var isAcquiredInSomeTarget = WebInspector.profilingLock().isAcquired(); | |
595 var enable = toggled || !isAcquiredInSomeTarget; | |
596 this.recordButton.setEnabled(enable); | 594 this.recordButton.setEnabled(enable); |
597 this.recordButton.toggled = toggled; | 595 this.recordButton.toggled = toggled; |
598 if (enable) | 596 if (enable) |
599 this.recordButton.title = this._selectedProfileType ? this._selected ProfileType.buttonTooltip : ""; | 597 this.recordButton.title = this._selectedProfileType ? this._selected ProfileType.buttonTooltip : ""; |
600 else | 598 else |
601 this.recordButton.title = WebInspector.anotherProfilerActiveLabel(); | 599 this.recordButton.title = WebInspector.anotherProfilerActiveLabel(); |
602 if (this._selectedProfileType) | 600 if (this._selectedProfileType) |
603 this._launcherView.updateProfileType(this._selectedProfileType, enab le); | 601 this._launcherView.updateProfileType(this._selectedProfileType, enab le); |
604 }, | 602 }, |
605 | 603 |
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1324 | 1322 |
1325 WebInspector.ProfilesPanelFactory.prototype = { | 1323 WebInspector.ProfilesPanelFactory.prototype = { |
1326 /** | 1324 /** |
1327 * @return {!WebInspector.Panel} | 1325 * @return {!WebInspector.Panel} |
1328 */ | 1326 */ |
1329 createPanel: function() | 1327 createPanel: function() |
1330 { | 1328 { |
1331 return WebInspector.ProfilesPanel._instance(); | 1329 return WebInspector.ProfilesPanel._instance(); |
1332 } | 1330 } |
1333 } | 1331 } |
OLD | NEW |