From 5f941c51804df1be9b5919eb60332be0bd512c65 Mon Sep 17 00:00:00 2001 From: deepak1556 Date: Thu, 10 Jan 2019 21:58:15 +0530 Subject: [PATCH] Remove CR_DEFINE_STATIC_LOCAL https://bugs.chromium.org/p/chromium/issues/detail?id=893317 --- atom/browser/api/atom_api_web_contents.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index 3b2d75f43571..c46b8b7e577c 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -47,6 +47,7 @@ #include "atom/common/native_mate_converters/value_converter.h" #include "atom/common/options_switches.h" #include "base/message_loop/message_loop.h" +#include "base/no_destructor.h" #include "base/strings/utf_string_conversions.h" #include "base/threading/thread_restrictions.h" #include "base/threading/thread_task_runner_handle.h" @@ -421,15 +422,14 @@ void WebContents::InitWithSessionAndOptions( #if defined(OS_LINUX) || defined(OS_WIN) // Update font settings. - CR_DEFINE_STATIC_LOCAL( - const gfx::FontRenderParams, params, - (gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(), nullptr))); - prefs->should_antialias_text = params.antialiasing; - prefs->use_subpixel_positioning = params.subpixel_positioning; - prefs->hinting = params.hinting; - prefs->use_autohinter = params.autohinter; - prefs->use_bitmaps = params.use_bitmaps; - prefs->subpixel_rendering = params.subpixel_rendering; + static const base::NoDestructor params( + gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(), nullptr)); + prefs->should_antialias_text = params->antialiasing; + prefs->use_subpixel_positioning = params->subpixel_positioning; + prefs->hinting = params->hinting; + prefs->use_autohinter = params->autohinter; + prefs->use_bitmaps = params->use_bitmaps; + prefs->subpixel_rendering = params->subpixel_rendering; #endif // Save the preferences in C++.