| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2012 Intel Inc. All rights reserved. | 3 * Copyright (C) 2012 Intel Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 _setUIControlsEnabled(enabled) { | 537 _setUIControlsEnabled(enabled) { |
| 538 this._recordingOptionUIControls.forEach(control => control.setEnabled(enable
d)); | 538 this._recordingOptionUIControls.forEach(control => control.setEnabled(enable
d)); |
| 539 } | 539 } |
| 540 | 540 |
| 541 /** | 541 /** |
| 542 * @param {boolean} userInitiated | 542 * @param {boolean} userInitiated |
| 543 * @return {!Promise} | 543 * @return {!Promise} |
| 544 */ | 544 */ |
| 545 _startRecording(userInitiated) { | 545 _startRecording(userInitiated) { |
| 546 console.assert(!this._statusPane, 'Status pane is already opened.'); | 546 console.assert(!this._statusPane, 'Status pane is already opened.'); |
| 547 var mainTarget = SDK.targetManager.mainTarget(); | 547 var tracingManagers = SDK.targetManager.models(SDK.TracingManager); |
| 548 if (!mainTarget) | 548 if (!tracingManagers.length) |
| 549 return Promise.resolve(); | 549 return Promise.resolve(); |
| 550 this._setState(Timeline.TimelinePanel.State.StartPending); | 550 this._setState(Timeline.TimelinePanel.State.StartPending); |
| 551 this._showRecordingStarted(); | 551 this._showRecordingStarted(); |
| 552 | 552 |
| 553 this._autoRecordGeneration = userInitiated ? null : Symbol('Generation'); | 553 this._autoRecordGeneration = userInitiated ? null : Symbol('Generation'); |
| 554 var enabledTraceProviders = Extensions.extensionServer.traceProviders().filt
er( | 554 var enabledTraceProviders = Extensions.extensionServer.traceProviders().filt
er( |
| 555 provider => Timeline.TimelinePanel._settingForTraceProvider(provider).ge
t()); | 555 provider => Timeline.TimelinePanel._settingForTraceProvider(provider).ge
t()); |
| 556 | 556 |
| 557 const recordingOptions = { | 557 const recordingOptions = { |
| 558 enableJSSampling: !this._disableCaptureJSProfileSetting.get(), | 558 enableJSSampling: !this._disableCaptureJSProfileSetting.get(), |
| 559 capturePictures: this._captureLayersAndPicturesSetting.get(), | 559 capturePictures: this._captureLayersAndPicturesSetting.get(), |
| 560 captureFilmStrip: this._showScreenshotsSetting.get() | 560 captureFilmStrip: this._showScreenshotsSetting.get() |
| 561 }; | 561 }; |
| 562 | 562 |
| 563 this._pendingPerformanceModel = new Timeline.PerformanceModel(); | 563 this._pendingPerformanceModel = new Timeline.PerformanceModel(); |
| 564 this._controller = new Timeline.TimelineController(mainTarget, this._pending
PerformanceModel, this); | 564 this._controller = new Timeline.TimelineController(tracingManagers[0], this.
_pendingPerformanceModel, this); |
| 565 Host.userMetrics.actionTaken( | 565 Host.userMetrics.actionTaken( |
| 566 userInitiated ? Host.UserMetrics.Action.TimelineStarted : Host.UserMetri
cs.Action.TimelinePageReloadStarted); | 566 userInitiated ? Host.UserMetrics.Action.TimelineStarted : Host.UserMetri
cs.Action.TimelinePageReloadStarted); |
| 567 this._setUIControlsEnabled(false); | 567 this._setUIControlsEnabled(false); |
| 568 this._hideLandingPage(); | 568 this._hideLandingPage(); |
| 569 return this._controller.startRecording(recordingOptions, enabledTraceProvide
rs) | 569 return this._controller.startRecording(recordingOptions, enabledTraceProvide
rs) |
| 570 .then(() => this._recordingStarted()); | 570 .then(() => this._recordingStarted()); |
| 571 } | 571 } |
| 572 | 572 |
| 573 _stopRecording() { | 573 _stopRecording() { |
| 574 if (this._statusPane) { | 574 if (this._statusPane) { |
| (...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1339 return true; | 1339 return true; |
| 1340 case 'timeline.jump-to-next-frame': | 1340 case 'timeline.jump-to-next-frame': |
| 1341 panel._jumpToFrame(1); | 1341 panel._jumpToFrame(1); |
| 1342 return true; | 1342 return true; |
| 1343 } | 1343 } |
| 1344 return false; | 1344 return false; |
| 1345 } | 1345 } |
| 1346 }; | 1346 }; |
| 1347 | 1347 |
| 1348 Timeline.TimelinePanel._traceProviderSettingSymbol = Symbol('traceProviderSettin
g'); | 1348 Timeline.TimelinePanel._traceProviderSettingSymbol = Symbol('traceProviderSettin
g'); |
| OLD | NEW |