| Index: tracing/tracing/extras/chrome/blame_context/blame_context.html
|
| diff --git a/tracing/tracing/extras/chrome/blame_context/blame_context.html b/tracing/tracing/extras/chrome/blame_context/blame_context.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..18605115cb5bf0e8f0e3b2fab30fd6ac69facca8
|
| --- /dev/null
|
| +++ b/tracing/tracing/extras/chrome/blame_context/blame_context.html
|
| @@ -0,0 +1,74 @@
|
| +<!DOCTYPE html>
|
| +<!--
|
| +Copyright 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/model/object_instance.html">
|
| +
|
| +<script>
|
| +'use strict';
|
| +
|
| +/**
|
| + * @fileoverview BlameContext is the Trace Viewer side correspondence of
|
| + * Chrome's class base::trace_event::BlameContext. More specifically,
|
| + *
|
| + * BlameContextSnapshot, which inherits from ObjectSnapshot, is the base class
|
| + * of all snapshots of blame contexts traced in Chrome.
|
| + *
|
| + * BlameContextInstance, which inherits from ObjectInstance, gathers snapshots
|
| + * of the same blame context traced in Chrome.
|
| + *
|
| + * BlameContextSnapshot and BlameContextInstance should never be instantiated
|
| + * directly. Subclasses corresponding to different BlameContexts in Chrome
|
| + * should define their own BlameContextSnapshot and BlameContextInstance
|
| + * specializations for instantiation.
|
| + *
|
| + */
|
| +tr.exportTo('tr.e.chrome', function() {
|
| + var ObjectSnapshot = tr.model.ObjectSnapshot;
|
| + var ObjectInstance = tr.model.ObjectInstance;
|
| +
|
| + function BlameContextSnapshot() {
|
| + ObjectSnapshot.apply(this, arguments);
|
| + }
|
| +
|
| + BlameContextSnapshot.prototype = {
|
| + __proto__: ObjectSnapshot.prototype,
|
| +
|
| + /**
|
| + * Returns the parent in the context tree.
|
| + */
|
| + get parentContext() {
|
| + if (this.args.parent instanceof BlameContextSnapshot)
|
| + return this.args.parent;
|
| + return undefined;
|
| + },
|
| +
|
| + get userFriendlyName() {
|
| + return 'BlameContext';
|
| + }
|
| + };
|
| +
|
| + function BlameContextInstance() {
|
| + ObjectInstance.apply(this, arguments);
|
| + }
|
| +
|
| + BlameContextInstance.prototype = {
|
| + __proto__: ObjectInstance.prototype,
|
| +
|
| + /**
|
| + * Returns the type of the blame context, to be overriden by subclasses.
|
| + */
|
| + get blameContextType() {
|
| + throw new Error('Not implemented');
|
| + }
|
| + };
|
| +
|
| + return {
|
| + BlameContextSnapshot: BlameContextSnapshot,
|
| + BlameContextInstance: BlameContextInstance
|
| + };
|
| +});
|
| +</script>
|
|
|