Commit 8011a4de authored by Jacobo Aragunde Pérez's avatar Jacobo Aragunde Pérez Committed by Commit Bot

Migrate font_cache_win.mojom to new Mojo types

Convert the implementation and all users of
content::mojom::FonctCacheWin.

Bug: 955171

Change-Id: I434383bf5ef0b036eaca6e005b5f389348344a62
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1827012Reviewed-by: default avatarOksana Zhuravlova <oksamyt@chromium.org>
Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Jacobo Aragunde Pérez <jaragunde@igalia.com>
Cr-Commit-Position: refs/heads/master@{#708521}
parent d27cbd66
......@@ -772,10 +772,10 @@ void ChildThreadImpl::ReleaseCachedFonts() {
GetFontCacheWin()->ReleaseCachedFonts();
}
mojom::FontCacheWin* ChildThreadImpl::GetFontCacheWin() {
if (!font_cache_win_ptr_)
BindHostReceiver(mojo::MakeRequest(&font_cache_win_ptr_));
return font_cache_win_ptr_.get();
const mojo::Remote<mojom::FontCacheWin>& ChildThreadImpl::GetFontCacheWin() {
if (!font_cache_win_)
BindHostReceiver(font_cache_win_.BindNewPipeAndPassReceiver());
return font_cache_win_;
}
#endif
......
......@@ -39,6 +39,7 @@
#if defined(OS_WIN)
#include "content/public/common/font_cache_win.mojom.h"
#include "mojo/public/cpp/bindings/remote.h"
#endif
namespace IPC {
......@@ -216,7 +217,7 @@ class CONTENT_EXPORT ChildThreadImpl
receiver) override;
#if defined(OS_WIN)
mojom::FontCacheWin* GetFontCacheWin();
const mojo::Remote<mojom::FontCacheWin>& GetFontCacheWin();
#endif
std::unique_ptr<mojo::core::ScopedIPCSupport> mojo_ipc_support_;
......@@ -228,7 +229,7 @@ class CONTENT_EXPORT ChildThreadImpl
associated_interface_provider_receivers_;
mojo::AssociatedRemote<mojom::RouteProvider> remote_route_provider_;
#if defined(OS_WIN)
mojom::FontCacheWinPtr font_cache_win_ptr_;
mutable mojo::Remote<mojom::FontCacheWin> font_cache_win_;
#endif
std::unique_ptr<IPC::SyncChannel> channel_;
......
......@@ -14,7 +14,7 @@
#include "base/stl_util.h"
#include "base/strings/string16.h"
#include "base/thread_annotations.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
namespace content {
namespace {
......@@ -137,9 +137,10 @@ FontCacheDispatcher::~FontCacheDispatcher() {
}
// static
void FontCacheDispatcher::Create(mojom::FontCacheWinRequest request) {
mojo::MakeStrongBinding(std::make_unique<FontCacheDispatcher>(),
std::move(request));
void FontCacheDispatcher::Create(
mojo::PendingReceiver<mojom::FontCacheWin> receiver) {
mojo::MakeSelfOwnedReceiver(std::make_unique<FontCacheDispatcher>(),
std::move(receiver));
}
void FontCacheDispatcher::PreCacheFont(const LOGFONT& log_font,
......
......@@ -11,6 +11,7 @@
#include "base/memory/singleton.h"
#include "content/common/content_export.h"
#include "content/public/common/font_cache_win.mojom.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
namespace content {
......@@ -22,7 +23,7 @@ class CONTENT_EXPORT FontCacheDispatcher : public mojom::FontCacheWin {
FontCacheDispatcher();
~FontCacheDispatcher() override;
static void Create(mojom::FontCacheWinRequest request);
static void Create(mojo::PendingReceiver<mojom::FontCacheWin> receiver);
private:
// mojom::FontCacheWin:
......
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