Commit e473bbcf authored by Julie Jeongeun Kim's avatar Julie Jeongeun Kim Committed by Commit Bot

Convert SandboxSupportMac to new Mojo types

This CL converts SandboxSupportMacPtr and
SandboxSupportMacRequest to new Mojo types. It
uses PendingReceiver, ReceiverSet, and Remote
instead of SandboxSupportMacRequest, BindingSet,
and SandboxSupportMacPtr.

Bug: 955171
Change-Id: I8d216a85939cba01c392bb821e189610d5e5b885
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1786708Reviewed-by: default avatarOksana Zhuravlova <oksamyt@chromium.org>
Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
Commit-Queue: Julie Kim <jkim@igalia.com>
Cr-Commit-Position: refs/heads/master@{#695842}
parent 416faab1
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
#include "base/macros.h" #include "base/macros.h"
#include "content/common/sandbox_support_mac.mojom.h" #include "content/common/sandbox_support_mac.mojom.h"
#include "mojo/public/cpp/bindings/binding_set.h" #include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/receiver_set.h"
namespace service_manager { namespace service_manager {
struct BindSourceInfo; struct BindSourceInfo;
...@@ -25,7 +26,7 @@ class SandboxSupportMacImpl : public mojom::SandboxSupportMac { ...@@ -25,7 +26,7 @@ class SandboxSupportMacImpl : public mojom::SandboxSupportMac {
SandboxSupportMacImpl(); SandboxSupportMacImpl();
~SandboxSupportMacImpl() override; ~SandboxSupportMacImpl() override;
void BindRequest(mojom::SandboxSupportMacRequest request, void BindRequest(mojo::PendingReceiver<mojom::SandboxSupportMac> receiver,
const service_manager::BindSourceInfo& source_info); const service_manager::BindSourceInfo& source_info);
// content::mojom::SandboxSupportMac: // content::mojom::SandboxSupportMac:
...@@ -35,7 +36,7 @@ class SandboxSupportMacImpl : public mojom::SandboxSupportMac { ...@@ -35,7 +36,7 @@ class SandboxSupportMacImpl : public mojom::SandboxSupportMac {
LoadFontCallback callback) override; LoadFontCallback callback) override;
private: private:
mojo::BindingSet<mojom::SandboxSupportMac> bindings_; mojo::ReceiverSet<mojom::SandboxSupportMac> receivers_;
DISALLOW_COPY_AND_ASSIGN(SandboxSupportMacImpl); DISALLOW_COPY_AND_ASSIGN(SandboxSupportMacImpl);
}; };
......
...@@ -18,9 +18,9 @@ SandboxSupportMacImpl::SandboxSupportMacImpl() = default; ...@@ -18,9 +18,9 @@ SandboxSupportMacImpl::SandboxSupportMacImpl() = default;
SandboxSupportMacImpl::~SandboxSupportMacImpl() = default; SandboxSupportMacImpl::~SandboxSupportMacImpl() = default;
void SandboxSupportMacImpl::BindRequest( void SandboxSupportMacImpl::BindRequest(
mojom::SandboxSupportMacRequest request, mojo::PendingReceiver<mojom::SandboxSupportMac> receiver,
const service_manager::BindSourceInfo& source_info) { const service_manager::BindSourceInfo& source_info) {
bindings_.AddBinding(this, std::move(request)); receivers_.Add(this, std::move(receiver));
} }
void SandboxSupportMacImpl::GetSystemColors(GetSystemColorsCallback callback) { void SandboxSupportMacImpl::GetSystemColors(GetSystemColorsCallback callback) {
......
...@@ -21,8 +21,8 @@ namespace content { ...@@ -21,8 +21,8 @@ namespace content {
WebSandboxSupportMac::WebSandboxSupportMac( WebSandboxSupportMac::WebSandboxSupportMac(
service_manager::Connector* connector) { service_manager::Connector* connector) {
connector->BindInterface(content::mojom::kSystemServiceName, connector->Connect(content::mojom::kSystemServiceName,
mojo::MakeRequest(&sandbox_support_)); sandbox_support_.BindNewPipeAndPassReceiver());
sandbox_support_->GetSystemColors(base::BindOnce( sandbox_support_->GetSystemColors(base::BindOnce(
&WebSandboxSupportMac::OnGotSystemColors, base::Unretained(this))); &WebSandboxSupportMac::OnGotSystemColors, base::Unretained(this)));
} }
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "base/memory/read_only_shared_memory_region.h" #include "base/memory/read_only_shared_memory_region.h"
#include "base/memory/shared_memory_mapping.h" #include "base/memory/shared_memory_mapping.h"
#include "content/common/sandbox_support_mac.mojom.h" #include "content/common/sandbox_support_mac.mojom.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "third_party/blink/public/platform/mac/web_sandbox_support.h" #include "third_party/blink/public/platform/mac/web_sandbox_support.h"
namespace service_manager { namespace service_manager {
...@@ -33,7 +34,7 @@ class WebSandboxSupportMac : public blink::WebSandboxSupport { ...@@ -33,7 +34,7 @@ class WebSandboxSupportMac : public blink::WebSandboxSupport {
private: private:
void OnGotSystemColors(base::ReadOnlySharedMemoryRegion region); void OnGotSystemColors(base::ReadOnlySharedMemoryRegion region);
mojom::SandboxSupportMacPtr sandbox_support_; mojo::Remote<mojom::SandboxSupportMac> sandbox_support_;
base::ReadOnlySharedMemoryMapping color_map_; base::ReadOnlySharedMemoryMapping color_map_;
DISALLOW_COPY_AND_ASSIGN(WebSandboxSupportMac); DISALLOW_COPY_AND_ASSIGN(WebSandboxSupportMac);
......
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