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 */ | 9 */ |
| 10 WebInspector.TracingModel = function() | 10 WebInspector.TracingModel = function() |
| (...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 626 _addAsyncEvent: function(payload) | 626 _addAsyncEvent: function(payload) |
| 627 { | 627 { |
| 628 var phase = WebInspector.TracingModel.Phase; | 628 var phase = WebInspector.TracingModel.Phase; |
| 629 var timestamp = payload.ts / 1000; | 629 var timestamp = payload.ts / 1000; |
| 630 var key = payload.name + "." + payload.id; | 630 var key = payload.name + "." + payload.id; |
| 631 var steps = this._openAsyncEvents[key]; | 631 var steps = this._openAsyncEvents[key]; |
| 632 | 632 |
| 633 var thread = this.threadById(payload.tid); | 633 var thread = this.threadById(payload.tid); |
| 634 if (payload.ph === phase.AsyncBegin) { | 634 if (payload.ph === phase.AsyncBegin) { |
| 635 if (steps) { | 635 if (steps) { |
| 636 console.error("Event " + key + " at " + timestamp + " was alread y started at " + steps[0].startTime); | 636 console.error("Event " + payload.name + " was already started"); |
|
alph
2014/09/23 16:02:07
has already been?
yurys
2014/09/23 16:13:28
Done.
| |
| 637 return; | 637 return; |
| 638 } | 638 } |
| 639 steps = [WebInspector.TracingModel.Event.fromPayload(payload, thread )]; | 639 steps = [WebInspector.TracingModel.Event.fromPayload(payload, thread )]; |
| 640 this._openAsyncEvents[key] = steps; | 640 this._openAsyncEvents[key] = steps; |
| 641 thread._addAsyncEventSteps(steps); | 641 thread._addAsyncEventSteps(steps); |
| 642 return; | 642 return; |
| 643 } | 643 } |
| 644 if (!steps) { | 644 if (!steps) { |
| 645 console.error("Unexpected async event, phase " + payload.ph + " at " + timestamp); | 645 console.error("Unexpected async event " + payload.name + ", phase " + payload.ph); |
| 646 return; | 646 return; |
| 647 } | 647 } |
| 648 var newEvent = WebInspector.TracingModel.Event.fromPayload(payload, thre ad); | 648 var newEvent = WebInspector.TracingModel.Event.fromPayload(payload, thre ad); |
| 649 if (payload.ph === phase.AsyncEnd) { | 649 if (payload.ph === phase.AsyncEnd) { |
| 650 steps.push(newEvent); | 650 steps.push(newEvent); |
| 651 delete this._openAsyncEvents[key]; | 651 delete this._openAsyncEvents[key]; |
| 652 } else if (payload.ph === phase.AsyncStepInto || payload.ph === phase.As yncStepPast) { | 652 } else if (payload.ph === phase.AsyncStepInto || payload.ph === phase.As yncStepPast) { |
| 653 var lastPhase = steps.peekLast().phase; | 653 var lastPhase = steps.peekLast().phase; |
| 654 if (lastPhase !== phase.AsyncBegin && lastPhase !== payload.ph) { | 654 if (lastPhase !== phase.AsyncBegin && lastPhase !== payload.ph) { |
| 655 console.assert(false, "Async event step phase mismatch: " + last Phase + " at " + steps.peekLast().startTime + " vs. " + payload.ph + " at " + ti mestamp); | 655 console.assert(false, "Async event step phase mismatch: " + last Phase + " at " + steps.peekLast().startTime + " vs. " + payload.ph + " at " + ti mestamp); |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 787 /** | 787 /** |
| 788 * @return {!Array.<!WebInspector.TracingModel.Event>} | 788 * @return {!Array.<!WebInspector.TracingModel.Event>} |
| 789 */ | 789 */ |
| 790 asyncEvents: function() | 790 asyncEvents: function() |
| 791 { | 791 { |
| 792 return this._asyncEvents; | 792 return this._asyncEvents; |
| 793 }, | 793 }, |
| 794 | 794 |
| 795 __proto__: WebInspector.TracingModel.NamedObject.prototype | 795 __proto__: WebInspector.TracingModel.NamedObject.prototype |
| 796 } | 796 } |
| OLD | NEW |