-
Notifications
You must be signed in to change notification settings - Fork 877
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hook LocalFontFaceSource into font whitelist
- Loading branch information
1 parent
77a4b69
commit 9b8be87
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
chromium_src/third_party/blink/renderer/core/css/local_font_face_source.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* Copyright (c) 2022 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
#include "third_party/blink/renderer/core/css/local_font_face_source.h" | ||
|
||
#include "third_party/blink/renderer/core/execution_context/execution_context.h" | ||
|
||
#define IsLocalFontAvailable IsLocalFontAvailable_ChromiumImpl | ||
|
||
#include "src/third_party/blink/renderer/core/css/local_font_face_source.cc" | ||
|
||
#undef IsLocalFontAvailable | ||
|
||
namespace blink { | ||
|
||
bool LocalFontFaceSource::IsLocalFontAvailable( | ||
const FontDescription& font_description) const { | ||
if (!brave::AllowFontFamily(font_selector_->GetExecutionContext(), | ||
font_name_)) { | ||
return false; | ||
} | ||
|
||
return IsLocalFontAvailable_ChromiumImpl(font_description); | ||
} | ||
|
||
} // namespace blink |
19 changes: 19 additions & 0 deletions
19
chromium_src/third_party/blink/renderer/core/css/local_font_face_source.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* Copyright (c) 2022 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
#ifndef BRAVE_CHROMIUM_SRC_THIRD_PARTY_BLINK_RENDERER_CORE_CSS_LOCAL_FONT_FACE_SOURCE_H_ | ||
#define BRAVE_CHROMIUM_SRC_THIRD_PARTY_BLINK_RENDERER_CORE_CSS_LOCAL_FONT_FACE_SOURCE_H_ | ||
|
||
#include "third_party/blink/renderer/core/css/css_font_face_source.h" | ||
|
||
#define IsLocalFontAvailable \ | ||
IsLocalFontAvailable_ChromiumImpl(const FontDescription&) const; \ | ||
bool IsLocalFontAvailable | ||
|
||
#include "src/third_party/blink/renderer/core/css/local_font_face_source.h" | ||
|
||
#undef IsLocalFontAvailable | ||
|
||
#endif // BRAVE_CHROMIUM_SRC_THIRD_PARTY_BLINK_RENDERER_CORE_CSS_LOCAL_FONT_FACE_SOURCE_H_ |