execution_context_impl.h 1.2 KB

123456789101112131415161718192021222324252627282930
  1. // Copyright 2020 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.
  4. #ifndef COMPONENTS_PERFORMANCE_MANAGER_EXECUTION_CONTEXT_EXECUTION_CONTEXT_IMPL_H_
  5. #define COMPONENTS_PERFORMANCE_MANAGER_EXECUTION_CONTEXT_EXECUTION_CONTEXT_IMPL_H_
  6. namespace performance_manager {
  7. class FrameNode;
  8. class WorkerNode;
  9. namespace execution_context {
  10. class ExecutionContext;
  11. // Constructs ExecutionContext wrappers (implemented as NodeAttachedData) for
  12. // FrameNodes and WorkerNodes. Once created the objects will live until the
  13. // underlying node disappears. These should only be called from the graph
  14. // sequence, like the underlying objects they wrap. The public interface of
  15. // this is via ExecutionContextRegistry::GetExecutionContextFor*Node().
  16. const ExecutionContext* GetOrCreateExecutionContextForFrameNode(
  17. const FrameNode* frame_node);
  18. const ExecutionContext* GetOrCreateExecutionContextForWorkerNode(
  19. const WorkerNode* worker_node);
  20. } // namespace execution_context
  21. } // namespace performance_manager
  22. #endif // COMPONENTS_PERFORMANCE_MANAGER_EXECUTION_CONTEXT_EXECUTION_CONTEXT_IMPL_H_