process_hosted_content_types_aggregator.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // Copyright 2021 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_DECORATORS_PROCESS_HOSTED_CONTENT_TYPES_AGGREGATOR_H_
  5. #define COMPONENTS_PERFORMANCE_MANAGER_DECORATORS_PROCESS_HOSTED_CONTENT_TYPES_AGGREGATOR_H_
  6. #include "components/performance_manager/public/graph/frame_node.h"
  7. #include "components/performance_manager/public/graph/graph.h"
  8. #include "components/performance_manager/public/graph/page_node.h"
  9. #include "components/performance_manager/public/graph/worker_node.h"
  10. namespace performance_manager {
  11. // Aggregates the type of content hosted inside a process and populates the
  12. // |hosted_content_types()| property.
  13. class ProcessHostedContentTypesAggregator
  14. : public GraphOwnedDefaultImpl,
  15. public PageNode::ObserverDefaultImpl,
  16. public FrameNode::ObserverDefaultImpl,
  17. public WorkerNode::ObserverDefaultImpl {
  18. public:
  19. ProcessHostedContentTypesAggregator();
  20. ~ProcessHostedContentTypesAggregator() override;
  21. ProcessHostedContentTypesAggregator(
  22. const ProcessHostedContentTypesAggregator&) = delete;
  23. ProcessHostedContentTypesAggregator& operator=(
  24. const ProcessHostedContentTypesAggregator&) = delete;
  25. // GraphOwned:
  26. void OnPassedToGraph(Graph* graph) override;
  27. void OnTakenFromGraph(Graph* graph) override;
  28. // PageNodeObserver:
  29. void OnTypeChanged(const PageNode* page_node) override;
  30. // FrameNodeObserver:
  31. void OnFrameNodeAdded(const FrameNode* frame_node) override;
  32. void OnIsAdFrameChanged(const FrameNode* frame_node) override;
  33. void OnURLChanged(const FrameNode* frame_node,
  34. const GURL& previous_value) override;
  35. // WorkerNodeObserver:
  36. void OnWorkerNodeAdded(const WorkerNode* worker_node) override;
  37. private:
  38. };
  39. } // namespace performance_manager
  40. #endif // COMPONENTS_PERFORMANCE_MANAGER_DECORATORS_PROCESS_HOSTED_CONTENT_TYPES_AGGREGATOR_H_