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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineModel.js

Issue 2288983003: DevTools: Show events from all processes on timeline. (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/main/Main.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 */ 488 */
489 setEvents: function(tracingModel, produceTraceStartedInPage) 489 setEvents: function(tracingModel, produceTraceStartedInPage)
490 { 490 {
491 this.reset(); 491 this.reset();
492 this._resetProcessingState(); 492 this._resetProcessingState();
493 493
494 this._minimumRecordTime = tracingModel.minimumRecordTime(); 494 this._minimumRecordTime = tracingModel.minimumRecordTime();
495 this._maximumRecordTime = tracingModel.maximumRecordTime(); 495 this._maximumRecordTime = tracingModel.maximumRecordTime();
496 496
497 var metadataEvents = this._processMetadataEvents(tracingModel, !!produce TraceStartedInPage); 497 var metadataEvents = this._processMetadataEvents(tracingModel, !!produce TraceStartedInPage);
498 var startTime = 0; 498 if (Runtime.experiments.isEnabled("timelineShowAllProcesses")) {
499 for (var i = 0, length = metadataEvents.page.length; i < length; i++) { 499 var lastPageMetaEvent = metadataEvents.page.peekLast();
500 var metaEvent = metadataEvents.page[i]; 500 for (var process of tracingModel.sortedProcesses()) {
501 var process = metaEvent.thread.process(); 501 for (var thread of process.sortedThreads())
502 var endTime = i + 1 < length ? metadataEvents.page[i + 1].startTime : Infinity; 502 this._processThreadEvents(0, Infinity, thread, thread === la stPageMetaEvent.thread);
503 this._currentPage = metaEvent.args["data"] && metaEvent.args["data"] ["page"]; 503 }
504 for (var thread of process.sortedThreads()) { 504 } else {
505 if (thread.name() === WebInspector.TimelineModel.WorkerThreadNam e) { 505 var startTime = 0;
506 var workerMetaEvent = metadataEvents.workers.find(e => e.arg s["data"]["workerThreadId"] === thread.id()); 506 for (var i = 0, length = metadataEvents.page.length; i < length; i++ ) {
507 if (!workerMetaEvent) 507 var metaEvent = metadataEvents.page[i];
508 continue; 508 var process = metaEvent.thread.process();
509 var workerId = workerMetaEvent.args["data"]["workerId"]; 509 var endTime = i + 1 < length ? metadataEvents.page[i + 1].startT ime : Infinity;
510 if (workerId) 510 this._currentPage = metaEvent.args["data"] && metaEvent.args["da ta"]["page"];
511 this._workerIdByThread.set(thread, workerId); 511 for (var thread of process.sortedThreads()) {
512 if (thread.name() === WebInspector.TimelineModel.WorkerThrea dName) {
513 var workerMetaEvent = metadataEvents.workers.find(e => e .args["data"]["workerThreadId"] === thread.id());
514 if (!workerMetaEvent)
515 continue;
516 var workerId = workerMetaEvent.args["data"]["workerId"];
517 if (workerId)
518 this._workerIdByThread.set(thread, workerId);
519 }
520 this._processThreadEvents(startTime, endTime, thread, thread === metaEvent.thread);
512 } 521 }
513 this._processThreadEvents(startTime, endTime, thread, thread === metaEvent.thread); 522 startTime = endTime;
514 } 523 }
515 startTime = endTime;
516 } 524 }
517 this._inspectedTargetEvents.sort(WebInspector.TracingModel.Event.compare StartTime); 525 this._inspectedTargetEvents.sort(WebInspector.TracingModel.Event.compare StartTime);
518 526
519 this._processBrowserEvents(tracingModel); 527 this._processBrowserEvents(tracingModel);
520 this._buildTimelineRecords(); 528 this._buildTimelineRecords();
521 this._buildGPUEvents(tracingModel); 529 this._buildGPUEvents(tracingModel);
522 this._insertFirstPaintEvent(); 530 this._insertFirstPaintEvent();
523 this._resetProcessingState(); 531 this._resetProcessingState();
524 }, 532 },
525 533
(...skipping 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after
1778 if (!id) 1786 if (!id)
1779 return; 1787 return;
1780 /** @type {!Map<string, !WebInspector.TracingModel.Event>|undefined} */ 1788 /** @type {!Map<string, !WebInspector.TracingModel.Event>|undefined} */
1781 var initiatorMap = this._initiatorByType.get(initiatorType); 1789 var initiatorMap = this._initiatorByType.get(initiatorType);
1782 if (isInitiator) 1790 if (isInitiator)
1783 initiatorMap.set(id, event); 1791 initiatorMap.set(id, event);
1784 else 1792 else
1785 event.initiator = initiatorMap.get(id) || null; 1793 event.initiator = initiatorMap.get(id) || null;
1786 } 1794 }
1787 } 1795 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/main/Main.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698