Commit f1761737 authored by Dominik Röttsches's avatar Dominik Röttsches Committed by Commit Bot

Remove deprecated loading mode switches

These switches were used in an trial to figure out whether they help
with the Windows empty font handle issues. These trials have now been
expired without the intended results and are no longer used.

Bug: 889864
Change-Id: I9ed1376d989b59a71e325cd54604faeaae71a5b1
Reviewed-on: https://chromium-review.googlesource.com/c/1371807Reviewed-by: default avatarEmil A Eklund <eae@chromium.org>
Reviewed-by: default avatarAlexei Svitkine <asvitkine@chromium.org>
Commit-Queue: Dominik Röttsches <drott@chromium.org>
Cr-Commit-Position: refs/heads/master@{#615576}
parent bdddd379
......@@ -38,4 +38,7 @@ per-file embedded_frame_sink*.*=xidachen@chromium.org
per-file embedded_frame_sink*.*=junov@chromium.org
per-file embedded_frame_sink*.*=kylechar@chromium.org
# DirectWrite Font Code
per-file dwrite_*=drott@chromium.org
# COMPONENT: Internals>Core
......@@ -106,17 +106,6 @@ const wchar_t* kLastResortFontNames[] = {
L"Sans", L"Arial", L"MS UI Gothic", L"Microsoft Sans Serif",
L"Segoe UI", L"Calibri", L"Times New Roman", L"Courier New"};
// Feature to enable loading font files from outside the system font directory.
const base::Feature kEnableCustomFonts {
"DirectWriteCustomFonts", base::FEATURE_ENABLED_BY_DEFAULT
};
// Feature to force loading font files using the custom font file path. Has no
// effect if kEnableCustomFonts is disabled.
const base::Feature kForceCustomFonts {
"ForceDirectWriteCustomFonts", base::FEATURE_DISABLED_BY_DEFAULT
};
struct RequiredFontStyle {
const wchar_t* family_name;
DWRITE_FONT_WEIGHT required_weight;
......@@ -179,8 +168,7 @@ bool CheckRequiredStylesPresent(IDWriteFontCollection* collection,
} // namespace
DWriteFontProxyImpl::DWriteFontProxyImpl()
: windows_fonts_path_(GetWindowsFontsPath()),
custom_font_file_loading_mode_(ENABLE) {}
: windows_fonts_path_(GetWindowsFontsPath()) {}
DWriteFontProxyImpl::~DWriteFontProxyImpl() = default;
......@@ -478,11 +466,6 @@ void DWriteFontProxyImpl::InitializeDirectWrite() {
return;
}
if (!base::FeatureList::IsEnabled(kEnableCustomFonts))
custom_font_file_loading_mode_ = DISABLE;
else if (base::FeatureList::IsEnabled(kForceCustomFonts))
custom_font_file_loading_mode_ = FORCE;
// Temp code to help track down crbug.com/561873
for (size_t font = 0; font < arraysize(kLastResortFontNames); font++) {
uint32_t font_index = 0;
......@@ -597,11 +580,9 @@ bool DWriteFontProxyImpl::AddLocalFile(
base::string16 file_path = base::i18n::FoldCase(file_path_chars.data());
if (!base::StartsWith(file_path, windows_fonts_path_,
base::CompareCase::SENSITIVE) ||
custom_font_file_loading_mode_ == FORCE) {
base::CompareCase::SENSITIVE)) {
LogLoaderType(FILE_OUTSIDE_SANDBOX);
if (custom_font_file_loading_mode_ != DISABLE)
custom_font_path_set->insert(file_path);
custom_font_path_set->insert(file_path);
} else {
LogLoaderType(FILE_SYSTEM_FONT_DIR);
path_set->insert(file_path);
......
......@@ -70,14 +70,11 @@ class CONTENT_EXPORT DWriteFontProxyImpl : public mojom::DWriteFontProxy {
bool IsLastResortFallbackFont(uint32_t font_index);
private:
enum CustomFontFileLoadingMode { ENABLE, DISABLE, FORCE };
bool direct_write_initialized_ = false;
Microsoft::WRL::ComPtr<IDWriteFontCollection> collection_;
Microsoft::WRL::ComPtr<IDWriteFactory2> factory2_;
Microsoft::WRL::ComPtr<IDWriteFontFallback> font_fallback_;
base::string16 windows_fonts_path_;
CustomFontFileLoadingMode custom_font_file_loading_mode_;
// Temp code to help track down crbug.com/561873
std::vector<uint32_t> last_resort_fonts_;
......
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