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

Side by Side Diff: Source/devtools/front_end/sdk/TimelineManager.js

Issue 399043002: DevTools: switch Timeline frontend into buffered mode and remove the corresponding experiment. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: timeline-decode-resize was fixed? Created 6 years, 5 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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 /** 53 /**
54 * @return {boolean} 54 * @return {boolean}
55 */ 55 */
56 isStarted: function() 56 isStarted: function()
57 { 57 {
58 return this._dispatcher.isStarted(); 58 return this._dispatcher.isStarted();
59 }, 59 },
60 60
61 /** 61 /**
62 * @param {number=} maxCallStackDepth 62 * @param {number=} maxCallStackDepth
63 * @param {boolean=} bufferEvents
64 * @param {string=} liveEvents 63 * @param {string=} liveEvents
65 * @param {boolean=} includeCounters 64 * @param {boolean=} includeCounters
66 * @param {boolean=} includeGPUEvents 65 * @param {boolean=} includeGPUEvents
67 * @param {function(?Protocol.Error)=} callback 66 * @param {function(?Protocol.Error)=} callback
68 */ 67 */
69 start: function(maxCallStackDepth, bufferEvents, liveEvents, includeCounters , includeGPUEvents, callback) 68 start: function(maxCallStackDepth, liveEvents, includeCounters, includeGPUEv ents, callback)
70 { 69 {
71 this._enablementCount++; 70 this._enablementCount++;
72 this.target().profilingLock.acquire(); 71 this.target().profilingLock.acquire();
73 if (WebInspector.experimentsSettings.timelineJSCPUProfile.isEnabled() && maxCallStackDepth) { 72 if (WebInspector.experimentsSettings.timelineJSCPUProfile.isEnabled() && maxCallStackDepth) {
74 this._configureCpuProfilerSamplingInterval(); 73 this._configureCpuProfilerSamplingInterval();
75 this._jsProfilerStarted = true; 74 this._jsProfilerStarted = true;
76 this.target().profilerAgent().start(); 75 this.target().profilerAgent().start();
77 } 76 }
78 if (this._enablementCount === 1) 77 if (this._enablementCount === 1)
79 this.target().timelineAgent().start(maxCallStackDepth, bufferEvents, liveEvents, includeCounters, includeGPUEvents, callback); 78 this.target().timelineAgent().start(maxCallStackDepth, true, liveEve nts, includeCounters, includeGPUEvents, callback);
80 else if (callback) 79 else if (callback)
81 callback(null); 80 callback(null);
82 }, 81 },
83 82
84 /** 83 /**
85 * @param {function(?Protocol.Error,?ProfilerAgent.CPUProfile)} callback 84 * @param {function(?Protocol.Error,?ProfilerAgent.CPUProfile)} callback
86 */ 85 */
87 stop: function(callback) 86 stop: function(callback)
88 { 87 {
89 this._enablementCount--; 88 this._enablementCount--;
90 if (this._enablementCount < 0) { 89 if (this._enablementCount < 0) {
91 console.error("WebInspector.TimelineManager start/stop calls are unb alanced " + new Error().stack); 90 console.error("WebInspector.TimelineManager start/stop calls are unb alanced " + new Error().stack);
92 return; 91 return;
93 } 92 }
94 93
95 var masterError = null; 94 var masterError = null;
96 var masterProfile = null; 95 var masterProfile = null;
97 var callbackBarrier = new CallbackBarrier(); 96 var callbackBarrier = new CallbackBarrier();
98 97
99 if (this._jsProfilerStarted) { 98 if (this._jsProfilerStarted) {
100 this.target().profilerAgent().stop(callbackBarrier.createCallback(pr ofilerCallback)); 99 this.target().profilerAgent().stop(callbackBarrier.createCallback(pr ofilerCallback));
101 this._jsProfilerStarted = false; 100 this._jsProfilerStarted = false;
102 } 101 }
103 if (!this._enablementCount) 102 if (!this._enablementCount)
104 this.target().timelineAgent().stop(callbackBarrier.createCallback(ti melineCallback)); 103 this.target().timelineAgent().stop(callbackBarrier.createCallback(ti melineCallback));
105 TimelineAgent.stop(callbackBarrier.createCallback(timelineCallback)) ;
106 104
107 callbackBarrier.callWhenDone(allDoneCallback.bind(this)); 105 callbackBarrier.callWhenDone(allDoneCallback.bind(this));
108 106
109 /** 107 /**
110 * @param {?Protocol.Error} error 108 * @param {?Protocol.Error} error
111 */ 109 */
112 function timelineCallback(error) 110 function timelineCallback(error)
113 { 111 {
114 masterError = masterError || error; 112 masterError = masterError || error;
115 } 113 }
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 }, 210 },
213 211
214 /** 212 /**
215 * @param {number} count 213 * @param {number} count
216 */ 214 */
217 progress: function(count) 215 progress: function(count)
218 { 216 {
219 this._manager.dispatchEventToListeners(WebInspector.TimelineManager.Even tTypes.TimelineProgress, count); 217 this._manager.dispatchEventToListeners(WebInspector.TimelineManager.Even tTypes.TimelineProgress, count);
220 } 218 }
221 } 219 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698