Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / trace-viewer / trace_viewer / tracing / trace_model / object_snapshot.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/event.html">
9
10 <script>
11 'use strict';
12
13 tv.exportTo('tracing.trace_model', function() {
14   /**
15    * A snapshot of an object instance, at a given moment in time.
16    *
17    * Initialization of snapshots and instances is three phased:
18    *
19    * 1. Instances and snapshots are constructed. This happens during event
20    *    importing. Little should be done here, because the object's data
21    *    are still being used by the importer to reconstruct object references.
22    *
23    * 2. Instances and snapshtos are preinitialized. This happens after implicit
24    *    objects have been found, but before any references have been found and
25    *    switched to direct references. Thus, every snapshot stands on its own.
26    *    This is a good time to do global field renaming and type conversion,
27    *    e.g. recognizing domain-specific types and converting from C++ naming
28    *    convention to JS.
29    *
30    * 3. Instances and snapshtos are initialized. At this point, {id_ref:
31    *    '0x1000'} fields have been converted to snapshot references. This is a
32    *    good time to generic initialization steps and argument verification.
33    *
34    * @constructor
35    */
36   function ObjectSnapshot(objectInstance, ts, args) {
37     tracing.trace_model.Event.call(this);
38     this.objectInstance = objectInstance;
39     this.ts = ts;
40     this.args = args;
41   }
42
43   ObjectSnapshot.prototype = {
44     __proto__: tracing.trace_model.Event.prototype,
45
46     /**
47      * See ObjectSnapshot constructor notes on object initialization.
48      */
49     preInitialize: function() {
50     },
51
52     /**
53      * See ObjectSnapshot constructor notes on object initialization.
54      */
55     initialize: function() {
56     },
57
58     addBoundsToRange: function(range) {
59       range.addValue(this.ts);
60     }
61   };
62
63   tracing.trace_model.Event.decorateSubtype(ObjectSnapshot);
64
65   return {
66     ObjectSnapshot: ObjectSnapshot
67   };
68 });
69 </script>
70