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.
8 <link rel="import" href="/tracing/trace_model/event.html">
13 tv.exportTo('tracing.trace_model', function() {
15 * A snapshot of an object instance, at a given moment in time.
17 * Initialization of snapshots and instances is three phased:
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.
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
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.
36 function ObjectSnapshot(objectInstance, ts, args) {
37 tracing.trace_model.Event.call(this);
38 this.objectInstance = objectInstance;
43 ObjectSnapshot.prototype = {
44 __proto__: tracing.trace_model.Event.prototype,
47 * See ObjectSnapshot constructor notes on object initialization.
49 preInitialize: function() {
53 * See ObjectSnapshot constructor notes on object initialization.
55 initialize: function() {
58 addBoundsToRange: function(range) {
59 range.addValue(this.ts);
63 tracing.trace_model.Event.decorateSubtype(ObjectSnapshot);
66 ObjectSnapshot: ObjectSnapshot