OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 }, | 574 }, |
575 | 575 |
576 /** | 576 /** |
577 * @param {!WebInspector.TracingModel} tracingModel | 577 * @param {!WebInspector.TracingModel} tracingModel |
578 * @return {?WebInspector.TracingModel.Event} | 578 * @return {?WebInspector.TracingModel.Event} |
579 */ | 579 */ |
580 _makeMockPageMetadataEvent: function(tracingModel) | 580 _makeMockPageMetadataEvent: function(tracingModel) |
581 { | 581 { |
582 var rendererMainThreadName = WebInspector.TimelineModel.RendererMainThre
adName; | 582 var rendererMainThreadName = WebInspector.TimelineModel.RendererMainThre
adName; |
583 // FIXME: pick up the first renderer process for now. | 583 // FIXME: pick up the first renderer process for now. |
584 var process = Object.values(tracingModel.sortedProcesses()).filter(funct
ion(p) { return p.threadByName(rendererMainThreadName); })[0]; | 584 var process = tracingModel.sortedProcesses().filter(function(p) { return
p.threadByName(rendererMainThreadName); })[0]; |
585 var thread = process && process.threadByName(rendererMainThreadName); | 585 var thread = process && process.threadByName(rendererMainThreadName); |
586 if (!thread) | 586 if (!thread) |
587 return null; | 587 return null; |
588 var pageMetaEvent = new WebInspector.TracingModel.Event( | 588 var pageMetaEvent = new WebInspector.TracingModel.Event( |
589 WebInspector.TracingModel.DevToolsMetadataEventCategory, | 589 WebInspector.TracingModel.DevToolsMetadataEventCategory, |
590 WebInspector.TimelineModel.DevToolsMetadataEvent.TracingStartedInPag
e, | 590 WebInspector.TimelineModel.DevToolsMetadataEvent.TracingStartedInPag
e, |
591 WebInspector.TracingModel.Phase.Metadata, | 591 WebInspector.TracingModel.Phase.Metadata, |
592 tracingModel.minimumRecordTime(), thread); | 592 tracingModel.minimumRecordTime(), thread); |
593 pageMetaEvent.addArgs({"data": {"sessionId": "mockSessionId"}}); | 593 pageMetaEvent.addArgs({"data": {"sessionId": "mockSessionId"}}); |
594 return pageMetaEvent; | 594 return pageMetaEvent; |
(...skipping 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1748 if (!id) | 1748 if (!id) |
1749 return; | 1749 return; |
1750 /** @type {!Map<string, !WebInspector.TracingModel.Event>|undefined} */ | 1750 /** @type {!Map<string, !WebInspector.TracingModel.Event>|undefined} */ |
1751 var initiatorMap = this._initiatorByType.get(initiatorType); | 1751 var initiatorMap = this._initiatorByType.get(initiatorType); |
1752 if (isInitiator) | 1752 if (isInitiator) |
1753 initiatorMap.set(id, event); | 1753 initiatorMap.set(id, event); |
1754 else | 1754 else |
1755 event.initiator = initiatorMap.get(id) || null; | 1755 event.initiator = initiatorMap.get(id) || null; |
1756 } | 1756 } |
1757 } | 1757 } |
OLD | NEW |