source_info.html revision 4a4f2fe02baf385f6c24fc98c6e17bf6ac5e0724
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/base/base.html"> 9 10<script> 11'use strict'; 12 13tr.exportTo('tr.model.source_info', function() { 14 function SourceInfo(file, opt_line) { 15 this.file_ = file; 16 this.line_ = opt_line || -1; 17 } 18 19 SourceInfo.prototype = { 20 get file() { 21 return this.file_; 22 }, 23 24 get line() { 25 return this.line_; 26 }, 27 28 toString: function() { 29 var str = ''; 30 if (this.file_) 31 str += this.file_; 32 if (this.line_ > 0) 33 str += ':' + this.line_; 34 return str; 35 } 36 }; 37 38 return { 39 SourceInfo: SourceInfo 40 }; 41}); 42</script> 43 44