| 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/value/diagnostics/related_value_map.html"> | 8 <link rel="import" href="/tracing/value/diagnostics/related_value_map.html"> |
| 9 | 9 |
| 10 <script> | 10 <script> |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 * @param {string} name | 39 * @param {string} name |
| 40 * @param {!(tr.v.d.ValueRef|tr.v.Histogram)} value | 40 * @param {!(tr.v.d.ValueRef|tr.v.Histogram)} value |
| 41 */ | 41 */ |
| 42 set(name, value) { | 42 set(name, value) { |
| 43 if (!(value instanceof tr.v.d.ValueRef)) { | 43 if (!(value instanceof tr.v.d.ValueRef)) { |
| 44 if (!(value instanceof tr.v.Histogram)) { | 44 if (!(value instanceof tr.v.Histogram)) { |
| 45 throw new Error( | 45 throw new Error( |
| 46 'RelatedHistogramBreakdown can only contain Histograms'); | 46 'RelatedHistogramBreakdown can only contain Histograms'); |
| 47 } | 47 } |
| 48 | 48 |
| 49 if (value.name.indexOf(name) !== (value.name.length - name.length)) { | |
| 50 throw new Error( | |
| 51 'RelatedHistogramBreakdown name must be a suffix of value.name'); | |
| 52 } | |
| 53 | |
| 54 if ((this.length > 0) && | 49 if ((this.length > 0) && |
| 55 (value.unit !== | 50 (value.unit !== |
| 56 tr.b.getFirstElement(this)[1].unit)) { | 51 tr.b.getFirstElement(this)[1].unit)) { |
| 57 throw new Error('Units mismatch', tr.b.getFirstElement(this)[1].unit, | 52 throw new Error('Units mismatch', tr.b.getFirstElement(this)[1].unit, |
| 58 value.unit); | 53 value.unit); |
| 59 } | 54 } |
| 60 } | 55 } |
| 61 | 56 |
| 62 tr.v.d.RelatedValueMap.prototype.set.call(this, name, value); | 57 tr.v.d.RelatedValueMap.prototype.set.call(this, name, value); |
| 63 } | 58 } |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 elementName: 'tr-v-ui-breakdown-span' | 122 elementName: 'tr-v-ui-breakdown-span' |
| 128 }); | 123 }); |
| 129 | 124 |
| 130 return { | 125 return { |
| 131 COLOR_SCHEME_CHROME_USER_FRIENDLY_CATEGORY_DRIVER: | 126 COLOR_SCHEME_CHROME_USER_FRIENDLY_CATEGORY_DRIVER: |
| 132 COLOR_SCHEME_CHROME_USER_FRIENDLY_CATEGORY_DRIVER, | 127 COLOR_SCHEME_CHROME_USER_FRIENDLY_CATEGORY_DRIVER, |
| 133 RelatedHistogramBreakdown: RelatedHistogramBreakdown | 128 RelatedHistogramBreakdown: RelatedHistogramBreakdown |
| 134 }; | 129 }; |
| 135 }); | 130 }); |
| 136 </script> | 131 </script> |
| OLD | NEW |