| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <!-- | 2 <!-- |
| 3 Copyright (c) 2013 The Chromium Authors. All rights reserved. | 3 Copyright (c) 2013 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/guid.html"> | 8 <link rel="import" href="/tracing/base/guid.html"> |
| 9 <link rel="import" href="/tracing/base/time_display_modes.html"> | 9 <link rel="import" href="/tracing/base/time_display_modes.html"> |
| 10 <link rel="import" href="/tracing/model/event.html"> | 10 <link rel="import" href="/tracing/model/event.html"> |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 addBoundsToRange: function(range) { | 40 addBoundsToRange: function(range) { |
| 41 range.addValue(this.start); | 41 range.addValue(this.start); |
| 42 range.addValue(this.end); | 42 range.addValue(this.end); |
| 43 }, | 43 }, |
| 44 | 44 |
| 45 // TODO(charliea): Can this be implemented in terms of Event.range()? | 45 // TODO(charliea): Can this be implemented in terms of Event.range()? |
| 46 // Returns true if 'that' TimedEvent is fully contained within 'this' timed | 46 // Returns true if 'that' TimedEvent is fully contained within 'this' timed |
| 47 // event. | 47 // event. |
| 48 bounds: function(that, opt_precisionUnit) { | 48 bounds: function(that, opt_precisionUnit) { |
| 49 if (opt_precisionUnit === undefined) | 49 if (opt_precisionUnit === undefined) { |
| 50 opt_precisionUnit = tr.b.TimeDisplayModes.ms; | 50 opt_precisionUnit = tr.b.TimeDisplayModes.ms; |
| 51 } |
| 51 | 52 |
| 52 var startsBefore = opt_precisionUnit.roundedLess(that.start, this.start); | 53 var startsBefore = opt_precisionUnit.roundedLess(that.start, this.start); |
| 53 var endsAfter = opt_precisionUnit.roundedLess(this.end, that.end); | 54 var endsAfter = opt_precisionUnit.roundedLess(this.end, that.end); |
| 54 return !startsBefore && !endsAfter; | 55 return !startsBefore && !endsAfter; |
| 55 } | 56 } |
| 56 }; | 57 }; |
| 57 | 58 |
| 58 return { | 59 return { |
| 59 TimedEvent, | 60 TimedEvent, |
| 60 }; | 61 }; |
| 61 }); | 62 }); |
| 62 </script> | 63 </script> |
| OLD | NEW |