[MBI] Instantiate AgentSchedulingGroup in the renderer process.

The AgentSchedulingGroup is instantiated in response to a Mojo API
called by AgentSchedulingGroupHost. It is owned by a set on
RenderThreadImpl (dual of AgentSchedulingGroupHost owned by
RenderProcessHost). For now, AgentSchedulingGroups (or their hosts) are
only deleted when their RenderThreadImpl/RenderProcessHost are
destroyed.

Bug: 1111231
Change-Id: Ia3384fcedd200d0536c918933e2a86666cd93a05
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2359950
Commit-Queue: Tal Pressman <[email protected]>
Reviewed-by: Kentaro Hara <[email protected]>
Reviewed-by: Kouhei Ueno <[email protected]>
Reviewed-by: Alexander Timin <[email protected]>
Reviewed-by: Daniel Cheng <[email protected]>
Cr-Commit-Position: refs/heads/master@{#801649}
diff --git a/content/renderer/render_thread_impl.h b/content/renderer/render_thread_impl.h
index 51f5c9d..bb128ce 100644
--- a/content/renderer/render_thread_impl.h
+++ b/content/renderer/render_thread_impl.h
@@ -99,6 +99,7 @@
 }  // namespace viz
 
 namespace content {
+class AgentSchedulingGroup;
 class AudioRendererMixerManager;
 class CategorizedWorkerPool;
 class GpuVideoAcceleratorFactoriesImpl;
@@ -442,6 +443,7 @@
   void CreateView(mojom::CreateViewParamsPtr params) override;
   void DestroyView(int32_t view_id) override;
   void CreateFrame(mojom::CreateFrameParamsPtr params) override;
+  void CreateAgentSchedulingGroup() override;
   void CreateFrameProxy(
       int32_t routing_id,
       int32_t render_view_routing_id,
@@ -614,6 +616,8 @@
 
   mojo::AssociatedRemote<mojom::RenderMessageFilter> render_message_filter_;
 
+  std::set<std::unique_ptr<AgentSchedulingGroup>> agent_scheduling_groups_;
+
   RendererMemoryMetrics purge_and_suspend_memory_metrics_;
   bool needs_to_record_first_active_paint_;
   base::TimeTicks was_backgrounded_time_;