blob: bdabde9a12015501e6bb6e8ac726d270f348fa7d [file] [log] [blame]
// Copyright 2019 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.
#include "third_party/blink/renderer/core/execution_context/agent.h"
namespace v8 {
class Isolate;
namespace blink {
// This corresponds to similar-origin window agent, that is shared by a group
// of Documents that are mutually reachable and have the same-site origins.
// The instance holds per-agent data in addition to the base Agent, that is also
// shared by associated Documents.
class WindowAgent final : public Agent {
// Normally you don't want to call this constructor; instead, use
// WindowAgentFactory::GetAgentForOrigin() so you can get the agent shared
// on the same-site frames.
// This constructor creates a unique agent that won't be shared with any
// other frames. Use this constructor only if:
// - An appropriate instance of WindowAgentFactory is not available
// (this should only happen in tests).
explicit WindowAgent(v8::Isolate* isolate);
~WindowAgent() override;
void Trace(Visitor*) override;
// TODO(keishi): Move per-agent data here with the correct granularity.
// E.g. ActiveMutationObservers and CustomElementReactionStack should move
// here.
} // namespace blink