Commit 33f67b99 authored by Tal Pressman's avatar Tal Pressman Committed by Commit Bot

[MBI] Create AgentSchedulingGroup class and mojo interface.

The AgentSchedulingGroup class is effectively empty, and is not yet
instantiated by anything.
The mojo interface is currently empty.

Bug: 1111231
Change-Id: I0c22cf38033a43c15594863d565b688319a69668
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2348241
Commit-Queue: Tal Pressman <talp@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarKouhei Ueno <kouhei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799943}
parent c27cc8d8
......@@ -5,7 +5,11 @@
#ifndef CONTENT_BROWSER_RENDERER_HOST_AGENT_SCHEDULING_GROUP_HOST_H_
#define CONTENT_BROWSER_RENDERER_HOST_AGENT_SCHEDULING_GROUP_HOST_H_
#include <memory>
#include "content/common/agent_scheduling_group.mojom.h"
#include "content/common/content_export.h"
#include "mojo/public/cpp/bindings/remote.h"
namespace content {
......@@ -31,12 +35,22 @@ class CONTENT_EXPORT AgentSchedulingGroupHost {
// Should not be called explicitly. Use Get() instead.
explicit AgentSchedulingGroupHost(RenderProcessHost& process);
virtual ~AgentSchedulingGroupHost();
~AgentSchedulingGroupHost();
RenderProcessHost* GetProcess();
private:
// The RenderProcessHost this AgentSchedulingGroup is assigned to.
RenderProcessHost& process_;
// Internal implementation of content::mojom::AgentSchedulingGroupHost, used
// for responding to calls from the (renderer-side) AgentSchedulingGroup.
std::unique_ptr<content::mojom::AgentSchedulingGroupHost> mojo_impl_;
// Remote stub of content::mojom::AgentSchedulingGroup, used for sending calls
// to the (renderer-side) AgentSchedulingGroup.
std::unique_ptr<mojo::Remote<content::mojom::AgentSchedulingGroup>>
mojo_remote_;
};
} // namespace content
......
......@@ -431,6 +431,7 @@ mojom("mojo_bindings") {
disable_variants = true
sources = [
"agent_scheduling_group.mojom",
"associated_interfaces.mojom",
"child_process.mojom",
"document_scoped_interface_bundle.mojom",
......
// Copyright 2020 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.
module content.mojom;
// Interface for general communication between AgentSchedulingGroup and
// AgentSchedulingGroupHost.
interface AgentSchedulingGroupHost {
};
// Interface for general communication between AgentSchedulingGroupHost and
// AgentSchedulingGroup.
interface AgentSchedulingGroup {
};
......@@ -45,6 +45,8 @@ target(link_target_type, "renderer") {
"accessibility/render_accessibility_impl.h",
"accessibility/render_accessibility_manager.cc",
"accessibility/render_accessibility_manager.h",
"agent_scheduling_group.cc",
"agent_scheduling_group.h",
"android/synchronous_layer_tree_frame_sink_impl.cc",
"android/synchronous_layer_tree_frame_sink_impl.h",
"browser_exposed_renderer_interfaces.cc",
......
// Copyright 2020 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 "content/renderer/agent_scheduling_group.h"
namespace content {
AgentSchedulingGroup::AgentSchedulingGroup() = default;
AgentSchedulingGroup::~AgentSchedulingGroup() = default;
} // namespace content
// Copyright 2020 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.
#ifndef CONTENT_RENDERER_AGENT_SCHEDULING_GROUP_H_
#define CONTENT_RENDERER_AGENT_SCHEDULING_GROUP_H_
#include <memory>
#include "content/common/agent_scheduling_group.mojom.h"
#include "content/common/content_export.h"
#include "mojo/public/cpp/bindings/remote.h"
namespace content {
// Renderer-side representation of AgentSchedulingGroup, used for communication
// with the (browser-side) AgentSchedulingGroupHost. AgentSchedulingGroup is
// Blink's unit of scheduling and performance isolation, which is the only way
// to obtain ordering guarantees between different Mojo (associated) interfaces
// and legacy IPC messages.
class CONTENT_EXPORT AgentSchedulingGroup {
public:
AgentSchedulingGroup();
~AgentSchedulingGroup();
AgentSchedulingGroup(const AgentSchedulingGroup&) = delete;
AgentSchedulingGroup(const AgentSchedulingGroup&&) = delete;
AgentSchedulingGroup& operator=(const AgentSchedulingGroup&) = delete;
AgentSchedulingGroup& operator=(const AgentSchedulingGroup&&) = delete;
private:
// Internal implementation of content::mojom::AgentSchedulingGroup, used for
// responding to calls from the (browser-side) AgentSchedulingGroupHost.
std::unique_ptr<content::mojom::AgentSchedulingGroup> mojo_impl_;
// Remote stub of content::mojom::AgentSchedulingGroupHost, used for sending
// calls to the (browser-side) AgentSchedulingGroupHost.
std::unique_ptr<mojo::Remote<content::mojom::AgentSchedulingGroupHost>>
mojo_remote_;
};
} // namespace content
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment