| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <!-- | 2 <!-- |
| 3 Copyright (c) 2014 The Chromium Authors. All rights reserved. | 3 Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| 4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
| 5 found in the LICENSE file. | 5 found in the LICENSE file. |
| 6 --> | 6 --> |
| 7 | 7 |
| 8 <link rel="import" href="/tracing/base/iteration_helpers.html"> | 8 <link rel="import" href="/tracing/base/iteration_helpers.html"> |
| 9 <link rel="import" href="/tracing/model/helpers/chrome_process_helper.html"> | 9 <link rel="import" href="/tracing/model/helpers/chrome_process_helper.html"> |
| 10 | 10 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 getCommitProvisionalLoadEventsInRange: function(rangeOfInterest) { | 50 getCommitProvisionalLoadEventsInRange: function(rangeOfInterest) { |
| 51 return this.getAllAsyncSlicesMatching(function(slice) { | 51 return this.getAllAsyncSlicesMatching(function(slice) { |
| 52 return slice.title === 'RenderFrameImpl::didCommitProvisionalLoad' && | 52 return slice.title === 'RenderFrameImpl::didCommitProvisionalLoad' && |
| 53 rangeOfInterest.intersectsExplicitRangeInclusive( | 53 rangeOfInterest.intersectsExplicitRangeInclusive( |
| 54 slice.start, slice.end); | 54 slice.start, slice.end); |
| 55 }); | 55 }); |
| 56 }, | 56 }, |
| 57 | 57 |
| 58 get hasLatencyEvents() { | 58 get hasLatencyEvents() { |
| 59 var hasLatency = false; | 59 var hasLatency = false; |
| 60 this.modelHelper.model.getAllThreads().some(function(thread) { | 60 for (var thread of this.modelHelper.model.getAllThreads()) |
| 61 thread.iterateAllEvents(function(event) { | 61 for (var event of thread.getDescendantEvents()) { |
| 62 if (!event.isTopLevel) | 62 if (!event.isTopLevel) |
| 63 return; | 63 continue; |
| 64 if (!(event instanceof tr.e.cc.InputLatencyAsyncSlice)) | 64 if (!(event instanceof tr.e.cc.InputLatencyAsyncSlice)) |
| 65 return; | 65 continue; |
| 66 hasLatency = true; | 66 hasLatency = true; |
| 67 }); | 67 } |
| 68 return hasLatency; | |
| 69 }); | |
| 70 return hasLatency; | 68 return hasLatency; |
| 71 }, | 69 }, |
| 72 | 70 |
| 73 getLatencyEventsInRange: function(rangeOfInterest) { | 71 getLatencyEventsInRange: function(rangeOfInterest) { |
| 74 return this.getAllAsyncSlicesMatching(function(slice) { | 72 return this.getAllAsyncSlicesMatching(function(slice) { |
| 75 return (slice.title.indexOf('InputLatency') === 0) && | 73 return (slice.title.indexOf('InputLatency') === 0) && |
| 76 rangeOfInterest.intersectsExplicitRangeInclusive( | 74 rangeOfInterest.intersectsExplicitRangeInclusive( |
| 77 slice.start, slice.end); | 75 slice.start, slice.end); |
| 78 }); | 76 }); |
| 79 }, | 77 }, |
| 80 | 78 |
| 81 getAllAsyncSlicesMatching: function(pred, opt_this) { | 79 getAllAsyncSlicesMatching: function(pred, opt_this) { |
| 82 var events = []; | 80 var events = []; |
| 83 this.iterAllThreads(function(thread) { | 81 this.iterAllThreads(function(thread) { |
| 84 thread.iterateAllEvents(function(slice) { | 82 for (var slice of thread.getDescendantEvents()) |
| 85 if (pred.call(opt_this, slice)) | 83 if (pred.call(opt_this, slice)) |
| 86 events.push(slice); | 84 events.push(slice); |
| 87 }); | |
| 88 }); | 85 }); |
| 89 return events; | 86 return events; |
| 90 }, | 87 }, |
| 91 | 88 |
| 92 getAllNetworkEventsInRange: function(rangeOfInterest) { | 89 getAllNetworkEventsInRange: function(rangeOfInterest) { |
| 93 var networkEvents = []; | 90 var networkEvents = []; |
| 94 this.modelHelper.model.getAllThreads().forEach(function(thread) { | 91 this.modelHelper.model.getAllThreads().forEach(function(thread) { |
| 95 thread.asyncSliceGroup.slices.forEach(function(slice) { | 92 thread.asyncSliceGroup.slices.forEach(function(slice) { |
| 96 var match = false; | 93 var match = false; |
| 97 if (slice.category == 'net' || // old-style URLRequest/Resource | 94 if (slice.category == 'net' || // old-style URLRequest/Resource |
| (...skipping 25 matching lines...) Expand all Loading... |
| 123 }); | 120 }); |
| 124 }, this); | 121 }, this); |
| 125 } | 122 } |
| 126 }; | 123 }; |
| 127 | 124 |
| 128 return { | 125 return { |
| 129 ChromeBrowserHelper: ChromeBrowserHelper | 126 ChromeBrowserHelper: ChromeBrowserHelper |
| 130 }; | 127 }; |
| 131 }); | 128 }); |
| 132 </script> | 129 </script> |
| OLD | NEW |