Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / trace-viewer / trace_viewer / tracing / trace_model / async_slice.html
1 <!DOCTYPE html>
2 <!--
3 Copyright (c) 2013 The Chromium Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file.
6 -->
7
8 <link rel="import" href="/tracing/trace_model/slice.html">
9
10 <script>
11 'use strict';
12
13 /**
14  * @fileoverview Provides the AsyncSlice class.
15  */
16 tvcm.exportTo('tracing.trace_model', function() {
17   /**
18    * A AsyncSlice represents an interval of time during which an
19    * asynchronous operation is in progress. An AsyncSlice consumes no CPU time
20    * itself and so is only associated with Threads at its start and end point.
21    *
22    * @constructor
23    */
24   function AsyncSlice(category, title, colorId, start, args) {
25     tracing.trace_model.Slice.apply(this, arguments);
26   };
27
28   AsyncSlice.prototype = {
29     __proto__: tracing.trace_model.Slice.prototype,
30
31     toJSON: function() {
32       var obj = new Object();
33       var keys = Object.keys(this);
34       for (var i = 0; i < keys.length; i++) {
35         var key = keys[i];
36         if (typeof this[key] == 'function')
37           continue;
38         if (key == 'startThread' || key == 'endThread') {
39           obj[key] = this[key].guid;
40           continue;
41         }
42         obj[key] = this[key];
43       }
44       return obj;
45     },
46
47     id: undefined,
48
49     startThread: undefined,
50
51     endThread: undefined,
52
53     subSlices: undefined
54   };
55
56   return {
57     AsyncSlice: AsyncSlice
58   };
59 });
60 </script>
61