summaryrefslogtreecommitdiff
path: root/chromium/content/child
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-07-31 15:50:41 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-08-30 12:35:23 +0000
commit7b2ffa587235a47d4094787d72f38102089f402a (patch)
tree30e82af9cbab08a7fa028bb18f4f2987a3f74dfa /chromium/content/child
parentd94af01c90575348c4e81a418257f254b6f8d225 (diff)
downloadqtwebengine-chromium-7b2ffa587235a47d4094787d72f38102089f402a.tar.gz
BASELINE: Update Chromium to 76.0.3809.94
Change-Id: I321c3f5f929c105aec0f98c5091ef6108822e647 Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/content/child')
-rw-r--r--chromium/content/child/BUILD.gn12
-rw-r--r--chromium/content/child/blink_platform_impl.cc83
-rw-r--r--chromium/content/child/blink_platform_impl.h16
-rw-r--r--chromium/content/child/child_process.cc29
-rw-r--r--chromium/content/child/child_process.h6
-rw-r--r--chromium/content/child/child_process_sandbox_support_impl_mac.cc2
-rw-r--r--chromium/content/child/child_thread_impl.cc8
-rw-r--r--chromium/content/child/dwrite_font_proxy/dwrite_font_proxy_init_impl_win.cc4
-rw-r--r--chromium/content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc4
-rw-r--r--chromium/content/child/font_warmup_win.cc2
-rw-r--r--chromium/content/child/font_warmup_win_unittest.cc24
-rw-r--r--chromium/content/child/runtime_features.cc109
-rw-r--r--chromium/content/child/webthemeengine_impl_android.cc8
-rw-r--r--chromium/content/child/webthemeengine_impl_android.h3
-rw-r--r--chromium/content/child/webthemeengine_impl_default.cc16
-rw-r--r--chromium/content/child/webthemeengine_impl_default.h3
-rw-r--r--chromium/content/child/webthemeengine_impl_mac.h4
17 files changed, 197 insertions, 136 deletions
diff --git a/chromium/content/child/BUILD.gn b/chromium/content/child/BUILD.gn
index 16e1d03b4d4..d696471083b 100644
--- a/chromium/content/child/BUILD.gn
+++ b/chromium/content/child/BUILD.gn
@@ -112,7 +112,6 @@ target(link_target_type, "child") {
"//storage/common",
"//third_party/blink/public:blink_headers",
"//third_party/blink/public:buildflags",
- "//third_party/blink/public:mojo_bindings",
"//third_party/blink/public:resources",
"//third_party/blink/public:scaled_resources",
"//third_party/blink/public/common",
@@ -129,18 +128,15 @@ target(link_target_type, "child") {
"//v8",
]
- if (!use_default_render_theme) {
- sources -= [
- "webthemeengine_impl_default.cc",
- "webthemeengine_impl_default.h",
- ]
- }
-
if (is_android) {
deps += [ "//third_party/android_sdk:cpu_features" ]
if (notouch_build) {
configs += [ ":notouch_config" ]
}
+ sources -= [
+ "webthemeengine_impl_default.cc",
+ "webthemeengine_impl_default.h",
+ ]
}
if (is_linux) {
diff --git a/chromium/content/child/blink_platform_impl.cc b/chromium/content/child/blink_platform_impl.cc
index 3ce31a5ea07..353e35a78ce 100644
--- a/chromium/content/child/blink_platform_impl.cc
+++ b/chromium/content/child/blink_platform_impl.cc
@@ -33,6 +33,7 @@
#include "content/app/resources/grit/content_resources.h"
#include "content/app/strings/grit/content_strings.h"
#include "content/child/child_thread_impl.h"
+#include "content/common/appcache_interfaces.h"
#include "content/common/service_worker/service_worker_utils.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_features.h"
@@ -50,8 +51,19 @@
#include "third_party/blink/public/resources/grit/blink_resources.h"
#include "third_party/zlib/google/compression_utils.h"
#include "ui/base/layout.h"
+#include "ui/base/ui_base_features.h"
#include "ui/events/gestures/blink/web_gesture_curve_impl.h"
+#if defined(OS_ANDROID)
+#include "content/child/webthemeengine_impl_android.h"
+#else
+#include "content/child/webthemeengine_impl_default.h"
+#endif
+
+#if defined(OS_MACOSX)
+#include "content/child/webthemeengine_impl_mac.h"
+#endif
+
using blink::WebData;
using blink::WebLocalizedString;
using blink::WebString;
@@ -61,7 +73,21 @@ using blink::WebURLError;
namespace content {
-static int ToMessageID(WebLocalizedString::Name name) {
+namespace {
+
+std::unique_ptr<blink::WebThemeEngine> GetWebThemeEngine() {
+#if defined(OS_ANDROID)
+ return std::make_unique<WebThemeEngineAndroid>();
+#elif defined(OS_MACOSX)
+ if (features::IsFormControlsRefreshEnabled())
+ return std::make_unique<WebThemeEngineDefault>();
+ return std::make_unique<WebThemeEngineMac>();
+#else
+ return std::make_unique<WebThemeEngineDefault>();
+#endif
+}
+
+int ToMessageID(WebLocalizedString::Name name) {
switch (name) {
case WebLocalizedString::kAXAMPMFieldText:
return IDS_AX_AM_PM_FIELD_TEXT;
@@ -323,30 +349,6 @@ static int ToMessageID(WebLocalizedString::Name name) {
return -1;
}
-// TODO(skyostil): Ensure that we always have an active task runner when
-// constructing the platform.
-BlinkPlatformImpl::BlinkPlatformImpl()
- : BlinkPlatformImpl(base::ThreadTaskRunnerHandle::IsSet()
- ? base::ThreadTaskRunnerHandle::Get()
- : nullptr,
- nullptr) {}
-
-BlinkPlatformImpl::BlinkPlatformImpl(
- scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner,
- scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner)
- : main_thread_task_runner_(std::move(main_thread_task_runner)),
- io_thread_task_runner_(std::move(io_thread_task_runner)) {}
-
-BlinkPlatformImpl::~BlinkPlatformImpl() {
-}
-
-void BlinkPlatformImpl::RecordAction(const blink::UserMetricsAction& name) {
- if (ChildThread* child_thread = ChildThread::Get())
- child_thread->RecordComputedAction(name.Action());
-}
-
-namespace {
-
WebData loadAudioSpatializationResource(const char* name) {
#ifdef IDR_AUDIO_SPATIALIZATION_COMPOSITE
if (!strcmp(name, "Composite")) {
@@ -533,6 +535,28 @@ class NestedMessageLoopRunnerImpl
} // namespace
+// TODO(skyostil): Ensure that we always have an active task runner when
+// constructing the platform.
+BlinkPlatformImpl::BlinkPlatformImpl()
+ : BlinkPlatformImpl(base::ThreadTaskRunnerHandle::IsSet()
+ ? base::ThreadTaskRunnerHandle::Get()
+ : nullptr,
+ nullptr) {}
+
+BlinkPlatformImpl::BlinkPlatformImpl(
+ scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner)
+ : main_thread_task_runner_(std::move(main_thread_task_runner)),
+ io_thread_task_runner_(std::move(io_thread_task_runner)),
+ native_theme_engine_(GetWebThemeEngine()) {}
+
+BlinkPlatformImpl::~BlinkPlatformImpl() {}
+
+void BlinkPlatformImpl::RecordAction(const blink::UserMetricsAction& name) {
+ if (ChildThread* child_thread = ChildThread::Get())
+ child_thread->RecordComputedAction(name.Action());
+}
+
WebData BlinkPlatformImpl::GetDataResource(const char* name) {
// Some clients will call into this method with an empty |name| when they have
// optional resources. For example, the PopupMenuChromium code can have icons
@@ -624,13 +648,12 @@ const char* BlinkPlatformImpl::GetBrowserServiceName() const {
return mojom::kBrowserServiceName;
}
-blink::WebMediaCapabilitiesClient*
-BlinkPlatformImpl::MediaCapabilitiesClient() {
- return &media_capabilities_client_;
+WebThemeEngine* BlinkPlatformImpl::ThemeEngine() {
+ return native_theme_engine_.get();
}
-WebThemeEngine* BlinkPlatformImpl::ThemeEngine() {
- return &native_theme_engine_;
+bool BlinkPlatformImpl::IsURLSupportedForAppCache(const blink::WebURL& url) {
+ return IsSchemeSupportedForAppCache(url);
}
base::File BlinkPlatformImpl::DatabaseOpenFile(
diff --git a/chromium/content/child/blink_platform_impl.h b/chromium/content/child/blink_platform_impl.h
index aa60edda9b7..7bde51bf3d0 100644
--- a/chromium/content/child/blink_platform_impl.h
+++ b/chromium/content/child/blink_platform_impl.h
@@ -16,23 +16,12 @@
#include "build/build_config.h"
#include "components/webcrypto/webcrypto_impl.h"
#include "content/common/content_export.h"
-#include "media/blink/webmediacapabilitiesclient_impl.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/public/platform/web_gesture_device.h"
#include "third_party/blink/public/platform/web_url_error.h"
#include "third_party/blink/public/public_buildflags.h"
#include "ui/base/layout.h"
-#if BUILDFLAG(USE_DEFAULT_RENDER_THEME)
-#include "content/child/webthemeengine_impl_default.h"
-#elif defined(OS_WIN)
-#include "content/child/webthemeengine_impl_win.h"
-#elif defined(OS_MACOSX)
-#include "content/child/webthemeengine_impl_mac.h"
-#elif defined(OS_ANDROID)
-#include "content/child/webthemeengine_impl_android.h"
-#endif
-
namespace content {
class WebCryptoImpl;
@@ -47,6 +36,7 @@ class CONTENT_EXPORT BlinkPlatformImpl : public blink::Platform {
// Platform methods (partial implementation):
blink::WebThemeEngine* ThemeEngine() override;
+ bool IsURLSupportedForAppCache(const blink::WebURL& url) override;
base::File DatabaseOpenFile(const blink::WebString& vfs_file_name,
int desired_flags) override;
int DatabaseDeleteFile(const blink::WebString& vfs_file_name,
@@ -77,7 +67,6 @@ class CONTENT_EXPORT BlinkPlatformImpl : public blink::Platform {
const blink::WebSecurityOrigin& script_origin) override;
blink::WebCrypto* Crypto() override;
const char* GetBrowserServiceName() const override;
- blink::WebMediaCapabilitiesClient* MediaCapabilitiesClient() override;
scoped_refptr<base::SingleThreadTaskRunner> GetIOTaskRunner() const override;
std::unique_ptr<NestedMessageLoopRunner> CreateNestedMessageLoopRunner()
@@ -86,9 +75,8 @@ class CONTENT_EXPORT BlinkPlatformImpl : public blink::Platform {
private:
scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner_;
- WebThemeEngineImpl native_theme_engine_;
+ std::unique_ptr<blink::WebThemeEngine> native_theme_engine_;
webcrypto::WebCryptoImpl web_crypto_;
- media::WebMediaCapabilitiesClientImpl media_capabilities_client_;
};
} // namespace content
diff --git a/chromium/content/child/child_process.cc b/chromium/content/child/child_process.cc
index 9313e993d91..3d4cd9e7b63 100644
--- a/chromium/content/child/child_process.cc
+++ b/chromium/content/child/child_process.cc
@@ -24,10 +24,10 @@ base::LazyInstance<base::ThreadLocalPointer<ChildProcess>>::DestructorAtExit
g_lazy_child_process_tls = LAZY_INSTANCE_INITIALIZER;
}
-ChildProcess::ChildProcess(
- base::ThreadPriority io_thread_priority,
- const std::string& thread_pool_name,
- std::unique_ptr<base::ThreadPool::InitParams> thread_pool_init_params)
+ChildProcess::ChildProcess(base::ThreadPriority io_thread_priority,
+ const std::string& thread_pool_name,
+ std::unique_ptr<base::ThreadPoolInstance::InitParams>
+ thread_pool_init_params)
: ref_count_(0),
shutdown_event_(base::WaitableEvent::ResetPolicy::MANUAL,
base::WaitableEvent::InitialState::NOT_SIGNALED),
@@ -35,18 +35,19 @@ ChildProcess::ChildProcess(
DCHECK(!g_lazy_child_process_tls.Pointer()->Get());
g_lazy_child_process_tls.Pointer()->Set(this);
- // Initialize ThreadPool if not already done. A ThreadPool may already
- // exist when ChildProcess is instantiated in the browser process or in a
- // test process.
- if (!base::ThreadPool::GetInstance()) {
+ // Initialize ThreadPoolInstance if not already done. A ThreadPoolInstance may
+ // already exist when ChildProcess is instantiated in the browser process or
+ // in a test process.
+ if (!base::ThreadPoolInstance::Get()) {
if (thread_pool_init_params) {
- base::ThreadPool::Create(thread_pool_name);
- base::ThreadPool::GetInstance()->Start(*thread_pool_init_params.get());
+ base::ThreadPoolInstance::Create(thread_pool_name);
+ base::ThreadPoolInstance::Get()->Start(*thread_pool_init_params.get());
} else {
- base::ThreadPool::CreateAndStartWithDefaultParams(thread_pool_name);
+ base::ThreadPoolInstance::CreateAndStartWithDefaultParams(
+ thread_pool_name);
}
- DCHECK(base::ThreadPool::GetInstance());
+ DCHECK(base::ThreadPoolInstance::Get());
initialized_thread_pool_ = true;
}
@@ -85,8 +86,8 @@ ChildProcess::~ChildProcess() {
io_thread_.Stop();
if (initialized_thread_pool_) {
- DCHECK(base::ThreadPool::GetInstance());
- base::ThreadPool::GetInstance()->Shutdown();
+ DCHECK(base::ThreadPoolInstance::Get());
+ base::ThreadPoolInstance::Get()->Shutdown();
}
}
diff --git a/chromium/content/child/child_process.h b/chromium/content/child/child_process.h
index 71c9e34524b..e82fb51d54c 100644
--- a/chromium/content/child/child_process.h
+++ b/chromium/content/child/child_process.h
@@ -43,8 +43,8 @@ class CONTENT_EXPORT ChildProcess {
ChildProcess(
base::ThreadPriority io_thread_priority = base::ThreadPriority::NORMAL,
const std::string& thread_pool_name = "ContentChild",
- std::unique_ptr<base::ThreadPool::InitParams> thread_pool_init_params =
- nullptr);
+ std::unique_ptr<base::ThreadPoolInstance::InitParams>
+ thread_pool_init_params = nullptr);
virtual ~ChildProcess();
// May be NULL if the main thread hasn't been set explicitly.
@@ -97,7 +97,7 @@ class CONTENT_EXPORT ChildProcess {
// io_thread_.
std::unique_ptr<ChildThreadImpl> main_thread_;
- // Whether this ChildProcess initialized ThreadPool.
+ // Whether this ChildProcess initialized ThreadPoolInstance.
bool initialized_thread_pool_ = false;
DISALLOW_COPY_AND_ASSIGN(ChildProcess);
diff --git a/chromium/content/child/child_process_sandbox_support_impl_mac.cc b/chromium/content/child/child_process_sandbox_support_impl_mac.cc
index 2eb514c648f..bb5559dea58 100644
--- a/chromium/content/child/child_process_sandbox_support_impl_mac.cc
+++ b/chromium/content/child/child_process_sandbox_support_impl_mac.cc
@@ -21,7 +21,7 @@ namespace content {
WebSandboxSupportMac::WebSandboxSupportMac(
service_manager::Connector* connector) {
- connector->BindInterface(content::mojom::kBrowserServiceName,
+ connector->BindInterface(content::mojom::kSystemServiceName,
mojo::MakeRequest(&sandbox_support_));
sandbox_support_->GetSystemColors(base::BindOnce(
&WebSandboxSupportMac::OnGotSystemColors, base::Unretained(this)));
diff --git a/chromium/content/child/child_thread_impl.cc b/chromium/content/child/child_thread_impl.cc
index caab65d3c9c..e7807e56ebb 100644
--- a/chromium/content/child/child_thread_impl.cc
+++ b/chromium/content/child/child_thread_impl.cc
@@ -240,8 +240,10 @@ class ChannelBootstrapFilter : public ConnectionFilter {
const std::string& interface_name,
mojo::ScopedMessagePipeHandle* interface_pipe,
service_manager::Connector* connector) override {
- if (source_info.identity.name() != mojom::kBrowserServiceName)
+ if (source_info.identity.name() != mojom::kBrowserServiceName &&
+ source_info.identity.name() != mojom::kSystemServiceName) {
return;
+ }
if (interface_name == IPC::mojom::ChannelBootstrap::Name_) {
DCHECK(bootstrap_.is_valid());
@@ -367,7 +369,7 @@ void ChildThreadImpl::OnFieldTrialGroupFinalized(
const std::string& trial_name,
const std::string& group_name) {
mojom::FieldTrialRecorderPtr field_trial_recorder;
- GetConnector()->BindInterface(mojom::kBrowserServiceName,
+ GetConnector()->BindInterface(mojom::kSystemServiceName,
&field_trial_recorder);
field_trial_recorder->FieldTrialActivated(trial_name);
}
@@ -614,7 +616,7 @@ void ChildThreadImpl::ReleaseCachedFonts() {
mojom::FontCacheWin* ChildThreadImpl::GetFontCacheWin() {
if (!font_cache_win_ptr_) {
- GetConnector()->BindInterface(mojom::kBrowserServiceName,
+ GetConnector()->BindInterface(mojom::kSystemServiceName,
&font_cache_win_ptr_);
}
return font_cache_win_ptr_.get();
diff --git a/chromium/content/child/dwrite_font_proxy/dwrite_font_proxy_init_impl_win.cc b/chromium/content/child/dwrite_font_proxy/dwrite_font_proxy_init_impl_win.cc
index 83a2859feff..f9166904638 100644
--- a/chromium/content/child/dwrite_font_proxy/dwrite_font_proxy_init_impl_win.cc
+++ b/chromium/content/child/dwrite_font_proxy/dwrite_font_proxy_init_impl_win.cc
@@ -59,7 +59,7 @@ void InitializeDWriteFontProxy(service_manager::Connector* connector) {
if (g_connection_callback_override) {
dwrite_font_proxy = g_connection_callback_override->Run();
} else if (connector) {
- connector->BindInterface(mojom::kBrowserServiceName,
+ connector->BindInterface(mojom::kSystemServiceName,
mojo::MakeRequest(&dwrite_font_proxy));
}
// If |connector| is not provided, the connection to the browser will be
@@ -91,7 +91,7 @@ void InitializeDWriteFontProxy(service_manager::Connector* connector) {
// This flag can be removed when Win8.0 and earlier are no longer supported.
bool fallback_available = g_font_fallback != nullptr;
DCHECK_EQ(fallback_available,
- base::win::GetVersion() > base::win::VERSION_WIN8);
+ base::win::GetVersion() > base::win::Version::WIN8);
blink::WebFontRendering::SetUseSkiaFontFallback(fallback_available);
}
diff --git a/chromium/content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc b/chromium/content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc
index c28736ebd80..8b0ed34dc4b 100644
--- a/chromium/content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc
+++ b/chromium/content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc
@@ -369,13 +369,13 @@ blink::mojom::DWriteFontProxy& DWriteFontCollectionProxy::GetFontProxy() {
blink::mojom::DWriteFontProxyPtrInfo dwrite_font_proxy;
if (main_task_runner_->RunsTasksInCurrentSequence()) {
ChildThread::Get()->GetConnector()->BindInterface(
- mojom::kBrowserServiceName, mojo::MakeRequest(&dwrite_font_proxy));
+ mojom::kSystemServiceName, mojo::MakeRequest(&dwrite_font_proxy));
} else {
main_task_runner_->PostTask(
FROM_HERE, base::BindOnce(
[](blink::mojom::DWriteFontProxyRequest request) {
ChildThread::Get()->GetConnector()->BindInterface(
- mojom::kBrowserServiceName, std::move(request));
+ mojom::kSystemServiceName, std::move(request));
},
mojo::MakeRequest(&dwrite_font_proxy)));
}
diff --git a/chromium/content/child/font_warmup_win.cc b/chromium/content/child/font_warmup_win.cc
index 87de0591ea9..4de26d24aec 100644
--- a/chromium/content/child/font_warmup_win.cc
+++ b/chromium/content/child/font_warmup_win.cc
@@ -388,7 +388,7 @@ void PatchServiceManagerCalls() {
if (is_patched)
return;
const char* service_provider_dll =
- (base::win::GetVersion() >= base::win::VERSION_WIN8
+ (base::win::GetVersion() >= base::win::Version::WIN8
? "api-ms-win-service-management-l1-1-0.dll"
: "advapi32.dll");
diff --git a/chromium/content/child/font_warmup_win_unittest.cc b/chromium/content/child/font_warmup_win_unittest.cc
index 32b556a0827..00564b98a16 100644
--- a/chromium/content/child/font_warmup_win_unittest.cc
+++ b/chromium/content/child/font_warmup_win_unittest.cc
@@ -136,7 +136,7 @@ int CALLBACK EnumFontCallbackTest(const LOGFONT* log_font,
} // namespace
TEST_F(GDIFontEmulationTest, CreateDeleteDCSuccess) {
- if (base::win::GetVersion() < base::win::VERSION_WIN8)
+ if (base::win::GetVersion() < base::win::Version::WIN8)
return;
std::unique_ptr<GdiFontPatchData> patch_data(SetupTest());
EXPECT_FALSE(!patch_data);
@@ -149,7 +149,7 @@ TEST_F(GDIFontEmulationTest, CreateDeleteDCSuccess) {
}
TEST_F(GDIFontEmulationTest, CreateUniqueDCSuccess) {
- if (base::win::GetVersion() < base::win::VERSION_WIN8)
+ if (base::win::GetVersion() < base::win::Version::WIN8)
return;
std::unique_ptr<GdiFontPatchData> patch_data(SetupTest());
EXPECT_NE(patch_data, nullptr);
@@ -166,7 +166,7 @@ TEST_F(GDIFontEmulationTest, CreateUniqueDCSuccess) {
}
TEST_F(GDIFontEmulationTest, CreateFontSuccess) {
- if (base::win::GetVersion() < base::win::VERSION_WIN8)
+ if (base::win::GetVersion() < base::win::Version::WIN8)
return;
std::unique_ptr<GdiFontPatchData> patch_data(SetupTest());
EXPECT_NE(patch_data, nullptr);
@@ -179,7 +179,7 @@ TEST_F(GDIFontEmulationTest, CreateFontSuccess) {
}
TEST_F(GDIFontEmulationTest, CreateFontFailure) {
- if (base::win::GetVersion() < base::win::VERSION_WIN8)
+ if (base::win::GetVersion() < base::win::Version::WIN8)
return;
std::unique_ptr<GdiFontPatchData> patch_data(SetupTest());
EXPECT_NE(patch_data, nullptr);
@@ -190,7 +190,7 @@ TEST_F(GDIFontEmulationTest, CreateFontFailure) {
}
TEST_F(GDIFontEmulationTest, EnumFontFamilySuccess) {
- if (base::win::GetVersion() < base::win::VERSION_WIN8)
+ if (base::win::GetVersion() < base::win::Version::WIN8)
return;
std::unique_ptr<GdiFontPatchData> patch_data(SetupTest());
EXPECT_NE(patch_data, nullptr);
@@ -204,7 +204,7 @@ TEST_F(GDIFontEmulationTest, EnumFontFamilySuccess) {
}
TEST_F(GDIFontEmulationTest, EnumFontFamilyFailure) {
- if (base::win::GetVersion() < base::win::VERSION_WIN8)
+ if (base::win::GetVersion() < base::win::Version::WIN8)
return;
std::unique_ptr<GdiFontPatchData> patch_data(SetupTest());
EXPECT_NE(patch_data, nullptr);
@@ -218,7 +218,7 @@ TEST_F(GDIFontEmulationTest, EnumFontFamilyFailure) {
}
TEST_F(GDIFontEmulationTest, DeleteDCFailure) {
- if (base::win::GetVersion() < base::win::VERSION_WIN8)
+ if (base::win::GetVersion() < base::win::Version::WIN8)
return;
std::unique_ptr<GdiFontPatchData> patch_data(SetupTest());
EXPECT_NE(patch_data, nullptr);
@@ -227,7 +227,7 @@ TEST_F(GDIFontEmulationTest, DeleteDCFailure) {
}
TEST_F(GDIFontEmulationTest, DeleteObjectFailure) {
- if (base::win::GetVersion() < base::win::VERSION_WIN8)
+ if (base::win::GetVersion() < base::win::Version::WIN8)
return;
std::unique_ptr<GdiFontPatchData> patch_data(SetupTest());
EXPECT_NE(patch_data, nullptr);
@@ -236,7 +236,7 @@ TEST_F(GDIFontEmulationTest, DeleteObjectFailure) {
}
TEST_F(GDIFontEmulationTest, GetFontDataSizeSuccess) {
- if (base::win::GetVersion() < base::win::VERSION_WIN8)
+ if (base::win::GetVersion() < base::win::Version::WIN8)
return;
std::unique_ptr<GdiFontPatchData> patch_data(SetupTest());
EXPECT_NE(patch_data, nullptr);
@@ -255,7 +255,7 @@ TEST_F(GDIFontEmulationTest, GetFontDataSizeSuccess) {
}
TEST_F(GDIFontEmulationTest, GetFontDataInvalidTagSuccess) {
- if (base::win::GetVersion() < base::win::VERSION_WIN8)
+ if (base::win::GetVersion() < base::win::Version::WIN8)
return;
std::unique_ptr<GdiFontPatchData> patch_data(SetupTest());
EXPECT_NE(patch_data, nullptr);
@@ -273,7 +273,7 @@ TEST_F(GDIFontEmulationTest, GetFontDataInvalidTagSuccess) {
}
TEST_F(GDIFontEmulationTest, GetFontDataInvalidFontSuccess) {
- if (base::win::GetVersion() < base::win::VERSION_WIN8)
+ if (base::win::GetVersion() < base::win::Version::WIN8)
return;
std::unique_ptr<GdiFontPatchData> patch_data(SetupTest());
EXPECT_NE(patch_data, nullptr);
@@ -285,7 +285,7 @@ TEST_F(GDIFontEmulationTest, GetFontDataInvalidFontSuccess) {
}
TEST_F(GDIFontEmulationTest, GetFontDataDataSuccess) {
- if (base::win::GetVersion() < base::win::VERSION_WIN8)
+ if (base::win::GetVersion() < base::win::Version::WIN8)
return;
std::unique_ptr<GdiFontPatchData> patch_data(SetupTest());
EXPECT_NE(patch_data, nullptr);
diff --git a/chromium/content/child/runtime_features.cc b/chromium/content/child/runtime_features.cc
index 06bde878ad2..d292b5ac80b 100644
--- a/chromium/content/child/runtime_features.cc
+++ b/chromium/content/child/runtime_features.cc
@@ -23,6 +23,7 @@
#include "services/network/public/cpp/features.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/platform/web_runtime_features.h"
+#include "ui/base/ui_base_features.h"
#include "ui/events/blink/blink_features.h"
#include "ui/gfx/switches.h"
#include "ui/gl/gl_switches.h"
@@ -49,7 +50,7 @@ void SetRuntimeFeatureDefaultsForPlatform() {
#endif
#if defined(OS_WIN)
- if (base::win::GetVersion() >= base::win::VERSION_WIN10)
+ if (base::win::GetVersion() >= base::win::Version::WIN10)
WebRuntimeFeatures::EnableWebBluetooth(true);
#endif
}
@@ -66,12 +67,16 @@ void SetIndividualRuntimeFeatures(
WebRuntimeFeatures::EnableBlinkHeapIncrementalMarking(
base::FeatureList::IsEnabled(features::kBlinkHeapIncrementalMarking));
+ WebRuntimeFeatures::EnableBlinkHeapUnifiedGCScheduling(
+ base::FeatureList::IsEnabled(features::kBlinkHeapUnifiedGCScheduling));
+
if (base::FeatureList::IsEnabled(features::kBloatedRendererDetection))
WebRuntimeFeatures::EnableBloatedRendererDetection(true);
- WebRuntimeFeatures::EnableBlockingFocusWithoutUserActivation(
- base::FeatureList::IsEnabled(
- blink::features::kBlockingFocusWithoutUserActivation));
+ if (base::FeatureList::IsEnabled(
+ blink::features::kBlockingFocusWithoutUserActivation)) {
+ WebRuntimeFeatures::EnableBlockingFocusWithoutUserActivation(true);
+ }
if (command_line.HasSwitch(switches::kDisableDatabases))
WebRuntimeFeatures::EnableDatabase(false);
@@ -105,8 +110,11 @@ void SetIndividualRuntimeFeatures(
if (command_line.HasSwitch(switches::kDisableFileSystem))
WebRuntimeFeatures::EnableFileSystem(false);
- if (!command_line.HasSwitch(switches::kDisableAcceleratedJpegDecoding))
- WebRuntimeFeatures::EnableDecodeToYUV(true);
+ if (!command_line.HasSwitch(switches::kDisableYUVImageDecoding) &&
+ base::FeatureList::IsEnabled(
+ blink::features::kDecodeLossyWebPImagesToYUV)) {
+ WebRuntimeFeatures::EnableDecodeLossyWebPImagesToYUV(true);
+ }
#if defined(SUPPORT_WEBGL2_COMPUTE_CONTEXT)
if (command_line.HasSwitch(switches::kEnableWebGL2ComputeContext)) {
@@ -170,8 +178,11 @@ void SetIndividualRuntimeFeatures(
WebRuntimeFeatures::EnableNetInfoDownlinkMax(true);
}
- if (command_line.HasSwitch(switches::kReducedReferrerGranularity))
- WebRuntimeFeatures::EnableReducedReferrerGranularity(true);
+ WebRuntimeFeatures::EnableReducedReferrerGranularity(
+ base::FeatureList::IsEnabled(features::kReducedReferrerGranularity));
+
+ if (base::FeatureList::IsEnabled(features::kPeriodicBackgroundSync))
+ WebRuntimeFeatures::EnablePeriodicBackgroundSync(true);
if (command_line.HasSwitch(switches::kDisablePermissionsAPI))
WebRuntimeFeatures::EnablePermissionsAPI(false);
@@ -184,6 +195,9 @@ void SetIndividualRuntimeFeatures(
if (command_line.HasSwitch(switches::kEnableUnsafeWebGPU))
WebRuntimeFeatures::EnableWebGPU(true);
+ if (command_line.HasSwitch(switches::kEnableWebGLSwapChain))
+ WebRuntimeFeatures::EnableWebGLSwapChain(true);
+
if (command_line.HasSwitch(switches::kEnableWebVR))
WebRuntimeFeatures::EnableWebVR(true);
@@ -193,6 +207,9 @@ void SetIndividualRuntimeFeatures(
if (base::FeatureList::IsEnabled(features::kWebXrHitTest))
WebRuntimeFeatures::EnableWebXRHitTest(true);
+ if (base::FeatureList::IsEnabled(features::kWebXrPlaneDetection))
+ WebRuntimeFeatures::EnableWebXRPlaneDetection(true);
+
if (command_line.HasSwitch(switches::kDisablePresentationAPI))
WebRuntimeFeatures::EnablePresentationAPI(false);
@@ -228,6 +245,16 @@ void SetIndividualRuntimeFeatures(
base::FeatureList::IsEnabled(blink::features::kBlinkGenPropertyTrees) ||
enable_experimental_web_platform_features);
+ WebRuntimeFeatures::EnableFeatureFromString(
+ "CSSBackdropFilter",
+ base::FeatureList::IsEnabled(blink::features::kCSSBackdropFilter) ||
+ enable_experimental_web_platform_features);
+
+ WebRuntimeFeatures::EnableFeatureFromString(
+ "FastBorderRadius",
+ base::FeatureList::IsEnabled(blink::features::kFastBorderRadius) ||
+ enable_experimental_web_platform_features);
+
WebRuntimeFeatures::EnablePassiveDocumentEventListeners(
base::FeatureList::IsEnabled(features::kPassiveDocumentEventListeners));
@@ -236,10 +263,6 @@ void SetIndividualRuntimeFeatures(
features::kPassiveDocumentWheelEventListeners));
WebRuntimeFeatures::EnableFeatureFromString(
- "FontCacheScaling",
- base::FeatureList::IsEnabled(features::kFontCacheScaling));
-
- WebRuntimeFeatures::EnableFeatureFromString(
"FontSrcLocalMatching",
base::FeatureList::IsEnabled(features::kFontSrcLocalMatching));
@@ -291,9 +314,6 @@ void SetIndividualRuntimeFeatures(
if (base::FeatureList::IsEnabled(features::kCompositorTouchAction))
WebRuntimeFeatures::EnableCompositorTouchAction(true);
- if (base::FeatureList::IsEnabled(features::kCSSFragmentIdentifiers))
- WebRuntimeFeatures::EnableCSSFragmentIdentifiers(true);
-
if (!base::FeatureList::IsEnabled(features::kGenericSensor))
WebRuntimeFeatures::EnableGenericSensor(false);
@@ -343,8 +363,8 @@ void SetIndividualRuntimeFeatures(
if (base::FeatureList::IsEnabled(features::kBuiltInModuleKvStorage))
WebRuntimeFeatures::EnableBuiltInModuleKvStorage(true);
- if (base::FeatureList::IsEnabled(blink::features::kLayoutNG))
- WebRuntimeFeatures::EnableLayoutNG(true);
+ WebRuntimeFeatures::EnableFeatureFromString(
+ "LayoutNG", base::FeatureList::IsEnabled(blink::features::kLayoutNG));
WebRuntimeFeatures::EnableLazyInitializeMediaControls(
base::FeatureList::IsEnabled(features::kLazyInitializeMediaControls));
@@ -359,9 +379,6 @@ void SetIndividualRuntimeFeatures(
WebRuntimeFeatures::EnableAllowActivationDelegationAttr(
base::FeatureList::IsEnabled(features::kAllowActivationDelegationAttr));
- WebRuntimeFeatures::EnableModernMediaControls(
- base::FeatureList::IsEnabled(media::kUseModernMediaControls));
-
WebRuntimeFeatures::EnableScriptStreamingOnPreload(
base::FeatureList::IsEnabled(features::kScriptStreamingOnPreload));
@@ -377,18 +394,27 @@ void SetIndividualRuntimeFeatures(
if (base::FeatureList::IsEnabled(features::kLazyImageVisibleLoadTimeMetrics))
WebRuntimeFeatures::EnableLazyImageVisibleLoadTimeMetrics(true);
- WebRuntimeFeatures::EnableRestrictDeviceSensorEventsToSecureContexts(
- base::FeatureList::IsEnabled(
- blink::features::kRestrictDeviceSensorEventsToSecureContexts));
-
- WebRuntimeFeatures::EnableRestrictLazyFrameLoadingToDataSaver(
+ WebRuntimeFeatures::EnableAutomaticLazyFrameLoading(
+ base::GetFieldTrialParamByFeatureAsBool(
+ features::kLazyFrameLoading, "automatic-lazy-load-frames-enabled",
+ false));
+ WebRuntimeFeatures::EnableRestrictAutomaticLazyFrameLoadingToDataSaver(
base::GetFieldTrialParamByFeatureAsBool(
features::kLazyFrameLoading,
"restrict-lazy-load-frames-to-data-saver-only", false));
- WebRuntimeFeatures::EnableRestrictLazyImageLoadingToDataSaver(
+
+ WebRuntimeFeatures::EnableAutomaticLazyImageLoading(
+ base::GetFieldTrialParamByFeatureAsBool(
+ features::kLazyImageLoading, "automatic-lazy-load-images-enabled",
+ false));
+ WebRuntimeFeatures::EnableRestrictAutomaticLazyImageLoadingToDataSaver(
base::GetFieldTrialParamByFeatureAsBool(
features::kLazyImageLoading,
"restrict-lazy-load-images-to-data-saver-only", false));
+ WebRuntimeFeatures::EnableLazyImageLoadingMetadataFetch(
+ base::GetFieldTrialParamByFeatureAsBool(
+ features::kLazyImageLoading, "enable-lazy-load-images-metadata-fetch",
+ true));
WebRuntimeFeatures::EnablePictureInPicture(
base::FeatureList::IsEnabled(media::kPictureInPicture));
@@ -409,9 +435,6 @@ void SetIndividualRuntimeFeatures(
if (base::FeatureList::IsEnabled(features::kFeaturePolicyForSandbox))
WebRuntimeFeatures::EnableFeaturePolicyForSandbox(true);
- if (base::FeatureList::IsEnabled(features::kPageLifecycle))
- WebRuntimeFeatures::EnablePageLifecycle(true);
-
#if defined(OS_ANDROID)
if (base::android::BuildInfo::GetInstance()->sdk_int() >=
base::android::SDK_VERSION_P) {
@@ -423,8 +446,8 @@ void SetIndividualRuntimeFeatures(
if (command_line.HasSwitch(switches::kEnableAccessibilityObjectModel))
WebRuntimeFeatures::EnableAccessibilityObjectModel(true);
- if (base::FeatureList::IsEnabled(blink::features::kNativeFilesystemAPI))
- WebRuntimeFeatures::EnableFeatureFromString("WritableFiles", true);
+ if (base::FeatureList::IsEnabled(blink::features::kNativeFileSystemAPI))
+ WebRuntimeFeatures::EnableFeatureFromString("NativeFileSystem", true);
if (base::FeatureList::IsEnabled(
blink::features::kForbidSyncXHRInPageDismissal)) {
@@ -489,11 +512,31 @@ void SetIndividualRuntimeFeatures(
if (!base::FeatureList::IsEnabled(features::kIdleDetection))
WebRuntimeFeatures::EnableIdleDetection(false);
+ WebRuntimeFeatures::EnableSkipTouchEventFilter(
+ base::FeatureList::IsEnabled(features::kSkipTouchEventFilter));
+
WebRuntimeFeatures::EnableStaleWhileRevalidate(
base::FeatureList::IsEnabled(features::kStaleWhileRevalidate));
- WebRuntimeFeatures::EnableSkipTouchEventFilter(
- base::FeatureList::IsEnabled(features::kSkipTouchEventFilter));
+ if (!base::FeatureList::IsEnabled(features::kSmsReceiver))
+ WebRuntimeFeatures::EnableSmsReceiver(false);
+
+ WebRuntimeFeatures::EnableDisplayLocking(
+ base::FeatureList::IsEnabled(blink::features::kDisplayLocking));
+
+ WebRuntimeFeatures::EnableFormControlsRefresh(
+ features::IsFormControlsRefreshEnabled());
+
+ if (base::FeatureList::IsEnabled(
+ blink::features::kAudioWorkletRealtimeThread)) {
+ WebRuntimeFeatures::EnableFeatureFromString(
+ "AudioWorkletRealtimeThread", true);
+ }
+
+ if (!base::FeatureList::IsEnabled(
+ features::kPauseExecutionContextOnBackgroundFreeze)) {
+ WebRuntimeFeatures::EnablePauseExecutionContextOnBackgroundFreeze(false);
+ }
}
} // namespace
diff --git a/chromium/content/child/webthemeengine_impl_android.cc b/chromium/content/child/webthemeengine_impl_android.cc
index f4602f53b19..e767d24d474 100644
--- a/chromium/content/child/webthemeengine_impl_android.cc
+++ b/chromium/content/child/webthemeengine_impl_android.cc
@@ -166,7 +166,9 @@ static void GetNativeThemeExtraParams(
}
}
-blink::WebSize WebThemeEngineImpl::GetSize(WebThemeEngine::Part part) {
+WebThemeEngineAndroid::~WebThemeEngineAndroid() = default;
+
+blink::WebSize WebThemeEngineAndroid::GetSize(WebThemeEngine::Part part) {
switch (part) {
case WebThemeEngine::kPartScrollbarHorizontalThumb:
case WebThemeEngine::kPartScrollbarVerticalThumb: {
@@ -184,7 +186,7 @@ blink::WebSize WebThemeEngineImpl::GetSize(WebThemeEngine::Part part) {
}
}
-void WebThemeEngineImpl::GetOverlayScrollbarStyle(ScrollbarStyle* style) {
+void WebThemeEngineAndroid::GetOverlayScrollbarStyle(ScrollbarStyle* style) {
// TODO(bokan): Android scrollbars on non-composited scrollers don't
// currently fade out so the fadeOutDuration and Delay Now that this has
// been added into Blink for other platforms we should plumb that through for
@@ -202,7 +204,7 @@ void WebThemeEngineImpl::GetOverlayScrollbarStyle(ScrollbarStyle* style) {
}
}
-void WebThemeEngineImpl::Paint(
+void WebThemeEngineAndroid::Paint(
cc::PaintCanvas* canvas,
WebThemeEngine::Part part,
WebThemeEngine::State state,
diff --git a/chromium/content/child/webthemeengine_impl_android.h b/chromium/content/child/webthemeengine_impl_android.h
index ede02ba2aea..9fb867bfe16 100644
--- a/chromium/content/child/webthemeengine_impl_android.h
+++ b/chromium/content/child/webthemeengine_impl_android.h
@@ -9,9 +9,10 @@
namespace content {
-class WebThemeEngineImpl : public blink::WebThemeEngine {
+class WebThemeEngineAndroid : public blink::WebThemeEngine {
public:
// WebThemeEngine methods:
+ ~WebThemeEngineAndroid() override;
blink::WebSize GetSize(blink::WebThemeEngine::Part) override;
void GetOverlayScrollbarStyle(
blink::WebThemeEngine::ScrollbarStyle*) override;
diff --git a/chromium/content/child/webthemeengine_impl_default.cc b/chromium/content/child/webthemeengine_impl_default.cc
index ecda4fe4b12..9aba2a58c8f 100644
--- a/chromium/content/child/webthemeengine_impl_default.cc
+++ b/chromium/content/child/webthemeengine_impl_default.cc
@@ -203,7 +203,9 @@ static void GetNativeThemeExtraParams(
}
}
-blink::WebSize WebThemeEngineImpl::GetSize(WebThemeEngine::Part part) {
+WebThemeEngineDefault::~WebThemeEngineDefault() = default;
+
+blink::WebSize WebThemeEngineDefault::GetSize(WebThemeEngine::Part part) {
ui::NativeTheme::ExtraParams extra;
ui::NativeTheme::Part native_theme_part = NativeThemePart(part);
#if defined(OS_WIN)
@@ -228,7 +230,7 @@ blink::WebSize WebThemeEngineImpl::GetSize(WebThemeEngine::Part part) {
native_theme_part, ui::NativeTheme::kNormal, extra);
}
-void WebThemeEngineImpl::Paint(
+void WebThemeEngineDefault::Paint(
cc::PaintCanvas* canvas,
WebThemeEngine::Part part,
WebThemeEngine::State state,
@@ -242,7 +244,7 @@ void WebThemeEngineImpl::Paint(
native_theme_extra_params);
}
-void WebThemeEngineImpl::GetOverlayScrollbarStyle(ScrollbarStyle* style) {
+void WebThemeEngineDefault::GetOverlayScrollbarStyle(ScrollbarStyle* style) {
style->fade_out_delay = ui::kOverlayScrollbarFadeDelay;
style->fade_out_duration = ui::kOverlayScrollbarFadeDuration;
// The other fields in this struct are used only on Android to draw solid
@@ -250,24 +252,24 @@ void WebThemeEngineImpl::GetOverlayScrollbarStyle(ScrollbarStyle* style) {
// NativeTheme so these fields are unused.
}
-bool WebThemeEngineImpl::SupportsNinePatch(Part part) const {
+bool WebThemeEngineDefault::SupportsNinePatch(Part part) const {
return ui::NativeTheme::GetInstanceForWeb()->SupportsNinePatch(
NativeThemePart(part));
}
-blink::WebSize WebThemeEngineImpl::NinePatchCanvasSize(Part part) const {
+blink::WebSize WebThemeEngineDefault::NinePatchCanvasSize(Part part) const {
return ui::NativeTheme::GetInstanceForWeb()->GetNinePatchCanvasSize(
NativeThemePart(part));
}
-blink::WebRect WebThemeEngineImpl::NinePatchAperture(Part part) const {
+blink::WebRect WebThemeEngineDefault::NinePatchAperture(Part part) const {
return ui::NativeTheme::GetInstanceForWeb()->GetNinePatchAperture(
NativeThemePart(part));
}
#if defined(OS_WIN)
// static
-void WebThemeEngineImpl::cacheScrollBarMetrics(
+void WebThemeEngineDefault::cacheScrollBarMetrics(
int32_t vertical_scroll_bar_width,
int32_t horizontal_scroll_bar_height,
int32_t vertical_arrow_bitmap_height,
diff --git a/chromium/content/child/webthemeengine_impl_default.h b/chromium/content/child/webthemeengine_impl_default.h
index ebe4c362e5f..51e0720037d 100644
--- a/chromium/content/child/webthemeengine_impl_default.h
+++ b/chromium/content/child/webthemeengine_impl_default.h
@@ -12,9 +12,10 @@
namespace content {
-class WebThemeEngineImpl : public blink::WebThemeEngine {
+class WebThemeEngineDefault : public blink::WebThemeEngine {
public:
// WebThemeEngine methods:
+ ~WebThemeEngineDefault() override;
blink::WebSize GetSize(blink::WebThemeEngine::Part) override;
void Paint(cc::PaintCanvas* canvas,
blink::WebThemeEngine::Part part,
diff --git a/chromium/content/child/webthemeengine_impl_mac.h b/chromium/content/child/webthemeengine_impl_mac.h
index e63b62f4464..29e31609233 100644
--- a/chromium/content/child/webthemeengine_impl_mac.h
+++ b/chromium/content/child/webthemeengine_impl_mac.h
@@ -9,7 +9,9 @@
namespace content {
-class WebThemeEngineImpl : public blink::WebThemeEngine {
+class WebThemeEngineMac : public blink::WebThemeEngine {
+ public:
+ ~WebThemeEngineMac() override {}
};
} // namespace content