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

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

Issue 614323003: DevTools: enable by default disableAgentsWhenProfile experiment (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: small change 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 } else { 719 } else {
720 this._recording = true; 720 this._recording = true;
721 this._startFrameCapturing(); 721 this._startFrameCapturing();
722 } 722 }
723 return this._recording; 723 return this._recording;
724 }, 724 },
725 725
726 _runSingleFrameCapturing: function() 726 _runSingleFrameCapturing: function()
727 { 727 {
728 var frameId = this._selectedFrameId(); 728 var frameId = this._selectedFrameId();
729 WebInspector.profilingLock().acquire(); 729 WebInspector.targetManager.suspendAllTargets();
yurys 2014/10/15 14:07:34 Do we really need this call here?
loislo 2014/10/15 15:38:47 aandrey@ knows why it is needed.
aandrey 2014/10/15 18:14:06 It may take some time to capture a single frame to
730 CanvasAgent.captureFrame(frameId, this._didStartCapturingFrame.bind(this , frameId)); 730 CanvasAgent.captureFrame(frameId, this._didStartCapturingFrame.bind(this , frameId));
731 WebInspector.profilingLock().release(); 731 WebInspector.targetManager.resumeAllTargets();
732 }, 732 },
733 733
734 _startFrameCapturing: function() 734 _startFrameCapturing: function()
735 { 735 {
736 var frameId = this._selectedFrameId(); 736 var frameId = this._selectedFrameId();
737 WebInspector.profilingLock().acquire(); 737 WebInspector.targetManager.suspendAllTargets();
aandrey 2014/10/15 18:14:06 This name is misleading. You don't really *suspend
loislo 2014/10/16 09:08:22 It depends what you mean under name Target.
aandrey 2014/10/16 09:49:41 AFAIU, you disable few agents that may affect prof
738 CanvasAgent.startCapturing(frameId, this._didStartCapturingFrame.bind(th is, frameId)); 738 CanvasAgent.startCapturing(frameId, this._didStartCapturingFrame.bind(th is, frameId));
739 }, 739 },
740 740
741 _stopFrameCapturing: function() 741 _stopFrameCapturing: function()
742 { 742 {
743 if (!this._lastProfileHeader) { 743 if (!this._lastProfileHeader) {
744 WebInspector.profilingLock().release(); 744 WebInspector.targetManager.resumeAllTargets();
745 return; 745 return;
746 } 746 }
747 var profileHeader = this._lastProfileHeader; 747 var profileHeader = this._lastProfileHeader;
748 var traceLogId = profileHeader.traceLogId(); 748 var traceLogId = profileHeader.traceLogId();
749 this._lastProfileHeader = null; 749 this._lastProfileHeader = null;
750 function didStopCapturing() 750 function didStopCapturing()
751 { 751 {
752 profileHeader._updateCapturingStatus(); 752 profileHeader._updateCapturingStatus();
753 } 753 }
754 CanvasAgent.stopCapturing(traceLogId, didStopCapturing); 754 CanvasAgent.stopCapturing(traceLogId, didStopCapturing);
755 WebInspector.profilingLock().release(); 755 WebInspector.targetManager.resumeAllTargets();
756 }, 756 },
757 757
758 /** 758 /**
759 * @param {string|undefined} frameId 759 * @param {string|undefined} frameId
760 * @param {?Protocol.Error} error 760 * @param {?Protocol.Error} error
761 * @param {!CanvasAgent.TraceLogId} traceLogId 761 * @param {!CanvasAgent.TraceLogId} traceLogId
762 */ 762 */
763 _didStartCapturingFrame: function(frameId, error, traceLogId) 763 _didStartCapturingFrame: function(frameId, error, traceLogId)
764 { 764 {
765 if (error || this._lastProfileHeader && this._lastProfileHeader.traceLog Id() === traceLogId) 765 if (error || this._lastProfileHeader && this._lastProfileHeader.traceLog Id() === traceLogId)
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
1310 }, 1310 },
1311 1311
1312 clearResourceStates: function() 1312 clearResourceStates: function()
1313 { 1313 {
1314 this._currentResourceStates = {}; 1314 this._currentResourceStates = {};
1315 this.dispatchEventToListeners(WebInspector.CanvasTraceLogPlayerProxy.Eve nts.CanvasReplayStateChanged); 1315 this.dispatchEventToListeners(WebInspector.CanvasTraceLogPlayerProxy.Eve nts.CanvasReplayStateChanged);
1316 }, 1316 },
1317 1317
1318 __proto__: WebInspector.Object.prototype 1318 __proto__: WebInspector.Object.prototype
1319 } 1319 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698