summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/catapult/tracing/tracing/model/scoped_id.html
blob: 652d6f0a7d3bc6a8613bcf4f878a525571b19b2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!DOCTYPE html>
<!--
Copyright (c) 2016 The Chromium Authors. All rights 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">
<link rel="import" href="/tracing/model/constants.html">

<script>
'use strict';

tr.exportTo('tr.model', function() {
  function ScopedId(scope, id) {
    if (scope === undefined) {
      throw new Error('Scope should be defined. Use \'' +
                      tr.model.OBJECT_DEFAULT_SCOPE +
                      '\' as the default scope.');
    }
    this.scope = scope;
    this.id = id;
  }

  ScopedId.prototype = {
    toString: function() {
      return '{scope: ' + this.scope + ', id: ' + this.id + '}';
    }
  };

  return {
    ScopedId: ScopedId
  };
});
</script>