<!DOCTYPE html>
<!--
Copyright (c) 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';

tr.exportTo('tr.e.chrome', function() {
  var constants = tr.e.cc.constants;

  var ObjectSnapshot = tr.model.ObjectSnapshot;
  var ObjectInstance = tr.model.ObjectInstance;

  function RenderFrameSnapshot() {
    ObjectSnapshot.apply(this, arguments);
  }

  RenderFrameSnapshot.prototype = {
    __proto__: ObjectSnapshot.prototype,

    preInitialize: function() {
    },

    initialize: function() {
    },

    get userFriendlyName() {
      return 'RenderFrame';
    }
  };

  ObjectSnapshot.register(
      RenderFrameSnapshot,
      {typeName: 'RenderFrame'});

  function RenderFrameInstance() {
    ObjectInstance.apply(this, arguments);
  }

  RenderFrameInstance.prototype = {
    __proto__: ObjectInstance.prototype
  };

  ObjectInstance.register(
      RenderFrameInstance,
      {typeName: 'RenderFrame'});

  return {
    RenderFrameSnapshot: RenderFrameSnapshot,
    RenderFrameInstance: RenderFrameInstance
  };
});
</script>

<!DOCTYPE html>
<!--
Copyright (c) 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';

tr.exportTo('tr.e.chrome', function() {
  var constants = tr.e.cc.constants;

  var ObjectSnapshot = tr.model.ObjectSnapshot;
  var ObjectInstance = tr.model.ObjectInstance;

  function RenderFrameSnapshot() {
    ObjectSnapshot.apply(this, arguments);
  }

  RenderFrameSnapshot.prototype = {
    __proto__: ObjectSnapshot.prototype,

    preInitialize: function() {
    },

    initialize: function() {
    },

    referencedAt: function(item, object, field) {
      if (item instanceof tr.e.chrome.FrameTreeNodeSnapshot &&
          object === item.args &&
          field === 'RenderFrame') {
        this.args.frameTreeNode = item;
      }
    },

    get userFriendlyName() {
      return 'RenderFrame';
    }
  };

  ObjectSnapshot.register(
      RenderFrameSnapshot,
      {typeName: 'RenderFrame'});

  function RenderFrameInstance() {
    ObjectInstance.apply(this, arguments);
  }

  RenderFrameInstance.prototype = {
    __proto__: ObjectInstance.prototype
  };

  ObjectInstance.register(
      RenderFrameInstance,
      {typeName: 'RenderFrame'});

  return {
    RenderFrameSnapshot: RenderFrameSnapshot,
    RenderFrameInstance: RenderFrameInstance
  };
});
</script>

Add back reference from RenderFrame to FrameTreeNode
Add back reference from RenderFrame to FrameTreeNode

In Chrome, a traced FrameTreeNodeBlameContext contains a
reference to the corresponding FrameBlameContext (if any),
but FrameBlameContext does not have a backward reference.

It would be useful if there are backward references, which
is done by this patch.

Review-Url: https://codereview.chromium.org/2011933004
