OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
983 */ | 983 */ |
984 _eventParent(event) { | 984 _eventParent(event) { |
985 return this._entryParent[event[Timeline.TimelineFlameChartDataProvider._inde
xSymbol]] || null; | 985 return this._entryParent[event[Timeline.TimelineFlameChartDataProvider._inde
xSymbol]] || null; |
986 } | 986 } |
987 | 987 |
988 /** | 988 /** |
989 * @param {number} entryIndex | 989 * @param {number} entryIndex |
990 * @return {?SDK.TracingModel.Event} | 990 * @return {?SDK.TracingModel.Event} |
991 */ | 991 */ |
992 eventByIndex(entryIndex) { | 992 eventByIndex(entryIndex) { |
993 return this._entryType(entryIndex) === Timeline.TimelineFlameChartDataProvid
er.EntryType.Event ? | 993 return entryIndex >= 0 && this._entryType(entryIndex) === Timeline.TimelineF
lameChartDataProvider.EntryType.Event ? |
994 /** @type {!SDK.TracingModel.Event} */ (this._entryData[entryIndex]) : | 994 /** @type {!SDK.TracingModel.Event} */ (this._entryData[entryIndex]) : |
995 null; | 995 null; |
996 } | 996 } |
997 | 997 |
998 /** | 998 /** |
999 * @param {function(!SDK.TracingModel.Event):string} colorForEvent | 999 * @param {function(!SDK.TracingModel.Event):string} colorForEvent |
1000 */ | 1000 */ |
1001 setEventColorMapping(colorForEvent) { | 1001 setEventColorMapping(colorForEvent) { |
1002 this._colorForEvent = colorForEvent; | 1002 this._colorForEvent = colorForEvent; |
1003 } | 1003 } |
1004 }; | 1004 }; |
1005 | 1005 |
1006 Timeline.TimelineFlameChartDataProvider.InstantEventVisibleDurationMs = 0.001; | 1006 Timeline.TimelineFlameChartDataProvider.InstantEventVisibleDurationMs = 0.001; |
1007 Timeline.TimelineFlameChartDataProvider._indexSymbol = Symbol('index'); | 1007 Timeline.TimelineFlameChartDataProvider._indexSymbol = Symbol('index'); |
1008 | 1008 |
1009 /** @enum {symbol} */ | 1009 /** @enum {symbol} */ |
1010 Timeline.TimelineFlameChartDataProvider.Events = { | 1010 Timeline.TimelineFlameChartDataProvider.Events = { |
1011 DataChanged: Symbol('DataChanged') | 1011 DataChanged: Symbol('DataChanged') |
1012 }; | 1012 }; |
1013 | 1013 |
1014 /** @enum {symbol} */ | 1014 /** @enum {symbol} */ |
1015 Timeline.TimelineFlameChartDataProvider.EntryType = { | 1015 Timeline.TimelineFlameChartDataProvider.EntryType = { |
1016 Frame: Symbol('Frame'), | 1016 Frame: Symbol('Frame'), |
1017 Event: Symbol('Event'), | 1017 Event: Symbol('Event'), |
1018 InteractionRecord: Symbol('InteractionRecord'), | 1018 InteractionRecord: Symbol('InteractionRecord'), |
1019 ExtensionEvent: Symbol('ExtensionEvent'), | 1019 ExtensionEvent: Symbol('ExtensionEvent'), |
1020 Screenshot: Symbol('Screenshot'), | 1020 Screenshot: Symbol('Screenshot'), |
1021 }; | 1021 }; |
OLD | NEW |