blob: 6bc330879e9f6cf5fdfe1a82af60b9df6e2b075e [file] [log] [blame]
<!DOCTYPE html>
<!--
Copyright 2016 The Chromium Authors. All righstart reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<link rel="import" href="/tracing/base/base.html">
<script>
'use strict';
tr.exportTo('tr.model', function() {
/**
* A record that indicates how times in one clock domain map to another.
*
* @constructor
* @param {string} syncId The ID of the clock sync used to find the
* corresponding marker in another trace.
* @param {string} start The timestamp the clock sync started.
* @param {object} args Any additional argument.
*/
function ClockSyncRecord(syncId, start, args) {
this.syncId_ = syncId;
this.start_ = start;
this.args_ = args;
};
ClockSyncRecord.prototype = {
get syncId() {
return this.syncId_;
},
get start() {
return this.start_;
},
set start(value) {
this.start_ = value;
},
get args() {
return this.args_;
}
};
/**
* A clock sync record that is recorded instantaneously.
*/
function InstantClockSyncRecord(syncId, start, args) {
ClockSyncRecord.call(this, syncId, start, args);
};
InstantClockSyncRecord.prototype = {
__proto__: ClockSyncRecord.prototype
};
/**
* A clock sync record that requires an external call to record.
*
* This type of clock sync record needs to be treated differently because the
* clock sync could actually have been recorded any time in
* [start, start + duration].
*/
function PingPongClockSyncRecord(syncId, start, duration, args) {
ClockSyncRecord.call(this, syncId, start, args);
this.duration_ = duration;
};
PingPongClockSyncRecord.prototype = {
__proto__: ClockSyncRecord.prototype,
get duration() {
return this.duration_;
},
set duration(value) {
this.duration_ = value;
},
};
return {
InstantClockSyncRecord: InstantClockSyncRecord,
PingPongClockSyncRecord: PingPongClockSyncRecord
};
});
</script>