| 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/iteration_helpers.html"> | 8 <link rel="import" href="/tracing/base/iteration_helpers.html"> |
| 9 | 9 |
| 10 <script> | 10 <script> |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 /** | 403 /** |
| 404 * A Transformer encapsulates information about how to turn timestamps in one | 404 * A Transformer encapsulates information about how to turn timestamps in one |
| 405 * clock domain into timestamps in another. It also stores additional data | 405 * clock domain into timestamps in another. It also stores additional data |
| 406 * about the maximum error involved in doing so. | 406 * about the maximum error involved in doing so. |
| 407 */ | 407 */ |
| 408 function Transformer(fn, error) { | 408 function Transformer(fn, error) { |
| 409 this.fn = fn; | 409 this.fn = fn; |
| 410 this.error = error; | 410 this.error = error; |
| 411 } | 411 } |
| 412 | 412 |
| 413 Transformer.IDENTITY = new Transformer(tr.b.identity, 0); | 413 Transformer.IDENTITY = new Transformer((x => x), 0); |
| 414 | 414 |
| 415 /** | 415 /** |
| 416 * Given two transformers, creates a third that's a composition of the two. | 416 * Given two transformers, creates a third that's a composition of the two. |
| 417 * | 417 * |
| 418 * @param {function(Number): Number} aToB A function capable of converting a | 418 * @param {function(Number): Number} aToB A function capable of converting a |
| 419 * timestamp from domain A to domain B. | 419 * timestamp from domain A to domain B. |
| 420 * @param {function(Number): Number} bToC A function capable of converting a | 420 * @param {function(Number): Number} bToC A function capable of converting a |
| 421 * timestamp from domain B to domain C. | 421 * timestamp from domain B to domain C. |
| 422 * | 422 * |
| 423 * @return {function(Number): Number} A function capable of converting a | 423 * @return {function(Number): Number} A function capable of converting a |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 return new Transformer( | 458 return new Transformer( |
| 459 (ts) => ts + tsShift, fromMarker.duration + toMarker.duration); | 459 (ts) => ts + tsShift, fromMarker.duration + toMarker.duration); |
| 460 }; | 460 }; |
| 461 | 461 |
| 462 return { | 462 return { |
| 463 ClockDomainId, | 463 ClockDomainId, |
| 464 ClockSyncManager, | 464 ClockSyncManager, |
| 465 }; | 465 }; |
| 466 }); | 466 }); |
| 467 </script> | 467 </script> |
| OLD | NEW |