Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2014 The Chromium Authors. All rights reserved. | 2 * Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * @constructor | 8 * @constructor |
| 9 * @param {!WebInspector.BackingStorage} backingStorage | 9 * @param {!WebInspector.BackingStorage} backingStorage |
| 10 */ | 10 */ |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 41 SnapshotObject: "O", | 41 SnapshotObject: "O", |
| 42 DeleteObject: "D" | 42 DeleteObject: "D" |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 WebInspector.TracingModel.MetadataEvent = { | 45 WebInspector.TracingModel.MetadataEvent = { |
| 46 ProcessSortIndex: "process_sort_index", | 46 ProcessSortIndex: "process_sort_index", |
| 47 ProcessName: "process_name", | 47 ProcessName: "process_name", |
| 48 ThreadSortIndex: "thread_sort_index", | 48 ThreadSortIndex: "thread_sort_index", |
| 49 ThreadName: "thread_name" | 49 ThreadName: "thread_name" |
| 50 } | 50 } |
| 51 WebInspector.TracingModel.ExtensionEvent = "Extension"; | |
| 51 | 52 |
| 52 WebInspector.TracingModel.TopLevelEventCategory = "toplevel"; | 53 WebInspector.TracingModel.TopLevelEventCategory = "toplevel"; |
| 53 WebInspector.TracingModel.DevToolsMetadataEventCategory = "disabled-by-default-d evtools.timeline"; | 54 WebInspector.TracingModel.DevToolsMetadataEventCategory = "disabled-by-default-d evtools.timeline"; |
| 54 WebInspector.TracingModel.DevToolsTimelineEventCategory = "disabled-by-default-d evtools.timeline"; | 55 WebInspector.TracingModel.DevToolsTimelineEventCategory = "disabled-by-default-d evtools.timeline"; |
| 55 | 56 |
| 56 WebInspector.TracingModel.FrameLifecycleEventCategory = "cc,devtools"; | 57 WebInspector.TracingModel.FrameLifecycleEventCategory = "cc,devtools"; |
| 57 | 58 |
| 58 /** | 59 /** |
| 59 * @param {string} phase | 60 * @param {string} phase |
| 60 * @return {boolean} | 61 * @return {boolean} |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 214 var timestamp = payload.ts / 1000; | 215 var timestamp = payload.ts / 1000; |
| 215 // We do allow records for unrelated threads to arrive out-of-order, | 216 // We do allow records for unrelated threads to arrive out-of-order, |
| 216 // so there's a chance we're getting records from the past. | 217 // so there's a chance we're getting records from the past. |
| 217 if (timestamp && (!this._minimumRecordTime || timestamp < this._minimumR ecordTime)) | 218 if (timestamp && (!this._minimumRecordTime || timestamp < this._minimumR ecordTime)) |
| 218 this._minimumRecordTime = timestamp; | 219 this._minimumRecordTime = timestamp; |
| 219 var endTimeStamp = (payload.ts + (payload.dur || 0)) / 1000; | 220 var endTimeStamp = (payload.ts + (payload.dur || 0)) / 1000; |
| 220 this._maximumRecordTime = Math.max(this._maximumRecordTime, endTimeStamp ); | 221 this._maximumRecordTime = Math.max(this._maximumRecordTime, endTimeStamp ); |
| 221 var event = process._addEvent(payload); | 222 var event = process._addEvent(payload); |
| 222 if (!event) | 223 if (!event) |
| 223 return; | 224 return; |
| 225 if (payload.name == WebInspector.TracingModel.ExtensionEvent) { | |
|
caseq
2016/07/11 18:58:38
Let's avoid this. I think the right way would be e
| |
| 226 var processName = payload.name; | |
| 227 process._setName(processName); | |
| 228 this._processByName.set(processName, process); | |
| 229 } | |
| 224 // Build async event when we've got events from all threads & processes, so we can sort them and process in the | 230 // Build async event when we've got events from all threads & processes, so we can sort them and process in the |
| 225 // chronological order. However, also add individual async events to the thread flow (above), so we can easily | 231 // chronological order. However, also add individual async events to the thread flow (above), so we can easily |
| 226 // display them on the same chart as other events, should we choose so. | 232 // display them on the same chart as other events, should we choose so. |
| 227 if (WebInspector.TracingModel.isAsyncPhase(payload.ph)) | 233 if (WebInspector.TracingModel.isAsyncPhase(payload.ph)) |
| 228 this._asyncEvents.push(event); | 234 this._asyncEvents.push(event); |
| 229 event._setBackingStorage(backingStorage); | 235 event._setBackingStorage(backingStorage); |
| 230 if (event.hasCategory(WebInspector.TracingModel.DevToolsMetadataEventCat egory)) | 236 if (event.hasCategory(WebInspector.TracingModel.DevToolsMetadataEventCat egory)) |
| 231 this._devToolsMetadataEvents.push(event); | 237 this._devToolsMetadataEvents.push(event); |
| 232 | 238 |
| 233 if (payload.ph !== WebInspector.TracingModel.Phase.Metadata) | 239 if (payload.ph !== WebInspector.TracingModel.Phase.Metadata) |
| (...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 928 /** | 934 /** |
| 929 * @return {!Array.<!WebInspector.TracingModel.AsyncEvent>} | 935 * @return {!Array.<!WebInspector.TracingModel.AsyncEvent>} |
| 930 */ | 936 */ |
| 931 asyncEvents: function() | 937 asyncEvents: function() |
| 932 { | 938 { |
| 933 return this._asyncEvents; | 939 return this._asyncEvents; |
| 934 }, | 940 }, |
| 935 | 941 |
| 936 __proto__: WebInspector.TracingModel.NamedObject.prototype | 942 __proto__: WebInspector.TracingModel.NamedObject.prototype |
| 937 } | 943 } |
| OLD | NEW |