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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js

Issue 2608043002: DevTools: extract modules (with extensions) (Closed)
Patch Set: fix externs (PerfUI) Created 3 years, 11 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
OLDNEW
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 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 provider => Timeline.TimelinePanel._settingForTraceProvider(provider).ge t()); 546 provider => Timeline.TimelinePanel._settingForTraceProvider(provider).ge t());
547 547
548 const recordingOptions = this._landingPage.recordingOptions(); 548 const recordingOptions = this._landingPage.recordingOptions();
549 this._controller = new Timeline.TimelineController(mainTarget, this, this._t racingModel); 549 this._controller = new Timeline.TimelineController(mainTarget, this, this._t racingModel);
550 this._controller.startRecording(recordingOptions, enabledTraceProviders); 550 this._controller.startRecording(recordingOptions, enabledTraceProviders);
551 this._recordingStartTime = Date.now(); 551 this._recordingStartTime = Date.now();
552 552
553 for (var i = 0; i < this._overviewControls.length; ++i) 553 for (var i = 0; i < this._overviewControls.length; ++i)
554 this._overviewControls[i].timelineStarted(); 554 this._overviewControls[i].timelineStarted();
555 555
556 Host.userMetrics.actionTaken(userInitiated ? Host.UserMetrics.Action.Timelin eStarted : Host.UserMetrics.Action.TimelinePageReloadStarted); 556 Host.userMetrics.actionTaken(
557 userInitiated ? Host.UserMetrics.Action.TimelineStarted : Host.UserMetri cs.Action.TimelinePageReloadStarted);
557 this._setUIControlsEnabled(false); 558 this._setUIControlsEnabled(false);
558 this._hideLandingPage(); 559 this._hideLandingPage();
559 } 560 }
560 561
561 _stopRecording() { 562 _stopRecording() {
562 if (this._statusPane) { 563 if (this._statusPane) {
563 this._statusPane.finish(); 564 this._statusPane.finish();
564 this._statusPane.updateStatus(Common.UIString('Stopping timeline\u2026')); 565 this._statusPane.updateStatus(Common.UIString('Stopping timeline\u2026'));
565 this._statusPane.updateProgressBar(Common.UIString('Received'), 0); 566 this._statusPane.updateProgressBar(Common.UIString('Received'), 0);
566 } 567 }
(...skipping 26 matching lines...) Expand all
593 _clear() { 594 _clear() {
594 this._showLandingPage(); 595 this._showLandingPage();
595 this._detailsSplitWidget.hideSidebar(); 596 this._detailsSplitWidget.hideSidebar();
596 this._sessionGeneration = null; 597 this._sessionGeneration = null;
597 this._recordingStartTime = 0; 598 this._recordingStartTime = 0;
598 this._reset(); 599 this._reset();
599 this._recreateToolbarItems(); 600 this._recreateToolbarItems();
600 } 601 }
601 602
602 _reset() { 603 _reset() {
603 Components.LineLevelProfile.instance().reset(); 604 PerfUI.LineLevelProfile.instance().reset();
604 this._tracingModel.reset(); 605 this._tracingModel.reset();
605 this._model.reset(); 606 this._model.reset();
606 for (let extensionEntry of this._extensionTracingModels) 607 for (let extensionEntry of this._extensionTracingModels)
607 extensionEntry.model.reset(); 608 extensionEntry.model.reset();
608 this._extensionTracingModels.splice(0); 609 this._extensionTracingModels.splice(0);
609 610
610 this.requestWindowTimes(0, Infinity); 611 this.requestWindowTimes(0, Infinity);
611 delete this._selection; 612 delete this._selection;
612 this._frameModel.reset(); 613 this._frameModel.reset();
613 this._filmStripModel.reset(this._tracingModel); 614 this._filmStripModel.reset(this._tracingModel);
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 if (this._statusPane) 717 if (this._statusPane)
717 this._statusPane.updateStatus(Common.UIString('Processing profile\u2026')) ; 718 this._statusPane.updateStatus(Common.UIString('Processing profile\u2026')) ;
718 this._model.setEvents(this._tracingModel, loadedFromFile); 719 this._model.setEvents(this._tracingModel, loadedFromFile);
719 this._frameModel.reset(); 720 this._frameModel.reset();
720 this._frameModel.addTraceEvents( 721 this._frameModel.addTraceEvents(
721 SDK.targetManager.mainTarget(), this._model.inspectedTargetEvents(), thi s._model.sessionId() || ''); 722 SDK.targetManager.mainTarget(), this._model.inspectedTargetEvents(), thi s._model.sessionId() || '');
722 this._filmStripModel.reset(this._tracingModel); 723 this._filmStripModel.reset(this._tracingModel);
723 var groups = TimelineModel.TimelineModel.AsyncEventGroup; 724 var groups = TimelineModel.TimelineModel.AsyncEventGroup;
724 var asyncEventsByGroup = this._model.mainThreadAsyncEvents(); 725 var asyncEventsByGroup = this._model.mainThreadAsyncEvents();
725 this._irModel.populate(asyncEventsByGroup.get(groups.input), asyncEventsByGr oup.get(groups.animation)); 726 this._irModel.populate(asyncEventsByGroup.get(groups.input), asyncEventsByGr oup.get(groups.animation));
726 this._model.cpuProfiles().forEach(profile => Components.LineLevelProfile.ins tance().appendCPUProfile(profile)); 727 this._model.cpuProfiles().forEach(profile => PerfUI.LineLevelProfile.instanc e().appendCPUProfile(profile));
727 if (this._statusPane) 728 if (this._statusPane)
728 this._statusPane.hide(); 729 this._statusPane.hide();
729 delete this._statusPane; 730 delete this._statusPane;
730 731
731 for (let entry of this._extensionTracingModels) 732 for (let entry of this._extensionTracingModels)
732 entry.model.adjustTime(this._model.minimumRecordTime() + (entry.timeOffset / 1000) - this._recordingStartTime); 733 entry.model.adjustTime(this._model.minimumRecordTime() + (entry.timeOffset / 1000) - this._recordingStartTime);
733 734
734 this._recreateToolbarItems(); 735 this._recreateToolbarItems();
735 this._flameChart.resizeToPreferredHeights(); 736 this._flameChart.resizeToPreferredHeights();
736 this._overviewPane.reset(); 737 this._overviewPane.reset();
(...skipping 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after
1920 } 1921 }
1921 1922
1922 /** 1923 /**
1923 * @override 1924 * @override
1924 * @param {!SDK.Target} target 1925 * @param {!SDK.Target} target
1925 */ 1926 */
1926 targetRemoved(target) { 1927 targetRemoved(target) {
1927 this._targets.remove(target, true); 1928 this._targets.remove(target, true);
1928 } 1929 }
1929 }; 1930 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698