| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** @typedef {!{range: !Protocol.CSS.SourceRange, styleSheetId: !Protocol.CSS.St
yleSheetId, wasUsed: boolean}} */ | 5 /** @typedef {!{range: !Protocol.CSS.SourceRange, styleSheetId: !Protocol.CSS.St
yleSheetId, wasUsed: boolean}} */ |
| 6 WebInspector.CSSModel.RuleUsage; | 6 SDK.CSSModel.RuleUsage; |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * @implements {WebInspector.TargetManager.Observer} | 9 * @implements {SDK.TargetManager.Observer} |
| 10 * @implements {WebInspector.TracingManagerClient} | 10 * @implements {SDK.TracingManagerClient} |
| 11 * @unrestricted | 11 * @unrestricted |
| 12 */ | 12 */ |
| 13 WebInspector.TimelineController = class { | 13 Timeline.TimelineController = class { |
| 14 /** | 14 /** |
| 15 * @param {!WebInspector.Target} target | 15 * @param {!SDK.Target} target |
| 16 * @param {!WebInspector.TimelineLifecycleDelegate} delegate | 16 * @param {!Timeline.TimelineLifecycleDelegate} delegate |
| 17 * @param {!WebInspector.TracingModel} tracingModel | 17 * @param {!SDK.TracingModel} tracingModel |
| 18 */ | 18 */ |
| 19 constructor(target, delegate, tracingModel) { | 19 constructor(target, delegate, tracingModel) { |
| 20 this._delegate = delegate; | 20 this._delegate = delegate; |
| 21 this._target = target; | 21 this._target = target; |
| 22 this._tracingModel = tracingModel; | 22 this._tracingModel = tracingModel; |
| 23 this._targets = []; | 23 this._targets = []; |
| 24 WebInspector.targetManager.observeTargets(this); | 24 SDK.targetManager.observeTargets(this); |
| 25 | 25 |
| 26 if (Runtime.experiments.isEnabled('timelineRuleUsageRecording')) | 26 if (Runtime.experiments.isEnabled('timelineRuleUsageRecording')) |
| 27 this._markUnusedCSS = WebInspector.settings.createSetting('timelineMarkUnu
sedCSS', false); | 27 this._markUnusedCSS = Common.settings.createSetting('timelineMarkUnusedCSS
', false); |
| 28 } | 28 } |
| 29 | 29 |
| 30 /** | 30 /** |
| 31 * @param {boolean} captureCauses | 31 * @param {boolean} captureCauses |
| 32 * @param {boolean} enableJSSampling | 32 * @param {boolean} enableJSSampling |
| 33 * @param {boolean} captureMemory | 33 * @param {boolean} captureMemory |
| 34 * @param {boolean} capturePictures | 34 * @param {boolean} capturePictures |
| 35 * @param {boolean} captureFilmStrip | 35 * @param {boolean} captureFilmStrip |
| 36 */ | 36 */ |
| 37 startRecording(captureCauses, enableJSSampling, captureMemory, capturePictures
, captureFilmStrip) { | 37 startRecording(captureCauses, enableJSSampling, captureMemory, capturePictures
, captureFilmStrip) { |
| 38 this._extensionTraceProviders = WebInspector.extensionServer.traceProviders(
).slice(); | 38 this._extensionTraceProviders = Extensions.extensionServer.traceProviders().
slice(); |
| 39 | 39 |
| 40 function disabledByDefault(category) { | 40 function disabledByDefault(category) { |
| 41 return 'disabled-by-default-' + category; | 41 return 'disabled-by-default-' + category; |
| 42 } | 42 } |
| 43 var categoriesArray = [ | 43 var categoriesArray = [ |
| 44 '-*', 'devtools.timeline', 'v8.execute', disabledByDefault('devtools.timel
ine'), | 44 '-*', 'devtools.timeline', 'v8.execute', disabledByDefault('devtools.timel
ine'), |
| 45 disabledByDefault('devtools.timeline.frame'), WebInspector.TracingModel.To
pLevelEventCategory, | 45 disabledByDefault('devtools.timeline.frame'), SDK.TracingModel.TopLevelEve
ntCategory, |
| 46 WebInspector.TimelineModel.Category.Console, WebInspector.TimelineModel.Ca
tegory.UserTiming | 46 TimelineModel.TimelineModel.Category.Console, TimelineModel.TimelineModel.
Category.UserTiming |
| 47 ]; | 47 ]; |
| 48 categoriesArray.push(WebInspector.TimelineModel.Category.LatencyInfo); | 48 categoriesArray.push(TimelineModel.TimelineModel.Category.LatencyInfo); |
| 49 | 49 |
| 50 if (Runtime.experiments.isEnabled('timelineFlowEvents')) { | 50 if (Runtime.experiments.isEnabled('timelineFlowEvents')) { |
| 51 categoriesArray.push(disabledByDefault('toplevel.flow'), disabledByDefault
('ipc.flow')); | 51 categoriesArray.push(disabledByDefault('toplevel.flow'), disabledByDefault
('ipc.flow')); |
| 52 } | 52 } |
| 53 if (Runtime.experiments.isEnabled('timelineV8RuntimeCallStats') && enableJSS
ampling) | 53 if (Runtime.experiments.isEnabled('timelineV8RuntimeCallStats') && enableJSS
ampling) |
| 54 categoriesArray.push(disabledByDefault('v8.runtime_stats_sampling')); | 54 categoriesArray.push(disabledByDefault('v8.runtime_stats_sampling')); |
| 55 if (Runtime.experiments.isEnabled('timelineTracingJSProfile') && enableJSSam
pling) { | 55 if (Runtime.experiments.isEnabled('timelineTracingJSProfile') && enableJSSam
pling) { |
| 56 categoriesArray.push(disabledByDefault('v8.cpu_profiler')); | 56 categoriesArray.push(disabledByDefault('v8.cpu_profiler')); |
| 57 if (WebInspector.moduleSetting('highResolutionCpuProfiling').get()) | 57 if (Common.moduleSetting('highResolutionCpuProfiling').get()) |
| 58 categoriesArray.push(disabledByDefault('v8.cpu_profiler.hires')); | 58 categoriesArray.push(disabledByDefault('v8.cpu_profiler.hires')); |
| 59 } | 59 } |
| 60 if (captureCauses || enableJSSampling) | 60 if (captureCauses || enableJSSampling) |
| 61 categoriesArray.push(disabledByDefault('devtools.timeline.stack')); | 61 categoriesArray.push(disabledByDefault('devtools.timeline.stack')); |
| 62 if (captureCauses && Runtime.experiments.isEnabled('timelineInvalidationTrac
king')) | 62 if (captureCauses && Runtime.experiments.isEnabled('timelineInvalidationTrac
king')) |
| 63 categoriesArray.push(disabledByDefault('devtools.timeline.invalidationTrac
king')); | 63 categoriesArray.push(disabledByDefault('devtools.timeline.invalidationTrac
king')); |
| 64 if (capturePictures) { | 64 if (capturePictures) { |
| 65 categoriesArray.push( | 65 categoriesArray.push( |
| 66 disabledByDefault('devtools.timeline.layers'), disabledByDefault('devt
ools.timeline.picture'), | 66 disabledByDefault('devtools.timeline.layers'), disabledByDefault('devt
ools.timeline.picture'), |
| 67 disabledByDefault('blink.graphics_context_annotations')); | 67 disabledByDefault('blink.graphics_context_annotations')); |
| 68 } | 68 } |
| 69 if (captureFilmStrip) | 69 if (captureFilmStrip) |
| 70 categoriesArray.push(disabledByDefault('devtools.screenshot')); | 70 categoriesArray.push(disabledByDefault('devtools.screenshot')); |
| 71 | 71 |
| 72 for (var traceProvider of this._extensionTraceProviders) | 72 for (var traceProvider of this._extensionTraceProviders) |
| 73 traceProvider.start(); | 73 traceProvider.start(); |
| 74 | 74 |
| 75 var categories = categoriesArray.join(','); | 75 var categories = categoriesArray.join(','); |
| 76 this._startRecordingWithCategories(categories, enableJSSampling); | 76 this._startRecordingWithCategories(categories, enableJSSampling); |
| 77 } | 77 } |
| 78 | 78 |
| 79 stopRecording() { | 79 stopRecording() { |
| 80 var tracingStoppedPromises = []; | 80 var tracingStoppedPromises = []; |
| 81 tracingStoppedPromises.push(new Promise(resolve => this._tracingCompleteCall
back = resolve)); | 81 tracingStoppedPromises.push(new Promise(resolve => this._tracingCompleteCall
back = resolve)); |
| 82 tracingStoppedPromises.push(this._stopProfilingOnAllTargets()); | 82 tracingStoppedPromises.push(this._stopProfilingOnAllTargets()); |
| 83 this._target.tracingManager.stop(); | 83 this._target.tracingManager.stop(); |
| 84 | 84 |
| 85 if (!Runtime.experiments.isEnabled('timelineRuleUsageRecording') || !this._m
arkUnusedCSS.get()) | 85 if (!Runtime.experiments.isEnabled('timelineRuleUsageRecording') || !this._m
arkUnusedCSS.get()) |
| 86 tracingStoppedPromises.push(WebInspector.targetManager.resumeAllTargets())
; | 86 tracingStoppedPromises.push(SDK.targetManager.resumeAllTargets()); |
| 87 else | 87 else |
| 88 this._addUnusedRulesToCoverage(); | 88 this._addUnusedRulesToCoverage(); |
| 89 | 89 |
| 90 Promise.all(tracingStoppedPromises).then(() => this._allSourcesFinished()); | 90 Promise.all(tracingStoppedPromises).then(() => this._allSourcesFinished()); |
| 91 | 91 |
| 92 this._delegate.loadingStarted(); | 92 this._delegate.loadingStarted(); |
| 93 | 93 |
| 94 for (var traceProvider of this._extensionTraceProviders) | 94 for (var traceProvider of this._extensionTraceProviders) |
| 95 traceProvider.stop(); | 95 traceProvider.stop(); |
| 96 } | 96 } |
| 97 | 97 |
| 98 /** | 98 /** |
| 99 * @override | 99 * @override |
| 100 * @param {!WebInspector.Target} target | 100 * @param {!SDK.Target} target |
| 101 */ | 101 */ |
| 102 targetAdded(target) { | 102 targetAdded(target) { |
| 103 this._targets.push(target); | 103 this._targets.push(target); |
| 104 if (this._profiling) | 104 if (this._profiling) |
| 105 this._startProfilingOnTarget(target); | 105 this._startProfilingOnTarget(target); |
| 106 } | 106 } |
| 107 | 107 |
| 108 /** | 108 /** |
| 109 * @override | 109 * @override |
| 110 * @param {!WebInspector.Target} target | 110 * @param {!SDK.Target} target |
| 111 */ | 111 */ |
| 112 targetRemoved(target) { | 112 targetRemoved(target) { |
| 113 this._targets.remove(target, true); | 113 this._targets.remove(target, true); |
| 114 // FIXME: We'd like to stop profiling on the target and retrieve a profile | 114 // FIXME: We'd like to stop profiling on the target and retrieve a profile |
| 115 // but it's too late. Backend connection is closed. | 115 // but it's too late. Backend connection is closed. |
| 116 } | 116 } |
| 117 | 117 |
| 118 _addUnusedRulesToCoverage() { | 118 _addUnusedRulesToCoverage() { |
| 119 var mainTarget = WebInspector.targetManager.mainTarget(); | 119 var mainTarget = SDK.targetManager.mainTarget(); |
| 120 if (!mainTarget) | 120 if (!mainTarget) |
| 121 return; | 121 return; |
| 122 var cssModel = WebInspector.CSSModel.fromTarget(mainTarget); | 122 var cssModel = SDK.CSSModel.fromTarget(mainTarget); |
| 123 | 123 |
| 124 /** | 124 /** |
| 125 * @param {!Array<!WebInspector.CSSModel.RuleUsage>} ruleUsageList | 125 * @param {!Array<!SDK.CSSModel.RuleUsage>} ruleUsageList |
| 126 */ | 126 */ |
| 127 function ruleListReceived(ruleUsageList) { | 127 function ruleListReceived(ruleUsageList) { |
| 128 | 128 |
| 129 for (var rule of ruleUsageList) { | 129 for (var rule of ruleUsageList) { |
| 130 if (rule.wasUsed) | 130 if (rule.wasUsed) |
| 131 continue; | 131 continue; |
| 132 | 132 |
| 133 var styleSheetHeader = cssModel.styleSheetHeaderForId(rule.styleSheetId)
; | 133 var styleSheetHeader = cssModel.styleSheetHeaderForId(rule.styleSheetId)
; |
| 134 var url = styleSheetHeader.sourceURL; | 134 var url = styleSheetHeader.sourceURL; |
| 135 | 135 |
| 136 WebInspector.CoverageProfile.instance().appendUnusedRule(url, rule.range
); | 136 Components.CoverageProfile.instance().appendUnusedRule(url, rule.range); |
| 137 } | 137 } |
| 138 } | 138 } |
| 139 | 139 |
| 140 cssModel.ruleListPromise().then(ruleListReceived); | 140 cssModel.ruleListPromise().then(ruleListReceived); |
| 141 } | 141 } |
| 142 | 142 |
| 143 /** | 143 /** |
| 144 * @param {!WebInspector.Target} target | 144 * @param {!SDK.Target} target |
| 145 * @return {!Promise} | 145 * @return {!Promise} |
| 146 */ | 146 */ |
| 147 _startProfilingOnTarget(target) { | 147 _startProfilingOnTarget(target) { |
| 148 return target.hasJSCapability() ? target.profilerAgent().start() : Promise.r
esolve(); | 148 return target.hasJSCapability() ? target.profilerAgent().start() : Promise.r
esolve(); |
| 149 } | 149 } |
| 150 | 150 |
| 151 /** | 151 /** |
| 152 * @return {!Promise} | 152 * @return {!Promise} |
| 153 */ | 153 */ |
| 154 _startProfilingOnAllTargets() { | 154 _startProfilingOnAllTargets() { |
| 155 var intervalUs = WebInspector.moduleSetting('highResolutionCpuProfiling').ge
t() ? 100 : 1000; | 155 var intervalUs = Common.moduleSetting('highResolutionCpuProfiling').get() ?
100 : 1000; |
| 156 this._target.profilerAgent().setSamplingInterval(intervalUs); | 156 this._target.profilerAgent().setSamplingInterval(intervalUs); |
| 157 this._profiling = true; | 157 this._profiling = true; |
| 158 return Promise.all(this._targets.map(this._startProfilingOnTarget)); | 158 return Promise.all(this._targets.map(this._startProfilingOnTarget)); |
| 159 } | 159 } |
| 160 | 160 |
| 161 /** | 161 /** |
| 162 * @param {!WebInspector.Target} target | 162 * @param {!SDK.Target} target |
| 163 * @return {!Promise} | 163 * @return {!Promise} |
| 164 */ | 164 */ |
| 165 _stopProfilingOnTarget(target) { | 165 _stopProfilingOnTarget(target) { |
| 166 return target.hasJSCapability() ? target.profilerAgent().stop(this._addCpuPr
ofile.bind(this, target.id())) : | 166 return target.hasJSCapability() ? target.profilerAgent().stop(this._addCpuPr
ofile.bind(this, target.id())) : |
| 167 Promise.resolve(); | 167 Promise.resolve(); |
| 168 } | 168 } |
| 169 | 169 |
| 170 /** | 170 /** |
| 171 * @param {number} targetId | 171 * @param {number} targetId |
| 172 * @param {?Protocol.Error} error | 172 * @param {?Protocol.Error} error |
| 173 * @param {?Protocol.Profiler.Profile} cpuProfile | 173 * @param {?Protocol.Profiler.Profile} cpuProfile |
| 174 */ | 174 */ |
| 175 _addCpuProfile(targetId, error, cpuProfile) { | 175 _addCpuProfile(targetId, error, cpuProfile) { |
| 176 if (!cpuProfile) { | 176 if (!cpuProfile) { |
| 177 WebInspector.console.warn(WebInspector.UIString('CPU profile for a target
is not available. %s', error || '')); | 177 Common.console.warn(Common.UIString('CPU profile for a target is not avail
able. %s', error || '')); |
| 178 return; | 178 return; |
| 179 } | 179 } |
| 180 if (!this._cpuProfiles) | 180 if (!this._cpuProfiles) |
| 181 this._cpuProfiles = new Map(); | 181 this._cpuProfiles = new Map(); |
| 182 this._cpuProfiles.set(targetId, cpuProfile); | 182 this._cpuProfiles.set(targetId, cpuProfile); |
| 183 } | 183 } |
| 184 | 184 |
| 185 /** | 185 /** |
| 186 * @return {!Promise} | 186 * @return {!Promise} |
| 187 */ | 187 */ |
| 188 _stopProfilingOnAllTargets() { | 188 _stopProfilingOnAllTargets() { |
| 189 var targets = this._profiling ? this._targets : []; | 189 var targets = this._profiling ? this._targets : []; |
| 190 this._profiling = false; | 190 this._profiling = false; |
| 191 return Promise.all(targets.map(this._stopProfilingOnTarget, this)); | 191 return Promise.all(targets.map(this._stopProfilingOnTarget, this)); |
| 192 } | 192 } |
| 193 | 193 |
| 194 /** | 194 /** |
| 195 * @param {string} categories | 195 * @param {string} categories |
| 196 * @param {boolean=} enableJSSampling | 196 * @param {boolean=} enableJSSampling |
| 197 * @param {function(?string)=} callback | 197 * @param {function(?string)=} callback |
| 198 */ | 198 */ |
| 199 _startRecordingWithCategories(categories, enableJSSampling, callback) { | 199 _startRecordingWithCategories(categories, enableJSSampling, callback) { |
| 200 | 200 |
| 201 if (!Runtime.experiments.isEnabled('timelineRuleUsageRecording') || !this._m
arkUnusedCSS.get()) | 201 if (!Runtime.experiments.isEnabled('timelineRuleUsageRecording') || !this._m
arkUnusedCSS.get()) |
| 202 WebInspector.targetManager.suspendAllTargets(); | 202 SDK.targetManager.suspendAllTargets(); |
| 203 | 203 |
| 204 var profilingStartedPromise = enableJSSampling && !Runtime.experiments.isEna
bled('timelineTracingJSProfile') ? | 204 var profilingStartedPromise = enableJSSampling && !Runtime.experiments.isEna
bled('timelineTracingJSProfile') ? |
| 205 this._startProfilingOnAllTargets() : | 205 this._startProfilingOnAllTargets() : |
| 206 Promise.resolve(); | 206 Promise.resolve(); |
| 207 var samplingFrequencyHz = WebInspector.moduleSetting('highResolutionCpuProfi
ling').get() ? 10000 : 1000; | 207 var samplingFrequencyHz = Common.moduleSetting('highResolutionCpuProfiling')
.get() ? 10000 : 1000; |
| 208 var options = 'sampling-frequency=' + samplingFrequencyHz; | 208 var options = 'sampling-frequency=' + samplingFrequencyHz; |
| 209 var target = this._target; | 209 var target = this._target; |
| 210 var tracingManager = target.tracingManager; | 210 var tracingManager = target.tracingManager; |
| 211 WebInspector.targetManager.suspendReload(target); | 211 SDK.targetManager.suspendReload(target); |
| 212 profilingStartedPromise.then(tracingManager.start.bind(tracingManager, this,
categories, options, onTraceStarted)); | 212 profilingStartedPromise.then(tracingManager.start.bind(tracingManager, this,
categories, options, onTraceStarted)); |
| 213 /** | 213 /** |
| 214 * @param {?string} error | 214 * @param {?string} error |
| 215 */ | 215 */ |
| 216 function onTraceStarted(error) { | 216 function onTraceStarted(error) { |
| 217 WebInspector.targetManager.resumeReload(target); | 217 SDK.targetManager.resumeReload(target); |
| 218 if (callback) | 218 if (callback) |
| 219 callback(error); | 219 callback(error); |
| 220 } | 220 } |
| 221 } | 221 } |
| 222 | 222 |
| 223 /** | 223 /** |
| 224 * @override | 224 * @override |
| 225 */ | 225 */ |
| 226 tracingStarted() { | 226 tracingStarted() { |
| 227 this._tracingModel.reset(); | 227 this._tracingModel.reset(); |
| 228 this._delegate.recordingStarted(); | 228 this._delegate.recordingStarted(); |
| 229 } | 229 } |
| 230 | 230 |
| 231 /** | 231 /** |
| 232 * @param {!Array.<!WebInspector.TracingManager.EventPayload>} events | 232 * @param {!Array.<!SDK.TracingManager.EventPayload>} events |
| 233 * @override | 233 * @override |
| 234 */ | 234 */ |
| 235 traceEventsCollected(events) { | 235 traceEventsCollected(events) { |
| 236 this._tracingModel.addEvents(events); | 236 this._tracingModel.addEvents(events); |
| 237 } | 237 } |
| 238 | 238 |
| 239 /** | 239 /** |
| 240 * @override | 240 * @override |
| 241 */ | 241 */ |
| 242 tracingComplete() { | 242 tracingComplete() { |
| 243 this._tracingCompleteCallback(); | 243 this._tracingCompleteCallback(); |
| 244 this._tracingCompleteCallback = null; | 244 this._tracingCompleteCallback = null; |
| 245 } | 245 } |
| 246 | 246 |
| 247 _allSourcesFinished() { | 247 _allSourcesFinished() { |
| 248 this._injectCpuProfileEvents(); | 248 this._injectCpuProfileEvents(); |
| 249 this._tracingModel.tracingComplete(); | 249 this._tracingModel.tracingComplete(); |
| 250 this._delegate.loadingComplete(true); | 250 this._delegate.loadingComplete(true); |
| 251 } | 251 } |
| 252 | 252 |
| 253 /** | 253 /** |
| 254 * @param {number} pid | 254 * @param {number} pid |
| 255 * @param {number} tid | 255 * @param {number} tid |
| 256 * @param {?Protocol.Profiler.Profile} cpuProfile | 256 * @param {?Protocol.Profiler.Profile} cpuProfile |
| 257 */ | 257 */ |
| 258 _injectCpuProfileEvent(pid, tid, cpuProfile) { | 258 _injectCpuProfileEvent(pid, tid, cpuProfile) { |
| 259 if (!cpuProfile) | 259 if (!cpuProfile) |
| 260 return; | 260 return; |
| 261 var cpuProfileEvent = /** @type {!WebInspector.TracingManager.EventPayload}
*/ ({ | 261 var cpuProfileEvent = /** @type {!SDK.TracingManager.EventPayload} */ ({ |
| 262 cat: WebInspector.TracingModel.DevToolsMetadataEventCategory, | 262 cat: SDK.TracingModel.DevToolsMetadataEventCategory, |
| 263 ph: WebInspector.TracingModel.Phase.Instant, | 263 ph: SDK.TracingModel.Phase.Instant, |
| 264 ts: this._tracingModel.maximumRecordTime() * 1000, | 264 ts: this._tracingModel.maximumRecordTime() * 1000, |
| 265 pid: pid, | 265 pid: pid, |
| 266 tid: tid, | 266 tid: tid, |
| 267 name: WebInspector.TimelineModel.RecordType.CpuProfile, | 267 name: TimelineModel.TimelineModel.RecordType.CpuProfile, |
| 268 args: {data: {cpuProfile: cpuProfile}} | 268 args: {data: {cpuProfile: cpuProfile}} |
| 269 }); | 269 }); |
| 270 this._tracingModel.addEvents([cpuProfileEvent]); | 270 this._tracingModel.addEvents([cpuProfileEvent]); |
| 271 } | 271 } |
| 272 | 272 |
| 273 _injectCpuProfileEvents() { | 273 _injectCpuProfileEvents() { |
| 274 if (!this._cpuProfiles) | 274 if (!this._cpuProfiles) |
| 275 return; | 275 return; |
| 276 | 276 |
| 277 var metadataEventTypes = WebInspector.TimelineModel.DevToolsMetadataEvent; | 277 var metadataEventTypes = TimelineModel.TimelineModel.DevToolsMetadataEvent; |
| 278 var metadataEvents = this._tracingModel.devToolsMetadataEvents(); | 278 var metadataEvents = this._tracingModel.devToolsMetadataEvents(); |
| 279 var mainMetaEvent = | 279 var mainMetaEvent = |
| 280 metadataEvents.filter(event => event.name === metadataEventTypes.Tracing
StartedInPage).peekLast(); | 280 metadataEvents.filter(event => event.name === metadataEventTypes.Tracing
StartedInPage).peekLast(); |
| 281 if (!mainMetaEvent) | 281 if (!mainMetaEvent) |
| 282 return; | 282 return; |
| 283 | 283 |
| 284 var pid = mainMetaEvent.thread.process().id(); | 284 var pid = mainMetaEvent.thread.process().id(); |
| 285 var mainCpuProfile = this._cpuProfiles.get(this._target.id()); | 285 var mainCpuProfile = this._cpuProfiles.get(this._target.id()); |
| 286 this._injectCpuProfileEvent(pid, mainMetaEvent.thread.id(), mainCpuProfile); | 286 this._injectCpuProfileEvent(pid, mainMetaEvent.thread.id(), mainCpuProfile); |
| 287 | 287 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 306 } | 306 } |
| 307 | 307 |
| 308 /** | 308 /** |
| 309 * @param {number} progress | 309 * @param {number} progress |
| 310 * @override | 310 * @override |
| 311 */ | 311 */ |
| 312 eventsRetrievalProgress(progress) { | 312 eventsRetrievalProgress(progress) { |
| 313 this._delegate.loadingProgress(progress); | 313 this._delegate.loadingProgress(progress); |
| 314 } | 314 } |
| 315 }; | 315 }; |
| OLD | NEW |