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

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

Issue 311113002: Move inspected target events calculation into TracingTimelineModel (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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) 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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 }, 243 },
244 244
245 /** 245 /**
246 * @return {!WebInspector.TimelineFrameModel} 246 * @return {!WebInspector.TimelineFrameModel}
247 */ 247 */
248 _frameModel: function() 248 _frameModel: function()
249 { 249 {
250 if (!this._lazyFrameModel) { 250 if (!this._lazyFrameModel) {
251 this._lazyFrameModel = new WebInspector.TimelineFrameModel(this._mod el); 251 this._lazyFrameModel = new WebInspector.TimelineFrameModel(this._mod el);
252 if (this._lazyTracingModel) 252 if (this._lazyTracingModel)
253 this._lazyFrameModel.addTraceEvents(this._lazyTracingModel.inspe ctedTargetEvents(), this._lazyTracingModel.sessionId()); 253 this._lazyFrameModel.addTraceEvents(this._tracingTimelineModel.i nspectedTargetEvents(), this._lazyTracingModel.sessionId());
254 254
255 } 255 }
256 return this._lazyFrameModel; 256 return this._lazyFrameModel;
257 }, 257 },
258 258
259 /** 259 /**
260 * @return {!WebInspector.TracingModel} 260 * @return {!WebInspector.TracingModel}
261 */ 261 */
262 _tracingModel: function() 262 _tracingModel: function()
263 { 263 {
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 */ 655 */
656 _startRecording: function(userInitiated) 656 _startRecording: function(userInitiated)
657 { 657 {
658 this._userInitiatedRecording = userInitiated; 658 this._userInitiatedRecording = userInitiated;
659 if (WebInspector.experimentsSettings.timelineOnTraceEvents.isEnabled()) { 659 if (WebInspector.experimentsSettings.timelineOnTraceEvents.isEnabled()) {
660 var categories = ["disabled-by-default-devtools.timeline", "devtools "]; 660 var categories = ["disabled-by-default-devtools.timeline", "devtools "];
661 if (this._captureStacksSetting.get()) 661 if (this._captureStacksSetting.get())
662 categories.push("disabled-by-default-devtools.timeline.stack"); 662 categories.push("disabled-by-default-devtools.timeline.stack");
663 this._model.willStartRecordingTraceEvents(); 663 this._model.willStartRecordingTraceEvents();
664 this._tracingModel().start(categories.join(","), ""); 664 this._tracingModel().start(categories.join(","), "");
665 this._tracingTimelineModel.willStartRecordingTraceEvents();
665 } else { 666 } else {
666 this._model.startRecording(this._captureStacksSetting.get(), this._c aptureMemorySetting.get()); 667 this._model.startRecording(this._captureStacksSetting.get(), this._c aptureMemorySetting.get());
667 if (WebInspector.experimentsSettings.timelineTracingMode.isEnabled() ) 668 if (WebInspector.experimentsSettings.timelineTracingMode.isEnabled() ) {
668 this._tracingModel().start(WebInspector.TimelinePanel.defaultTra cingCategoryFilter, ""); 669 this._tracingModel().start(WebInspector.TimelinePanel.defaultTra cingCategoryFilter, "");
670 this._tracingTimelineModel.willStartRecordingTraceEvents();
671 }
669 } 672 }
670 for (var i = 0; i < this._overviewControls.length; ++i) 673 for (var i = 0; i < this._overviewControls.length; ++i)
671 this._overviewControls[i].timelineStarted(); 674 this._overviewControls[i].timelineStarted();
672 675
673 if (userInitiated) 676 if (userInitiated)
674 WebInspector.userMetrics.TimelineStarted.record(); 677 WebInspector.userMetrics.TimelineStarted.record();
675 }, 678 },
676 679
677 _stopRecording: function() 680 _stopRecording: function()
678 { 681 {
679 this._userInitiatedRecording = false; 682 this._userInitiatedRecording = false;
680 this._model.stopRecording(); 683 this._model.stopRecording();
681 if (this._lazyTracingModel) 684 if (this._lazyTracingModel)
682 this._lazyTracingModel.stop(this._onTracingComplete.bind(this)); 685 this._lazyTracingModel.stop(this._onTracingComplete.bind(this));
683 686
684 for (var i = 0; i < this._overviewControls.length; ++i) 687 for (var i = 0; i < this._overviewControls.length; ++i)
685 this._overviewControls[i].timelineStopped(); 688 this._overviewControls[i].timelineStopped();
686 }, 689 },
687 690
688 _onTracingComplete: function() 691 _onTracingComplete: function()
689 { 692 {
693 this._tracingTimelineModel.didStopRecordingTraceEvents();
690 if (this._lazyFrameModel) { 694 if (this._lazyFrameModel) {
691 this._lazyFrameModel.reset(); 695 this._lazyFrameModel.reset();
692 this._lazyFrameModel.addTraceEvents(this._lazyTracingModel.inspected TargetEvents(), this._lazyTracingModel.sessionId()); 696 this._lazyFrameModel.addTraceEvents(this._tracingTimelineModel.inspe ctedTargetEvents(), this._lazyTracingModel.sessionId());
693 this._overviewPane.update(); 697 this._overviewPane.update();
694 } 698 }
695 if (WebInspector.experimentsSettings.timelineOnTraceEvents.isEnabled()) { 699 if (WebInspector.experimentsSettings.timelineOnTraceEvents.isEnabled())
696 this._tracingTimelineModel.didStopRecordingTraceEvents();
697 this._model.didStopRecordingTraceEvents(this._tracingTimelineModel.m ainThreadEvents()); 700 this._model.didStopRecordingTraceEvents(this._tracingTimelineModel.m ainThreadEvents());
698 }
699 this._refreshViews(); 701 this._refreshViews();
700 }, 702 },
701 703
702 _onProfilingStateChanged: function() 704 _onProfilingStateChanged: function()
703 { 705 {
704 this._updateToggleTimelineButton(this.toggleTimelineButton.toggled); 706 this._updateToggleTimelineButton(this.toggleTimelineButton.toggled);
705 }, 707 },
706 708
707 /** 709 /**
708 * @param {boolean} toggled 710 * @param {boolean} toggled
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after
1436 * @param {!WebInspector.TimelineModel.Record} record 1438 * @param {!WebInspector.TimelineModel.Record} record
1437 * @return {boolean} 1439 * @return {boolean}
1438 */ 1440 */
1439 accept: function(record) 1441 accept: function(record)
1440 { 1442 {
1441 return !this._hiddenRecords[record.type()]; 1443 return !this._hiddenRecords[record.type()];
1442 }, 1444 },
1443 1445
1444 __proto__: WebInspector.TimelineModel.Filter.prototype 1446 __proto__: WebInspector.TimelineModel.Filter.prototype
1445 } 1447 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698