| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <!-- | 2 <!-- |
| 3 Copyright 2016 The Chromium Authors. All rights reserved. | 3 Copyright 2016 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/raf.html"> | 8 <link rel="import" href="/tracing/base/raf.html"> |
| 9 <link rel="import" href="/tracing/metrics/metric_registry.html"> | 9 <link rel="import" href="/tracing/metrics/metric_registry.html"> |
| 10 <link rel="import" href="/tracing/metrics/value_set.html"> | 10 <link rel="import" href="/tracing/metrics/value_set.html"> |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 updateContents_: function() { | 113 updateContents_: function() { |
| 114 this.style.width = ''; | 114 this.style.width = ''; |
| 115 tr.b.requestAnimationFrame(function() { | 115 tr.b.requestAnimationFrame(function() { |
| 116 var width = this.$.results.getBoundingClientRect().width + 15; | 116 var width = this.$.results.getBoundingClientRect().width + 15; |
| 117 this.style.width = width + 'px'; | 117 this.style.width = width + 'px'; |
| 118 }, this); | 118 }, this); |
| 119 | 119 |
| 120 if (!this.model_) { | 120 if (!this.model_) { |
| 121 this.$.results.values = new tr.metrics.ValueSet([ | 121 this.$.results.values = new tr.metrics.ValueSet([ |
| 122 new tr.v.FailureValue('missing', { | 122 new tr.v.FailureValue('missing', { |
| 123 description: 'Missing model' | 123 description: 'Missing model', |
| 124 stack: '' |
| 124 }) | 125 }) |
| 125 ]); | 126 ]); |
| 126 return; | 127 return; |
| 127 } | 128 } |
| 128 | 129 |
| 129 var metric = tr.metrics.MetricRegistry.findTypeInfoWithName( | 130 var metric = tr.metrics.MetricRegistry.findTypeInfoWithName( |
| 130 this.currentMetricName_); | 131 this.currentMetricName_); |
| 131 var values = new tr.metrics.ValueSet(); | 132 var values = new tr.metrics.ValueSet(); |
| 133 var options = {}; |
| 134 if (this.rangeOfInterest && !this.rangeOfInterest.isEmpty) |
| 135 options.rangeOfInterest = this.rangeOfInterest; |
| 136 |
| 132 try { | 137 try { |
| 133 metric.constructor(values, this.model_, { | 138 metric.constructor(values, this.model_, options); |
| 134 rangeOfInterest: this.rangeOfInterest | |
| 135 }); | |
| 136 } catch (err) { | 139 } catch (err) { |
| 137 this.$.results.values = new tr.metrics.ValueSet([ | 140 this.$.results.values = new tr.metrics.ValueSet([ |
| 138 new tr.v.FailureValue('error', { | 141 new tr.v.FailureValue('error', { |
| 139 description: err.message, | 142 description: err.message, |
| 140 stack: err.stack | 143 stack: err.stack |
| 141 }) | 144 }) |
| 142 ]); | 145 ]); |
| 143 return; | 146 return; |
| 144 } | 147 } |
| 145 this.$.results.values = values; | 148 this.$.results.values = values; |
| 146 } | 149 } |
| 147 }); | 150 }); |
| 148 | 151 |
| 149 return {}; | 152 return {}; |
| 150 }); | 153 }); |
| 151 </script> | 154 </script> |
| OLD | NEW |