1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
9 base.exportTo('tracing.analysis', function() {
10 var ObjectSnapshotView = ui.define('object-snapshot-view');
12 ObjectSnapshotView.prototype = {
13 __proto__: HTMLDivElement.prototype,
15 decorate: function() {
16 this.objectSnapshot_ = undefined;
19 get requiresTallView() {
24 this.objectSnapshot = obj;
28 return this.objectSnapshot;
31 get objectSnapshot() {
32 return this.objectSnapshot_;
35 set objectSnapshot(i) {
36 this.objectSnapshot_ = i;
37 this.updateContents();
40 updateContents: function() {
41 throw new Error('Not implemented');
45 ObjectSnapshotView.typeNameToViewInfoMap = {};
46 ObjectSnapshotView.register = function(typeName,
49 if (ObjectSnapshotView.typeNameToViewInfoMap[typeName])
50 throw new Error('Handler already registered for ' + typeName);
51 var options = opt_options || {
54 ObjectSnapshotView.typeNameToViewInfoMap[typeName] = {
55 constructor: viewConstructor,
60 ObjectSnapshotView.unregister = function(typeName) {
61 if (ObjectSnapshotView.typeNameToViewInfoMap[typeName] === undefined)
62 throw new Error(typeName + ' not registered');
63 delete ObjectSnapshotView.typeNameToViewInfoMap[typeName];
66 ObjectSnapshotView.getViewInfo = function(typeName) {
67 return ObjectSnapshotView.typeNameToViewInfoMap[typeName];
71 ObjectSnapshotView: ObjectSnapshotView