summaryrefslogtreecommitdiff
path: root/chromium/content/child
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/content/child')
-rw-r--r--chromium/content/child/BUILD.gn7
-rw-r--r--chromium/content/child/OWNERS11
-rw-r--r--chromium/content/child/assert_matching_enums.cc2
-rw-r--r--chromium/content/child/blink_platform_impl.cc21
-rw-r--r--chromium/content/child/blink_platform_impl.h6
-rw-r--r--chromium/content/child/child_histogram_fetcher_impl.cc2
-rw-r--r--chromium/content/child/child_process.cc4
-rw-r--r--chromium/content/child/child_process_sandbox_support_impl_linux.cc11
-rw-r--r--chromium/content/child/child_thread_impl.cc54
-rw-r--r--chromium/content/child/child_thread_impl.h16
-rw-r--r--chromium/content/child/runtime_features.cc102
-rw-r--r--chromium/content/child/webfallbackthemeengine_impl.cc215
-rw-r--r--chromium/content/child/webfallbackthemeengine_impl.h40
-rw-r--r--chromium/content/child/webthemeengine_impl_android.cc1
-rw-r--r--chromium/content/child/webthemeengine_impl_default.cc1
15 files changed, 110 insertions, 383 deletions
diff --git a/chromium/content/child/BUILD.gn b/chromium/content/child/BUILD.gn
index fbb110d2d40..7c110b354fa 100644
--- a/chromium/content/child/BUILD.gn
+++ b/chromium/content/child/BUILD.gn
@@ -72,8 +72,6 @@ target(link_target_type, "child") {
"service_factory.h",
"thread_safe_sender.cc",
"thread_safe_sender.h",
- "webfallbackthemeengine_impl.cc",
- "webfallbackthemeengine_impl.h",
"webthemeengine_impl_android.cc",
"webthemeengine_impl_android.h",
"webthemeengine_impl_default.cc",
@@ -106,7 +104,6 @@ target(link_target_type, "child") {
"//gpu/command_buffer/client",
"//media",
"//media/blink",
- "//mojo/common",
"//mojo/edk",
"//net",
"//services/device/public/cpp:device_features",
@@ -148,6 +145,10 @@ target(link_target_type, "child") {
deps += [ "//third_party/android_tools:cpu_features" ]
}
+ if (is_linux) {
+ deps += [ "//services/service_manager/zygote" ]
+ }
+
if (is_win) {
libs = [ "dwrite.lib" ]
}
diff --git a/chromium/content/child/OWNERS b/chromium/content/child/OWNERS
index e9510bd4d17..5d33001f6a8 100644
--- a/chromium/content/child/OWNERS
+++ b/chromium/content/child/OWNERS
@@ -1,12 +1 @@
haraken@chromium.org
-
-# AppCache
-per-file appcache*=michaeln@chromium.org
-
-# WebSQL
-per-file database_*=jsbell@chromium.org
-per-file database_*=michaeln@chromium.org
-per-file db_*=jsbell@chromium.org
-per-file db_*=michaeln@chromium.org
-per-file web_database_*=jsbell@chromium.org
-per-file web_database_*=michaeln@chromium.org
diff --git a/chromium/content/child/assert_matching_enums.cc b/chromium/content/child/assert_matching_enums.cc
index b2b3db58b71..be579b005c8 100644
--- a/chromium/content/child/assert_matching_enums.cc
+++ b/chromium/content/child/assert_matching_enums.cc
@@ -8,7 +8,7 @@
#include "base/macros.h"
#include "content/public/common/screen_orientation_values.h"
#include "media/base/mime_util.h"
-#include "third_party/blink/public/platform/modules/screen_orientation/web_screen_orientation_lock_type.h"
+#include "third_party/blink/public/common/screen_orientation/web_screen_orientation_lock_type.h"
#include "third_party/blink/public/platform/web_menu_source_type.h"
#include "third_party/blink/public/platform/web_text_input_mode.h"
#include "third_party/blink/public/platform/web_text_input_type.h"
diff --git a/chromium/content/child/blink_platform_impl.cc b/chromium/content/child/blink_platform_impl.cc
index aa67eb82782..d15a8c88c11 100644
--- a/chromium/content/child/blink_platform_impl.cc
+++ b/chromium/content/child/blink_platform_impl.cc
@@ -59,7 +59,6 @@
#include "ui/events/keycodes/dom/keycode_converter.h"
using blink::WebData;
-using blink::WebFallbackThemeEngine;
using blink::WebLocalizedString;
using blink::WebString;
using blink::WebThemeEngine;
@@ -366,10 +365,6 @@ void BlinkPlatformImpl::UpdateWebThreadTLS(blink::WebThread* thread,
BlinkPlatformImpl::~BlinkPlatformImpl() {
}
-WebString BlinkPlatformImpl::UserAgent() {
- return blink::WebString::FromUTF8(GetContentClient()->GetUserAgent());
-}
-
std::unique_ptr<blink::WebThread> BlinkPlatformImpl::CreateThread(
const blink::WebThreadCreationParams& params) {
std::unique_ptr<blink::scheduler::WebThreadBase> thread =
@@ -702,16 +697,12 @@ WebThemeEngine* BlinkPlatformImpl::ThemeEngine() {
return &native_theme_engine_;
}
-WebFallbackThemeEngine* BlinkPlatformImpl::FallbackThemeEngine() {
- return &fallback_theme_engine_;
-}
-
blink::Platform::FileHandle BlinkPlatformImpl::DatabaseOpenFile(
const blink::WebString& vfs_file_name,
int desired_flags) {
#if defined(OS_WIN)
return INVALID_HANDLE_VALUE;
-#elif defined(OS_POSIX)
+#elif defined(OS_POSIX) || defined(OS_FUCHSIA)
return -1;
#endif
}
@@ -742,10 +733,6 @@ bool BlinkPlatformImpl::DatabaseSetFileSize(
return false;
}
-size_t BlinkPlatformImpl::NumberOfProcessors() {
- return static_cast<size_t>(base::SysInfo::NumberOfProcessors());
-}
-
size_t BlinkPlatformImpl::MaxDecodedImageBytes() {
const int kMB = 1024 * 1024;
const int kMaxNumberOfBytesPerPixel = 4;
@@ -781,12 +768,6 @@ bool BlinkPlatformImpl::IsLowEndDevice() {
return base::SysInfo::IsLowEndDevice();
}
-uint32_t BlinkPlatformImpl::GetUniqueIdForProcess() {
- // TODO(rickyz): Replace this with base::GetUniqueIdForProcess when that's
- // ready.
- return base::trace_event::TraceLog::GetInstance()->process_id();
-}
-
bool BlinkPlatformImpl::IsMainThread() const {
return main_thread_task_runner_.get() &&
main_thread_task_runner_->BelongsToCurrentThread();
diff --git a/chromium/content/child/blink_platform_impl.h b/chromium/content/child/blink_platform_impl.h
index f9d13cf958a..4cbfab92679 100644
--- a/chromium/content/child/blink_platform_impl.h
+++ b/chromium/content/child/blink_platform_impl.h
@@ -15,7 +15,6 @@
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
#include "components/webcrypto/webcrypto_impl.h"
-#include "content/child/webfallbackthemeengine_impl.h"
#include "content/common/content_export.h"
#include "media/blink/webmediacapabilitiesclient_impl.h"
#include "third_party/blink/public/platform/platform.h"
@@ -58,7 +57,6 @@ class CONTENT_EXPORT BlinkPlatformImpl : public blink::Platform {
// Platform methods (partial implementation):
blink::WebThemeEngine* ThemeEngine() override;
- blink::WebFallbackThemeEngine* FallbackThemeEngine() override;
blink::Platform::FileHandle DatabaseOpenFile(
const blink::WebString& vfs_file_name,
int desired_flags) override;
@@ -71,12 +69,9 @@ class CONTENT_EXPORT BlinkPlatformImpl : public blink::Platform {
const blink::WebSecurityOrigin& origin) override;
bool DatabaseSetFileSize(const blink::WebString& vfs_file_name,
long long size) override;
- size_t NumberOfProcessors() override;
size_t MaxDecodedImageBytes() override;
bool IsLowEndDevice() override;
- uint32_t GetUniqueIdForProcess() override;
- blink::WebString UserAgent() override;
std::unique_ptr<blink::WebThread> CreateThread(
const blink::WebThreadCreationParams& params) override;
std::unique_ptr<blink::WebThread> CreateWebAudioThread() override;
@@ -127,7 +122,6 @@ class CONTENT_EXPORT BlinkPlatformImpl : public blink::Platform {
scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner_;
WebThemeEngineImpl native_theme_engine_;
- WebFallbackThemeEngineImpl fallback_theme_engine_;
base::ThreadLocalStorage::Slot current_thread_slot_;
webcrypto::WebCryptoImpl web_crypto_;
media::WebMediaCapabilitiesClientImpl media_capabilities_client_;
diff --git a/chromium/content/child/child_histogram_fetcher_impl.cc b/chromium/content/child/child_histogram_fetcher_impl.cc
index 36dbd27bb6f..97283203509 100644
--- a/chromium/content/child/child_histogram_fetcher_impl.cc
+++ b/chromium/content/child/child_histogram_fetcher_impl.cc
@@ -37,7 +37,7 @@ void ChildHistogramFetcherFactoryImpl::CreateFetcher(
const MojoResult result = mojo::UnwrapSharedMemoryHandle(
std::move(buffer_handle), &memory_handle, &memory_size, nullptr);
- if (result == MOJO_RESULT_OK) {
+ if (result == MOJO_RESULT_OK && memory_handle.IsValid()) {
// This message must be received only once. Multiple calls to create a
// global allocator will cause a CHECK() failure.
base::GlobalHistogramAllocator::CreateWithSharedMemoryHandle(memory_handle,
diff --git a/chromium/content/child/child_process.cc b/chromium/content/child/child_process.cc
index 835a59e685a..7f70a3408c6 100644
--- a/chromium/content/child/child_process.cc
+++ b/chromium/content/child/child_process.cc
@@ -101,13 +101,13 @@ void ChildProcess::set_main_thread(ChildThreadImpl* thread) {
void ChildProcess::AddRefProcess() {
DCHECK(!main_thread_.get() || // null in unittests.
- main_thread_->message_loop()->task_runner()->BelongsToCurrentThread());
+ main_thread_->main_thread_runner()->BelongsToCurrentThread());
ref_count_++;
}
void ChildProcess::ReleaseProcess() {
DCHECK(!main_thread_.get() || // null in unittests.
- main_thread_->message_loop()->task_runner()->BelongsToCurrentThread());
+ main_thread_->main_thread_runner()->BelongsToCurrentThread());
DCHECK(ref_count_);
if (--ref_count_)
return;
diff --git a/chromium/content/child/child_process_sandbox_support_impl_linux.cc b/chromium/content/child/child_process_sandbox_support_impl_linux.cc
index 587ddeab58e..7899935f659 100644
--- a/chromium/content/child/child_process_sandbox_support_impl_linux.cc
+++ b/chromium/content/child/child_process_sandbox_support_impl_linux.cc
@@ -15,8 +15,8 @@
#include "base/posix/unix_domain_socket.h"
#include "base/sys_byteorder.h"
#include "base/trace_event/trace_event.h"
-#include "content/public/common/common_sandbox_support_linux.h"
#include "services/service_manager/sandbox/linux/sandbox_linux.h"
+#include "services/service_manager/zygote/common/common_sandbox_support_linux.h"
#include "third_party/blink/public/platform/linux/web_fallback_font.h"
#include "third_party/blink/public/platform/web_font_render_style.h"
#include "third_party/blink/public/platform/web_string.h"
@@ -37,7 +37,7 @@ void GetFallbackFontForCharacter(int32_t character,
uint8_t buf[512];
const ssize_t n = base::UnixDomainSocket::SendRecvMsg(
- GetSandboxFD(), buf, sizeof(buf), nullptr, request);
+ service_manager::GetSandboxFD(), buf, sizeof(buf), nullptr, request);
std::string family_name;
std::string filename;
@@ -88,7 +88,7 @@ void GetRenderStyleForStrike(const char* family,
uint8_t buf[512];
const ssize_t n = base::UnixDomainSocket::SendRecvMsg(
- GetSandboxFD(), buf, sizeof(buf), nullptr, request);
+ service_manager::GetSandboxFD(), buf, sizeof(buf), nullptr, request);
if (n == -1)
return;
@@ -127,8 +127,9 @@ int MatchFontWithFallback(const std::string& face,
request.WriteUInt32(fallback_family);
uint8_t reply_buf[64];
int fd = -1;
- base::UnixDomainSocket::SendRecvMsg(GetSandboxFD(), reply_buf,
- sizeof(reply_buf), &fd, request);
+ base::UnixDomainSocket::SendRecvMsg(service_manager::GetSandboxFD(),
+ reply_buf, sizeof(reply_buf), &fd,
+ request);
return fd;
}
diff --git a/chromium/content/child/child_thread_impl.cc b/chromium/content/child/child_thread_impl.cc
index 2663268bce3..d6898e941c8 100644
--- a/chromium/content/child/child_thread_impl.cc
+++ b/chromium/content/child/child_thread_impl.cc
@@ -17,7 +17,6 @@
#include "base/location.h"
#include "base/logging.h"
#include "base/macros.h"
-#include "base/message_loop/message_loop.h"
#include "base/message_loop/timer_slack.h"
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram_macros.h"
@@ -44,7 +43,6 @@
#include "content/public/common/connection_filter.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_switches.h"
-#include "content/public/common/mojo_channel_switches.h"
#include "content/public/common/service_manager_connection.h"
#include "content/public/common/service_names.mojom.h"
#include "content/public/common/simple_connection_filter.h"
@@ -64,6 +62,7 @@
#include "services/resource_coordinator/public/cpp/memory_instrumentation/client_process_impl.h"
#include "services/resource_coordinator/public/mojom/memory_instrumentation/memory_instrumentation.mojom.h"
#include "services/resource_coordinator/public/mojom/service_constants.mojom.h"
+#include "services/service_manager/embedder/switches.h"
#include "services/service_manager/public/cpp/connector.h"
#include "services/service_manager/public/cpp/interface_provider.h"
#include "services/service_manager/runner/common/client_util.h"
@@ -74,13 +73,19 @@
#include "content/public/common/content_descriptors.h"
#endif
-#if defined(OS_MACOSX)
-#include "base/allocator/allocator_interception_mac.h"
+#if defined(CLANG_COVERAGE)
+extern "C" int __llvm_profile_write_file(void);
#endif
namespace content {
namespace {
+void WriteClangCoverageProfile() {
+#if defined(CLANG_COVERAGE)
+ __llvm_profile_write_file();
+#endif
+}
+
// How long to wait for a connection to the browser process before giving up.
const int kConnectionTimeoutS = 15;
@@ -104,6 +109,7 @@ class WaitAndExitDelegate : public base::PlatformThread::Delegate {
void ThreadMain() override {
base::PlatformThread::Sleep(duration_);
+ WriteClangCoverageProfile();
_exit(0);
}
@@ -164,6 +170,7 @@ class SuicideOnChannelErrorFilter : public IPC::MessageFilter {
__lsan_do_leak_check();
#endif
#else
+ WriteClangCoverageProfile();
_exit(0);
#endif
}
@@ -212,7 +219,7 @@ void QuitClosure::BindToMainThread() {
scoped_refptr<base::SingleThreadTaskRunner> task_runner(
base::ThreadTaskRunnerHandle::Get());
base::Closure quit_closure =
- base::MessageLoop::current()->QuitWhenIdleClosure();
+ base::RunLoop::QuitCurrentWhenIdleClosureDeprecated();
closure_ = base::Bind(&QuitClosure::PostClosure, task_runner, quit_closure);
cond_var_.Signal();
}
@@ -232,7 +239,7 @@ base::LazyInstance<QuitClosure>::DestructorAtExit g_quit_closure =
std::unique_ptr<mojo::edk::IncomingBrokerClientInvitation>
InitializeMojoIPCChannel() {
TRACE_EVENT0("startup", "InitializeMojoIPCChannel");
- mojo::edk::ScopedPlatformHandle platform_channel;
+ mojo::edk::ScopedInternalPlatformHandle platform_channel;
#if defined(OS_WIN)
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
mojo::edk::PlatformChannelPair::kMojoPlatformChannelHandleSwitch)) {
@@ -251,8 +258,9 @@ InitializeMojoIPCChannel() {
mojo::edk::PlatformChannelPair::PassClientHandleFromParentProcess(
*base::CommandLine::ForCurrentProcess());
#elif defined(OS_POSIX)
- platform_channel.reset(mojo::edk::PlatformHandle(
- base::GlobalDescriptors::GetInstance()->Get(kMojoIPCChannel)));
+ platform_channel.reset(mojo::edk::InternalPlatformHandle(
+ base::GlobalDescriptors::GetInstance()->Get(
+ service_manager::kMojoIPCChannel)));
#endif
// Mojo isn't supported on all child process types.
// TODO(crbug.com/604282): Support Mojo in the remaining processes.
@@ -432,7 +440,7 @@ void ChildThreadImpl::Init(const Options& options) {
TRACE_EVENT0("startup", "ChildThreadImpl::Init");
g_lazy_tls.Pointer()->Set(this);
on_channel_error_called_ = false;
- message_loop_ = base::MessageLoop::current();
+ main_thread_runner_ = base::ThreadTaskRunnerHandle::Get();
#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED)
// We must make sure to instantiate the IPC Logger *before* we create the
// channel, otherwise we can get a callback on the IO thread which creates
@@ -458,7 +466,7 @@ void ChildThreadImpl::Init(const Options& options) {
std::string service_request_token =
base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
- switches::kServiceRequestChannelToken);
+ service_manager::switches::kServiceRequestChannelToken);
if (!service_request_token.empty() && invitation) {
service_request_pipe =
invitation->ExtractMessagePipe(service_request_token);
@@ -476,8 +484,8 @@ void ChildThreadImpl::Init(const Options& options) {
}
sync_message_filter_ = channel_->CreateSyncMessageFilter();
- thread_safe_sender_ = new ThreadSafeSender(
- message_loop_->task_runner(), sync_message_filter_.get());
+ thread_safe_sender_ =
+ new ThreadSafeSender(main_thread_runner_, sync_message_filter_.get());
auto registry = std::make_unique<service_manager::BinderRegistry>();
registry->AddInterface(base::Bind(&ChildHistogramFetcherFactoryImpl::Create),
@@ -562,15 +570,7 @@ void ChildThreadImpl::Init(const Options& options) {
connection_timeout = temp;
}
-#if defined(OS_MACOSX)
- if (base::CommandLine::InitializedForCurrentProcess() &&
- base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableHeapProfiling)) {
- base::allocator::PeriodicallyShimNewMallocZones();
- }
-#endif
-
- message_loop_->task_runner()->PostDelayedTask(
+ main_thread_runner_->PostDelayedTask(
FROM_HERE,
base::BindOnce(&ChildThreadImpl::EnsureConnected,
channel_connected_factory_->GetWeakPtr()),
@@ -608,7 +608,7 @@ void ChildThreadImpl::InitTracing() {
channel_->AddFilter(new tracing::ChildTraceMessageFilter(
ChildProcess::current()->io_task_runner()));
- chrome_trace_event_agent_ = std::make_unique<tracing::ChromeTraceEventAgent>(
+ trace_event_agent_ = tracing::TraceEventAgent::Create(
GetConnector(), false /* request_clock_sync_marker_on_android */);
}
@@ -632,8 +632,10 @@ ChildThreadImpl::~ChildThreadImpl() {
}
void ChildThreadImpl::Shutdown() {
- // Delete objects that hold references to blink so derived classes can
- // safely shutdown blink in their Shutdown implementation.
+ // The renderer process (and others) can to fast shutdown by calling _exit(0),
+ // in which case the clang-coverage profile does not get written to the file.
+ // So force write the profile here before shutting down.
+ WriteClangCoverageProfile();
}
bool ChildThreadImpl::ShouldBeDestroyed() {
@@ -653,7 +655,7 @@ void ChildThreadImpl::OnChannelError() {
}
bool ChildThreadImpl::Send(IPC::Message* msg) {
- DCHECK(message_loop_->task_runner()->BelongsToCurrentThread());
+ DCHECK(main_thread_runner_->BelongsToCurrentThread());
if (!channel_) {
delete msg;
return false;
@@ -713,7 +715,7 @@ service_manager::Connector* ChildThreadImpl::GetConnector() {
}
IPC::MessageRouter* ChildThreadImpl::GetRouter() {
- DCHECK(message_loop_->task_runner()->BelongsToCurrentThread());
+ DCHECK(main_thread_runner_->BelongsToCurrentThread());
return &router_;
}
diff --git a/chromium/content/child/child_thread_impl.h b/chromium/content/child/child_thread_impl.h
index 523af416a39..9f4155dfdcf 100644
--- a/chromium/content/child/child_thread_impl.h
+++ b/chromium/content/child/child_thread_impl.h
@@ -12,6 +12,7 @@
#include <string>
#include "base/macros.h"
+#include "base/memory/scoped_refptr.h"
#include "base/memory/shared_memory.h"
#include "base/memory/weak_ptr.h"
#include "base/metrics/field_trial.h"
@@ -29,7 +30,7 @@
#include "ipc/message_router.h"
#include "mojo/public/cpp/bindings/associated_binding.h"
#include "mojo/public/cpp/bindings/associated_binding_set.h"
-#include "services/tracing/public/cpp/chrome_trace_event_agent.h"
+#include "services/tracing/public/cpp/trace_event_agent.h"
#if defined(OS_WIN)
#include "content/public/common/font_cache_win.mojom.h"
@@ -37,10 +38,6 @@
#include "content/common/font_loader_mac.mojom.h"
#endif
-namespace base {
-class MessageLoop;
-} // namespace base
-
namespace IPC {
class MessageFilter;
class SyncChannel;
@@ -132,7 +129,9 @@ class CONTENT_EXPORT ChildThreadImpl
return thread_safe_sender_.get();
}
- base::MessageLoop* message_loop() const { return message_loop_; }
+ scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner() const {
+ return main_thread_runner_;
+ }
// Returns the one child thread. Can only be called on the main thread.
static ChildThreadImpl* current();
@@ -248,13 +247,14 @@ class CONTENT_EXPORT ChildThreadImpl
// attempt to communicate.
bool on_channel_error_called_;
- base::MessageLoop* message_loop_;
+ // TaskRunner to post tasks to the main thread.
+ scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner_;
std::unique_ptr<base::PowerMonitor> power_monitor_;
scoped_refptr<base::SingleThreadTaskRunner> browser_process_io_runner_;
- std::unique_ptr<tracing::ChromeTraceEventAgent> chrome_trace_event_agent_;
+ std::unique_ptr<tracing::TraceEventAgent> trace_event_agent_;
std::unique_ptr<variations::ChildProcessFieldTrialSyncer> field_trial_syncer_;
diff --git a/chromium/content/child/runtime_features.cc b/chromium/content/child/runtime_features.cc
index 03a522caa66..e999f7b68a5 100644
--- a/chromium/content/child/runtime_features.cc
+++ b/chromium/content/child/runtime_features.cc
@@ -90,14 +90,17 @@ void SetRuntimeFeaturesDefaultsAndUpdateFromArgs(
if (enableExperimentalWebPlatformFeatures)
WebRuntimeFeatures::EnableExperimentalFeatures(true);
+ SetRuntimeFeatureDefaultsForPlatform();
+
+ // Begin individual features.
+ // Do not add individual features above this line.
+
WebRuntimeFeatures::EnableOriginTrials(
base::FeatureList::IsEnabled(features::kOriginTrials));
if (!base::FeatureList::IsEnabled(features::kWebUsb))
WebRuntimeFeatures::EnableWebUsb(false);
- SetRuntimeFeatureDefaultsForPlatform();
-
if (command_line.HasSwitch(switches::kDisableDatabases))
WebRuntimeFeatures::EnableDatabase(false);
@@ -138,15 +141,12 @@ void SetRuntimeFeaturesDefaultsAndUpdateFromArgs(
}
#if defined(OS_MACOSX)
- bool enable_canvas_2d_image_chromium = command_line.HasSwitch(
- switches::kEnableGpuMemoryBufferCompositorResources) &&
+ const bool enable_canvas_2d_image_chromium =
+ command_line.HasSwitch(
+ switches::kEnableGpuMemoryBufferCompositorResources) &&
!command_line.HasSwitch(switches::kDisable2dCanvasImageChromium) &&
- !command_line.HasSwitch(switches::kDisableGpu);
-
- if (enable_canvas_2d_image_chromium) {
- enable_canvas_2d_image_chromium =
- base::FeatureList::IsEnabled(features::kCanvas2DImageChromium);
- }
+ !command_line.HasSwitch(switches::kDisableGpu) &&
+ base::FeatureList::IsEnabled(features::kCanvas2DImageChromium);
#else
bool enable_canvas_2d_image_chromium = false;
#endif
@@ -189,9 +189,9 @@ void SetRuntimeFeaturesDefaultsAndUpdateFromArgs(
if (command_line.HasSwitch(switches::kReducedReferrerGranularity))
WebRuntimeFeatures::EnableReducedReferrerGranularity(true);
- WebRuntimeFeatures::EnableRootLayerScrolling(
- base::FeatureList::IsEnabled(features::kRootLayerScrolling) ||
- enableExperimentalWebPlatformFeatures);
+ WebRuntimeFeatures::EnableIntersectionObserverGeometryMapper(
+ base::FeatureList::IsEnabled(
+ features::kIntersectionObserverGeometryMapper));
if (command_line.HasSwitch(switches::kDisablePermissionsAPI))
WebRuntimeFeatures::EnablePermissionsAPI(false);
@@ -210,14 +210,17 @@ void SetRuntimeFeaturesDefaultsAndUpdateFromArgs(
if (base::FeatureList::IsEnabled(features::kWebXrGamepadSupport))
WebRuntimeFeatures::EnableWebXRGamepadSupport(true);
+ if (base::FeatureList::IsEnabled(features::kWebXrHitTest))
+ WebRuntimeFeatures::EnableWebXRHitTest(true);
+
if (command_line.HasSwitch(switches::kDisablePresentationAPI))
WebRuntimeFeatures::EnablePresentationAPI(false);
if (command_line.HasSwitch(switches::kDisableRemotePlaybackAPI))
WebRuntimeFeatures::EnableRemotePlaybackAPI(false);
- WebRuntimeFeatures::EnableScrollAnchoring(
- base::FeatureList::IsEnabled(features::kScrollAnchoring) ||
+ WebRuntimeFeatures::EnableSecMetadata(
+ base::FeatureList::IsEnabled(features::kSecMetadata) ||
enableExperimentalWebPlatformFeatures);
WebRuntimeFeatures::EnableUserActivationV2(
@@ -232,6 +235,10 @@ void SetRuntimeFeaturesDefaultsAndUpdateFromArgs(
command_line.HasSwitch(switches::kEnableSlimmingPaintV175) ||
enableExperimentalWebPlatformFeatures);
+ WebRuntimeFeatures::EnableFeatureFromString(
+ "BlinkGenPropertyTrees",
+ command_line.HasSwitch(switches::kEnableBlinkGenPropertyTrees));
+
if (command_line.HasSwitch(switches::kEnableSlimmingPaintV2))
WebRuntimeFeatures::EnableSlimmingPaintV2(true);
@@ -297,6 +304,9 @@ void SetRuntimeFeaturesDefaultsAndUpdateFromArgs(
if (base::FeatureList::IsEnabled(features::kGamepadExtensions))
WebRuntimeFeatures::EnableGamepadExtensions(true);
+ if (base::FeatureList::IsEnabled(features::kGamepadVibration))
+ WebRuntimeFeatures::EnableGamepadVibration(true);
+
if (base::FeatureList::IsEnabled(features::kCompositeOpaqueFixedPosition))
WebRuntimeFeatures::EnableFeatureFromString("CompositeOpaqueFixedPosition",
true);
@@ -313,9 +323,6 @@ void SetRuntimeFeaturesDefaultsAndUpdateFromArgs(
WebRuntimeFeatures::EnableGenericSensorExtraClasses(true);
}
- if (base::FeatureList::IsEnabled(features::kNotificationsWithMojo))
- WebRuntimeFeatures::EnableNotificationsWithMojo(true);
-
if (base::FeatureList::IsEnabled(network::features::kOutOfBlinkCORS))
WebRuntimeFeatures::EnableOutOfBlinkCORS(true);
@@ -330,10 +337,6 @@ void SetRuntimeFeaturesDefaultsAndUpdateFromArgs(
false);
}
- if (base::FeatureList::IsEnabled(
- features::kTurnOff2DAndOpacityCompositorAnimations))
- WebRuntimeFeatures::EnableTurnOff2DAndOpacityCompositorAnimations(true);
-
if (base::FeatureList::IsEnabled(features::kRasterInducingScroll))
WebRuntimeFeatures::EnableRasterInducingScroll(true);
@@ -362,10 +365,8 @@ void SetRuntimeFeaturesDefaultsAndUpdateFromArgs(
WebRuntimeFeatures::EnableResourceLoadScheduler(
base::FeatureList::IsEnabled(features::kResourceLoadScheduler));
- if (command_line.HasSwitch(
- switches::kDisableOriginTrialControlledBlinkFeatures)) {
- WebRuntimeFeatures::EnableOriginTrialControlledFeatures(false);
- }
+ if (base::FeatureList::IsEnabled(features::kLayeredAPI))
+ WebRuntimeFeatures::EnableLayeredAPI(true);
WebRuntimeFeatures::EnableLazyInitializeMediaControls(
base::FeatureList::IsEnabled(features::kLazyInitializeMediaControls));
@@ -402,17 +403,6 @@ void SetRuntimeFeaturesDefaultsAndUpdateFromArgs(
if (base::FeatureList::IsEnabled(features::kLazyFrameLoading))
WebRuntimeFeatures::EnableLazyFrameLoading(true);
- // Enable explicitly enabled features, and then disable explicitly disabled
- // ones.
- for (const std::string& feature :
- FeaturesFromSwitch(command_line, switches::kEnableBlinkFeatures)) {
- WebRuntimeFeatures::EnableFeatureFromString(feature, true);
- }
- for (const std::string& feature :
- FeaturesFromSwitch(command_line, switches::kDisableBlinkFeatures)) {
- WebRuntimeFeatures::EnableFeatureFromString(feature, false);
- }
-
WebRuntimeFeatures::EnableV8ContextSnapshot(
base::FeatureList::IsEnabled(features::kV8ContextSnapshot));
@@ -434,21 +424,47 @@ void SetRuntimeFeaturesDefaultsAndUpdateFromArgs(
WebRuntimeFeatures::EnablePictureInPicture(
base::FeatureList::IsEnabled(media::kPictureInPicture));
- WebRuntimeFeatures::EnableCodeCacheAfterExecute(
- base::FeatureList::IsEnabled(features::kCodeCacheAfterExecute));
-
WebRuntimeFeatures::EnableCacheInlineScriptCode(
base::FeatureList::IsEnabled(features::kCacheInlineScriptCode));
- if (base::FeatureList::IsEnabled(features::kUnifiedTouchAdjustment))
- WebRuntimeFeatures::EnableUnifiedTouchAdjustment(true);
-
// Make srcset on link rel=preload work with SignedHTTPExchange flag too.
if (base::FeatureList::IsEnabled(features::kSignedHTTPExchange))
WebRuntimeFeatures::EnablePreloadImageSrcSetEnabled(true);
WebRuntimeFeatures::EnableOffMainThreadWebSocket(
base::FeatureList::IsEnabled(features::kOffMainThreadWebSocket));
+
+ if (base::FeatureList::IsEnabled(
+ features::kExperimentalProductivityFeatures)) {
+ WebRuntimeFeatures::EnableExperimentalProductivityFeatures(true);
+ }
+
+#if defined(OS_ANDROID)
+ if (base::FeatureList::IsEnabled(features::kDisplayCutoutAPI))
+ WebRuntimeFeatures::EnableDisplayCutoutViewportFit(true);
+#endif
+
+ // End individual features.
+ // Do not add individual features below this line.
+
+ if (command_line.HasSwitch(
+ switches::kDisableOriginTrialControlledBlinkFeatures)) {
+ WebRuntimeFeatures::EnableOriginTrialControlledFeatures(false);
+ }
+
+ WebRuntimeFeatures::EnableAutoplayIgnoresWebAudio(
+ base::FeatureList::IsEnabled(media::kAutoplayIgnoreWebAudio));
+
+ // Enable explicitly enabled features, and then disable explicitly disabled
+ // ones.
+ for (const std::string& feature :
+ FeaturesFromSwitch(command_line, switches::kEnableBlinkFeatures)) {
+ WebRuntimeFeatures::EnableFeatureFromString(feature, true);
+ }
+ for (const std::string& feature :
+ FeaturesFromSwitch(command_line, switches::kDisableBlinkFeatures)) {
+ WebRuntimeFeatures::EnableFeatureFromString(feature, false);
+ }
};
} // namespace content
diff --git a/chromium/content/child/webfallbackthemeengine_impl.cc b/chromium/content/child/webfallbackthemeengine_impl.cc
deleted file mode 100644
index 5c091bc0a75..00000000000
--- a/chromium/content/child/webfallbackthemeengine_impl.cc
+++ /dev/null
@@ -1,215 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/child/webfallbackthemeengine_impl.h"
-
-#include "base/macros.h"
-#include "skia/ext/platform_canvas.h"
-#include "third_party/blink/public/platform/web_rect.h"
-#include "third_party/blink/public/platform/web_size.h"
-#include "ui/native_theme/native_theme_base.h"
-
-using blink::WebCanvas;
-using blink::WebColor;
-using blink::WebRect;
-using blink::WebFallbackThemeEngine;
-
-namespace content {
-
-class WebFallbackThemeEngineImpl::WebFallbackNativeTheme
- : public ui::NativeThemeBase {
- public:
- WebFallbackNativeTheme() {}
- ~WebFallbackNativeTheme() override {}
-
- // NativeTheme:
- SkColor GetSystemColor(ColorId color_id) const override {
- // The paint routines in NativeThemeBase only use GetSystemColor for
- // button focus colors and the fallback theme is not used for buttons.
- NOTREACHED();
- return SK_ColorRED;
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(WebFallbackNativeTheme);
-};
-
-static ui::NativeTheme::Part NativeThemePart(
- WebFallbackThemeEngine::Part part) {
- switch (part) {
- case WebFallbackThemeEngine::kPartScrollbarDownArrow:
- return ui::NativeTheme::kScrollbarDownArrow;
- case WebFallbackThemeEngine::kPartScrollbarLeftArrow:
- return ui::NativeTheme::kScrollbarLeftArrow;
- case WebFallbackThemeEngine::kPartScrollbarRightArrow:
- return ui::NativeTheme::kScrollbarRightArrow;
- case WebFallbackThemeEngine::kPartScrollbarUpArrow:
- return ui::NativeTheme::kScrollbarUpArrow;
- case WebFallbackThemeEngine::kPartScrollbarHorizontalThumb:
- return ui::NativeTheme::kScrollbarHorizontalThumb;
- case WebFallbackThemeEngine::kPartScrollbarVerticalThumb:
- return ui::NativeTheme::kScrollbarVerticalThumb;
- case WebFallbackThemeEngine::kPartScrollbarHorizontalTrack:
- return ui::NativeTheme::kScrollbarHorizontalTrack;
- case WebFallbackThemeEngine::kPartScrollbarVerticalTrack:
- return ui::NativeTheme::kScrollbarVerticalTrack;
- case WebFallbackThemeEngine::kPartScrollbarCorner:
- return ui::NativeTheme::kScrollbarCorner;
- case WebFallbackThemeEngine::kPartCheckbox:
- return ui::NativeTheme::kCheckbox;
- case WebFallbackThemeEngine::kPartRadio:
- return ui::NativeTheme::kRadio;
- case WebFallbackThemeEngine::kPartButton:
- return ui::NativeTheme::kPushButton;
- case WebFallbackThemeEngine::kPartTextField:
- return ui::NativeTheme::kTextField;
- case WebFallbackThemeEngine::kPartMenuList:
- return ui::NativeTheme::kMenuList;
- case WebFallbackThemeEngine::kPartSliderTrack:
- return ui::NativeTheme::kSliderTrack;
- case WebFallbackThemeEngine::kPartSliderThumb:
- return ui::NativeTheme::kSliderThumb;
- case WebFallbackThemeEngine::kPartInnerSpinButton:
- return ui::NativeTheme::kInnerSpinButton;
- case WebFallbackThemeEngine::kPartProgressBar:
- return ui::NativeTheme::kProgressBar;
- default:
- return ui::NativeTheme::kScrollbarDownArrow;
- }
-}
-
-static ui::NativeTheme::State NativeThemeState(
- WebFallbackThemeEngine::State state) {
- switch (state) {
- case WebFallbackThemeEngine::kStateDisabled:
- return ui::NativeTheme::kDisabled;
- case WebFallbackThemeEngine::kStateHover:
- return ui::NativeTheme::kHovered;
- case WebFallbackThemeEngine::kStateNormal:
- return ui::NativeTheme::kNormal;
- case WebFallbackThemeEngine::kStatePressed:
- return ui::NativeTheme::kPressed;
- default:
- return ui::NativeTheme::kDisabled;
- }
-}
-
-static void GetNativeThemeExtraParams(
- WebFallbackThemeEngine::Part part,
- WebFallbackThemeEngine::State state,
- const WebFallbackThemeEngine::ExtraParams* extra_params,
- ui::NativeTheme::ExtraParams* native_theme_extra_params) {
- switch (part) {
- case WebFallbackThemeEngine::kPartScrollbarHorizontalTrack:
- case WebFallbackThemeEngine::kPartScrollbarVerticalTrack:
- native_theme_extra_params->scrollbar_track.track_x =
- extra_params->scrollbar_track.track_x;
- native_theme_extra_params->scrollbar_track.track_y =
- extra_params->scrollbar_track.track_y;
- native_theme_extra_params->scrollbar_track.track_width =
- extra_params->scrollbar_track.track_width;
- native_theme_extra_params->scrollbar_track.track_height =
- extra_params->scrollbar_track.track_height;
- break;
- case WebFallbackThemeEngine::kPartCheckbox:
- native_theme_extra_params->button.checked = extra_params->button.checked;
- native_theme_extra_params->button.indeterminate =
- extra_params->button.indeterminate;
- break;
- case WebFallbackThemeEngine::kPartRadio:
- native_theme_extra_params->button.checked = extra_params->button.checked;
- break;
- case WebFallbackThemeEngine::kPartButton:
- native_theme_extra_params->button.is_default =
- extra_params->button.is_default;
- native_theme_extra_params->button.has_border =
- extra_params->button.has_border;
- // Native buttons have a different focus style.
- native_theme_extra_params->button.is_focused = false;
- native_theme_extra_params->button.background_color =
- extra_params->button.background_color;
- break;
- case WebFallbackThemeEngine::kPartTextField:
- native_theme_extra_params->text_field.is_text_area =
- extra_params->text_field.is_text_area;
- native_theme_extra_params->text_field.is_listbox =
- extra_params->text_field.is_listbox;
- native_theme_extra_params->text_field.background_color =
- extra_params->text_field.background_color;
- break;
- case WebFallbackThemeEngine::kPartMenuList:
- native_theme_extra_params->menu_list.has_border =
- extra_params->menu_list.has_border;
- native_theme_extra_params->menu_list.has_border_radius =
- extra_params->menu_list.has_border_radius;
- native_theme_extra_params->menu_list.arrow_x =
- extra_params->menu_list.arrow_x;
- native_theme_extra_params->menu_list.arrow_y =
- extra_params->menu_list.arrow_y;
- native_theme_extra_params->menu_list.arrow_size =
- extra_params->menu_list.arrow_size;
- native_theme_extra_params->menu_list.arrow_color =
- extra_params->menu_list.arrow_color;
- native_theme_extra_params->menu_list.background_color =
- extra_params->menu_list.background_color;
- break;
- case WebFallbackThemeEngine::kPartSliderTrack:
- case WebFallbackThemeEngine::kPartSliderThumb:
- native_theme_extra_params->slider.vertical =
- extra_params->slider.vertical;
- native_theme_extra_params->slider.in_drag = extra_params->slider.in_drag;
- break;
- case WebFallbackThemeEngine::kPartInnerSpinButton:
- native_theme_extra_params->inner_spin.spin_up =
- extra_params->inner_spin.spin_up;
- native_theme_extra_params->inner_spin.read_only =
- extra_params->inner_spin.read_only;
- break;
- case WebFallbackThemeEngine::kPartProgressBar:
- native_theme_extra_params->progress_bar.determinate =
- extra_params->progress_bar.determinate;
- native_theme_extra_params->progress_bar.value_rect_x =
- extra_params->progress_bar.value_rect_x;
- native_theme_extra_params->progress_bar.value_rect_y =
- extra_params->progress_bar.value_rect_y;
- native_theme_extra_params->progress_bar.value_rect_width =
- extra_params->progress_bar.value_rect_width;
- native_theme_extra_params->progress_bar.value_rect_height =
- extra_params->progress_bar.value_rect_height;
- break;
- default:
- break; // Parts that have no extra params get here.
- }
-}
-
-WebFallbackThemeEngineImpl::WebFallbackThemeEngineImpl()
- : theme_(new WebFallbackNativeTheme()) {}
-
-WebFallbackThemeEngineImpl::~WebFallbackThemeEngineImpl() {}
-
-blink::WebSize WebFallbackThemeEngineImpl::GetSize(
- WebFallbackThemeEngine::Part part) {
- ui::NativeTheme::ExtraParams extra;
- return theme_->GetPartSize(NativeThemePart(part),
- ui::NativeTheme::kNormal,
- extra);
-}
-
-void WebFallbackThemeEngineImpl::Paint(
- blink::WebCanvas* canvas,
- WebFallbackThemeEngine::Part part,
- WebFallbackThemeEngine::State state,
- const blink::WebRect& rect,
- const WebFallbackThemeEngine::ExtraParams* extra_params) {
- ui::NativeTheme::ExtraParams native_theme_extra_params;
- GetNativeThemeExtraParams(
- part, state, extra_params, &native_theme_extra_params);
- theme_->Paint(canvas,
- NativeThemePart(part),
- NativeThemeState(state),
- gfx::Rect(rect),
- native_theme_extra_params);
-}
-
-} // namespace content
diff --git a/chromium/content/child/webfallbackthemeengine_impl.h b/chromium/content/child/webfallbackthemeengine_impl.h
deleted file mode 100644
index 53f7b83c2df..00000000000
--- a/chromium/content/child/webfallbackthemeengine_impl.h
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CONTENT_CHILD_WEBFALLBACKTHEMEENGINE_IMPL_H_
-#define CONTENT_CHILD_WEBFALLBACKTHEMEENGINE_IMPL_H_
-
-#include <memory>
-
-#include "base/macros.h"
-#include "third_party/blink/public/platform/web_fallback_theme_engine.h"
-
-namespace content {
-
-// This theme should only be used in layout tests in cases the mock theme can't
-// handle (such as zoomed controls).
-class WebFallbackThemeEngineImpl : public blink::WebFallbackThemeEngine {
- public:
- WebFallbackThemeEngineImpl();
- ~WebFallbackThemeEngineImpl();
-
- // WebFallbackThemeEngine methods:
- blink::WebSize GetSize(blink::WebFallbackThemeEngine::Part) override;
- void Paint(
- blink::WebCanvas* canvas,
- blink::WebFallbackThemeEngine::Part part,
- blink::WebFallbackThemeEngine::State state,
- const blink::WebRect& rect,
- const blink::WebFallbackThemeEngine::ExtraParams* extra_params) override;
-
- private:
- class WebFallbackNativeTheme;
- std::unique_ptr<WebFallbackNativeTheme> theme_;
-
- DISALLOW_COPY_AND_ASSIGN(WebFallbackThemeEngineImpl);
-};
-
-} // namespace content
-
-#endif // CONTENT_CHILD_WEBFALLBACKTHEMEENGINE_IMPL_H_
diff --git a/chromium/content/child/webthemeengine_impl_android.cc b/chromium/content/child/webthemeengine_impl_android.cc
index a66f7fbce54..6b14c3e23d7 100644
--- a/chromium/content/child/webthemeengine_impl_android.cc
+++ b/chromium/content/child/webthemeengine_impl_android.cc
@@ -12,7 +12,6 @@
#include "ui/native_theme/native_theme.h"
using blink::WebCanvas;
-using blink::WebColor;
using blink::WebRect;
using blink::WebThemeEngine;
diff --git a/chromium/content/child/webthemeengine_impl_default.cc b/chromium/content/child/webthemeengine_impl_default.cc
index 6d898cc534c..13e0a6278c9 100644
--- a/chromium/content/child/webthemeengine_impl_default.cc
+++ b/chromium/content/child/webthemeengine_impl_default.cc
@@ -12,7 +12,6 @@
#include "ui/native_theme/overlay_scrollbar_constants_aura.h"
using blink::WebCanvas;
-using blink::WebColor;
using blink::WebRect;
using blink::WebThemeEngine;
using blink::WebScrollbarOverlayColorTheme;