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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
43 this.element.addEventListener("contextmenu", this._contextMenu.bind(this), f alse); | 43 this.element.addEventListener("contextmenu", this._contextMenu.bind(this), f alse); |
44 this._dropTarget = new WebInspector.DropTarget(this.element, [WebInspector.D ropTarget.Types.Files, WebInspector.DropTarget.Types.URIList], WebInspector.UISt ring("Drop timeline file or URL here"), this._handleDrop.bind(this)); | 44 this._dropTarget = new WebInspector.DropTarget(this.element, [WebInspector.D ropTarget.Types.Files, WebInspector.DropTarget.Types.URIList], WebInspector.UISt ring("Drop timeline file or URL here"), this._handleDrop.bind(this)); |
45 | 45 |
46 this._state = WebInspector.TimelinePanel.State.Idle; | 46 this._state = WebInspector.TimelinePanel.State.Idle; |
47 this._detailsLinkifier = new WebInspector.Linkifier(); | 47 this._detailsLinkifier = new WebInspector.Linkifier(); |
48 this._windowStartTime = 0; | 48 this._windowStartTime = 0; |
49 this._windowEndTime = Infinity; | 49 this._windowEndTime = Infinity; |
50 this._millisecondsToRecordAfterLoadEvent = 3000; | 50 this._millisecondsToRecordAfterLoadEvent = 3000; |
51 this._toggleRecordAction = /** @type {!WebInspector.Action }*/ (WebInspector .actionRegistry.action("timeline.toggle-recording")); | 51 this._toggleRecordAction = /** @type {!WebInspector.Action }*/ (WebInspector .actionRegistry.action("timeline.toggle-recording")); |
52 | 52 |
53 this._extensionTraceProviders = WebInspector.extensionServer.traceProviders( ); | |
54 | |
53 /** @type {!Array<!WebInspector.TimelineModel.Filter>} */ | 55 /** @type {!Array<!WebInspector.TimelineModel.Filter>} */ |
54 this._filters = []; | 56 this._filters = []; |
55 if (!Runtime.experiments.isEnabled("timelineShowAllEvents")) { | 57 if (!Runtime.experiments.isEnabled("timelineShowAllEvents")) { |
56 this._filters.push(WebInspector.TimelineUIUtils.visibleEventsFilter()); | 58 this._filters.push(WebInspector.TimelineUIUtils.visibleEventsFilter()); |
57 this._filters.push(new WebInspector.ExcludeTopLevelFilter()); | 59 this._filters.push(new WebInspector.ExcludeTopLevelFilter()); |
58 } | 60 } |
59 | 61 |
60 // Create models. | 62 // Create models. |
61 this._tracingModelBackingStorage = new WebInspector.TempFileBackingStorage(" tracing"); | 63 this._tracingModelBackingStorage = new WebInspector.TempFileBackingStorage(" tracing"); |
62 this._tracingModel = new WebInspector.TracingModel(this._tracingModelBacking Storage); | 64 this._tracingModel = new WebInspector.TracingModel(this._tracingModelBacking Storage); |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
383 if (!Runtime.experiments.isEnabled("timelineRecordingPerspectives") || p erspectiveSetting.get() === WebInspector.TimelinePanel.Perspectives.Custom) { | 385 if (!Runtime.experiments.isEnabled("timelineRecordingPerspectives") || p erspectiveSetting.get() === WebInspector.TimelinePanel.Perspectives.Custom) { |
384 this._panelToolbar.appendToolbarItem(this._createSettingCheckbox( | 386 this._panelToolbar.appendToolbarItem(this._createSettingCheckbox( |
385 WebInspector.UIString("Network"), this._captureNetworkSetting, W ebInspector.UIString("Show network requests information"))); | 387 WebInspector.UIString("Network"), this._captureNetworkSetting, W ebInspector.UIString("Show network requests information"))); |
386 this._panelToolbar.appendToolbarItem(this._createSettingCheckbox( | 388 this._panelToolbar.appendToolbarItem(this._createSettingCheckbox( |
387 WebInspector.UIString("JS Profile"), this._captureJSProfileSetti ng, WebInspector.UIString("Capture JavaScript stacks with sampling profiler. (Ha s small performance overhead)"))); | 389 WebInspector.UIString("JS Profile"), this._captureJSProfileSetti ng, WebInspector.UIString("Capture JavaScript stacks with sampling profiler. (Ha s small performance overhead)"))); |
388 this._panelToolbar.appendToolbarItem(screenshotCheckbox); | 390 this._panelToolbar.appendToolbarItem(screenshotCheckbox); |
389 this._panelToolbar.appendToolbarItem(this._createSettingCheckbox( | 391 this._panelToolbar.appendToolbarItem(this._createSettingCheckbox( |
390 WebInspector.UIString("Memory"), this._captureMemorySetting, Web Inspector.UIString("Capture memory information on every timeline event."))); | 392 WebInspector.UIString("Memory"), this._captureMemorySetting, Web Inspector.UIString("Capture memory information on every timeline event."))); |
391 this._panelToolbar.appendToolbarItem(this._createSettingCheckbox( | 393 this._panelToolbar.appendToolbarItem(this._createSettingCheckbox( |
392 WebInspector.UIString("Paint"), this._captureLayersAndPicturesSe tting, WebInspector.UIString("Capture graphics layer positions and rasterization draw calls. (Has large performance overhead)"))); | 394 WebInspector.UIString("Paint"), this._captureLayersAndPicturesSe tting, WebInspector.UIString("Capture graphics layer positions and rasterization draw calls. (Has large performance overhead)"))); |
395 | |
396 for (var provider of this._extensionTraceProviders) { | |
397 this._panelToolbar.appendToolbarItem(this._createSettingCheckbox ( | |
caseq
2016/07/11 18:58:38
let's also have some handling for trace providers
| |
398 WebInspector.UIString(provider.categoryName), | |
399 WebInspector.settings.createSetting(provider.categoryName, f alse), | |
400 WebInspector.UIString(provider.categoryTooltip))); | |
401 } | |
393 } else { | 402 } else { |
394 this._panelToolbar.appendToolbarItem(screenshotCheckbox); | 403 this._panelToolbar.appendToolbarItem(screenshotCheckbox); |
395 } | 404 } |
396 | 405 |
397 this._captureNetworkSetting.addChangeListener(this._onNetworkChanged, th is); | 406 this._captureNetworkSetting.addChangeListener(this._onNetworkChanged, th is); |
398 this._captureMemorySetting.addChangeListener(this._onModeChanged, this); | 407 this._captureMemorySetting.addChangeListener(this._onModeChanged, this); |
399 this._captureFilmStripSetting.addChangeListener(this._onModeChanged, thi s); | 408 this._captureFilmStripSetting.addChangeListener(this._onModeChanged, thi s); |
400 | 409 |
401 this._panelToolbar.appendSeparator(); | 410 this._panelToolbar.appendSeparator(); |
402 var garbageCollectButton = new WebInspector.ToolbarButton(WebInspector.U IString("Collect garbage"), "garbage-collect-toolbar-item"); | 411 var garbageCollectButton = new WebInspector.ToolbarButton(WebInspector.U IString("Collect garbage"), "garbage-collect-toolbar-item"); |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
765 | 774 |
766 if (!success) { | 775 if (!success) { |
767 this._statusPane.hide(); | 776 this._statusPane.hide(); |
768 delete this._statusPane; | 777 delete this._statusPane; |
769 this._clear(); | 778 this._clear(); |
770 return; | 779 return; |
771 } | 780 } |
772 | 781 |
773 if (this._statusPane) | 782 if (this._statusPane) |
774 this._statusPane.updateStatus(WebInspector.UIString("Processing time line\u2026")); | 783 this._statusPane.updateStatus(WebInspector.UIString("Processing time line\u2026")); |
775 this._model.setEvents(this._tracingModel, loadedFromFile); | 784 this._model.setEvents(this._tracingModel, this._extensionTraceProviders, loadedFromFile); |
776 this._frameModel.reset(); | 785 this._frameModel.reset(); |
777 this._frameModel.addTraceEvents(this._model.target(), this._model.inspec tedTargetEvents(), this._model.sessionId() || ""); | 786 this._frameModel.addTraceEvents(this._model.target(), this._model.inspec tedTargetEvents(), this._model.sessionId() || ""); |
778 | 787 |
779 var groups = WebInspector.TimelineModel.AsyncEventGroup; | 788 var groups = WebInspector.TimelineModel.AsyncEventGroup; |
780 var asyncEventsByGroup = this._model.mainThreadAsyncEvents(); | 789 var asyncEventsByGroup = this._model.mainThreadAsyncEvents(); |
781 this._irModel.populate(asyncEventsByGroup.get(groups.input), asyncEvents ByGroup.get(groups.animation)); | 790 this._irModel.populate(asyncEventsByGroup.get(groups.input), asyncEvents ByGroup.get(groups.animation)); |
782 this._model.cpuProfiles().forEach(profile => WebInspector.LineLevelProfi le.instance().appendCPUProfile(profile)); | 791 this._model.cpuProfiles().forEach(profile => WebInspector.LineLevelProfi le.instance().appendCPUProfile(profile)); |
783 if (this._statusPane) | 792 if (this._statusPane) |
784 this._statusPane.hide(); | 793 this._statusPane.hide(); |
785 delete this._statusPane; | 794 delete this._statusPane; |
(...skipping 1251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2037 * @override | 2046 * @override |
2038 * @param {!WebInspector.Target} target | 2047 * @param {!WebInspector.Target} target |
2039 */ | 2048 */ |
2040 targetRemoved: function(target) | 2049 targetRemoved: function(target) |
2041 { | 2050 { |
2042 this._targets.remove(target, true); | 2051 this._targets.remove(target, true); |
2043 }, | 2052 }, |
2044 | 2053 |
2045 __proto__: WebInspector.Object.prototype | 2054 __proto__: WebInspector.Object.prototype |
2046 } | 2055 } |
OLD | NEW |