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() { ...@@ -772,10 +772,10 @@ void ChildThreadImpl::ReleaseCachedFonts() {
GetFontCacheWin()->ReleaseCachedFonts(); GetFontCacheWin()->ReleaseCachedFonts();
} }
mojom::FontCacheWin* ChildThreadImpl::GetFontCacheWin() { const mojo::Remote<mojom::FontCacheWin>& ChildThreadImpl::GetFontCacheWin() {
if (!font_cache_win_ptr_) if (!font_cache_win_)
BindHostReceiver(mojo::MakeRequest(&font_cache_win_ptr_)); BindHostReceiver(font_cache_win_.BindNewPipeAndPassReceiver());
return font_cache_win_ptr_.get(); return font_cache_win_;
} }
#endif #endif
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#if defined(OS_WIN) #if defined(OS_WIN)
#include "content/public/common/font_cache_win.mojom.h" #include "content/public/common/font_cache_win.mojom.h"
#include "mojo/public/cpp/bindings/remote.h"
#endif #endif
namespace IPC { namespace IPC {
...@@ -216,7 +217,7 @@ class CONTENT_EXPORT ChildThreadImpl ...@@ -216,7 +217,7 @@ class CONTENT_EXPORT ChildThreadImpl
receiver) override; receiver) override;
#if defined(OS_WIN) #if defined(OS_WIN)
mojom::FontCacheWin* GetFontCacheWin(); const mojo::Remote<mojom::FontCacheWin>& GetFontCacheWin();
#endif #endif
std::unique_ptr<mojo::core::ScopedIPCSupport> mojo_ipc_support_; std::unique_ptr<mojo::core::ScopedIPCSupport> mojo_ipc_support_;
...@@ -228,7 +229,7 @@ class CONTENT_EXPORT ChildThreadImpl ...@@ -228,7 +229,7 @@ class CONTENT_EXPORT ChildThreadImpl
associated_interface_provider_receivers_; associated_interface_provider_receivers_;
mojo::AssociatedRemote<mojom::RouteProvider> remote_route_provider_; mojo::AssociatedRemote<mojom::RouteProvider> remote_route_provider_;
#if defined(OS_WIN) #if defined(OS_WIN)
mojom::FontCacheWinPtr font_cache_win_ptr_; mutable mojo::Remote<mojom::FontCacheWin> font_cache_win_;
#endif #endif
std::unique_ptr<IPC::SyncChannel> channel_; std::unique_ptr<IPC::SyncChannel> channel_;
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include "base/stl_util.h" #include "base/stl_util.h"
#include "base/strings/string16.h" #include "base/strings/string16.h"
#include "base/thread_annotations.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 content {
namespace { namespace {
...@@ -137,9 +137,10 @@ FontCacheDispatcher::~FontCacheDispatcher() { ...@@ -137,9 +137,10 @@ FontCacheDispatcher::~FontCacheDispatcher() {
} }
// static // static
void FontCacheDispatcher::Create(mojom::FontCacheWinRequest request) { void FontCacheDispatcher::Create(
mojo::MakeStrongBinding(std::make_unique<FontCacheDispatcher>(), mojo::PendingReceiver<mojom::FontCacheWin> receiver) {
std::move(request)); mojo::MakeSelfOwnedReceiver(std::make_unique<FontCacheDispatcher>(),
std::move(receiver));
} }
void FontCacheDispatcher::PreCacheFont(const LOGFONT& log_font, void FontCacheDispatcher::PreCacheFont(const LOGFONT& log_font,
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "base/memory/singleton.h" #include "base/memory/singleton.h"
#include "content/common/content_export.h" #include "content/common/content_export.h"
#include "content/public/common/font_cache_win.mojom.h" #include "content/public/common/font_cache_win.mojom.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
namespace content { namespace content {
...@@ -22,7 +23,7 @@ class CONTENT_EXPORT FontCacheDispatcher : public mojom::FontCacheWin { ...@@ -22,7 +23,7 @@ class CONTENT_EXPORT FontCacheDispatcher : public mojom::FontCacheWin {
FontCacheDispatcher(); FontCacheDispatcher();
~FontCacheDispatcher() override; ~FontCacheDispatcher() override;
static void Create(mojom::FontCacheWinRequest request); static void Create(mojo::PendingReceiver<mojom::FontCacheWin> receiver);
private: private:
// mojom::FontCacheWin: // 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