1<!DOCTYPE html>
2<!--
3Copyright 2015 The Chromium Authors. All rights reserved.
4Use of this source code is governed by a BSD-style license that can be
5found in the LICENSE file.
6-->
7
8<link rel="import" href="/tracing/model/source_info/source_info.html">
9
10<script>
11'use strict';
12
13tr.exportTo('tr.model.source_info', function() {
14  function JSSourceInfo(file, line, column, isNative, scriptId, state) {
15    tr.model.source_info.SourceInfo.call(this, file, line, column);
16
17    this.isNative_ = isNative;
18    this.scriptId_ = scriptId;
19    this.state_ = state;
20  }
21
22  JSSourceInfo.prototype = {
23    __proto__: tr.model.source_info.SourceInfo.prototype,
24
25    get state() {
26      return this.state_;
27    },
28
29    get isNative() {
30      return this.isNative_;
31    },
32
33    get scriptId() {
34      return this.scriptId_;
35    },
36
37    toString: function() {
38      var str = this.isNative_ ? '[native v8] ' : '';
39      return str +
40          tr.model.source_info.SourceInfo.prototype.toString.call(this);
41    }
42  };
43
44  return {
45    JSSourceInfo: JSSourceInfo,
46    JSSourceState: {
47      COMPILED: 'compiled',
48      OPTIMIZABLE: 'optimizable',
49      OPTIMIZED: 'optimized',
50      UNKNOWN: 'unknown'
51    }
52  };
53});
54</script>
55
56