Commit 81582d4c authored by Olivier Yiptong's avatar Olivier Yiptong Committed by Commit Bot

FontAccess: Consolidate build configuration macros

This cleans up the per-platform build configuration preprocessor
directives. With this change, the platform build configurations are
consolidated in one place.

Bug: 1043306
Change-Id: Id9e2da3bf156e245b510ce7b32346df285fd6f79
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2422811
Commit-Queue: Olivier Yiptong <oyiptong@chromium.org>
Auto-Submit: Olivier Yiptong <oyiptong@chromium.org>
Reviewed-by: default avatarJoshua Bell <jsbell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#809240}
parent 26a1fe8e
......@@ -41,8 +41,7 @@ void FontAccessManagerImpl::EnumerateLocalFonts(
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK_CURRENTLY_ON(BrowserThread::UI);
#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \
defined(OS_MAC)
#if defined(PLATFORM_HAS_LOCAL_FONT_ENUMERATION_IMPL)
const BindingContext& context = receivers_.current_context();
RenderFrameHostImpl* rfh = RenderFrameHostImpl::FromID(context.frame_id);
......@@ -103,8 +102,7 @@ void FontAccessManagerImpl::DidRequestPermission(
// Per-platform delegation for obtaining cached font enumeration data occurs
// here, after the permission has been granted.
#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \
defined(OS_MAC)
#if defined(PLATFORM_HAS_LOCAL_FONT_ENUMERATION_IMPL)
ipc_task_runner_->PostTask(
FROM_HERE, base::BindOnce(
[](EnumerateLocalFontsCallback callback,
......
......@@ -7,7 +7,6 @@
#include "base/macros.h"
#include "base/sequence_checker.h"
#include "build/build_config.h"
#include "content/common/content_export.h"
#include "content/public/browser/global_routing_id.h"
#include "mojo/public/cpp/bindings/receiver_set.h"
......
......@@ -7,7 +7,6 @@
#include "base/run_loop.h"
#include "base/test/bind_test_util.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
#include "content/browser/font_access/font_enumeration_cache.h"
#include "content/browser/permissions/permission_controller_impl.h"
#include "content/browser/renderer_host/frame_tree_node.h"
......@@ -177,8 +176,7 @@ class FontAccessManagerImplTest : public RenderViewHostImplTestHarness {
base::test::ScopedFeatureList scoped_feature_list_;
};
#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \
defined(OS_MAC)
#if defined(PLATFORM_HAS_LOCAL_FONT_ENUMERATION_IMPL)
namespace {
void ValidateFontEnumerationBasic(FontEnumerationStatus status,
......
......@@ -6,21 +6,15 @@
#include "base/task/task_traits.h"
#include "base/task/thread_pool.h"
#include "build/build_config.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \
defined(OS_MAC)
#define PLATFORM_HAS_NATIVE_ENUMERATION_IMPL 1
#endif
namespace content {
FontEnumerationCache::FontEnumerationCache() = default;
FontEnumerationCache::~FontEnumerationCache() = default;
#if !defined(PLATFORM_HAS_NATIVE_ENUMERATION_IMPL)
#if !defined(PLATFORM_HAS_LOCAL_FONT_ENUMERATION_IMPL)
// static
FontEnumerationCache* FontEnumerationCache::GetInstance() {
return nullptr;
......
......@@ -10,10 +10,16 @@
#include "base/sequence_checker.h"
#include "base/synchronization/atomic_flag.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "content/common/content_export.h"
#include "third_party/blink/public/common/font_access/font_enumeration_table.pb.h"
#include "third_party/blink/public/mojom/font_access/font_access.mojom.h"
#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \
defined(OS_MAC)
#define PLATFORM_HAS_LOCAL_FONT_ENUMERATION_IMPL 1
#endif
using blink::mojom::FontEnumerationStatus;
namespace content {
......
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