diff --git a/scripts/big-pkgs.list b/scripts/big-pkgs.list index 074e9f4f08ccc8b..ffc0402ec822bd1 100644 --- a/scripts/big-pkgs.list +++ b/scripts/big-pkgs.list @@ -1,5 +1,6 @@ angle-android bionic-host +carbonyl-host-tools clvk dart dotnet8.0 diff --git a/scripts/setup-ubuntu.sh b/scripts/setup-ubuntu.sh index 1d3e936244e76db..5892c7d82274ddc 100755 --- a/scripts/setup-ubuntu.sh +++ b/scripts/setup-ubuntu.sh @@ -294,6 +294,10 @@ PACKAGES+=" libwebp7 libwebp7:i386 libwebp-dev" PACKAGES+=" libwebpdemux2 libwebpdemux2:i386" PACKAGES+=" libwebpmux3 libwebpmux3:i386" +# Required by chromium-based packages +PACKAGES+=" libfontconfig1" +PACKAGES+=" libfontconfig1:i386" + # Required by wine-stable PACKAGES+=" libfreetype-dev:i386" diff --git a/x11-packages/carbonyl-host-tools/0001-override-build-target.patch b/x11-packages/carbonyl-host-tools/0001-override-build-target.patch new file mode 100644 index 000000000000000..76c22f34b5b1ace --- /dev/null +++ b/x11-packages/carbonyl-host-tools/0001-override-build-target.patch @@ -0,0 +1,11 @@ +--- a/src/browser/BUILD.gn ++++ b/src/browser/BUILD.gn +@@ -40,7 +40,7 @@ + if (is_mac) { + target += "apple-darwin" + } else if (is_linux) { +- target += "unknown-linux-gnu" ++ target += "linux-android" + } + + libs = ["carbonyl"] diff --git a/x11-packages/carbonyl-host-tools/0002-fix-cxx-include.patch b/x11-packages/carbonyl-host-tools/0002-fix-cxx-include.patch new file mode 100644 index 000000000000000..da6d952455ef5af --- /dev/null +++ b/x11-packages/carbonyl-host-tools/0002-fix-cxx-include.patch @@ -0,0 +1,9 @@ +--- a/chromium/src/carbonyl/src/browser/renderer.cc ++++ b/chromium/src/carbonyl/src/browser/renderer.cc +@@ -1,5 +1,6 @@ + #include "carbonyl/src/browser/renderer.h" + ++#include + #include + #include + #include diff --git a/x11-packages/carbonyl-host-tools/0003-properly-include-base-callback.patch b/x11-packages/carbonyl-host-tools/0003-properly-include-base-callback.patch new file mode 100644 index 000000000000000..9e79524d253c9ac --- /dev/null +++ b/x11-packages/carbonyl-host-tools/0003-properly-include-base-callback.patch @@ -0,0 +1,11 @@ +--- a/src/browser/host_display_client.h ++++ b/src/browser/host_display_client.h +@@ -3,7 +3,7 @@ + + #include + +-#include "base/callback.h" ++#include "base/functional/callback.h" + #include "base/memory/shared_memory_mapping.h" + #include "carbonyl/src/browser/export.h" + #include "components/viz/host/host_display_client.h" diff --git a/x11-packages/carbonyl-host-tools/0004-add-support-for-putty.patch b/x11-packages/carbonyl-host-tools/0004-add-support-for-putty.patch new file mode 100644 index 000000000000000..8a1fea1eef3c2b5 --- /dev/null +++ b/x11-packages/carbonyl-host-tools/0004-add-support-for-putty.patch @@ -0,0 +1,23 @@ +From 62d5b2d96bd8890d82ee5150fc4d0db76e68106d Mon Sep 17 00:00:00 2001 +From: Boyi C +Date: Tue, 28 Mar 2023 12:23:33 +0800 +Subject: [PATCH] Update tty.rs to support putty + +Add mode 1002 to tts, to make mouse works in Putty. +--- + src/input/tty.rs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/input/tty.rs b/src/input/tty.rs +index 5cf491b..38dd3f6 100644 +--- a/src/input/tty.rs ++++ b/src/input/tty.rs +@@ -65,7 +65,7 @@ enum TTY { + File(File), + } + +-const SEQUENCES: [(u32, bool); 4] = [(1049, true), (1003, true), (1006, true), (25, false)]; ++const SEQUENCES: [(u32, bool); 5] = [(1049, true), (1002, true), (1003, true), (1006, true), (25, false)]; + + impl TTY { + fn stdin() -> TTY { diff --git a/x11-packages/carbonyl-host-tools/0005-passing-args-from-c-main.patch b/x11-packages/carbonyl-host-tools/0005-passing-args-from-c-main.patch new file mode 100644 index 000000000000000..e272479a41f297a --- /dev/null +++ b/x11-packages/carbonyl-host-tools/0005-passing-args-from-c-main.patch @@ -0,0 +1,156 @@ + +--- a/src/browser/bridge.rs ++++ b/src/browser/bridge.rs +@@ -44,6 +44,11 @@ + rect: CRect, + color: CColor, + } ++#[repr(C)] ++#[derive(Copy, Clone)] ++pub struct InitArg { ++ arg: *const c_char, ++} + + #[repr(C)] + pub struct RendererBridge { +@@ -103,8 +108,8 @@ + post_task: extern "C" fn(extern "C" fn(*mut c_void), *mut c_void), + } + +-fn main() -> io::Result> { +- let cmd = match CommandLineProgram::parse_or_run() { ++fn main(args: Vec) -> io::Result> { ++ let cmd = match CommandLineProgram::parse_or_run(args) { + None => return Ok(Some(0)), + Some(cmd) => cmd, + }; +@@ -142,8 +147,22 @@ + } + + #[no_mangle] +-pub extern "C" fn carbonyl_bridge_main() { +- if let Some(code) = main().unwrap() { ++pub extern "C" fn carbonyl_bridge_main( ++ args: *const InitArg, ++ argc: size_t, ++) { ++ // Parse Vec from params ++ let args = unsafe { std::slice::from_raw_parts(args, argc) }; ++ let args = args.iter() ++ .skip(1) ++ .map(|arg| { ++ let str = unsafe { CStr::from_ptr(arg.arg) }; ++ ++ str.to_str().unwrap().to_owned() ++ }) ++ .collect::>(); ++ ++ if let Some(code) = main(args).unwrap() { + std::process::exit(code) + } + } +--- a/src/cli/cli.rs ++++ b/src/cli/cli.rs +@@ -1,4 +1,5 @@ + use std::{env, ffi::OsStr}; ++use std::sync::OnceLock; + + use super::CommandLineProgram; + +@@ -35,7 +36,17 @@ + } + } + ++static INIT: OnceLock> = OnceLock::new(); ++ + impl CommandLine { ++ pub fn set_args(args: Vec) { ++ INIT.get_or_init(|| { args }); ++ } ++ ++ pub fn get_args() -> Vec { ++ INIT.get_or_init(|| Vec::new()).to_vec() ++ } ++ + pub fn parse() -> CommandLine { + let mut fps = 60.0; + let mut zoom = 1.0; +@@ -43,7 +54,7 @@ + let mut bitmap = false; + let mut shell_mode = false; + let mut program = CommandLineProgram::Main; +- let args = env::args().skip(1).collect::>(); ++ let args = Self::get_args(); + + for arg in &args { + let split: Vec<&str> = arg.split("=").collect(); +--- a/src/cli/program.rs ++++ b/src/cli/program.rs +@@ -8,7 +8,8 @@ + } + + impl CommandLineProgram { +- pub fn parse_or_run() -> Option { ++ pub fn parse_or_run(args: Vec) -> Option { ++ CommandLine::set_args(args); + let cmd = CommandLine::parse(); + + match cmd.program { +--- a/src/browser/renderer.h ++++ b/src/browser/renderer.h +@@ -47,7 +47,7 @@ + + class CARBONYL_RENDERER_EXPORT Renderer { + public: +- static void Main(); ++ static void Main(int argc, const char** argv); + static Renderer* GetCurrent(); + + gfx::Size GetSize(); +--- a/src/browser/renderer.cc ++++ b/src/browser/renderer.cc +@@ -34,8 +34,14 @@ + carbonyl_renderer_rect rect; + carbonyl_renderer_color color; + }; ++struct carbonyl_init_arg { ++ const char *arg; ++}; + +-void carbonyl_bridge_main(); ++void carbonyl_bridge_main( ++ const struct carbonyl_init_arg* args, ++ size_t argc ++); + bool carbonyl_bridge_bitmap_mode(); + float carbonyl_bridge_get_dpi(); + +@@ -71,8 +77,15 @@ + + Renderer::Renderer(struct carbonyl_renderer* ptr): ptr_(ptr) {} + +-void Renderer::Main() { +- carbonyl_bridge_main(); ++void Renderer::Main(int argc, const char** argv) { ++ if (argc < 0) { ++ argc = 0; ++ } ++ struct carbonyl_init_arg args[argc]; ++ for (int i = 0; i < argc; ++i) { ++ args[i].arg = argv[i]; ++ } ++ carbonyl_bridge_main(args, (size_t) argc); + + Bridge::Configure( + carbonyl_bridge_get_dpi(), +--- a/chromium/src/headless/app/headless_shell_main.cc ++++ b/chromium/src/headless/app/headless_shell_main.cc +@@ -17,7 +17,7 @@ + #include "carbonyl/src/browser/renderer.h" + + int main(int argc, const char** argv) { +- carbonyl::Renderer::Main(); ++ carbonyl::Renderer::Main(argc, argv); + + content::ContentMainParams params(nullptr); + #if BUILDFLAG(IS_WIN) diff --git a/x11-packages/carbonyl-host-tools/9001-Add-Carbonyl-service.diff b/x11-packages/carbonyl-host-tools/9001-Add-Carbonyl-service.diff new file mode 100644 index 000000000000000..d13181e8715137b --- /dev/null +++ b/x11-packages/carbonyl-host-tools/9001-Add-Carbonyl-service.diff @@ -0,0 +1,20 @@ +--- a/chromium/patches/chromium/0002-Add-Carbonyl-service.patch ++++ b/chromium/patches/chromium/0002-Add-Carbonyl-service.patch +@@ -590,7 +590,7 @@ + + base64.c_str(), + + PrimaryFont()-> + + PlatformData(). +-+ CreateSkFont(false, &font_description_) +++ CreateSkFont(&font_description_) + + ); + + + + if (node_id != cc::kInvalidNodeId) { +@@ -622,7 +622,7 @@ + + base64.c_str(), + + PrimaryFont()-> + + PlatformData(). +-+ CreateSkFont(false, &font_description_) +++ CreateSkFont(&font_description_) + + ); + + + + if (node_id != cc::kInvalidNodeId) { diff --git a/x11-packages/carbonyl-host-tools/9002-Setup-browser-default-settings.diff b/x11-packages/carbonyl-host-tools/9002-Setup-browser-default-settings.diff new file mode 100644 index 000000000000000..03d73a6f6874a08 --- /dev/null +++ b/x11-packages/carbonyl-host-tools/9002-Setup-browser-default-settings.diff @@ -0,0 +1,34 @@ +--- a/chromium/patches/chromium/0004-Setup-browser-default-settings.patch ++++ b/chromium/patches/chromium/0004-Setup-browser-default-settings.patch +@@ -10,9 +10,9 @@ + + diff --git a/headless/public/headless_browser.cc b/headless/public/headless_browser.cc + index b6c70ecb0fc23..c836a082d2e68 100644 +---- a/headless/public/headless_browser.cc +-+++ b/headless/public/headless_browser.cc +-@@ -22,14 +22,14 @@ namespace headless { ++--- a/headless/lib/browser/headless_browser_impl.cc +++++ b/headless/lib/browser/headless_browser_impl.cc ++@@ -25,7 +25,7 @@ + + namespace { + // Product name for building the default user agent string. +@@ -21,14 +21,15 @@ + constexpr gfx::Size kDefaultWindowSize(800, 600); + + constexpr gfx::FontRenderParams::Hinting kDefaultFontRenderHinting = +- gfx::FontRenderParams::Hinting::HINTING_FULL; ++@@ -122,7 +122,7 @@ + +- std::string GetProductNameAndVersion() { ++ /// static ++ std::string HeadlessBrowser::GetProductNameAndVersion() { + - return std::string(kHeadlessProductName) + "/" + PRODUCT_VERSION; + + return std::string(kHeadlessProductName) + "/" + PRODUCT_VERSION + " (Carbonyl)"; + } +- } // namespace + ++ HeadlessBrowserImpl::HeadlessBrowserImpl( + diff --git a/headless/public/headless_browser.h b/headless/public/headless_browser.h + index 48efaa7d57ca2..afc0236147519 100644 + --- a/headless/public/headless_browser.h diff --git a/x11-packages/carbonyl-host-tools/9003-Bridge-browser-into-Carbonyl-library.diff b/x11-packages/carbonyl-host-tools/9003-Bridge-browser-into-Carbonyl-library.diff new file mode 100644 index 000000000000000..53b6adf5446bd49 --- /dev/null +++ b/x11-packages/carbonyl-host-tools/9003-Bridge-browser-into-Carbonyl-library.diff @@ -0,0 +1,88 @@ +--- a/chromium/patches/chromium/0009-Bridge-browser-into-Carbonyl-library.patch ++++ b/chromium/patches/chromium/0009-Bridge-browser-into-Carbonyl-library.patch +@@ -18,14 +18,14 @@ + +++ b/headless/app/headless_shell.cc + @@ -4,6 +4,8 @@ + +- #include "headless/app/headless_shell.h" ++ #include "headless/public/headless_shell.h" + + +#include "carbonyl/src/browser/bridge.h" + + + #include + + #include "base/base_switches.h" +-@@ -90,6 +92,8 @@ void HeadlessShell::OnBrowserStart(HeadlessBrowser* browser) { ++@@ -103,6 +105,8 @@ + HeadlessBrowserContext::Builder context_builder = + browser_->CreateBrowserContextBuilder(); + +@@ -34,15 +34,13 @@ + // Retrieve the locale set by InitApplicationLocale() in + // headless_content_main_delegate.cc in a way that is free of side-effects. + context_builder.SetAcceptLanguage(base::i18n::GetConfiguredLocale()); +-@@ -113,39 +117,14 @@ void HeadlessShell::OnBrowserStart(HeadlessBrowser* browser) { +- +- GURL target_url = ConvertArgumentToURL(args.front()); ++@@ -133,35 +137,12 @@ ++ HeadlessWebContents::Builder builder( ++ browser_context->CreateWebContentsBuilder()); + + - // If driven by a debugger just open the target page and + - // leave expecting the debugger will do what they need. +-- if (IsRemoteDebuggingEnabled()) { +-- HeadlessWebContents::Builder builder( +-- browser_context_->CreateWebContentsBuilder()); ++- if (devtools_enabled) { + - HeadlessWebContents* web_contents = + - builder.SetInitialURL(target_url).Build(); + - if (!web_contents) { +@@ -56,8 +54,6 @@ + - // execute the commands against the target page. + -#if defined(HEADLESS_ENABLE_COMMANDS) + - GURL handler_url = HeadlessCommandHandler::GetHandlerUrl(); +- HeadlessWebContents::Builder builder( +- browser_context_->CreateWebContentsBuilder()); + HeadlessWebContents* web_contents = + - builder.SetInitialURL(handler_url).Build(); + + builder.SetInitialURL(target_url).Build(); +@@ -71,7 +67,7 @@ + - HeadlessCommandHandler::ProcessCommands( + - HeadlessWebContentsImpl::From(web_contents)->web_contents(), + - std::move(target_url), +-- base::BindOnce(&HeadlessShell::ShutdownSoon, weak_factory_.GetWeakPtr())); ++- base::BindOnce(&HeadlessShell::ShutdownSoon, base::Unretained(this))); + -#endif + } + +@@ -90,9 +86,9 @@ + int main(int argc, const char** argv) { + + carbonyl_shell_main(); + + ++ content::ContentMainParams params(nullptr); + #if BUILDFLAG(IS_WIN) + sandbox::SandboxInterfaceInfo sandbox_info = {nullptr}; +- content::InitializeSandboxInfo(&sandbox_info); + diff --git a/headless/lib/browser/headless_browser_impl.cc b/headless/lib/browser/headless_browser_impl.cc + index 1a1223108be6d..fd45d215479ab 100644 + --- a/headless/lib/browser/headless_browser_impl.cc +@@ -550,7 +546,7 @@ + + #include "base/memory/weak_ptr.h" + #include "base/task/single_thread_task_runner.h" +-@@ -121,9 +122,24 @@ class HEADLESS_EXPORT HeadlessBrowserImpl : public HeadlessBrowser, ++@@ -121,7 +122,22 @@ + policy::PolicyService* GetPolicyService(); + #endif + +@@ -566,9 +562,7 @@ + + void OnMouseDownInput(unsigned int x, unsigned int y); + + void OnMouseMoveInput(unsigned int x, unsigned int y); + + +- bool did_shutdown() const { return did_shutdown_; } +- +- protected: ++ private: + + // TODO: use base::TaskRunner + + std::thread input_thread_; + + diff --git a/x11-packages/carbonyl-host-tools/9004-Rename-carbonyl-Renderer-to-carbonyl-Bridge.diff b/x11-packages/carbonyl-host-tools/9004-Rename-carbonyl-Renderer-to-carbonyl-Bridge.diff new file mode 100644 index 000000000000000..7b5d101250a8fd5 --- /dev/null +++ b/x11-packages/carbonyl-host-tools/9004-Rename-carbonyl-Renderer-to-carbonyl-Bridge.diff @@ -0,0 +1,20 @@ +--- a/chromium/patches/chromium/0011-Rename-carbonyl-Renderer-to-carbonyl-Bridge.patch ++++ b/chromium/patches/chromium/0011-Rename-carbonyl-Renderer-to-carbonyl-Bridge.patch +@@ -17,14 +17,14 @@ + --- a/headless/app/headless_shell.cc + +++ b/headless/app/headless_shell.cc + @@ -12,6 +12,7 @@ +- #include "base/bind.h" + #include "base/command_line.h" + #include "base/files/file_util.h" ++ #include "base/functional/bind.h" + +#include "base/functional/callback.h" + #include "base/i18n/rtl.h" ++ #include "base/logging.h" + #include "base/task/thread_pool.h" +- #include "build/branding_buildflags.h" +-@@ -92,7 +93,9 @@ void HeadlessShell::OnBrowserStart(HeadlessBrowser* browser) { ++@@ -105,7 +106,9 @@ + HeadlessBrowserContext::Builder context_builder = + browser_->CreateBrowserContextBuilder(); + diff --git a/x11-packages/carbonyl-host-tools/9005-Refactor-rendering-bridge.diff b/x11-packages/carbonyl-host-tools/9005-Refactor-rendering-bridge.diff new file mode 100644 index 000000000000000..25d3f0fa16d32aa --- /dev/null +++ b/x11-packages/carbonyl-host-tools/9005-Refactor-rendering-bridge.diff @@ -0,0 +1,121 @@ +--- a/chromium/patches/chromium/0013-Refactor-rendering-bridge.patch ++++ b/chromium/patches/chromium/0013-Refactor-rendering-bridge.patch +@@ -528,35 +528,34 @@ + index 1df3ffe72c93d..5aa0bdc25e409 100644 + --- a/headless/lib/browser/headless_browser_impl.cc + +++ b/headless/lib/browser/headless_browser_impl.cc +-@@ -15,6 +15,7 @@ ++@@ -13,6 +13,7 @@ ++ #include "base/functional/callback.h" + #include "base/memory/ptr_util.h" +- #include "base/run_loop.h" +- #include "base/threading/thread_task_runner_handle.h" ++ #include "base/task/single_thread_task_runner.h" + +#include "components/zoom/zoom_controller.h" +- #include "content/public/app/content_main.h" + #include "content/public/browser/browser_task_traits.h" + #include "content/public/browser/browser_thread.h" +-@@ -24,9 +25,11 @@ ++ #include "content/public/browser/devtools_agent_host.h" ++@@ -20,6 +21,7 @@ + #include "headless/lib/browser/headless_browser_context_impl.h" + #include "headless/lib/browser/headless_browser_main_parts.h" + #include "headless/lib/browser/headless_devtools_agent_host_client.h" + +#include "headless/lib/browser/headless_screen.h" + #include "headless/lib/browser/headless_web_contents_impl.h" +- #include "net/http/http_util.h" +- #include "services/network/public/cpp/network_switches.h" +-+#include "ui/compositor/compositor.h" +- #include "ui/events/devices/device_data_manager.h" ++ #include "headless/public/version.h" + +- #include "content/public/browser/render_frame_host.h" +-@@ -34,6 +37,7 @@ ++@@ -28,8 +30,10 @@ + #include "content/public/browser/render_widget_host.h" + #include "content/public/browser/web_contents.h" + #include "carbonyl/src/browser/bridge.h" + +#include "carbonyl/src/browser/renderer.h" + #include "third_party/blink/public/common/input/web_mouse_event.h" + #include "third_party/blink/public/common/input/web_mouse_wheel_event.h" +++#include "ui/compositor/compositor.h" + #include "ui/events/keycodes/keyboard_codes.h" +-@@ -119,7 +123,7 @@ void HeadlessBrowserImpl::set_browser_main_parts( ++ ++ namespace carbonyl { ++@@ -213,7 +217,7 @@ + } + + void HeadlessBrowserImpl::Resize() { +@@ -565,7 +564,7 @@ + auto rect = gfx::Rect(0, 0, size.width(), size.height()); + + for (auto* ctx: GetAllBrowserContexts()) { +-@@ -133,8 +137,6 @@ void HeadlessBrowserImpl::Resize() { ++@@ -227,8 +231,6 @@ + PlatformSetWebContentsBounds(impl, rect); + } + } +@@ -574,7 +573,7 @@ + } + + void HeadlessBrowserImpl::OnShutdownInput() { +-@@ -436,7 +438,7 @@ void HeadlessBrowserImpl::RunOnStartCallback() { ++@@ -530,7 +532,7 @@ + input_thread_ = std::thread([=]() { + carbonyl::browser = this; + +@@ -583,7 +582,7 @@ + .shutdown = []() { + if (carbonyl::browser) { + carbonyl::browser->OnShutdownInput(); +-@@ -500,7 +502,7 @@ void HeadlessBrowserImpl::RunOnStartCallback() { ++@@ -594,7 +596,7 @@ + } + }; + +@@ -609,30 +608,25 @@ + index e2cb88fbcf708..397b2585f3d0f 100644 + --- a/headless/lib/browser/headless_browser_impl_mac.mm + +++ b/headless/lib/browser/headless_browser_impl_mac.mm +-@@ -6,6 +6,8 @@ +- ++@@ -7,6 +7,8 @@ + #import "base/mac/scoped_objc_class_swizzler.h" ++ #include "base/memory/weak_ptr.h" + #include "base/no_destructor.h" + +#include "carbonyl/src/browser/bridge.h" + +#include "content/browser/renderer_host/render_widget_host_view_mac.h" ++ #include "content/public/browser/browser_task_traits.h" ++ #include "content/public/browser/browser_thread.h" + #include "content/public/browser/render_widget_host_view.h" +- #include "content/public/browser/web_contents.h" +- #include "headless/lib/browser/headless_web_contents_impl.h" +-@@ -95,8 +97,13 @@ void HeadlessBrowserImpl::PlatformSetWebContentsBounds( +- +- content::RenderWidgetHostView* host_view = +- web_contents->web_contents()->GetRenderWidgetHostView(); +-- if (host_view) +-+ if (host_view) { +- host_view->SetWindowFrameInScreen(bounds); +-+ +-+ static_cast(host_view)->SetCurrentDeviceScaleFactor( +-+ carbonyl::Bridge::GetDPI() +-+ ); +-+ } +- } +- +- ui::Compositor* HeadlessBrowserImpl::PlatformGetCompositor( ++@@ -109,6 +111,9 @@ ++ content_web_contents->GetRenderWidgetHostView(); ++ if (host_view) { ++ host_view->SetWindowFrameInScreen(bounds); +++ static_cast(host_view)->SetCurrentDeviceScaleFactor( +++ carbonyl::Bridge::GetDPI() +++ ); ++ } ++ } ++ }, + diff --git a/headless/lib/browser/headless_browser_main_parts_mac.mm b/headless/lib/browser/headless_browser_main_parts_mac.mm + index 718e37ef8bd3e..8ca30b9d88d5b 100644 + --- a/headless/lib/browser/headless_browser_main_parts_mac.mm diff --git a/x11-packages/carbonyl-host-tools/9006-Move-Skia-text-rendering-control-to-bridge.diff b/x11-packages/carbonyl-host-tools/9006-Move-Skia-text-rendering-control-to-bridge.diff new file mode 100644 index 000000000000000..33f188511bf4f0d --- /dev/null +++ b/x11-packages/carbonyl-host-tools/9006-Move-Skia-text-rendering-control-to-bridge.diff @@ -0,0 +1,52 @@ +--- a/chromium/patches/chromium/0014-Move-Skia-text-rendering-control-to-bridge.patch ++++ b/chromium/patches/chromium/0014-Move-Skia-text-rendering-control-to-bridge.patch +@@ -12,7 +12,7 @@ + index 379cf6c58b2b0..891efd6a9d796 100644 + --- a/content/renderer/render_frame_impl.cc + +++ b/content/renderer/render_frame_impl.cc +-@@ -285,7 +285,6 @@ ++@@ -285,11 +285,10 @@ + #include "third_party/skia/include/svg/SkSVGCanvas.h" + #include "third_party/skia/include/utils/SkBase64.h" + #include "third_party/skia/src/text/GlyphRun.h" +@@ -20,7 +20,22 @@ + #include "third_party/skia/src/core/SkClipStackDevice.h" + #include "third_party/skia/src/core/SkDevice.h" + #include "third_party/skia/src/core/SkFontPriv.h" +-@@ -2244,10 +2243,6 @@ void RenderFrameImpl::Initialize(blink::WebFrame* parent) { ++-#include "third_party/skia/src/utils/SkUTF.h" +++#include "third_party/skia/include/core/SkTypes.h" ++ ++ using base::Time; ++ using blink::ContextMenuData; ++@@ -335,6 +334,9 @@ ++ using blink::mojom::SelectionMenuBehavior; ++ using network::mojom::ReferrerPolicy; ++ +++template +++using SkAutoSTArray = skia_private::AutoSTArray; +++ ++ namespace content { ++ ++ namespace { ++@@ -2250,10 +2252,6 @@ + ); + + host->ObserveTerminalRender(render_callback_); +@@ -35,12 +35,12 @@ + index b330273c16db3..297ffacf073fa 100644 + --- a/skia/BUILD.gn + +++ b/skia/BUILD.gn +-@@ -203,7 +203,7 @@ source_set("skcms") { ++@@ -205,7 +205,7 @@ + } + + component("skia") { + - deps = [] + + deps = [ "//carbonyl/src/browser:bridge" ] +- sources = [ +- # Chrome sources. +- "config/SkUserConfig.h", ++ public = [ ++ "ext/benchmarking_canvas.h", ++ "ext/cicp.h", diff --git a/x11-packages/carbonyl-host-tools/build.sh b/x11-packages/carbonyl-host-tools/build.sh new file mode 100644 index 000000000000000..5afae31bd605edb --- /dev/null +++ b/x11-packages/carbonyl-host-tools/build.sh @@ -0,0 +1,310 @@ +TERMUX_PKG_HOMEPAGE=https://github.com/fathyb/carbonyl +TERMUX_PKG_DESCRIPTION="Chromium based browser built to run in a terminal (Host tools, NOT FOR TERMUX)" +TERMUX_PKG_LICENSE="BSD 3-Clause" +TERMUX_PKG_LICENSE_FILE="license.md" +TERMUX_PKG_MAINTAINER="@licy183" +_CHROMIUM_VERSION=111.0.5563.146 +TERMUX_PKG_VERSION=0.0.3 +TERMUX_PKG_SRCURL=(https://github.com/fathyb/carbonyl/archive/refs/tags/v$TERMUX_PKG_VERSION.tar.gz + https://commondatastorage.googleapis.com/chromium-browser-official/chromium-$_CHROMIUM_VERSION.tar.xz) +TERMUX_PKG_SHA256=(bf421b9498a084a7cf2238a574d37d31b498d3e271fdb3dcf466e7ed6c80013d + 1e701fa31b55fa0633c307af8537b4dbf67e02d8cad1080c57d845ed8c48b5fe) +TERMUX_PKG_DEPENDS="atk, cups, dbus, fontconfig, gtk3, krb5, libc++, libdrm, libevdev, libxkbcommon, libminizip, libnss, libwayland, libx11, mesa, openssl, pango, pulseaudio, zlib" +TERMUX_PKG_BUILD_DEPENDS="libnotify, libffi-static" +TERMUX_PKG_ON_DEVICE_BUILD_NOT_SUPPORTED=true +# Chromium doesn't support i686 on Linux. +# Carbonyl donesn't support arm. +TERMUX_PKG_BLACKLISTED_ARCHES="arm, i686" +# Host tools, no need to run elf-cleaner +TERMUX_PKG_NO_ELF_CLEANER=true + +SYSTEM_LIBRARIES=" libdrm fontconfig" +# TERMUX_PKG_DEPENDS="libdrm, fontconfig" + +termux_step_post_get_source() { + # Move chromium source + mv chromium-$_CHROMIUM_VERSION chromium/src + + # Apply diffs + for f in $(find "$TERMUX_PKG_BUILDER_DIR/" -maxdepth 1 -type f -name *.diff | sort); do + echo "Applying patch: $(basename $f)" + patch -p1 < "$f" + done + + # Apply patches related to chromium + pushd chromium/src + for f in $(find "$TERMUX_PKG_BUILDER_DIR/patches" -maxdepth 1 -type f -name *.patch | sort); do + echo "Applying patch: $(basename $f)" + patch -p1 < "$f" + done + popd + + # Apply patches related to carbonyl + pushd chromium/src + for f in $(find "$TERMUX_PKG_SRCDIR/chromium/patches/chromium/" -maxdepth 1 -type f -name *.patch | sort); do + echo "Applying patch: $(basename $f)" + patch --silent -p1 < "$f" + done + popd + + pushd chromium/src/third_party/skia + for f in $(find "$TERMUX_PKG_SRCDIR/chromium/patches/skia/" -maxdepth 1 -type f -name *.diff | sort); do + echo "Applying patch: $(basename $f)" + patch --silent -p1 < "$f" + done + popd + + pushd chromium/src/third_party/webrtc + for f in $(find "$TERMUX_PKG_SRCDIR/chromium/patches/webrtc/" -maxdepth 1 -type f -name *.diff | sort); do + echo "Applying patch: $(basename $f)" + patch --silent -p1 < "$f" + done + popd +} + +termux_step_configure() { + cd $TERMUX_PKG_SRCDIR/chromium/src + termux_setup_ninja + termux_setup_gn + termux_setup_nodejs + + # Remove termux's dummy pkg-config + local _target_pkg_config=$(command -v pkg-config) + local _host_pkg_config="$(cat $_target_pkg_config | grep exec | awk '{print $2}')" + rm -rf $TERMUX_PKG_TMPDIR/host-pkg-config-bin + mkdir -p $TERMUX_PKG_TMPDIR/host-pkg-config-bin + ln -s $_host_pkg_config $TERMUX_PKG_TMPDIR/host-pkg-config-bin/pkg-config + export PATH="$TERMUX_PKG_TMPDIR/host-pkg-config-bin:$PATH" + + # Install amd64 rootfs if necessary + build/linux/sysroot_scripts/install-sysroot.py --arch=amd64 + local _amd64_sysroot_path="$(pwd)/build/linux/$(ls build/linux | grep 'amd64-sysroot')" + + # Link to system tools required by the build + mkdir -p third_party/node/linux/node-linux-x64/bin + ln -sf $(command -v node) third_party/node/linux/node-linux-x64/bin/ + ln -sf $(command -v java) third_party/jdk/current/bin/ + + # Dummy librt.so + # Why not dummy a librt.a? Some of the binaries reference symbols only exists in Android + # for some reason, such as the `chrome_crashpad_handler`, which needs to link with + # libprotobuf_lite.a, but it is hard to remove the usage of `android/log.h` in protobuf. + echo "INPUT(-llog -liconv -landroid-shmem)" > "$TERMUX_PREFIX/lib/librt.so" + + # Dummy libpthread.a and libresolv.a + echo '!' > "$TERMUX_PREFIX/lib/libpthread.a" + echo '!' > "$TERMUX_PREFIX/lib/libresolv.a" + + # Symlink libffi.a to libffi_pic.a + ln -sfr $TERMUX_PREFIX/lib/libffi.a $TERMUX_PREFIX/lib/libffi_pic.a + + # Merge sysroots + rm -rf $TERMUX_PKG_TMPDIR/sysroot + mkdir -p $TERMUX_PKG_TMPDIR/sysroot + pushd $TERMUX_PKG_TMPDIR/sysroot + mkdir -p usr/include usr/lib usr/bin + cp -R $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/include/* usr/include + cp -R $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/include/$TERMUX_HOST_PLATFORM/* usr/include + cp -R $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/$TERMUX_HOST_PLATFORM/$TERMUX_PKG_API_LEVEL/* usr/lib/ + cp "$TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/$TERMUX_HOST_PLATFORM/libc++_shared.so" usr/lib/ + cp "$TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/$TERMUX_HOST_PLATFORM/libc++_static.a" usr/lib/ + cp "$TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/$TERMUX_HOST_PLATFORM/libc++abi.a" usr/lib/ + cp -Rf $TERMUX_PREFIX/include/* usr/include + cp -Rf $TERMUX_PREFIX/lib/* usr/lib + ln -sf /data ./data + # This is needed to build cups + cp -Rf $TERMUX_PREFIX/bin/cups-config usr/bin/ + chmod +x usr/bin/cups-config + popd + + # Construct args + local _clang_base_path="/usr/lib/llvm-18" + local _host_cc="$_clang_base_path/bin/clang" + local _host_cxx="$_clang_base_path/bin/clang++" + local _host_toolchain="$TERMUX_PKG_CACHEDIR/custom-toolchain:host" + local _target_cpu _target_sysroot="$TERMUX_PKG_TMPDIR/sysroot" + local _v8_toolchain_name _v8_current_cpu _v8_sysroot_path + if [ "$TERMUX_ARCH" = "aarch64" ]; then + _target_cpu="arm64" + _v8_current_cpu="arm64" + _v8_sysroot_path="$_amd64_sysroot_path" + _v8_toolchain_name="host" + elif [ "$TERMUX_ARCH" = "arm" ]; then + # Install i386 rootfs if necessary + build/linux/sysroot_scripts/install-sysroot.py --arch=i386 + _target_cpu="arm" + _v8_current_cpu="x86" + _v8_sysroot_path="$_i386_sysroot_path" + _v8_toolchain_name="clang_x86_v8_arm" + elif [ "$TERMUX_ARCH" = "x86_64" ]; then + _target_cpu="x64" + _v8_current_cpu="x64" + _v8_sysroot_path="$_amd64_sysroot_path" + _v8_toolchain_name="host" + fi + + local _common_args_file=$TERMUX_PKG_TMPDIR/common-args-file + rm -f $_common_args_file + touch $_common_args_file + + echo " +import(\"//carbonyl/src/browser/args.gn\") +# Do not build with symbols +is_debug = false +is_component_build = false +symbol_level = 0 +# Use our custom toolchain +use_sysroot = false +target_cpu = \"$_target_cpu\" +target_rpath = \"$TERMUX_PREFIX/lib\" +target_sysroot = \"$_target_sysroot\" +clang_base_path = \"$_clang_base_path\" +custom_toolchain = \"//build/toolchain/linux/unbundle:default\" +host_toolchain = \"$TERMUX_PKG_CACHEDIR/custom-toolchain:host\" +v8_snapshot_toolchain = \"$TERMUX_PKG_CACHEDIR/custom-toolchain:$_v8_toolchain_name\" +clang_use_chrome_plugins = false +dcheck_always_on = false +chrome_pgo_phase = 0 +treat_warnings_as_errors = false +# Use system libraries as little as possible +use_bundled_fontconfig = false +use_system_freetype = true +use_system_libdrm = true +use_custom_libcxx = false +use_allocator_shim = false +use_partition_alloc_as_malloc = false +enable_backup_ref_ptr_support = false +enable_mte_checked_ptr_support = false +use_nss_certs = true +use_udev = false +use_gnome_keyring = false +use_alsa = false +use_libpci = false +use_pulseaudio = false +use_ozone = true +use_qt = false +ozone_auto_platforms = false +ozone_platform = \"headless\" +ozone_platform_x11 = false +ozone_platform_wayland = false +ozone_platform_headless = true +angle_enable_vulkan = true +angle_enable_swiftshader = true +rtc_use_pipewire = false +use_vaapi_x11 = false +# See comments on Chromium package +enable_nacl = false +use_thin_lto=false +# Enable jumbo build (unified build) +use_jumbo_build = true +" >> $_common_args_file + + if [ "$TERMUX_ARCH" = "arm" ]; then + echo "arm_arch = \"armv7-a\"" >> $_common_args_file + echo "arm_float_abi = \"softfp\"" >> $_common_args_file + fi + + # Use custom toolchain + rm -rf $TERMUX_PKG_CACHEDIR/custom-toolchain + mkdir -p $TERMUX_PKG_CACHEDIR/custom-toolchain + cp -f $TERMUX_PKG_BUILDER_DIR/toolchain-template/host-toolchain.gn.in $TERMUX_PKG_CACHEDIR/custom-toolchain/BUILD.gn + sed -i "s|@HOST_CC@|$_host_cc|g + s|@HOST_CXX@|$_host_cxx|g + s|@HOST_LD@|$_host_cxx|g + s|@HOST_AR@|$(command -v llvm-ar)|g + s|@HOST_NM@|$(command -v llvm-nm)|g + s|@HOST_IS_CLANG@|true|g + s|@HOST_USE_GOLD@|false|g + s|@HOST_SYSROOT@|$_amd64_sysroot_path|g + s|@V8_CURRENT_CPU@|$_target_cpu|g + " $TERMUX_PKG_CACHEDIR/custom-toolchain/BUILD.gn + if [ "$_v8_toolchain_name" != "host" ]; then + cat $TERMUX_PKG_BUILDER_DIR/toolchain-template/v8-toolchain.gn.in >> $TERMUX_PKG_CACHEDIR/custom-toolchain/BUILD.gn + sed -i "s|@V8_CC@|$_host_cc|g + s|@V8_CXX@|$_host_cxx|g + s|@V8_LD@|$_host_cxx|g + s|@V8_AR@|$(command -v llvm-ar)|g + s|@V8_NM@|$(command -v llvm-nm)|g + s|@V8_TOOLCHAIN_NAME@|$_v8_toolchain_name|g + s|@V8_CURRENT_CPU@|$_v8_current_cpu|g + s|@V8_V8_CURRENT_CPU@|$_target_cpu|g + s|@V8_IS_CLANG@|true|g + s|@V8_USE_GOLD@|false|g + s|@V8_SYSROOT@|$_v8_sysroot_path|g + " $TERMUX_PKG_CACHEDIR/custom-toolchain/BUILD.gn + fi + + cd $TERMUX_PKG_SRCDIR/chromium/src + mkdir -p $TERMUX_PKG_BUILDDIR/out/Release + cat $_common_args_file > $TERMUX_PKG_BUILDDIR/out/Release/args.gn + gn gen $TERMUX_PKG_BUILDDIR/out/Release --export-compile-commands + + export cr_v8_toolchain="$_v8_toolchain_name" +} + +termux_step_make() { + cd $TERMUX_PKG_BUILDDIR + # Build v8 snapshot and tools + time ninja -C out/Release \ + v8_context_snapshot \ + run_mksnapshot_default \ + run_torque \ + generate_bytecode_builtins_list \ + v8:run_gen-regexp-special-case + + # Build host tools + time ninja -C out/Release \ + generate_top_domain_list_variables_file \ + generate_chrome_colors_info \ + character_data \ + gen_root_store_inc \ + generate_transport_security_state \ + generate_top_domains_trie + + # Build swiftshader + time ninja -C out/Release \ + third_party/swiftshader/src/Vulkan:icd_file \ + third_party/swiftshader/src/Vulkan:swiftshader_libvulkan +} + +termux_step_make_install() { + cd $TERMUX_PKG_BUILDDIR + mkdir -p $TERMUX_PREFIX/opt/$TERMUX_PKG_NAME + + local v8_tools=( + mksnapshot # run_mksnapshot_default + torque # torque + bytecode_builtins_list_generator # generate_bytecode_builtins_list + gen-regexp-special-case # v8:run_gen-regexp-special-case + ) + mkdir -p "$TERMUX_PREFIX/opt/$TERMUX_PKG_NAME/$cr_v8_toolchain/" + cp "${v8_tools[@]/#/out/Release/$cr_v8_toolchain/}" "$TERMUX_PREFIX/opt/$TERMUX_PKG_NAME/$cr_v8_toolchain/" + + local host_tools=( + make_top_domain_list_variables # generate_top_domain_list_variables_file + generate_colors_info # generate_chrome_colors_info + character_data_generator # character_data + root_store_tool # gen_root_store_inc + transport_security_state_generator # generate_transport_security_state + top_domain_generator # generate_top_domains_trie + icudtl.dat # icu data + ) + mkdir -p "$TERMUX_PREFIX/opt/$TERMUX_PKG_NAME/host/" + cp "${host_tools[@]/#/out/Release/host/}" "$TERMUX_PREFIX/opt/$TERMUX_PKG_NAME/host/" + + local normal_files=( + # v8 snapshot data + snapshot_blob.bin + v8_context_snapshot.bin + + # swiftshader + libvk_swiftshader.so + vk_swiftshader_icd.json + ) + cp "${normal_files[@]/#/out/Release/}" "$TERMUX_PREFIX/opt/$TERMUX_PKG_NAME/" +} + +termux_step_post_make_install() { + # Remove the dummy files + rm $TERMUX_PREFIX/lib/lib{{pthread,resolv,ffi_pic}.a,rt.so} +} diff --git a/x11-packages/carbonyl-host-tools/patches/0000-patches-desc b/x11-packages/carbonyl-host-tools/patches/0000-patches-desc new file mode 100644 index 000000000000000..292ca1ba885c502 --- /dev/null +++ b/x11-packages/carbonyl-host-tools/patches/0000-patches-desc @@ -0,0 +1,13 @@ +Patches 0001-0999 are reserved for the building system of chromium. + +Patches 1001-2999 are reserved to make chromium work properly on Termux. + +1001-1499 are reserved for chromium (base, content, etc.). +1501-1599 are reserved for angle, blink, swiftshader and v8. +2001-2999 are reserved for other 3rd-party libraries and mixed patches. + +Patches 6001-6999 are reserved for some patches that cherry-picks or reverts a commit. + +Patches 7001-7999 are reserved for some patches related to compiler features or bugs. + +Patches 8001-8999 are reserved for some patches that adds missing includes or namespaces. diff --git a/x11-packages/carbonyl-host-tools/patches/0001-compiler-use-android-target.patch b/x11-packages/carbonyl-host-tools/patches/0001-compiler-use-android-target.patch new file mode 100644 index 000000000000000..d719757da11b187 --- /dev/null +++ b/x11-packages/carbonyl-host-tools/patches/0001-compiler-use-android-target.patch @@ -0,0 +1,24 @@ +--- a/build/config/compiler/BUILD.gn ++++ b/build/config/compiler/BUILD.gn +@@ -960,8 +960,8 @@ + } else if (current_cpu == "arm") { + if (is_clang && !is_android && !is_nacl && + !(is_chromeos_lacros && is_chromeos_device)) { +- cflags += [ "--target=arm-linux-gnueabihf" ] +- ldflags += [ "--target=arm-linux-gnueabihf" ] ++ cflags += [ "--target=armv7a-linux-android24" ] ++ ldflags += [ "--target=armv7a-linux-android24" ] + } + if (!is_nacl) { + cflags += [ +@@ -975,8 +975,8 @@ + } else if (current_cpu == "arm64") { + if (is_clang && !is_android && !is_nacl && !is_fuchsia && + !(is_chromeos_lacros && is_chromeos_device)) { +- cflags += [ "--target=aarch64-linux-gnu" ] +- ldflags += [ "--target=aarch64-linux-gnu" ] ++ cflags += [ "--target=aarch64-linux-android24" ] ++ ldflags += [ "--target=aarch64-linux-android24" ] + } + } else if (current_cpu == "mipsel" && !is_nacl) { + ldflags += [ "-Wl,--hash-style=sysv" ] diff --git a/x11-packages/carbonyl-host-tools/patches/0002-compiler-warnings.patch b/x11-packages/carbonyl-host-tools/patches/0002-compiler-warnings.patch new file mode 100644 index 000000000000000..1f2496cc0182d57 --- /dev/null +++ b/x11-packages/carbonyl-host-tools/patches/0002-compiler-warnings.patch @@ -0,0 +1,45 @@ +--- a/build/config/compiler/BUILD.gn ++++ b/build/config/compiler/BUILD.gn +@@ -1608,6 +1608,12 @@ + "-Wno-unused-parameter", # Unused function parameters. + ] + ++ cflags_cc += [ ++ # Disables for C++ only ++ "-Wno-invalid-offsetof", # offsetof on non-standard-layout type ++ # (crbug.com/40285259) ++ ] ++ + if (!is_nacl || is_nacl_saigo) { + cflags += [ + # An ABI compat warning we don't care about, https://crbug.com/1102157 +@@ -1618,6 +1624,11 @@ + } + } + ++ cflags += [ ++ "-Wno-unknown-warning-option", ++ "-Wno-unknown-pragmas", ++ ] ++ + if (is_clang) { + cflags += [ + "-Wloop-analysis", +@@ -1636,6 +1647,17 @@ + } + + cflags += [ ++ # TODO(crbug.com/40284799): Fix and re-enable. ++ "-Wno-thread-safety-reference-return", ++ ] ++ ++ cflags_cc += [ ++ # Will be fix later, disable it for now ++ "-Wno-deprecated-this-capture", ++ "-Wno-vla-cxx-extension", ++ ] ++ ++ cflags += [ + "-Wenum-compare-conditional", + + # Ignore warnings about MSVC optimization pragmas. diff --git a/x11-packages/carbonyl-host-tools/patches/0003-script-add-ld-preload.patch b/x11-packages/carbonyl-host-tools/patches/0003-script-add-ld-preload.patch new file mode 100644 index 000000000000000..e69de29bb2d1d64 diff --git a/x11-packages/carbonyl-host-tools/patches/0004-compiler-remove-unsupported-flags.patch b/x11-packages/carbonyl-host-tools/patches/0004-compiler-remove-unsupported-flags.patch new file mode 100644 index 000000000000000..0592c68e6946bcb --- /dev/null +++ b/x11-packages/carbonyl-host-tools/patches/0004-compiler-remove-unsupported-flags.patch @@ -0,0 +1,19 @@ +--- a/build/config/compiler/BUILD.gn ++++ b/build/config/compiler/BUILD.gn +@@ -1569,16 +1569,6 @@ + # TODO(thakis): Only for no_chromium_code? http://crbug.com/912662 + "-Wno-ignored-pragma-optimize", + ] +- +- if (!is_nacl) { +- cflags += [ +- # TODO(crbug.com/1343975) Evaluate and possibly enable. +- "-Wno-deprecated-builtins", +- +- # TODO(crbug.com/1352183) Evaluate and possibly enable. +- "-Wno-bitfield-constant-conversion", +- ] +- } + } + } + } diff --git a/x11-packages/carbonyl-host-tools/patches/0005-compiler-remove-gsimple-template-names.patch b/x11-packages/carbonyl-host-tools/patches/0005-compiler-remove-gsimple-template-names.patch new file mode 100644 index 000000000000000..ddb3f8f99c067a3 --- /dev/null +++ b/x11-packages/carbonyl-host-tools/patches/0005-compiler-remove-gsimple-template-names.patch @@ -0,0 +1,15 @@ +--- a/build/config/compiler/BUILD.gn ++++ b/build/config/compiler/BUILD.gn +@@ -808,9 +808,9 @@ + # lldb doesn't have the needed changes yet. + # * Fuchsia isn't supported as zxdb doesn't support simple template names yet. + # TODO(crbug.com/1379070): Remove if the upstream default ever changes. +- if (is_clang && !is_nacl && !is_win && !is_apple && !is_fuchsia) { +- cflags_cc += [ "-gsimple-template-names" ] +- } ++ # if (is_clang && !is_nacl && !is_win && !is_apple && !is_fuchsia) { ++ # cflags_cc += [ "-gsimple-template-names" ] ++ # } + + # MLGO specific flags. These flags enable an ML-based inliner trained on + # Chrome on Android (arm32) with ThinLTO enabled, optimizing for size. diff --git a/x11-packages/carbonyl-host-tools/patches/0100-reland-jumbo-build.patch b/x11-packages/carbonyl-host-tools/patches/0100-reland-jumbo-build.patch new file mode 100644 index 000000000000000..67f20407924771e --- /dev/null +++ b/x11-packages/carbonyl-host-tools/patches/0100-reland-jumbo-build.patch @@ -0,0 +1,5129 @@ +From 639ec7a8b59cd19a5db9793ac09ba79a09d2da31 Mon Sep 17 00:00:00 2001 +From: Chongyun Lee +Date: Wed, 29 Jan 2025 22:21:25 +0800 +Subject: [PATCH] Reland jumbo build + +Based on https://github.com/qt/qtwebengine-chromium/commit/8b55b5c01d1ca28e9b68dcb7ed22fbe820f2b83a + +--- + ash/keyboard/ui/BUILD.gn | 3 +- + base/BUILD.gn | 3 +- + build/config/jumbo.gni | 296 ++++++++++++++++++ + build/config/merge_for_jumbo.py | 145 +++++++++ + cc/cc.gni | 5 +- + components/autofill/content/browser/BUILD.gn | 3 +- + components/autofill/content/renderer/BUILD.gn | 6 +- + components/autofill/core/browser/BUILD.gn | 5 +- + components/autofill/core/common/BUILD.gn | 4 +- + components/cdm/browser/BUILD.gn | 5 +- + components/cdm/common/BUILD.gn | 3 +- + components/cdm/renderer/BUILD.gn | 3 +- + .../content_settings/core/browser/BUILD.gn | 5 +- + .../content_settings/core/common/BUILD.gn | 5 +- + .../content_settings/core/test/BUILD.gn | 4 +- + components/domain_reliability/BUILD.gn | 6 +- + .../feature_engagement/internal/BUILD.gn | 6 +- + .../feature_engagement/internal/test/BUILD.gn | 4 +- + components/feature_engagement/public/BUILD.gn | 6 +- + components/lookalikes/core/BUILD.gn | 7 +- + .../providers/cast/certificate/BUILD.gn | 11 +- + components/metrics/BUILD.gn | 7 +- + components/omnibox/browser/BUILD.gn | 5 +- + .../password_manager/content/browser/BUILD.gn | 4 +- + .../password_manager/core/browser/BUILD.gn | 7 +- + .../core/browser/leak_detection/BUILD.gn | 7 +- + .../password_manager/core/common/BUILD.gn | 3 +- + components/payments/content/BUILD.gn | 11 +- + components/payments/content/icon/BUILD.gn | 4 +- + components/payments/core/BUILD.gn | 11 +- + components/policy/content/BUILD.gn | 5 +- + components/policy/core/browser/BUILD.gn | 5 +- + components/policy/core/common/BUILD.gn | 9 +- + .../safe_browsing/content/browser/BUILD.gn | 5 +- + .../safe_browsing/core/browser/BUILD.gn | 3 +- + components/security_state/content/BUILD.gn | 4 +- + components/security_state/core/BUILD.gn | 6 +- + components/sync/BUILD.gn | 1 + + components/sync/base/BUILD.gn | 3 +- + components/sync/driver/BUILD.gn | 3 +- + components/sync/protocol/BUILD.gn | 3 +- + components/sync_device_info/BUILD.gn | 3 +- + components/sync_user_events/BUILD.gn | 4 +- + components/url_formatter/BUILD.gn | 7 +- + components/viz/common/BUILD.gn | 2 + + components/viz/service/BUILD.gn | 4 + + components/viz/viz.gni | 7 +- + components/webauthn/content/browser/BUILD.gn | 4 +- + components/wifi/BUILD.gn | 6 +- + content/browser/BUILD.gn | 3 +- + content/gpu/BUILD.gn | 5 +- + content/public/browser/BUILD.gn | 3 +- + content/public/child/BUILD.gn | 3 +- + content/public/common/BUILD.gn | 3 +- + content/public/renderer/BUILD.gn | 5 +- + content/renderer/BUILD.gn | 5 +- + content/test/BUILD.gn | 5 +- + content/utility/BUILD.gn | 3 +- + docs/clang_tidy.md | 8 + + docs/clang_tool_refactoring.md | 2 + + docs/linux/build_instructions.md | 9 + + docs/mac_build_instructions.md | 9 + + docs/windows_build_instructions.md | 2 +- + extensions/BUILD.gn | 3 +- + extensions/browser/BUILD.gn | 5 +- + extensions/common/BUILD.gn | 3 +- + extensions/renderer/BUILD.gn | 5 +- + gpu/BUILD.gn | 3 +- + gpu/command_buffer/client/BUILD.gn | 9 +- + gpu/command_buffer/common/BUILD.gn | 5 +- + gpu/command_buffer/service/BUILD.gn | 7 +- + gpu/config/BUILD.gn | 3 +- + gpu/ipc/service/BUILD.gn | 3 +- + media/base/BUILD.gn | 3 +- + media/base/android/BUILD.gn | 3 +- + media/base/ipc/BUILD.gn | 4 +- + media/base/mac/BUILD.gn | 4 +- + media/base/win/BUILD.gn | 4 +- + media/capture/BUILD.gn | 7 +- + media/cast/BUILD.gn | 11 +- + media/filters/BUILD.gn | 3 +- + media/media_options.gni | 6 +- + media/mojo/clients/BUILD.gn | 4 +- + media/mojo/common/BUILD.gn | 4 +- + media/mojo/services/BUILD.gn | 3 +- + mojo/public/tools/bindings/mojom.gni | 5 +- + ppapi/cpp/BUILD.gn | 5 +- + ppapi/host/BUILD.gn | 3 +- + ppapi/proxy/BUILD.gn | 11 +- + ppapi/shared_impl/BUILD.gn | 9 +- + .../cert_net_url_loader/BUILD.gn | 3 +- + services/network/BUILD.gn | 5 +- + services/network/public/cpp/BUILD.gn | 9 +- + storage/browser/BUILD.gn | 5 +- + third_party/blink/common/BUILD.gn | 5 +- + .../blink/renderer/bindings/core/v8/BUILD.gn | 4 +- + .../renderer/bindings/modules/v8/BUILD.gn | 2 +- + .../blink/renderer/controller/BUILD.gn | 7 +- + third_party/blink/renderer/core/BUILD.gn | 10 +- + third_party/blink/renderer/core/core.gni | 5 +- + .../blink/renderer/core/inspector/BUILD.gn | 3 +- + third_party/blink/renderer/modules/BUILD.gn | 6 +- + .../blink/renderer/modules/gamepad/BUILD.gn | 2 +- + .../blink/renderer/modules/hid/BUILD.gn | 2 +- + .../blink/renderer/modules/media/BUILD.gn | 1 + + .../renderer/modules/mediastream/BUILD.gn | 3 +- + .../blink/renderer/modules/modules.gni | 3 +- + .../renderer/modules/peerconnection/BUILD.gn | 2 +- + .../blink/renderer/modules/storage/BUILD.gn | 2 +- + .../blink/renderer/modules/webrtc/BUILD.gn | 1 + + .../renderer/modules/webtransport/BUILD.gn | 2 +- + third_party/blink/renderer/platform/BUILD.gn | 11 +- + .../blink/renderer/platform/blob/BUILD.gn | 7 +- + .../blink/renderer/platform/heap/BUILD.gn | 5 +- + .../platform/instrumentation/BUILD.gn | 3 +- + .../blink/renderer/platform/loader/BUILD.gn | 5 +- + .../blink/renderer/platform/network/BUILD.gn | 5 +- + .../blink/renderer/platform/platform.gni | 4 +- + .../renderer/platform/scheduler/BUILD.gn | 7 +- + .../blink/renderer/platform/wtf/BUILD.gn | 5 +- + third_party/inspector_protocol/BUILD.gn | 4 +- + ui/accessibility/BUILD.gn | 5 +- + ui/accessibility/platform/BUILD.gn | 1 + + ui/aura/BUILD.gn | 5 +- + ui/base/BUILD.gn | 7 +- + ui/base/clipboard/BUILD.gn | 9 +- + ui/base/ime/BUILD.gn | 5 +- + ui/base/ime/ash/BUILD.gn | 3 +- + ui/base/ime/fuchsia/BUILD.gn | 4 +- + ui/base/ime/init/BUILD.gn | 3 +- + ui/base/ime/linux/BUILD.gn | 3 +- + ui/base/ime/mac/BUILD.gn | 4 +- + ui/base/ime/win/BUILD.gn | 4 +- + ui/base/prediction/BUILD.gn | 4 +- + ui/base/x/BUILD.gn | 3 +- + ui/color/BUILD.gn | 7 +- + ui/compositor/BUILD.gn | 5 +- + ui/display/BUILD.gn | 5 +- + ui/display/fake/BUILD.gn | 3 +- + ui/display/manager/BUILD.gn | 3 +- + ui/display/types/BUILD.gn | 4 +- + ui/display/util/BUILD.gn | 3 +- + ui/events/BUILD.gn | 13 +- + ui/events/blink/BUILD.gn | 5 +- + ui/events/devices/BUILD.gn | 4 +- + ui/events/devices/x11/BUILD.gn | 3 +- + ui/events/ipc/BUILD.gn | 4 +- + ui/events/keycodes/BUILD.gn | 5 +- + ui/events/platform/BUILD.gn | 3 +- + ui/events/platform/x11/BUILD.gn | 3 +- + ui/gfx/BUILD.gn | 15 +- + ui/gfx/animation/BUILD.gn | 3 +- + ui/gfx/codec/BUILD.gn | 3 +- + ui/gfx/geometry/BUILD.gn | 4 +- + ui/gfx/ipc/BUILD.gn | 4 +- + ui/gfx/ipc/buffer_types/BUILD.gn | 4 +- + ui/gfx/ipc/color/BUILD.gn | 4 +- + ui/gfx/ipc/geometry/BUILD.gn | 4 +- + ui/gfx/ipc/skia/BUILD.gn | 4 +- + ui/gfx/range/BUILD.gn | 4 +- + ui/gfx/x/BUILD.gn | 3 +- + ui/gl/BUILD.gn | 7 +- + ui/gl/init/BUILD.gn | 3 +- + ui/gtk/BUILD.gn | 4 +- + ui/latency/BUILD.gn | 5 +- + ui/message_center/BUILD.gn | 3 +- + ui/message_center/public/cpp/BUILD.gn | 3 +- + ui/native_theme/BUILD.gn | 9 +- + ui/ozone/BUILD.gn | 11 +- + ui/platform_window/stub/BUILD.gn | 4 +- + ui/platform_window/win/BUILD.gn | 4 +- + ui/resources/BUILD.gn | 1 + + ui/shell_dialogs/BUILD.gn | 3 +- + ui/snapshot/BUILD.gn | 5 +- + ui/surface/BUILD.gn | 3 +- + ui/touch_selection/BUILD.gn | 3 +- + ui/views/BUILD.gn | 7 +- + ui/views/controls/webview/BUILD.gn | 3 +- + ui/views/examples/BUILD.gn | 5 +- + ui/views_content_client/BUILD.gn | 3 +- + ui/web_dialogs/BUILD.gn | 6 +- + ui/wm/BUILD.gn | 5 +- + ui/wm/public/BUILD.gn | 3 +- + 183 files changed, 993 insertions(+), 305 deletions(-) + create mode 100644 build/config/jumbo.gni + create mode 100755 build/config/merge_for_jumbo.py + +diff --git a/ash/keyboard/ui/BUILD.gn b/ash/keyboard/ui/BUILD.gn +index 113c6c81f..e99f151b1 100644 +--- a/ash/keyboard/ui/BUILD.gn ++++ b/ash/keyboard/ui/BUILD.gn +@@ -3,6 +3,7 @@ + # found in the LICENSE file. + + import("//build/config/chromeos/ui_mode.gni") ++import("//build/config/jumbo.gni") + import("//mojo/public/tools/bindings/mojom.gni") + import("//testing/test.gni") + import("//third_party/google_input_tools/closure.gni") +@@ -11,7 +12,7 @@ import("//tools/grit/grit_rule.gni") + + assert(is_chromeos_ash) + +-component("ui") { ++jumbo_component("ui") { + sources = [ + "container_behavior.cc", + "container_behavior.h", +diff --git a/base/BUILD.gn b/base/BUILD.gn +index 1f0e5cc5f..e0139a879 100644 +--- a/base/BUILD.gn ++++ b/base/BUILD.gn +@@ -29,6 +29,7 @@ import("//build/config/compiler/compiler.gni") + import("//build/config/cronet/config.gni") + import("//build/config/dcheck_always_on.gni") + import("//build/config/ios/config.gni") ++import("//build/config/jumbo.gni") + import("//build/config/logging.gni") + import("//build/config/nacl/config.gni") + import("//build/config/profiling/profiling.gni") +@@ -187,7 +188,7 @@ buildflag_header("message_pump_buildflags") { + # base compilation units to be linked in where they wouldn't have otherwise. + # This does not include test code (test support and anything in the test + # directory) which should use source_set as is recommended for GN targets). +-component("base") { ++jumbo_component("base") { + sources = [ + "allocator/allocator_check.cc", + "allocator/allocator_check.h", +diff --git a/build/config/jumbo.gni b/build/config/jumbo.gni +new file mode 100644 +index 000000000..dd8972423 +--- /dev/null ++++ b/build/config/jumbo.gni +@@ -0,0 +1,296 @@ ++# Copyright 2017 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. ++ ++import("//build/config/nacl/config.gni") # To see if jumbo should be turned off ++import("//build/toolchain/goma.gni") ++ ++declare_args() { ++ # If true, use a jumbo build (files compiled together) to speed up ++ # compilation. ++ use_jumbo_build = false ++ ++ # A list of build targets to exclude from jumbo builds, for optimal ++ # round trip time when frequently changing a set of cpp files. The ++ # targets can be just the short name (in which case it matches any ++ # target with that name), a directory prefixed with the root ++ # specifier //, or a full build target label. ++ # ++ # Example: ++ # These would all exclude the "browser" target in a file ++ # content/browser/BUILD.gn, and potentially more. ++ # ++ # jumbo_build_excluded = [ "browser" ] ++ # jumbo_build_excluded = [ "//content/browser" ] ++ # jumbo_build_excluded = [ "//content/browser:browser" ] ++ jumbo_build_excluded = [] ++ ++ # How many files to group on average. Smaller numbers give more ++ # parallellism, higher numbers give less total CPU usage. Higher ++ # numbers also give longer single-file recompilation times. ++ # ++ # Recommendations: ++ # Higher numbers than 100 does not reduce wall clock compile times ++ # even for 4 cores or less so no reason to go higher than 100. ++ # Going from 50 to 100 with a 4 core CPU saves about 3% CPU time and ++ # 3% wall clock time in a tree with blink, v8 and content ++ # jumbofied. At the same time it increases the compile time for the ++ # largest jumbo chunks by 10-20% and reduces the chance to use all ++ # available CPU cores. So set the default to 50 to balance between ++ # high and low-core build performance. -1 means do the default which ++ # varies depending on whether goma is enabled. ++ jumbo_file_merge_limit = -1 ++} ++ ++# Normal builds benefit from lots of jumbification ++jumbo_file_merge_default = 50 ++ ++# Goma builds benefit from more parallelism ++jumbo_file_merge_goma = 8 ++ ++# Use one of the targets jumbo_source_set, jumbo_static_library, or ++# jumbo_component to generate a target which merges sources if possible to ++# compile much faster. ++# ++# Special values. ++# ++# target_type ++# The kind of target to build. For example the string ++# "static_library". ++# ++# always_build_jumbo ++# If set and set to true, then use jumbo compile even when it is ++# globally disabled. Otherwise it has no effect. ++# ++# never_build_jumbo ++# If set and set to true, then do not jumbo compile even if it is ++# globally enabled. Otherwise it has no effect. ++# ++# jumbo_excluded_sources ++# If set to a list of files, those files will not be merged with ++# the rest. This can be necessary if merging the files causes ++# compilation issues and fixing the issues is impractical. ++template("internal_jumbo_target") { ++ use_jumbo_build_for_target = use_jumbo_build ++ if (defined(invoker.always_build_jumbo) && invoker.always_build_jumbo) { ++ use_jumbo_build_for_target = true ++ } ++ if (defined(invoker.never_build_jumbo) && invoker.never_build_jumbo) { ++ use_jumbo_build_for_target = false ++ } ++ if (is_nacl_irt || is_nacl_nonsfi) { ++ # The code is barely compatible with the nacl toolchain anymore and we ++ # don't want to stress it further with jumbo compilation units. ++ use_jumbo_build_for_target = false ++ } ++ ++ foreach(excluded_target, jumbo_build_excluded) { ++ if (excluded_target == target_name || ++ excluded_target == get_label_info(":" + target_name, "dir") || ++ excluded_target == ++ get_label_info(":" + target_name, "label_no_toolchain")) { ++ use_jumbo_build_for_target = false ++ } ++ } ++ ++ excluded_sources = [] ++ if (defined(invoker.jumbo_excluded_sources)) { ++ excluded_sources = invoker.jumbo_excluded_sources ++ } ++ ++ if (defined(invoker.sources)) { ++ invoker_sources = invoker.sources ++ } else { ++ invoker_sources = [] ++ } ++ ++ gen_target_dir = invoker.target_gen_dir ++ ++ not_needed([ "gen_target_dir" ]) # Prevent "unused variable". ++ ++ if (use_jumbo_build_for_target) { ++ jumbo_files = [] ++ ++ # Split the sources list into chunks that are not excessively large ++ current_file_index = 0 ++ next_chunk_start = 0 ++ next_chunk_number = 1 ++ merge_limit = jumbo_file_merge_limit ++ if (merge_limit == -1) { ++ if (use_goma) { ++ merge_limit = jumbo_file_merge_goma ++ } else { ++ merge_limit = jumbo_file_merge_default ++ } ++ } ++ has_c_file = false ++ has_objective_c_file = false ++ sources_in_jumbo_files = [] ++ assert(merge_limit > 0) ++ foreach(source_file, invoker_sources) { ++ source_ext = get_path_info(source_file, "extension") ++ is_source_file = true ++ if (source_ext == "c") { ++ has_c_file = true ++ } else if (source_ext == "mm") { ++ has_objective_c_file = true ++ } else if (source_ext == "cc" || source_ext == "cpp") { ++ if (current_file_index == next_chunk_start) { ++ jumbo_files += [ "$gen_target_dir/" + target_name + "_jumbo_" + ++ next_chunk_number + ".cc" ] ++ next_chunk_number += 1 ++ next_chunk_start += merge_limit ++ } ++ current_file_index += 1 ++ } else { ++ is_source_file = false ++ } ++ if (is_source_file) { ++ sources_in_jumbo_files += [ source_file ] ++ } ++ } ++ ++ if (jumbo_files == [] || current_file_index == 1) { ++ # Empty sources list or a sources list with only header files or ++ # at most one non-header file. ++ use_jumbo_build_for_target = false ++ not_needed([ ++ "sources_in_jumbo_files", ++ "current_file_index", ++ "next_chunk_start", ++ "next_chunk_number", ++ ]) ++ } ++ ++ if (has_c_file) { ++ jumbo_files += [ "$gen_target_dir/" + target_name + "_jumbo_c.c" ] ++ } ++ if (has_objective_c_file) { ++ jumbo_files += [ "$gen_target_dir/" + target_name + "_jumbo_mm.mm" ] ++ } ++ } ++ ++ if (use_jumbo_build_for_target) { ++ merge_action_name = target_name + "__jumbo_merge" ++ sources_in_jumbo_files -= excluded_sources ++ ++ # Create an action that calls a script that merges all the source files. ++ action(merge_action_name) { ++ script = "//build/config/merge_for_jumbo.py" ++ response_file_contents = ++ rebase_path(sources_in_jumbo_files, root_build_dir) ++ outputs = jumbo_files ++ args = [ "--outputs" ] + rebase_path(outputs, root_build_dir) + ++ [ "--file-list={{response_file_name}}" ] ++ ++ # For the "gn analyze" step to work, gn needs to know about the ++ # original source files. They can't be in |sources| because then ++ # they will be compiled, so they have to be somewhere else where ++ # gn analyze looks. One alternative is the |data| list but that ++ # will affect test packaging with known bad effects on ++ # distributed testing. Putting them in this action's input list ++ # is the least bad place. ++ inputs = [] ++ foreach(f, invoker_sources - excluded_sources) { ++ # Avoid generated files and non non-source files. ++ in_source_tree = string_replace(rebase_path(f), ++ rebase_path(root_out_dir), ++ "dummy") == rebase_path(f) ++ is_source_file = get_path_info(f, "extension") == "cc" || ++ get_path_info(f, "extension") == "cpp" || ++ get_path_info(f, "extension") == "c" || ++ get_path_info(f, "extension") == "mm" ++ if (in_source_tree && is_source_file) { ++ inputs += [ f ] ++ } ++ } ++ } ++ } else { ++ # If the list subtraction triggers a gn error, ++ # jumbo_excluded_sources lists a file that is not in sources. ++ sources_after_exclusion = invoker_sources - excluded_sources ++ not_needed([ "sources_after_exclusion" ]) ++ } ++ ++ target_type = invoker.target_type ++ ++ # Perform the actual operation, either on the original sources or ++ # the sources post-jumbo merging. ++ target(target_type, target_name) { ++ deps = [] ++ if (defined(invoker.deps)) { ++ deps += invoker.deps ++ } ++ ++ # Take everything else not handled above from the invoker. ++ variables_to_not_forward = [ "deps" ] ++ if (use_jumbo_build_for_target) { ++ deps += [ ":" + merge_action_name ] ++ variables_to_not_forward += [ "sources" ] ++ assert(jumbo_files != []) ++ sources = invoker_sources - sources_in_jumbo_files + jumbo_files ++ ++ # Change include_dirs to make sure that the jumbo file can find its ++ # #included files. ++ variables_to_not_forward += [ "include_dirs" ] ++ include_dirs = [] ++ if (defined(invoker.include_dirs)) { ++ include_dirs = invoker.include_dirs ++ } ++ include_dirs += [ root_build_dir ] ++ } ++ forward_variables_from(invoker, "*", variables_to_not_forward) ++ } ++} ++ ++# See documentation above by "internal_jumbo_target". ++template("jumbo_source_set") { ++ internal_jumbo_target(target_name) { ++ target_type = "source_set" ++ forward_variables_from(invoker, "*") ++ } ++} ++ ++set_defaults("jumbo_source_set") { ++ # This sets the default list of configs when the jumbo_source_set target ++ # is defined. The default_compiler_configs comes from BUILDCONFIG.gn and ++ # is the list normally applied to static libraries and source sets. ++ configs = default_compiler_configs ++} ++ ++# See documentation above by "internal_jumbo_target". ++template("jumbo_static_library") { ++ internal_jumbo_target(target_name) { ++ target_type = "static_library" ++ forward_variables_from(invoker, "*") ++ } ++} ++ ++set_defaults("jumbo_static_library") { ++ # This sets the default list of configs when the jumbo_static_library target ++ # is defined. The default_compiler_configs comes from BUILDCONFIG.gn and ++ # is the list normally applied to static libraries and source sets. ++ configs = default_compiler_configs ++} ++ ++# See documentation above by "internal_jumbo_target". ++template("jumbo_component") { ++ internal_jumbo_target(target_name) { ++ target_type = "component" ++ forward_variables_from(invoker, "*") ++ } ++} ++ ++set_defaults("jumbo_component") { ++ # This sets the default list of configs when the jumbo_component ++ # target is defined. This code is a clone of set_defaults for the ++ # ordinary "component" template. ++ if (is_component_build) { ++ configs = default_shared_library_configs ++ if (is_android) { ++ configs -= [ "//build/config/android:hide_all_but_jni_onload" ] ++ } ++ } else { ++ configs = default_compiler_configs ++ } ++} +diff --git a/build/config/merge_for_jumbo.py b/build/config/merge_for_jumbo.py +new file mode 100755 +index 000000000..6d037a80e +--- /dev/null ++++ b/build/config/merge_for_jumbo.py +@@ -0,0 +1,145 @@ ++#!/usr/bin/env python ++# ++# Copyright 2016 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. ++ ++"""This script creates a "jumbo" file which merges all incoming files ++for compiling. ++ ++""" ++ ++from __future__ import print_function ++from __future__ import unicode_literals ++ ++import argparse ++import hashlib ++import io ++import os ++ ++def cut_ranges(boundaries): ++ # Given an increasing sequence of boundary indices, generate a sequence of ++ # non-overlapping ranges. The total range is inclusive of the first index ++ # and exclusive of the last index from the given sequence. ++ for start, stop in zip(boundaries, boundaries[1:]): ++ yield range(start, stop) ++ ++ ++def generate_chunk_stops(inputs, output_count, smart_merge=True): ++ # Note: In the comments below, unique numeric labels are assigned to files. ++ # Consider them as the sorted rank of the hash of each file path. ++ # Simple jumbo chunking generates uniformly sized chunks with the ceiling of: ++ # (output_index + 1) * input_count / output_count ++ input_count = len(inputs) ++ stops = [((i + 1) * input_count + output_count - 1) // output_count ++ for i in range(output_count)] ++ # This is disruptive at times because file insertions and removals can ++ # invalidate many chunks as all files are offset by one. ++ # For example, say we have 12 files in 4 uniformly sized chunks: ++ # 9, 4, 0; 7, 1, 11; 5, 10, 2; 6, 3, 8 ++ # If we delete the first file we get: ++ # 4, 0, 7; 1, 11, 5; 10, 2, 6; 3, 8 ++ # All of the chunks have new sets of inputs. ++ ++ # With path-aware chunking, we start with the uniformly sized chunks: ++ # 9, 4, 0; 7, 1, 11; 5, 10, 2; 6, 3, 8 ++ # First we find the smallest rank in each of the chunks. Their indices are ++ # stored in the |centers| list and in this example the ranks would be: ++ # 0, 1, 2, 3 ++ # Then we find the largest rank between the centers. Their indices are stored ++ # in the |stops| list and in this example the ranks would be: ++ # 7, 11, 6 ++ # These files mark the boundaries between chunks and these boundary files are ++ # often maintained even as files are added or deleted. ++ # In this example, 7, 11, and 6 are the first files in each chunk: ++ # 9, 4, 0; 7, 1; 11, 5, 10, 2; 6, 3, 8 ++ # If we delete the first file and repeat the process we get: ++ # 4, 0; 7, 1; 11, 5, 10, 2; 6, 3, 8 ++ # Only the first chunk has a new set of inputs. ++ if smart_merge: ++ # Starting with the simple chunks, every file is assigned a rank. ++ # This requires a hash function that is stable across runs. ++ hasher = lambda n: hashlib.md5(inputs[n].encode()).hexdigest() ++ # In each chunk there is a key file with lowest rank; mark them. ++ # Note that they will not easily change. ++ centers = [min(indices, key=hasher) for indices in cut_ranges([0] + stops)] ++ # Between each pair of key files there is a file with highest rank. ++ # Mark these to be used as border files. They also will not easily change. ++ # Forget the inital chunks and create new chunks by splitting the list at ++ # every border file. ++ stops = [max(indices, key=hasher) for indices in cut_ranges(centers)] ++ stops.append(input_count) ++ return stops ++ ++ ++def write_jumbo_files(inputs, outputs, written_input_set, written_output_set): ++ chunk_stops = generate_chunk_stops(inputs, len(outputs)) ++ ++ written_inputs = 0 ++ for output_index, output_file in enumerate(outputs): ++ written_output_set.add(output_file) ++ if os.path.isfile(output_file): ++ with open(output_file, "r") as current: ++ current_jumbo_file = current.read() ++ else: ++ current_jumbo_file = None ++ ++ out = io.StringIO() ++ out.write("/* This is a Jumbo file. Don't edit. */\n\n") ++ out.write("/* Generated with merge_for_jumbo.py. */\n\n") ++ input_limit = chunk_stops[output_index] ++ while written_inputs < input_limit: ++ filename = inputs[written_inputs] ++ written_inputs += 1 ++ out.write("#include \"%s\"\n" % filename) ++ written_input_set.add(filename) ++ new_jumbo_file = out.getvalue() ++ out.close() ++ ++ if new_jumbo_file != current_jumbo_file: ++ with open(output_file, "w") as out: ++ out.write(new_jumbo_file) ++ ++ ++def main(): ++ parser = argparse.ArgumentParser() ++ parser.add_argument("--outputs", nargs="+", required=True, ++ help='List of output files to split input into') ++ parser.add_argument("--file-list", required=True) ++ parser.add_argument("--verbose", action="store_true") ++ args = parser.parse_args() ++ ++ lines = [] ++ # If written with gn |write_file| each file is on its own line. ++ with open(args.file_list) as file_list_file: ++ lines = [line.strip() for line in file_list_file if line.strip()] ++ # If written with gn |response_file_contents| the files are space separated. ++ all_inputs = [] ++ for line in lines: ++ all_inputs.extend(line.split()) ++ ++ written_output_set = set() # Just for double checking ++ written_input_set = set() # Just for double checking ++ for language_ext in (".cc", ".c", ".mm",): ++ if language_ext == ".cc": ++ ext_pattern = (".cc", ".cpp") ++ else: ++ ext_pattern = tuple([language_ext]) ++ ++ outputs = [x for x in args.outputs if x.endswith(ext_pattern)] ++ inputs = [x for x in all_inputs if x.endswith(ext_pattern)] ++ ++ if not outputs: ++ assert not inputs ++ continue ++ ++ write_jumbo_files(inputs, outputs, written_input_set, written_output_set) ++ ++ assert set(args.outputs) == written_output_set, "Did not fill all outputs" ++ assert set(all_inputs) == written_input_set, "Did not use all inputs" ++ if args.verbose: ++ print("Generated %s (%d files) based on %s" % ( ++ str(args.outputs), len(written_input_set), args.file_list)) ++ ++if __name__ == "__main__": ++ main() +diff --git a/cc/cc.gni b/cc/cc.gni +index 090420c90..6b0e76bf2 100644 +--- a/cc/cc.gni ++++ b/cc/cc.gni +@@ -2,6 +2,7 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//testing/test.gni") + + cc_remove_configs = [] +@@ -16,7 +17,7 @@ if (!is_debug) { + } + + template("cc_component") { +- component(target_name) { ++ jumbo_component(target_name) { + forward_variables_from(invoker, "*", [ "configs" ]) + if (defined(invoker.configs)) { + configs += invoker.configs +@@ -27,7 +28,7 @@ template("cc_component") { + } + + template("cc_test_static_library") { +- static_library(target_name) { ++ jumbo_static_library(target_name) { + forward_variables_from(invoker, "*", [ "configs" ]) + if (defined(invoker.configs)) { + configs += invoker.configs +diff --git a/components/autofill/content/browser/BUILD.gn b/components/autofill/content/browser/BUILD.gn +index 41281a8a3..0956447f2 100644 +--- a/components/autofill/content/browser/BUILD.gn ++++ b/components/autofill/content/browser/BUILD.gn +@@ -2,9 +2,10 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//third_party/protobuf/proto_library.gni") + +-static_library("browser") { ++jumbo_static_library("browser") { + sources = [ + "autofill_log_router_factory.cc", + "autofill_log_router_factory.h", +diff --git a/components/autofill/content/renderer/BUILD.gn b/components/autofill/content/renderer/BUILD.gn +index 74d600740..c501e95a0 100644 +--- a/components/autofill/content/renderer/BUILD.gn ++++ b/components/autofill/content/renderer/BUILD.gn +@@ -2,7 +2,9 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + +-static_library("renderer") { ++import("//build/config/jumbo.gni") ++ ++jumbo_static_library("renderer") { + sources = [ + "autofill_agent.cc", + "autofill_agent.h", +@@ -54,7 +56,7 @@ static_library("renderer") { + ] + } + +-static_library("test_support") { ++jumbo_static_library("test_support") { + testonly = true + sources = [ + "autofill_agent_test_api.h", +diff --git a/components/autofill/core/browser/BUILD.gn b/components/autofill/core/browser/BUILD.gn +index dd87df9e1..56ed0accc 100644 +--- a/components/autofill/core/browser/BUILD.gn ++++ b/components/autofill/core/browser/BUILD.gn +@@ -4,6 +4,7 @@ + + import("//build/buildflag_header.gni") + import("//build/config/chrome_build.gni") ++import("//build/config/jumbo.gni") + import("//chrome/version.gni") + import("//testing/libfuzzer/fuzzer_test.gni") + import("//tools/grit/grit_rule.gni") +@@ -56,7 +57,7 @@ action("regex_patterns_inl_h") { + rebase_path(outputs, root_build_dir) + } + +-static_library("browser") { ++jumbo_static_library("browser") { + sources = [ + "address_normalization_manager.cc", + "address_normalization_manager.h", +@@ -638,7 +639,7 @@ if (is_android) { + } + } + +-static_library("test_support") { ++jumbo_static_library("test_support") { + testonly = true + sources = [ + "autofill_form_test_utils.cc", +diff --git a/components/autofill/core/common/BUILD.gn b/components/autofill/core/common/BUILD.gn +index 525e406b1..a3ae400a5 100644 +--- a/components/autofill/core/common/BUILD.gn ++++ b/components/autofill/core/common/BUILD.gn +@@ -1,10 +1,10 @@ + # Copyright 2014 The Chromium Authors + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. +- ++import("//build/config/jumbo.gni") + import("//testing/libfuzzer/fuzzer_test.gni") + +-static_library("common") { ++jumbo_static_library("common") { + sources = [ + "aliases.h", + "autocomplete_parsing_util.cc", +diff --git a/components/cdm/browser/BUILD.gn b/components/cdm/browser/BUILD.gn +index 100695c76..440335a3e 100644 +--- a/components/cdm/browser/BUILD.gn ++++ b/components/cdm/browser/BUILD.gn +@@ -2,10 +2,11 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//media/media_options.gni") + + if (enable_media_drm_storage) { +- source_set("browser") { ++ jumbo_source_set("browser") { + sources = [ + "media_drm_storage_impl.cc", + "media_drm_storage_impl.h", +@@ -36,7 +37,7 @@ if (enable_media_drm_storage) { + } + } + +- source_set("unit_tests") { ++ jumbo_source_set("unit_tests") { + testonly = true + sources = [ "media_drm_storage_impl_unittest.cc" ] + deps = [ +diff --git a/components/cdm/common/BUILD.gn b/components/cdm/common/BUILD.gn +index 92910a901..ddcd5da6e 100644 +--- a/components/cdm/common/BUILD.gn ++++ b/components/cdm/common/BUILD.gn +@@ -1,10 +1,11 @@ + # Copyright 2014 The Chromium Authors + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. ++import("//build/config/jumbo.gni") + + import("//third_party/widevine/cdm/widevine.gni") + +-static_library("common") { ++jumbo_static_library("common") { + sources = [ + "cdm_message_generator.cc", + "cdm_message_generator.h", +diff --git a/components/cdm/renderer/BUILD.gn b/components/cdm/renderer/BUILD.gn +index 3369afc6e..c22ad2fd4 100644 +--- a/components/cdm/renderer/BUILD.gn ++++ b/components/cdm/renderer/BUILD.gn +@@ -2,9 +2,10 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//third_party/widevine/cdm/widevine.gni") + +-static_library("renderer") { ++jumbo_static_library("renderer") { + sources = [ + "external_clear_key_key_system_info.cc", + "external_clear_key_key_system_info.h", +diff --git a/components/content_settings/core/browser/BUILD.gn b/components/content_settings/core/browser/BUILD.gn +index e6b576fca..c999aa971 100644 +--- a/components/content_settings/core/browser/BUILD.gn ++++ b/components/content_settings/core/browser/BUILD.gn +@@ -3,9 +3,10 @@ + # found in the LICENSE file. + + import("//build/config/features.gni") ++import("//build/config/jumbo.gni") + import("//ppapi/buildflags/buildflags.gni") + +-static_library("browser") { ++jumbo_static_library("browser") { + sources = [ + "content_settings_default_provider.cc", + "content_settings_default_provider.h", +@@ -79,7 +80,7 @@ static_library("browser") { + configs += [ "//build/config/compiler:wexit_time_destructors" ] + } + +-source_set("unit_tests") { ++jumbo_source_set("unit_tests") { + testonly = true + sources = [ + "content_settings_pref_unittest.cc", +diff --git a/components/content_settings/core/common/BUILD.gn b/components/content_settings/core/common/BUILD.gn +index 54060e445..de23fe321 100644 +--- a/components/content_settings/core/common/BUILD.gn ++++ b/components/content_settings/core/common/BUILD.gn +@@ -2,10 +2,11 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//mojo/public/tools/bindings/mojom.gni") + import("//testing/libfuzzer/fuzzer_test.gni") + +-static_library("common") { ++jumbo_static_library("common") { + sources = [ + "content_settings.cc", + "content_settings.h", +@@ -48,7 +49,7 @@ static_library("common") { + } + } + +-source_set("unit_tests") { ++jumbo_source_set("unit_tests") { + testonly = true + sources = [ + "content_settings_pattern_parser_unittest.cc", +diff --git a/components/content_settings/core/test/BUILD.gn b/components/content_settings/core/test/BUILD.gn +index 56bef89ec..adfa5131d 100644 +--- a/components/content_settings/core/test/BUILD.gn ++++ b/components/content_settings/core/test/BUILD.gn +@@ -2,7 +2,9 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + +-static_library("test_support") { ++import("//build/config/jumbo.gni") ++ ++jumbo_static_library("test_support") { + testonly = true + sources = [ + "content_settings_mock_provider.cc", +diff --git a/components/domain_reliability/BUILD.gn b/components/domain_reliability/BUILD.gn +index 1e61419d6..8d53a1c71 100644 +--- a/components/domain_reliability/BUILD.gn ++++ b/components/domain_reliability/BUILD.gn +@@ -2,6 +2,8 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") ++ + action("bake_in_configs") { + visibility = [ ":*" ] + script = "bake_in_configs.py" +@@ -43,7 +45,7 @@ action("bake_in_configs") { + ] + } + +-component("domain_reliability") { ++jumbo_component("domain_reliability") { + sources = [ + "baked_in_configs.h", + "beacon.cc", +@@ -86,7 +88,7 @@ component("domain_reliability") { + ] + } + +-source_set("unit_tests") { ++jumbo_source_set("unit_tests") { + testonly = true + sources = [ + "config_unittest.cc", +diff --git a/components/feature_engagement/internal/BUILD.gn b/components/feature_engagement/internal/BUILD.gn +index edf92e022..3c183cc41 100644 +--- a/components/feature_engagement/internal/BUILD.gn ++++ b/components/feature_engagement/internal/BUILD.gn +@@ -2,12 +2,14 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") ++ + if (is_android) { + import("//build/config/android/config.gni") + import("//build/config/android/rules.gni") + } + +-static_library("internal") { ++jumbo_static_library("internal") { + visibility = [ + ":*", + "//components/feature_engagement", +@@ -84,7 +86,7 @@ static_library("internal") { + } + } + +-source_set("unit_tests") { ++jumbo_source_set("unit_tests") { + testonly = true + + visibility = [ "//components/feature_engagement:unit_tests" ] +diff --git a/components/feature_engagement/internal/test/BUILD.gn b/components/feature_engagement/internal/test/BUILD.gn +index 56bb9c947..aefded72e 100644 +--- a/components/feature_engagement/internal/test/BUILD.gn ++++ b/components/feature_engagement/internal/test/BUILD.gn +@@ -2,7 +2,9 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + +-source_set("test_support") { ++import("//build/config/jumbo.gni") ++ ++jumbo_source_set("test_support") { + testonly = true + + visibility = [ "//components/feature_engagement/internal:unit_tests" ] +diff --git a/components/feature_engagement/public/BUILD.gn b/components/feature_engagement/public/BUILD.gn +index 01a489fec..cb1223d3a 100644 +--- a/components/feature_engagement/public/BUILD.gn ++++ b/components/feature_engagement/public/BUILD.gn +@@ -2,12 +2,14 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") ++ + if (is_android) { + import("//build/config/android/config.gni") + import("//build/config/android/rules.gni") + } + +-source_set("public") { ++jumbo_source_set("public") { + sources = [ + "configuration.cc", + "configuration.h", +@@ -46,7 +48,7 @@ source_set("public") { + } + } + +-source_set("unit_tests") { ++jumbo_source_set("unit_tests") { + testonly = true + + visibility = [ "//components/feature_engagement:unit_tests" ] +diff --git a/components/lookalikes/core/BUILD.gn b/components/lookalikes/core/BUILD.gn +index 6b3f610f2..a06e3e539 100644 +--- a/components/lookalikes/core/BUILD.gn ++++ b/components/lookalikes/core/BUILD.gn +@@ -2,9 +2,10 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//third_party/protobuf/proto_library.gni") + +-static_library("core") { ++jumbo_static_library("core") { + sources = [ + "lookalike_url_ui_util.cc", + "lookalike_url_ui_util.h", +@@ -32,7 +33,7 @@ static_library("core") { + ] + } + +-static_library("safety_tips") { ++jumbo_static_library("safety_tips") { + sources = [ + "safety_tip_test_utils.cc", + "safety_tip_test_utils.h", +@@ -48,7 +49,7 @@ static_library("safety_tips") { + ] + } + +-source_set("unit_tests") { ++jumbo_source_set("unit_tests") { + testonly = true + sources = [ + "lookalike_url_util_unittest.cc", +diff --git a/components/media_router/common/providers/cast/certificate/BUILD.gn b/components/media_router/common/providers/cast/certificate/BUILD.gn +index c5e579cb4..98e1d2faf 100644 +--- a/components/media_router/common/providers/cast/certificate/BUILD.gn ++++ b/components/media_router/common/providers/cast/certificate/BUILD.gn +@@ -2,6 +2,7 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//third_party/openscreen/src/build/config/cast.gni") + + config("developer_certificate_config") { +@@ -11,7 +12,7 @@ config("developer_certificate_config") { + } + } + +-source_set("certificate_reader") { ++jumbo_source_set("certificate_reader") { + sources = [ + "cast_cert_reader.cc", + "cast_cert_reader.h", +@@ -29,7 +30,7 @@ source_set("certificate_roots") { + ] + } + +-static_library("certificate") { ++jumbo_static_library("certificate") { + sources = [ + "cast_cert_validator.cc", + "cast_cert_validator.h", +@@ -57,7 +58,7 @@ static_library("certificate") { + } + } + +-source_set("openscreen_certificate_verifier") { ++jumbo_source_set("openscreen_certificate_verifier") { + sources = [ + "net_parsed_certificate.cc", + "net_parsed_certificate.h", +@@ -72,7 +73,7 @@ source_set("openscreen_certificate_verifier") { + ] + } + +-static_library("test_support") { ++jumbo_static_library("test_support") { + testonly = true + sources = [ + "cast_cert_test_helpers.cc", +@@ -88,7 +89,7 @@ static_library("test_support") { + ] + } + +-source_set("unit_tests") { ++jumbo_source_set("unit_tests") { + testonly = true + sources = [ + "cast_cert_validator_unittest.cc", +diff --git a/components/metrics/BUILD.gn b/components/metrics/BUILD.gn +index 05bf0885e..5c3b006ec 100644 +--- a/components/metrics/BUILD.gn ++++ b/components/metrics/BUILD.gn +@@ -3,6 +3,7 @@ + # found in the LICENSE file. + + import("//build/config/chromeos/ui_mode.gni") ++import("//build/config/jumbo.gni") + import("//testing/test.gni") + + if (is_android) { +@@ -58,7 +59,7 @@ if (is_android) { + } + } + +-static_library("metrics") { ++jumbo_static_library("metrics") { + sources = [ + "android_metrics_provider.cc", + "android_metrics_provider.h", +@@ -319,7 +320,7 @@ source_set("library_support") { + ] + } + +-static_library("net") { ++jumbo_static_library("net") { + sources = [ + "net/cellular_logic_helper.cc", + "net/cellular_logic_helper.h", +@@ -442,7 +443,7 @@ source_set("call_stack_profile_collector") { + ] + } + +-static_library("test_support") { ++jumbo_static_library("test_support") { + testonly = true + sources = [ + "test/test_enabled_state_provider.cc", +diff --git a/components/omnibox/browser/BUILD.gn b/components/omnibox/browser/BUILD.gn +index 00aad3bc6..1c9461202 100644 +--- a/components/omnibox/browser/BUILD.gn ++++ b/components/omnibox/browser/BUILD.gn +@@ -3,6 +3,7 @@ + # found in the LICENSE file. + + import("//build/buildflag_header.gni") ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + import("//components/optimization_guide/features.gni") + import("//components/vector_icons/vector_icons.gni") +@@ -90,7 +91,7 @@ static_library("vector_icons") { + ] + } + +-static_library("browser") { ++jumbo_static_library("browser") { + sources = [ + "actions/omnibox_action.cc", + "actions/omnibox_action.h", +@@ -554,7 +555,7 @@ if (is_android) { + } + } + +-static_library("test_support") { ++jumbo_static_library("test_support") { + testonly = true + sources = [ + "fake_autocomplete_provider.h", +diff --git a/components/password_manager/content/browser/BUILD.gn b/components/password_manager/content/browser/BUILD.gn +index fbbfc6b59..ad1d43dc5 100644 +--- a/components/password_manager/content/browser/BUILD.gn ++++ b/components/password_manager/content/browser/BUILD.gn +@@ -2,7 +2,9 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + +-static_library("browser") { ++import("//build/config/jumbo.gni") ++ ++jumbo_static_library("browser") { + sources = [ + "bad_message.cc", + "bad_message.h", +diff --git a/components/password_manager/core/browser/BUILD.gn b/components/password_manager/core/browser/BUILD.gn +index c48d5b19c..9055d146f 100644 +--- a/components/password_manager/core/browser/BUILD.gn ++++ b/components/password_manager/core/browser/BUILD.gn +@@ -3,6 +3,7 @@ + # found in the LICENSE file. + + import("//build/config/chromeos/ui_mode.gni") ++import("//build/config/jumbo.gni") + import("//testing/libfuzzer/fuzzer_test.gni") + import("//third_party/libprotobuf-mutator/fuzzable_proto_library.gni") + +@@ -17,7 +18,7 @@ config("password_reuse_detection_config") { + } + } + +-static_library("browser") { ++jumbo_static_library("browser") { + sources = [ + "affiliation/affiliated_match_helper.cc", + "affiliation/affiliated_match_helper.h", +@@ -462,7 +463,7 @@ fuzzable_proto_library("affiliation_proto") { + sources = [ "affiliation/affiliation_api.proto" ] + } + +-static_library("password_hash_data") { ++jumbo_static_library("password_hash_data") { + sources = [ + "password_hash_data.cc", + "password_hash_data.h", +@@ -488,7 +489,7 @@ static_library("hash_password_manager") { + ] + } + +-static_library("test_support") { ++jumbo_static_library("test_support") { + testonly = true + sources = [ + "affiliation/fake_affiliation_api.cc", +diff --git a/components/password_manager/core/browser/leak_detection/BUILD.gn b/components/password_manager/core/browser/leak_detection/BUILD.gn +index 11171fb39..1fe2f56b0 100644 +--- a/components/password_manager/core/browser/leak_detection/BUILD.gn ++++ b/components/password_manager/core/browser/leak_detection/BUILD.gn +@@ -2,6 +2,7 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//third_party/libprotobuf-mutator/fuzzable_proto_library.gni") + + fuzzable_proto_library("proto") { +@@ -20,7 +21,7 @@ source_set("leak_detection_interface_headers") { + ] + } + +-source_set("leak_detection") { ++jumbo_source_set("leak_detection") { + sources = [ + "bulk_leak_check.h", + "bulk_leak_check_impl.cc", +@@ -59,7 +60,7 @@ source_set("leak_detection") { + ] + } + +-source_set("test_support") { ++jumbo_source_set("test_support") { + testonly = true + sources = [ + "mock_leak_detection_check_factory.cc", +@@ -77,7 +78,7 @@ source_set("test_support") { + ] + } + +-source_set("unit_tests") { ++jumbo_source_set("unit_tests") { + testonly = true + sources = [ + "bulk_leak_check_impl_unittest.cc", +diff --git a/components/password_manager/core/common/BUILD.gn b/components/password_manager/core/common/BUILD.gn +index e560bfa59..9913a38f1 100644 +--- a/components/password_manager/core/common/BUILD.gn ++++ b/components/password_manager/core/common/BUILD.gn +@@ -5,8 +5,9 @@ + if (is_android) { + import("//build/config/android/rules.gni") + } ++import("//build/config/jumbo.gni") + +-static_library("common") { ++jumbo_static_library("common") { + sources = [ + "credential_manager_types.cc", + "credential_manager_types.h", +diff --git a/components/payments/content/BUILD.gn b/components/payments/content/BUILD.gn +index 6e4c00c32..d61b22010 100644 +--- a/components/payments/content/BUILD.gn ++++ b/components/payments/content/BUILD.gn +@@ -3,8 +3,9 @@ + # found in the LICENSE file. + + import("//build/config/chromeos/ui_mode.gni") ++import("//build/config/jumbo.gni") + +-static_library("content") { ++jumbo_static_library("content") { + sources = [ + "android_app_communication.cc", + "android_app_communication.h", +@@ -127,7 +128,7 @@ static_library("content") { + } + + # Files used by content and utility. +-static_library("content_common") { ++jumbo_static_library("content_common") { + sources = [ + "web_app_manifest.cc", + "web_app_manifest.h", +@@ -139,7 +140,7 @@ static_library("content_common") { + ] + } + +-static_library("utils") { ++jumbo_static_library("utils") { + sources = [ + "developer_console_logger.cc", + "developer_console_logger.h", +@@ -186,7 +187,7 @@ static_library("utils") { + ] + } + +-static_library("test_support") { ++jumbo_static_library("test_support") { + testonly = true + sources = [ + "mock_payment_manifest_web_data_service.cc", +@@ -203,7 +204,7 @@ static_library("test_support") { + ] + } + +-source_set("unit_tests") { ++jumbo_source_set("unit_tests") { + testonly = true + sources = [ + "android_app_communication_test_support.h", +diff --git a/components/payments/content/icon/BUILD.gn b/components/payments/content/icon/BUILD.gn +index 517b3dd3d..a9b2aba72 100644 +--- a/components/payments/content/icon/BUILD.gn ++++ b/components/payments/content/icon/BUILD.gn +@@ -2,7 +2,9 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + +-static_library("icon") { ++import("//build/config/jumbo.gni") ++ ++jumbo_static_library("icon") { + sources = [ + "icon_size.cc", + "icon_size.h", +diff --git a/components/payments/core/BUILD.gn b/components/payments/core/BUILD.gn +index a1eba8c24..6b0985ef5 100644 +--- a/components/payments/core/BUILD.gn ++++ b/components/payments/core/BUILD.gn +@@ -3,8 +3,9 @@ + # found in the LICENSE file. + + import("//build/config/chromeos/ui_mode.gni") ++import("//build/config/jumbo.gni") + +-static_library("core") { ++jumbo_static_library("core") { + sources = [ + "android_app_description.cc", + "android_app_description.h", +@@ -105,7 +106,7 @@ static_library("core") { + ] + } + +-static_library("error_strings") { ++jumbo_static_library("error_strings") { + sources = [ + "error_strings.cc", + "error_strings.h", +@@ -121,14 +122,14 @@ static_library("error_strings") { + } + } + +-static_library("method_strings") { ++jumbo_static_library("method_strings") { + sources = [ + "method_strings.cc", + "method_strings.h", + ] + } + +-static_library("test_support") { ++jumbo_static_library("test_support") { + testonly = true + sources = [ + "const_csp_checker.cc", +@@ -156,7 +157,7 @@ static_library("test_support") { + ] + } + +-source_set("unit_tests") { ++jumbo_source_set("unit_tests") { + testonly = true + sources = [ + "android_app_description_tools_unittest.cc", +diff --git a/components/policy/content/BUILD.gn b/components/policy/content/BUILD.gn +index 59fba6739..cd76604b2 100644 +--- a/components/policy/content/BUILD.gn ++++ b/components/policy/content/BUILD.gn +@@ -3,10 +3,11 @@ + # found in the LICENSE file. + + import("//build/config/features.gni") ++import("//build/config/jumbo.gni") + + assert(!is_ios, "Policy Throttle should not be referenced on iOS") + +-source_set("safe_sites_navigation_throttle") { ++jumbo_source_set("safe_sites_navigation_throttle") { + sources = [ + "safe_search_service.cc", + "safe_search_service.h", +@@ -26,7 +27,7 @@ source_set("safe_sites_navigation_throttle") { + ] + } + +-source_set("content") { ++jumbo_source_set("content") { + sources = [ + "policy_blocklist_navigation_throttle.cc", + "policy_blocklist_navigation_throttle.h", +diff --git a/components/policy/core/browser/BUILD.gn b/components/policy/core/browser/BUILD.gn +index 5386fa78b..a5908ec67 100644 +--- a/components/policy/core/browser/BUILD.gn ++++ b/components/policy/core/browser/BUILD.gn +@@ -4,6 +4,7 @@ + + import("//build/config/chromeos/ui_mode.gni") + import("//build/config/features.gni") ++import("//build/config/jumbo.gni") + + group("browser") { + if (is_component_build) { +@@ -13,7 +14,7 @@ group("browser") { + } + } + +-source_set("internal") { ++jumbo_source_set("internal") { + visibility = [ "//components/policy/*" ] + sources = [ + "browser_policy_connector.cc", +@@ -106,7 +107,7 @@ source_set("internal") { + ] + } + +-static_library("test_support") { ++jumbo_static_library("test_support") { + testonly = true + sources = [ + "configuration_policy_pref_store_test.cc", +diff --git a/components/policy/core/common/BUILD.gn b/components/policy/core/common/BUILD.gn +index 7adc855d1..5db665ef6 100644 +--- a/components/policy/core/common/BUILD.gn ++++ b/components/policy/core/common/BUILD.gn +@@ -4,6 +4,7 @@ + + import("//build/config/chromeos/ui_mode.gni") + import("//build/config/features.gni") ++import("//build/config/jumbo.gni") + import("//testing/libfuzzer/fuzzer_test.gni") + + group("policy_namespace") { +@@ -18,7 +19,7 @@ group("common") { + } + } + +-source_set("policy_namespace_internal") { ++jumbo_source_set("policy_namespace_internal") { + visibility = [ "//components/policy/*" ] + + configs += [ "//components/policy:component_implementation" ] +@@ -30,7 +31,7 @@ source_set("policy_namespace_internal") { + ] + } + +-source_set("util") { ++jumbo_source_set("util") { + sources = [ + "cloud/cloud_policy_util.cc", + "cloud/cloud_policy_util.h", +@@ -60,7 +61,7 @@ source_set("util") { + } + } + +-source_set("internal") { ++jumbo_source_set("internal") { + visibility = [ "//components/policy/*" ] + + configs += [ "//components/policy:component_implementation" ] +@@ -379,7 +380,7 @@ source_set("internal") { + } + } + +-static_library("test_support") { ++jumbo_static_library("test_support") { + testonly = true + sources = [ + "cloud/mock_cloud_external_data_manager.cc", +diff --git a/components/safe_browsing/content/browser/BUILD.gn b/components/safe_browsing/content/browser/BUILD.gn +index 7c9ed1b84..8959b7f04 100644 +--- a/components/safe_browsing/content/browser/BUILD.gn ++++ b/components/safe_browsing/content/browser/BUILD.gn +@@ -3,6 +3,7 @@ + # found in the LICENSE file. + + import("//build/config/features.gni") ++import("//build/config/jumbo.gni") + import("//components/safe_browsing/buildflags.gni") + + # NOTE: This target is separated from :browser as +@@ -61,7 +62,7 @@ if (safe_browsing_mode > 0) { + } + } + +-source_set("browser") { ++jumbo_source_set("browser") { + sources = [ + "base_blocking_page.cc", + "base_blocking_page.h", +@@ -190,7 +191,7 @@ source_set("unit_tests") { + ] + } + +-source_set("client_side_detection") { ++jumbo_source_set("client_side_detection") { + sources = [ + "client_side_detection_host.cc", + "client_side_detection_host.h", +diff --git a/components/safe_browsing/core/browser/BUILD.gn b/components/safe_browsing/core/browser/BUILD.gn +index f8174fe6e..7fa572899 100644 +--- a/components/safe_browsing/core/browser/BUILD.gn ++++ b/components/safe_browsing/core/browser/BUILD.gn +@@ -3,8 +3,9 @@ + # found in the LICENSE file. + + import("//build/config/features.gni") ++import("//build/config/jumbo.gni") + +-source_set("browser") { ++jumbo_source_set("browser") { + sources = [ + "hash_database_mechanism.cc", + "hash_database_mechanism.h", +diff --git a/components/security_state/content/BUILD.gn b/components/security_state/content/BUILD.gn +index 0331f31f7..e79f5a83d 100644 +--- a/components/security_state/content/BUILD.gn ++++ b/components/security_state/content/BUILD.gn +@@ -2,7 +2,9 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + +-static_library("content") { ++import("//build/config/jumbo.gni") ++ ++jumbo_static_library("content") { + sources = [ + "content_utils.cc", + "content_utils.h", +diff --git a/components/security_state/core/BUILD.gn b/components/security_state/core/BUILD.gn +index 497dcf512..1f69e4ad0 100644 +--- a/components/security_state/core/BUILD.gn ++++ b/components/security_state/core/BUILD.gn +@@ -2,12 +2,14 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") ++ + if (is_android) { + import("//build/config/android/config.gni") + import("//build/config/android/rules.gni") + } + +-static_library("core") { ++jumbo_static_library("core") { + sources = [ + "security_state.cc", + "security_state.h", +@@ -33,7 +35,7 @@ if (is_android) { + } + } + +-source_set("unit_tests") { ++jumbo_source_set("unit_tests") { + testonly = true + sources = [ "security_state_unittest.cc" ] + +diff --git a/components/sync/BUILD.gn b/components/sync/BUILD.gn +index 858d78f65..18ac65924 100644 +--- a/components/sync/BUILD.gn ++++ b/components/sync/BUILD.gn +@@ -4,6 +4,7 @@ + + import("//build/config/chromeos/ui_mode.gni") + import("//build/config/features.gni") ++import("//build/config/jumbo.gni") + import("//testing/test.gni") + + group("sync") { +diff --git a/components/sync/base/BUILD.gn b/components/sync/base/BUILD.gn +index 363a0753d..a6aaee0b4 100644 +--- a/components/sync/base/BUILD.gn ++++ b/components/sync/base/BUILD.gn +@@ -4,13 +4,14 @@ + + import("//build/config/chromeos/ui_mode.gni") + import("//build/config/features.gni") ++import("//build/config/jumbo.gni") + + declare_args() { + # Controls the product part of the user agent calculated in sync_util.cc. + sync_user_agent_product = "Chrome" + } + +-static_library("base") { ++jumbo_static_library("base") { + sources = [ + "bind_to_task_runner.h", + "client_tag_hash.cc", +diff --git a/components/sync/driver/BUILD.gn b/components/sync/driver/BUILD.gn +index 2016439ad..e366920f9 100644 +--- a/components/sync/driver/BUILD.gn ++++ b/components/sync/driver/BUILD.gn +@@ -4,8 +4,9 @@ + + import("//build/config/chromeos/ui_mode.gni") + import("//build/config/features.gni") ++import("//build/config/jumbo.gni") + +-static_library("driver") { ++jumbo_static_library("driver") { + sources = [ + "active_devices_provider.h", + "backend_migrator.cc", +diff --git a/components/sync/protocol/BUILD.gn b/components/sync/protocol/BUILD.gn +index b2bcd8fbb..308e324ad 100644 +--- a/components/sync/protocol/BUILD.gn ++++ b/components/sync/protocol/BUILD.gn +@@ -2,6 +2,7 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//third_party/protobuf/proto_library.gni") + import("protocol_sources.gni") + +@@ -15,7 +16,7 @@ proto_library("protocol") { + # it being listed in public_deps of upper directories (even though it doesn't + # fit the definition of public_deps). Consider using a group() to expose this + # together with the "protocol" target and simplify things. +-static_library("util") { ++jumbo_static_library("util") { + sources = [ + "entity_data.cc", + "entity_data.h", +diff --git a/components/sync_device_info/BUILD.gn b/components/sync_device_info/BUILD.gn +index a5dd5cb4f..b9ee683ef 100644 +--- a/components/sync_device_info/BUILD.gn ++++ b/components/sync_device_info/BUILD.gn +@@ -4,12 +4,13 @@ + + import("//build/config/chromeos/ui_mode.gni") + import("//build/config/features.gni") ++import("//build/config/jumbo.gni") + if (is_android) { + import("//build/config/android/config.gni") + import("//build/config/android/rules.gni") + } + +-static_library("sync_device_info") { ++jumbo_static_library("sync_device_info") { + sources = [ + "device_count_metrics_provider.cc", + "device_count_metrics_provider.h", +diff --git a/components/sync_user_events/BUILD.gn b/components/sync_user_events/BUILD.gn +index 3470bc2b6..02c216bd9 100644 +--- a/components/sync_user_events/BUILD.gn ++++ b/components/sync_user_events/BUILD.gn +@@ -2,7 +2,9 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + +-static_library("sync_user_events") { ++import("//build/config/jumbo.gni") ++ ++jumbo_static_library("sync_user_events") { + sources = [ + "global_id_mapper.h", + "no_op_user_event_service.cc", +diff --git a/components/url_formatter/BUILD.gn b/components/url_formatter/BUILD.gn +index 1ea38702d..225fb724b 100644 +--- a/components/url_formatter/BUILD.gn ++++ b/components/url_formatter/BUILD.gn +@@ -2,13 +2,14 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//testing/libfuzzer/fuzzer_test.gni") + + if (is_android) { + import("//build/config/android/rules.gni") + } + +-static_library("skeleton_generator") { ++jumbo_static_library("skeleton_generator") { + sources = [ + "spoof_checks/skeleton_generator.cc", + "spoof_checks/skeleton_generator.h", +@@ -19,7 +20,7 @@ static_library("skeleton_generator") { + ] + } + +-static_library("url_formatter") { ++jumbo_static_library("url_formatter") { + sources = [ + "elide_url.cc", + "elide_url.h", +@@ -64,7 +65,7 @@ if (is_android) { + } + } + +-source_set("unit_tests") { ++jumbo_source_set("unit_tests") { + testonly = true + sources = [ + "elide_url_unittest.cc", +diff --git a/components/viz/common/BUILD.gn b/components/viz/common/BUILD.gn +index 61c722392..d8075e84c 100644 +--- a/components/viz/common/BUILD.gn ++++ b/components/viz/common/BUILD.gn +@@ -375,6 +375,8 @@ viz_component("common") { + } + + viz_source_set("unit_tests") { ++ # Not ready for jumbo compilation. Too much repeated test code. ++ never_build_jumbo = true + testonly = true + sources = [ + "display/overlay_strategy_unittest.cc", +diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn +index 77fc13c92..bebc21404 100644 +--- a/components/viz/service/BUILD.gn ++++ b/components/viz/service/BUILD.gn +@@ -450,6 +450,8 @@ viz_component("service") { + } + + viz_source_set("unit_tests") { ++ # Not ready for jumbo compilation. Too much repeated test code. ++ never_build_jumbo = true + testonly = true + sources = [ + "debugger/viz_debugger_unittests/viz_debugger_internal.cc", +@@ -596,6 +598,8 @@ viz_source_set("unit_tests") { + } + + viz_source_set("perf_tests") { ++ # Not ready for jumbo compilation. Too much repeated test code. ++ never_build_jumbo = true + testonly = true + sources = [ + "display/bsp_tree_perftest.cc", +diff --git a/components/viz/viz.gni b/components/viz/viz.gni +index c4b5a16a4..d8786c5b1 100644 +--- a/components/viz/viz.gni ++++ b/components/viz/viz.gni +@@ -2,6 +2,7 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//gpu/vulkan/features.gni") + import("//skia/features.gni") + import("//testing/test.gni") +@@ -31,7 +32,7 @@ if (!is_debug) { + } + + template("viz_source_set") { +- source_set(target_name) { ++ jumbo_source_set(target_name) { + forward_variables_from(invoker, "*", [ "configs" ]) + if (defined(invoker.configs)) { + configs += invoker.configs +@@ -42,7 +43,7 @@ template("viz_source_set") { + } + + template("viz_component") { +- component(target_name) { ++ jumbo_component(target_name) { + forward_variables_from(invoker, "*", [ "configs" ]) + if (defined(invoker.configs)) { + configs += invoker.configs +@@ -53,7 +54,7 @@ template("viz_component") { + } + + template("viz_static_library") { +- static_library(target_name) { ++ jumbo_static_library(target_name) { + forward_variables_from(invoker, "*", [ "configs" ]) + if (defined(invoker.configs)) { + configs += invoker.configs +diff --git a/components/webauthn/content/browser/BUILD.gn b/components/webauthn/content/browser/BUILD.gn +index 5d17d9f9a..f3e00ee81 100644 +--- a/components/webauthn/content/browser/BUILD.gn ++++ b/components/webauthn/content/browser/BUILD.gn +@@ -2,7 +2,9 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + +-static_library("browser") { ++import("//build/config/jumbo.gni") ++ ++jumbo_static_library("browser") { + if (is_component_build) { + check_includes = false + } +diff --git a/components/wifi/BUILD.gn b/components/wifi/BUILD.gn +index c05f146af..61361ec6f 100644 +--- a/components/wifi/BUILD.gn ++++ b/components/wifi/BUILD.gn +@@ -2,7 +2,9 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + +-component("wifi") { ++import("//build/config/jumbo.gni") ++ ++jumbo_component("wifi") { + sources = [ + "network_properties.cc", + "network_properties.h", +@@ -42,7 +44,7 @@ component("wifi") { + } + } + +-static_library("test_support") { ++jumbo_static_library("test_support") { + sources = [ + "fake_wifi_service.cc", + "fake_wifi_service.h", +diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn +index 62a5aa48f..24283757c 100644 +--- a/content/browser/BUILD.gn ++++ b/content/browser/BUILD.gn +@@ -8,6 +8,7 @@ import("//build/config/chromeos/ui_mode.gni") + import("//build/config/chromeos/ui_mode.gni") + import("//build/config/compiler/pgo/pgo.gni") + import("//build/config/features.gni") ++import("//build/config/jumbo.gni") + import("//build/config/linux/pangocairo/pangocairo.gni") + import("//build/config/ozone.gni") + import("//build/config/ui.gni") +@@ -36,7 +37,7 @@ buildflag_header("buildflags") { + flags = [ "USE_SOCKET_BROKER=$use_socket_broker" ] + } + +-source_set("browser") { ++jumbo_source_set("browser") { + # Only the public target should depend on this. All other targets (even + # internal content ones) should depend on the public one. + visibility = [ +diff --git a/content/gpu/BUILD.gn b/content/gpu/BUILD.gn +index 9f5f303b2..361151ada 100644 +--- a/content/gpu/BUILD.gn ++++ b/content/gpu/BUILD.gn +@@ -4,6 +4,7 @@ + + import("//build/config/chromecast_build.gni") + import("//build/config/chromeos/ui_mode.gni") ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + import("//gpu/vulkan/features.gni") + import("//media/media_options.gni") +@@ -20,9 +21,9 @@ group("gpu") { + } + + if (is_component_build) { +- link_target_type = "source_set" ++ link_target_type = "jumbo_source_set" + } else { +- link_target_type = "static_library" ++ link_target_type = "jumbo_static_library" + } + + target(link_target_type, "gpu_sources") { +diff --git a/content/public/browser/BUILD.gn b/content/public/browser/BUILD.gn +index 34e280653..458179958 100644 +--- a/content/public/browser/BUILD.gn ++++ b/content/public/browser/BUILD.gn +@@ -3,6 +3,7 @@ + # found in the LICENSE file. + + import("//build/config/chromeos/ui_mode.gni") ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + import("//device/vr/buildflags/buildflags.gni") + import("//ppapi/buildflags/buildflags.gni") +@@ -22,7 +23,7 @@ group("browser") { + } + } + +-source_set("browser_sources") { ++jumbo_source_set("browser_sources") { + # External code should depend on via ":browser" above. + visibility = [ "//content/*" ] + sources = [ +diff --git a/content/public/child/BUILD.gn b/content/public/child/BUILD.gn +index 73fce2d99..2f298f5cd 100644 +--- a/content/public/child/BUILD.gn ++++ b/content/public/child/BUILD.gn +@@ -2,6 +2,7 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//ppapi/buildflags/buildflags.gni") + + # See //content/BUILD.gn for how this works. +@@ -19,7 +20,7 @@ group("child") { + } + } + +-source_set("child_sources") { ++jumbo_source_set("child_sources") { + # External code should depend in via ":child" above. + visibility = [ "//content/*" ] + +diff --git a/content/public/common/BUILD.gn b/content/public/common/BUILD.gn +index 6d88bcb5c..2bbc9c55f 100644 +--- a/content/public/common/BUILD.gn ++++ b/content/public/common/BUILD.gn +@@ -6,6 +6,7 @@ import("//build/buildflag_header.gni") + import("//build/config/chromecast_build.gni") + import("//build/config/chromeos/ui_mode.gni") + import("//build/config/features.gni") ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + import("//content/public/common/zygote/features.gni") + import("//media/media_options.gni") +@@ -147,7 +148,7 @@ component("main_function_params") { + configs += [ "//content:content_implementation" ] + } + +-source_set("common_sources") { ++jumbo_source_set("common_sources") { + # External code should depend on via ":common" above. + visibility = [ "//content/*" ] + +diff --git a/content/public/renderer/BUILD.gn b/content/public/renderer/BUILD.gn +index 68a045575..99605eb86 100644 +--- a/content/public/renderer/BUILD.gn ++++ b/content/public/renderer/BUILD.gn +@@ -3,6 +3,7 @@ + # found in the LICENSE file. + + import("//build/config/features.gni") ++import("//build/config/jumbo.gni") + import("//media/media_options.gni") + import("//ppapi/buildflags/buildflags.gni") + +@@ -16,9 +17,9 @@ group("renderer") { + } + + if (is_component_build) { +- link_target_type = "source_set" ++ link_target_type = "jumbo_source_set" + } else { +- link_target_type = "static_library" ++ link_target_type = "jumbo_static_library" + } + target(link_target_type, "renderer_sources") { + # External code should depend on via ":renderer" above. +diff --git a/content/renderer/BUILD.gn b/content/renderer/BUILD.gn +index a1f691c0d..0ea6bc0ef 100644 +--- a/content/renderer/BUILD.gn ++++ b/content/renderer/BUILD.gn +@@ -5,6 +5,7 @@ + import("//build/config/chromecast_build.gni") + import("//build/config/chromeos/ui_mode.gni") + import("//build/config/features.gni") ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + import("//content/common/features.gni") + import("//media/media_options.gni") +@@ -14,9 +15,9 @@ import("//third_party/webrtc/webrtc.gni") + import("//tools/ipc_fuzzer/ipc_fuzzer.gni") + + if (is_component_build) { +- link_target_type = "source_set" ++ link_target_type = "jumbo_source_set" + } else { +- link_target_type = "static_library" ++ link_target_type = "jumbo_static_library" + } + + target(link_target_type, "renderer") { +diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn +index 00ac83055..1796ef8fb 100644 +--- a/content/test/BUILD.gn ++++ b/content/test/BUILD.gn +@@ -7,6 +7,7 @@ import("//build/config/chromecast_build.gni") + import("//build/config/chromeos/ui_mode.gni") + import("//build/config/compiler/compiler.gni") + import("//build/config/features.gni") ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + import("//build/nocompile.gni") + import("//components/viz/common/debugger/viz_debugger.gni") +@@ -32,7 +33,7 @@ if (is_android) { + + # Use a static library here because many test binaries depend on this but don't + # require many files from it. This makes linking more efficient. +-static_library("test_support") { ++jumbo_static_library("test_support") { + testonly = true + + # See comment at the top of //content/BUILD.gn for why this is disabled in +@@ -910,7 +911,7 @@ group("telemetry_gpu_integration_test_data") { + + # browsertest_support can be used by targets that run content_shell based + # browser tests. +-static_library("browsertest_support") { ++jumbo_static_library("browsertest_support") { + testonly = true + + # See comment at the top of //content/BUILD.gn for why this is disabled in +diff --git a/content/utility/BUILD.gn b/content/utility/BUILD.gn +index c23c3610a..a92269a11 100644 +--- a/content/utility/BUILD.gn ++++ b/content/utility/BUILD.gn +@@ -3,6 +3,7 @@ + # found in the LICENSE file. + + import("//build/config/chromeos/ui_mode.gni") ++import("//build/config/jumbo.gni") + import("//chromeos/ash/components/assistant/assistant.gni") + import("//components/services/screen_ai/buildflags/features.gni") + import("//device/vr/buildflags/buildflags.gni") +@@ -11,7 +12,7 @@ import("//media/media_options.gni") + import("//printing/buildflags/buildflags.gni") + import("//services/accessibility/buildflags.gni") + +-source_set("utility") { ++jumbo_source_set("utility") { + # Only the public target should depend on this. All other targets (even + # internal content ones other than test) should depend on the public one. + visibility = [ +diff --git a/docs/clang_tidy.md b/docs/clang_tidy.md +index d6a95c6df..c29802964 100644 +--- a/docs/clang_tidy.md ++++ b/docs/clang_tidy.md +@@ -265,6 +265,14 @@ Copy-Paste Friendly (though you'll still need to stub in the variables): + 'chrome/browser/.*' + ``` + ++\*It's not clear which, if any, `gn` flags outside of `use_jumbo_build` may ++cause issues for `clang-tidy`. I've had no problems building a component release ++build, both with and without goma. if you run into issues, let us know! ++||||||| fa98118a45f ++\*It's not clear which, if any, `gn` flags may cause issues for ++`clang-tidy`. I've had no problems building a component release build, ++both with and without goma. if you run into issues, let us know! ++ + Note that the source file regex must match how the build specified the file. + This means that on Windows, you must use (escaped) backslashes even from a bash + shell. +diff --git a/docs/clang_tool_refactoring.md b/docs/clang_tool_refactoring.md +index 418a31bcc..ff0a35e12 100644 +--- a/docs/clang_tool_refactoring.md ++++ b/docs/clang_tool_refactoring.md +@@ -15,6 +15,8 @@ with a traditional find-and-replace regexp: + + ## Caveats + ++* Clang tools do not work with jumbo builds. ++ + * Invocations of a clang tool runs on on only one build config at a time. For + example, running the tool across a `target_os="win"` build won't update code + that is guarded by `OS_POSIX`. Performing a global refactoring will often +diff --git a/docs/linux/build_instructions.md b/docs/linux/build_instructions.md +index c1943042f..a357fcace 100644 +--- a/docs/linux/build_instructions.md ++++ b/docs/linux/build_instructions.md +@@ -161,6 +161,15 @@ please follow [Goma for Chromium contributors](https://chromium.googlesource.com + If you are a Google employee, see + [go/building-chrome](https://goto.google.com/building-chrome) instead. + ++#### Jumbo/Unity builds ++ ++Jumbo builds merge many translation units ("source files") and compile them ++together. Since a large portion of Chromium's code is in shared header files, ++this dramatically reduces the total amount of work needed. Check out the ++[Jumbo / Unity builds](jumbo.md) for more information. ++ ++Enable jumbo builds by setting the GN arg `use_jumbo_build=true`. ++ + #### Disable NaCl + + By default, the build includes support for +diff --git a/docs/mac_build_instructions.md b/docs/mac_build_instructions.md +index 57571c3cb..f76f1e517 100644 +--- a/docs/mac_build_instructions.md ++++ b/docs/mac_build_instructions.md +@@ -154,6 +154,15 @@ in your args.gn to disable debug symbols altogether. This makes both full + rebuilds and linking faster (at the cost of not getting symbolized backtraces + in gdb). + ++#### Jumbo/Unity builds ++ ++Jumbo builds merge many translation units ("source files") and compile them ++together. Since a large portion of Chromium's code is in shared header files, ++this dramatically reduces the total amount of work needed. Check out the ++[Jumbo / Unity builds](jumbo.md) for more information. ++ ++Enable jumbo builds by setting the GN arg `use_jumbo_build=true`. ++ + #### CCache + + You might also want to [install ccache](ccache_mac.md) to speed up the build. +diff --git a/docs/windows_build_instructions.md b/docs/windows_build_instructions.md +index eb878ed16..bdc7e4d34 100644 +--- a/docs/windows_build_instructions.md ++++ b/docs/windows_build_instructions.md +@@ -219,7 +219,7 @@ There are some gn flags that can improve build speeds. You can specify these + in the editor that appears when you create your output directory + (`gn args out/Default`) or on the gn gen command line + (`gn gen out/Default --args="is_component_build = true is_debug = true"`). +-Some helpful settings to consider using include: ++* `use_jumbo_build = true` - [Jumbo/unity](jumbo.md) builds. + * `is_component_build = true` - this uses more, smaller DLLs, and may avoid + having to relink chrome.dll after every change. + * `enable_nacl = false` - this disables Native Client which is usually not +diff --git a/extensions/BUILD.gn b/extensions/BUILD.gn +index eb5b6dc41..b6f980bd2 100644 +--- a/extensions/BUILD.gn ++++ b/extensions/BUILD.gn +@@ -3,6 +3,7 @@ + + import("//build/config/chromecast_build.gni") + import("//build/config/chromeos/ui_mode.gni") ++import("//build/config/jumbo.gni") + import("//extensions/buildflags/buildflags.gni") + import("//testing/test.gni") + import("//tools/grit/grit_rule.gni") +@@ -74,7 +75,7 @@ grit("extensions_renderer_resources") { + ] + } + +-static_library("test_support") { ++jumbo_static_library("test_support") { + testonly = true + sources = [ + "browser/api/declarative/test_rules_registry.cc", +diff --git a/extensions/browser/BUILD.gn b/extensions/browser/BUILD.gn +index 6e38824c9..128b78af9 100644 +--- a/extensions/browser/BUILD.gn ++++ b/extensions/browser/BUILD.gn +@@ -4,6 +4,7 @@ + + import("//build/config/chromeos/ui_mode.gni") + import("//build/config/features.gni") ++import("//build/config/jumbo.gni") + import("//extensions/buildflags/buildflags.gni") + import("//testing/libfuzzer/fuzzer_test.gni") + +@@ -68,7 +69,7 @@ source_set("core_keyed_service_factories") { + # nodes" and could be easily toggled on-and-off through dependencies for + # different platforms). + # See also https://crbug.com/883570. +-source_set("browser_sources") { ++jumbo_source_set("browser_sources") { + visibility = [ "./*" ] + + sources = [ +@@ -768,7 +769,7 @@ source_set("browser_tests") { + } + + # The set of sources that are needed for both browser and unit tests. +-source_set("test_support") { ++jumbo_source_set("test_support") { + testonly = true + sources = [ + "api/declarative_net_request/test_utils.cc", +diff --git a/extensions/common/BUILD.gn b/extensions/common/BUILD.gn +index 31ad56f8e..97c23c3ae 100644 +--- a/extensions/common/BUILD.gn ++++ b/extensions/common/BUILD.gn +@@ -4,6 +4,7 @@ + + import("//build/config/chromeos/ui_mode.gni") + import("//build/config/features.gni") ++import("//build/config/jumbo.gni") + import("//components/nacl/features.gni") + import("//extensions/buildflags/buildflags.gni") + import("//mojo/public/tools/bindings/mojom.gni") +@@ -197,7 +198,7 @@ mojom("mojom") { + # This must be a static library because extensions common depends on + # GetTrustedICAPublicKey in extensions/browser which isn't always linked + # in. TODO(brettw): This reverse dependency should be fixed. +-static_library("common") { ++jumbo_static_library("common") { + sources = [ + "activation_sequence.h", + "alias.h", +diff --git a/extensions/renderer/BUILD.gn b/extensions/renderer/BUILD.gn +index f473618f4..6cd5aec4f 100644 +--- a/extensions/renderer/BUILD.gn ++++ b/extensions/renderer/BUILD.gn +@@ -3,11 +3,12 @@ + # found in the LICENSE file. + + import("//build/config/features.gni") ++import("//build/config/jumbo.gni") + import("//extensions/buildflags/buildflags.gni") + + assert(enable_extensions) + +-source_set("renderer") { ++jumbo_source_set("renderer") { + sources = [ + "activity_log_converter_strategy.cc", + "activity_log_converter_strategy.h", +@@ -278,7 +279,7 @@ source_set("renderer") { + deps += [ "//components/crash/core/common:crash_key" ] + } + +-static_library("unit_test_support") { ++jumbo_static_library("unit_test_support") { + # Sources that are shared between chrome-based renderer unit tests and + # top-level extensions renderer unit tests. + testonly = true +diff --git a/gpu/BUILD.gn b/gpu/BUILD.gn +index dc5668200..6a50784a7 100644 +--- a/gpu/BUILD.gn ++++ b/gpu/BUILD.gn +@@ -3,6 +3,7 @@ + # found in the LICENSE file. + + import("//build/config/chromeos/ui_mode.gni") ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + import("//gpu/vulkan/features.gni") + import("//testing/libfuzzer/fuzzer_test.gni") +@@ -163,7 +164,7 @@ if (!use_static_angle) { + } + } # if (!use_static_angle) + +-static_library("test_support") { ++jumbo_static_library("test_support") { + testonly = true + sources = [ + "command_buffer/client/client_test_helper.cc", +diff --git a/gpu/command_buffer/client/BUILD.gn b/gpu/command_buffer/client/BUILD.gn +index e12714a4b..136df7d5c 100644 +--- a/gpu/command_buffer/client/BUILD.gn ++++ b/gpu/command_buffer/client/BUILD.gn +@@ -2,6 +2,7 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//components/nacl/toolchain.gni") + import("//ui/gl/features.gni") + +@@ -49,7 +50,7 @@ group("webgpu") { + } + } + +-source_set("client_sources") { ++jumbo_source_set("client_sources") { + # External code should depend on this via //gpu/client above rather than + # depending on this directly or the component build will break. + visibility = [ "//gpu/*" ] +@@ -223,7 +224,7 @@ source_set("webgpu_interface") { + } + + # Library emulates GLES2 using command_buffers. +-component("gles2_implementation") { ++jumbo_component("gles2_implementation") { + sources = gles2_implementation_source_files + + defines = [ "GLES2_IMPL_IMPLEMENTATION" ] +@@ -325,7 +326,7 @@ source_set("webgpu_sources") { + } + + # Library emulates GLES2 using command_buffers. +-component("gles2_implementation_no_check") { ++jumbo_component("gles2_implementation_no_check") { + sources = gles2_implementation_source_files + + defines = [ +@@ -372,7 +373,7 @@ component("gles2_c_lib") { + + # Same as gles2_c_lib except with no parameter checking. Required for + # OpenGL ES 2.0 conformance tests. +-component("gles2_c_lib_nocheck") { ++jumbo_component("gles2_c_lib_nocheck") { + sources = gles2_c_lib_source_files + + defines = [ +diff --git a/gpu/command_buffer/common/BUILD.gn b/gpu/command_buffer/common/BUILD.gn +index 0bba94461..497dcf156 100644 +--- a/gpu/command_buffer/common/BUILD.gn ++++ b/gpu/command_buffer/common/BUILD.gn +@@ -7,6 +7,7 @@ + # non-component build. This needs to match the GYP build which was likely an + # attempt to make larger components to help with loading. + ++import("//build/config/jumbo.gni") + import("//ui/gl/features.gni") + + group("common") { +@@ -47,7 +48,7 @@ group("webgpu") { + + # Minimal set of definitions which don't have GPU dependencies outside of this + # directory. +-source_set("common_base_sources") { ++jumbo_source_set("common_base_sources") { + visibility = [ "//gpu/*" ] + sources = [ + "command_buffer_id.h", +@@ -66,7 +67,7 @@ source_set("common_base_sources") { + configs += [ "//gpu:gpu_implementation" ] + } + +-source_set("common_sources") { ++jumbo_source_set("common_sources") { + visibility = [ "//gpu/*" ] + + sources = [ +diff --git a/gpu/command_buffer/service/BUILD.gn b/gpu/command_buffer/service/BUILD.gn +index 375215e6b..2e0a3176b 100644 +--- a/gpu/command_buffer/service/BUILD.gn ++++ b/gpu/command_buffer/service/BUILD.gn +@@ -2,6 +2,7 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + import("//gpu/vulkan/features.gni") + import("//skia/features.gni") +@@ -26,9 +27,9 @@ group("gles2") { + } + + if (is_component_build) { +- link_target_type = "source_set" ++ link_target_type = "jumbo_source_set" + } else { +- link_target_type = "static_library" ++ link_target_type = "jumbo_static_library" + } + target(link_target_type, "service_sources") { + # External code should depend on this via //gpu/command_buffer/service above +@@ -593,7 +594,7 @@ proto_library("disk_cache_proto") { + } + + if (is_android) { +- static_library("android_texture_owner_test_support") { ++ jumbo_static_library("android_texture_owner_test_support") { + testonly = true + sources = [ + "mock_abstract_texture.cc", +diff --git a/gpu/config/BUILD.gn b/gpu/config/BUILD.gn +index d8ee27329..4f552bc9f 100644 +--- a/gpu/config/BUILD.gn ++++ b/gpu/config/BUILD.gn +@@ -5,6 +5,7 @@ + import("//build/config/chrome_build.gni") + import("//build/config/chromecast_build.gni") + import("//build/config/chromeos/ui_mode.gni") ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + import("//gpu/vulkan/features.gni") + import("//skia/features.gni") +@@ -113,7 +114,7 @@ if (enable_vulkan) { + } + } + +-source_set("config_sources") { ++jumbo_source_set("config_sources") { + # External code should depend on this via //gpu/config above rather than + # depending on this directly or the component build will break. + visibility = [ "//gpu/*" ] +diff --git a/gpu/ipc/service/BUILD.gn b/gpu/ipc/service/BUILD.gn +index e5bc3c86e..7b407ff11 100644 +--- a/gpu/ipc/service/BUILD.gn ++++ b/gpu/ipc/service/BUILD.gn +@@ -2,6 +2,7 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + import("//gpu/vulkan/features.gni") + import("//testing/test.gni") +@@ -13,7 +14,7 @@ declare_args() { + subpixel_font_rendering_disabled = false + } + +-component("service") { ++jumbo_component("service") { + output_name = "gpu_ipc_service" + sources = [ + "command_buffer_stub.cc", +diff --git a/media/base/BUILD.gn b/media/base/BUILD.gn +index 85aeba882..a4702a9d6 100644 +--- a/media/base/BUILD.gn ++++ b/media/base/BUILD.gn +@@ -5,6 +5,7 @@ + import("//build/config/android/config.gni") + import("//build/config/arm.gni") + import("//build/config/features.gni") ++import("//build/config/jumbo.gni") + import("//build/config/linux/pkg_config.gni") + import("//build/config/ozone.gni") + import("//build/config/ui.gni") +@@ -15,7 +16,7 @@ if (is_android) { + import("//build/config/android/rules.gni") + } + +-source_set("base") { ++jumbo_source_set("base") { + # Do not expand the visibility here without double-checking with OWNERS, this + # is a roll-up target which is part of the //media component. Most other DEPs + # should be using //media and not directly DEP this roll-up target. +diff --git a/media/base/android/BUILD.gn b/media/base/android/BUILD.gn +index b4b17de4b..8bba35a9c 100644 +--- a/media/base/android/BUILD.gn ++++ b/media/base/android/BUILD.gn +@@ -4,6 +4,7 @@ + + import("//build/config/android/config.gni") + import("//build/config/arm.gni") ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + import("//media/media_options.gni") + +@@ -13,7 +14,7 @@ if (is_android) { + # This is bundled into //media, so all dependencies should be on //media. + # APK targets that depend on this indirectly, should also + # depend on :media_java to get the corresponding Java classes. +- source_set("android") { ++ jumbo_source_set("android") { + visibility = [ + "//media", + "//media/filters", +diff --git a/media/base/ipc/BUILD.gn b/media/base/ipc/BUILD.gn +index 621787352..98da4b475 100644 +--- a/media/base/ipc/BUILD.gn ++++ b/media/base/ipc/BUILD.gn +@@ -2,7 +2,9 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + +-source_set("ipc") { ++import("//build/config/jumbo.gni") ++ ++jumbo_source_set("ipc") { + sources = [ + "media_param_traits.cc", + "media_param_traits.h", +diff --git a/media/base/mac/BUILD.gn b/media/base/mac/BUILD.gn +index 0c770ef02..5b860c92b 100644 +--- a/media/base/mac/BUILD.gn ++++ b/media/base/mac/BUILD.gn +@@ -2,9 +2,11 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") ++ + assert(is_apple) + +-source_set("mac") { ++jumbo_source_set("mac") { + # Note: This source_set is depended on only by //media. In the component + # build, if other component targets also depend on it, multiple copies of + # the ObjC classes declared in the files below will cause warnings at +diff --git a/media/base/win/BUILD.gn b/media/base/win/BUILD.gn +index 297076823..dca1840aa 100644 +--- a/media/base/win/BUILD.gn ++++ b/media/base/win/BUILD.gn +@@ -2,6 +2,8 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") ++ + assert(is_win) + + config("delay_load_mf") { +@@ -13,7 +15,7 @@ config("delay_load_mf") { + ] + } + +-component("media_foundation_util") { ++jumbo_component("media_foundation_util") { + defines = [ "IS_MF_UTIL_IMPL" ] + sources = [ + "dxgi_device_manager.cc", +diff --git a/media/capture/BUILD.gn b/media/capture/BUILD.gn +index 3e6bfcbff..62127fe94 100644 +--- a/media/capture/BUILD.gn ++++ b/media/capture/BUILD.gn +@@ -4,6 +4,7 @@ + + import("//build/config/chromeos/ui_mode.gni") + import("//build/config/features.gni") ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + import("//media/media_options.gni") + import("//testing/test.gni") +@@ -29,7 +30,7 @@ component("capture_switches") { + } + + # Things needed by //media/capture/mojom/video_capture_types.mojom. +-component("capture_base") { ++jumbo_component("capture_base") { + defines = [ "CAPTURE_IMPLEMENTATION" ] + sources = [ + "capture_export.h", +@@ -52,7 +53,7 @@ component("capture_base") { + } + + # Target which allows breakout of Android BUILD.gn files. +-source_set("capture_device_specific") { ++jumbo_source_set("capture_device_specific") { + visibility = [ + ":capture_lib", + "//media/capture/content/android", +@@ -111,7 +112,7 @@ source_set("capture_device_specific") { + } + } + +-component("capture_lib") { ++jumbo_component("capture_lib") { + defines = [ "CAPTURE_IMPLEMENTATION" ] + sources = [ + "video/create_video_capture_device_factory.cc", +diff --git a/media/cast/BUILD.gn b/media/cast/BUILD.gn +index 088b9dd60..832d4e571 100644 +--- a/media/cast/BUILD.gn ++++ b/media/cast/BUILD.gn +@@ -5,6 +5,7 @@ + import("//build/config/android/config.gni") + import("//build/config/chromeos/ui_mode.gni") + import("//build/config/features.gni") ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + import("//testing/libfuzzer/fuzzer_test.gni") + import("//testing/test.gni") +@@ -16,7 +17,7 @@ proto_library("logging_proto") { + } + + # Common code shared by all cast components. +-source_set("common") { ++jumbo_source_set("common") { + sources = [ + "cast_callbacks.h", + "cast_config.cc", +@@ -77,7 +78,7 @@ source_set("common") { + ] + } + +-source_set("net") { ++jumbo_source_set("net") { + sources = [ + "net/cast_transport.h", + "net/cast_transport_config.cc", +@@ -129,7 +130,7 @@ source_set("net") { + public_deps = [ ":common" ] + } + +-source_set("encoding") { ++jumbo_source_set("encoding") { + sources = [ + "encoding/audio_encoder.cc", + "encoding/audio_encoder.h", +@@ -193,7 +194,7 @@ source_set("encoding") { + + # TODO(https://crbug.com/1327074): should be split into multiple source sets + # once the new Open Screen frame sender implementation is added. +-source_set("sender") { ++jumbo_source_set("sender") { + sources = [ + "cast_sender.h", + "cast_sender_impl.cc", +@@ -231,7 +232,7 @@ source_set("sender") { + } + } + +-source_set("test_receiver") { ++jumbo_source_set("test_receiver") { + testonly = true + sources = [ + "test/receiver/audio_decoder.cc", +diff --git a/media/filters/BUILD.gn b/media/filters/BUILD.gn +index 93c112499..c03caa985 100644 +--- a/media/filters/BUILD.gn ++++ b/media/filters/BUILD.gn +@@ -2,10 +2,11 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//media/gpu/args.gni") + import("//media/media_options.gni") + +-source_set("filters") { ++jumbo_source_set("filters") { + # Do not expand the visibility here without double-checking with OWNERS, this + # is a roll-up target which is part of the //media component. Most other DEPs + # should be using //media and not directly DEP this roll-up target. +diff --git a/media/media_options.gni b/media/media_options.gni +index cda336a92..fa878c039 100644 +--- a/media/media_options.gni ++++ b/media/media_options.gni +@@ -7,6 +7,7 @@ import("//build/config/chromecast_build.gni") + import("//build/config/chromeos/args.gni") + import("//build/config/chromeos/ui_mode.gni") + import("//build/config/features.gni") ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + import("//media/gpu/args.gni") + import("//testing/libfuzzer/fuzzer_test.gni") +@@ -84,7 +85,7 @@ declare_args() { + # Enable logging override, e.g. enable DVLOGs through level 2 at build time. + # On Cast devices, these are logged as INFO. + # When enabled on Fuchsia, these are logged as VLOGs. +- enable_logging_override = is_cast_media_device ++ enable_logging_override = !use_jumbo_build && is_cast_media_device + + enable_dav1d_decoder = !is_ios + +@@ -164,6 +165,9 @@ assert( + !enable_platform_dolby_vision || enable_platform_hevc, + "enable_platform_hevc required for enable_platform_dolby_vision") + ++# Logging override must not be enabled in jumbo builds. ++assert(!use_jumbo_build || !enable_logging_override) ++ + # Use another declare_args() to pick up possible overrides of |use_cras|. + declare_args() { + # Enables runtime selection of PulseAudio library. +diff --git a/media/mojo/clients/BUILD.gn b/media/mojo/clients/BUILD.gn +index 0c7eab9d1..3e7198e67 100644 +--- a/media/mojo/clients/BUILD.gn ++++ b/media/mojo/clients/BUILD.gn +@@ -2,8 +2,10 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") ++ + # Implementations of media C++ interfaces using corresponding mojo services. +-source_set("clients") { ++jumbo_source_set("clients") { + visibility = [ + "//chromecast/*", + +diff --git a/media/mojo/common/BUILD.gn b/media/mojo/common/BUILD.gn +index ae5303dc1..30141f142 100644 +--- a/media/mojo/common/BUILD.gn ++++ b/media/mojo/common/BUILD.gn +@@ -2,7 +2,9 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + +-source_set("common") { ++import("//build/config/jumbo.gni") ++ ++jumbo_source_set("common") { + sources = [ + "audio_data_s16_converter.cc", + "audio_data_s16_converter.h", +diff --git a/media/mojo/services/BUILD.gn b/media/mojo/services/BUILD.gn +index b79cb992f..3a2a76481 100644 +--- a/media/mojo/services/BUILD.gn ++++ b/media/mojo/services/BUILD.gn +@@ -4,6 +4,7 @@ + + import("//build/config/chromecast_build.gni") + import("//build/config/chromeos/ui_mode.gni") ++import("//build/config/jumbo.gni") + import("//media/gpu/args.gni") + import("//media/media_options.gni") + import("//mojo/public/tools/fuzzers/mojolpm.gni") +@@ -12,7 +13,7 @@ import("//testing/test.gni") + enable_playback_events_recorder = + enable_cast_receiver && (is_fuchsia || is_android) + +-component("services") { ++jumbo_component("services") { + output_name = "media_mojo_services" + sources = [ + "deferred_destroy_unique_receiver_set.h", +diff --git a/mojo/public/tools/bindings/mojom.gni b/mojo/public/tools/bindings/mojom.gni +index 496934eeb..6b29f9c12 100644 +--- a/mojo/public/tools/bindings/mojom.gni ++++ b/mojo/public/tools/bindings/mojom.gni +@@ -2,6 +2,7 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//third_party/closure_compiler/closure_args.gni") + import("//third_party/closure_compiler/compile_js.gni") + import("//third_party/protobuf/proto_library.gni") +@@ -946,7 +947,7 @@ template("mojom") { + } + + shared_cpp_sources_target_name = "${target_name}_shared_cpp_sources" +- source_set(shared_cpp_sources_target_name) { ++ jumbo_source_set(shared_cpp_sources_target_name) { + if (defined(invoker.testonly)) { + testonly = invoker.testonly + } +@@ -1566,7 +1567,7 @@ template("mojom") { + sources_target_name = output_target_name + } + +- target(sources_target_type, sources_target_name) { ++ target("jumbo_" + sources_target_type, sources_target_name) { + if (defined(output_name_override)) { + output_name = output_name_override + } +diff --git a/ppapi/cpp/BUILD.gn b/ppapi/cpp/BUILD.gn +index c916c3a5c..0e03f92de 100644 +--- a/ppapi/cpp/BUILD.gn ++++ b/ppapi/cpp/BUILD.gn +@@ -2,6 +2,7 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//ppapi/buildflags/buildflags.gni") + + if (is_nacl) { +@@ -13,7 +14,7 @@ assert(enable_ppapi) + if (is_nacl && is_nacl_glibc) { + cpp_target_type = "shared_library" + } else { +- cpp_target_type = "static_library" ++ cpp_target_type = "jumbo_static_library" + } + + # Link to this target to get the PPAPI C++ wrapper objects and plugin startup +@@ -54,7 +55,7 @@ target(cpp_target_type, "cpp") { + # Link to this target to get only the PPAPI C++ wrapper objects but not the + # plugin startup code. Some plugins need special startup code that they supply + # themselves. +-source_set("objects") { ++jumbo_source_set("objects") { + sources = [ + "array_output.cc", + "array_output.h", +diff --git a/ppapi/host/BUILD.gn b/ppapi/host/BUILD.gn +index 46c0f0159..acf4d9f46 100644 +--- a/ppapi/host/BUILD.gn ++++ b/ppapi/host/BUILD.gn +@@ -2,11 +2,12 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//ppapi/buildflags/buildflags.gni") + + assert(enable_ppapi) + +-component("host") { ++jumbo_component("host") { + output_name = "ppapi_host" + + sources = [ +diff --git a/ppapi/proxy/BUILD.gn b/ppapi/proxy/BUILD.gn +index 21cacd867..882449ba0 100644 +--- a/ppapi/proxy/BUILD.gn ++++ b/ppapi/proxy/BUILD.gn +@@ -2,6 +2,7 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//build/config/nacl/config.gni") + import("//components/nacl/toolchain.gni") + import("//ppapi/buildflags/buildflags.gni") +@@ -12,9 +13,15 @@ config("proxy_implementation") { + defines = [ "PPAPI_PROXY_IMPLEMENTATION" ] + } + +-component("proxy") { ++jumbo_component("proxy") { + output_name = "ppapi_proxy" + ++ if (is_nacl) { ++ # The nacl toolchain has template related bugs that are triggered ++ # in jumbo builds. https://crbug.com/912152 ++ never_build_jumbo = true ++ } ++ + sources = [ + # Take some standalone files from the C++ wrapper allowing us to more + # easily make async callbacks in the proxy. We can't depend on the +@@ -327,7 +334,7 @@ source_set("ipc_sources") { + } + } + +-static_library("test_support") { ++jumbo_static_library("test_support") { + testonly = true + + sources = [ +diff --git a/ppapi/shared_impl/BUILD.gn b/ppapi/shared_impl/BUILD.gn +index 3b5c21ab0..a202bb7a0 100644 +--- a/ppapi/shared_impl/BUILD.gn ++++ b/ppapi/shared_impl/BUILD.gn +@@ -2,6 +2,7 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//build/config/nacl/config.gni") + import("//components/nacl/toolchain.gni") + import("//ppapi/buildflags/buildflags.gni") +@@ -42,12 +43,18 @@ source_set("headers") { + } + + # This contains the things that //ppapi/thunk needs. +-source_set("common") { ++jumbo_source_set("common") { + visibility = [ + ":*", + "//ppapi/thunk:*", + ] + ++ if (is_nacl) { ++ # The nacl toolchain has template related bugs that are triggered ++ # in jumbo builds. https://crbug.com/912152 ++ never_build_jumbo = true ++ } ++ + sources = [ + "array_var.cc", + "array_var.h", +diff --git a/services/cert_verifier/cert_net_url_loader/BUILD.gn b/services/cert_verifier/cert_net_url_loader/BUILD.gn +index ffc6bdc4a..28ab85355 100644 +--- a/services/cert_verifier/cert_net_url_loader/BUILD.gn ++++ b/services/cert_verifier/cert_net_url_loader/BUILD.gn +@@ -2,10 +2,11 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//crypto/features.gni") + import("//testing/test.gni") + +-component("cert_net_url_loader") { ++jumbo_component("cert_net_url_loader") { + sources = [ + "cert_net_fetcher_url_loader.cc", + "cert_net_fetcher_url_loader.h", +diff --git a/services/network/BUILD.gn b/services/network/BUILD.gn +index 5c4cfc609..20c632ec8 100644 +--- a/services/network/BUILD.gn ++++ b/services/network/BUILD.gn +@@ -3,12 +3,13 @@ + # found in the LICENSE file. + + import("//build/config/chromeos/ui_mode.gni") ++import("//build/config/jumbo.gni") + import("//mojo/public/tools/bindings/mojom.gni") + import("//net/features.gni") + import("//services/network/public/cpp/features.gni") + import("//testing/libfuzzer/fuzzer_test.gni") + +-component("network_service") { ++jumbo_component("network_service") { + sources = [ + "brokered_client_socket_factory.cc", + "brokered_client_socket_factory.h", +@@ -505,7 +506,7 @@ source_set("tests") { + } + } + +-source_set("test_support") { ++jumbo_source_set("test_support") { + testonly = true + + sources = [ +diff --git a/services/network/public/cpp/BUILD.gn b/services/network/public/cpp/BUILD.gn +index d23e85462..8d757bb4e 100644 +--- a/services/network/public/cpp/BUILD.gn ++++ b/services/network/public/cpp/BUILD.gn +@@ -3,6 +3,7 @@ + # found in the LICENSE file. + + import("//build/buildflag_header.gni") ++import("//build/config/jumbo.gni") + import("//mojo/public/tools/bindings/mojom.gni") + import("//services/network/public/cpp/features.gni") + import("//testing/libfuzzer/fuzzer_test.gni") +@@ -17,7 +18,7 @@ buildflag_header("buildflags") { + ] + } + +-component("crash_keys") { ++jumbo_component("crash_keys") { + sources = [ + "crash_keys.cc", + "crash_keys.h", +@@ -26,7 +27,7 @@ component("crash_keys") { + defines = [ "IS_NETWORK_CPP_CRASH_KEYS_IMPL" ] + } + +-component("cpp") { ++jumbo_component("cpp") { + output_name = "network_cpp" + + sources = [ +@@ -310,7 +311,7 @@ component("schemeful_site_mojom_support") { + + # This component is separate from cpp_base as it is a dependency of + # //services/network/public/mojom:cookies_mojom. +-component("first_party_sets_mojom_support") { ++jumbo_component("first_party_sets_mojom_support") { + sources = [ + "first_party_sets_mojom_traits.cc", + "first_party_sets_mojom_traits.h", +@@ -324,7 +325,7 @@ component("first_party_sets_mojom_support") { + defines = [ "IS_FIRST_PARTY_SETS_MOJOM_TRAITS_IMPL" ] + } + +-component("cpp_base") { ++jumbo_component("cpp_base") { + output_name = "network_cpp_base" + + sources = [ +diff --git a/storage/browser/BUILD.gn b/storage/browser/BUILD.gn +index 5addf5624..e30e9df29 100644 +--- a/storage/browser/BUILD.gn ++++ b/storage/browser/BUILD.gn +@@ -1,10 +1,11 @@ + # Copyright 2014 The Chromium Authors + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. ++import("//build/config/jumbo.gni") + import("//mojo/public/tools/bindings/mojom.gni") + import("//testing/test.gni") + +-component("browser") { ++jumbo_component("browser") { + output_name = "storage_browser" + sources = [ + "blob/blob_builder_from_stream.cc", +@@ -366,7 +367,7 @@ source_set("unittests") { + ] + } + +-static_library("test_support") { ++jumbo_static_library("test_support") { + testonly = true + + sources = [ +diff --git a/third_party/blink/common/BUILD.gn b/third_party/blink/common/BUILD.gn +index 108b79fbc..f1921c283 100644 +--- a/third_party/blink/common/BUILD.gn ++++ b/third_party/blink/common/BUILD.gn +@@ -2,6 +2,7 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//testing/libfuzzer/fuzzer_test.gni") + import("//testing/test.gni") + import("//third_party/blink/renderer/build/scripts/scripts.gni") +@@ -117,7 +118,7 @@ config("blink_common_implementation") { + defines = [ "BLINK_COMMON_IMPLEMENTATION=1" ] + } + +-source_set("common") { ++jumbo_source_set("common") { + # No target should directly depend on this target since this is just the + # source set rather than the actual component that can be linked to. + # Dependencies instead should be to //third_party/blink/public/common:common. +@@ -365,7 +366,7 @@ test("blink_common_unittests") { + data_deps = [ ":common_unittests_data" ] + } + +-source_set("common_unittests_sources") { ++jumbo_source_set("common_unittests_sources") { + testonly = true + + sources = [ +diff --git a/third_party/blink/renderer/bindings/core/v8/BUILD.gn b/third_party/blink/renderer/bindings/core/v8/BUILD.gn +index 8ea091846..e5249c3f4 100644 +--- a/third_party/blink/renderer/bindings/core/v8/BUILD.gn ++++ b/third_party/blink/renderer/bindings/core/v8/BUILD.gn +@@ -29,7 +29,7 @@ blink_core_sources("v8") { + ] + } + +-source_set("testing") { ++jumbo_source_set("testing") { + testonly = true + + visibility = [] +@@ -61,8 +61,6 @@ group("generated") { + "//third_party/blink/renderer/core/*", + ] + +- public_deps = +- [ "//third_party/blink/renderer/bindings:generate_bindings_all" ] + } + + fuzzer_test("v8_serialized_script_value_fuzzer") { +diff --git a/third_party/blink/renderer/bindings/modules/v8/BUILD.gn b/third_party/blink/renderer/bindings/modules/v8/BUILD.gn +index 5f1951cde..472bdb77a 100644 +--- a/third_party/blink/renderer/bindings/modules/v8/BUILD.gn ++++ b/third_party/blink/renderer/bindings/modules/v8/BUILD.gn +@@ -29,7 +29,7 @@ blink_modules_sources("v8") { + ] + } + +-source_set("testing") { ++jumbo_source_set("testing") { + testonly = true + + visibility = [] +diff --git a/third_party/blink/renderer/controller/BUILD.gn b/third_party/blink/renderer/controller/BUILD.gn +index 2cf3784f8..5d8e526ef 100644 +--- a/third_party/blink/renderer/controller/BUILD.gn ++++ b/third_party/blink/renderer/controller/BUILD.gn +@@ -2,6 +2,7 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + import("//testing/test.gni") + import("//third_party/blink/renderer/bindings/bindings.gni") +@@ -14,7 +15,7 @@ visibility = [ + "//third_party/blink/*", + ] + +-component("controller") { ++jumbo_component("controller") { + output_name = "blink_controller" + + deps = [ +@@ -174,7 +175,7 @@ test("blink_perf_tests") { + deps = [ ":blink_perf_tests_sources" ] + } + +-source_set("blink_perf_tests_sources") { ++jumbo_source_set("blink_perf_tests_sources") { + visibility = [] # Allow re-assignment of list. + visibility = [ "*" ] + testonly = true +@@ -219,7 +220,7 @@ source_set("blink_bindings_test_sources") { + ] + } + +-source_set("blink_unittests_sources") { ++jumbo_source_set("blink_unittests_sources") { + visibility = [] # Allow re-assignment of list. + visibility = [ "*" ] + testonly = true +diff --git a/third_party/blink/renderer/core/BUILD.gn b/third_party/blink/renderer/core/BUILD.gn +index fabf49654..e1234cafb 100644 +--- a/third_party/blink/renderer/core/BUILD.gn ++++ b/third_party/blink/renderer/core/BUILD.gn +@@ -422,7 +422,7 @@ blink_core_sources("core_hot") { + } + } + +-source_set("testing") { ++jumbo_source_set("testing") { + testonly = true + + configs += [ +@@ -1224,7 +1224,7 @@ if (is_component_build) { + core_generated_target_type = "static_library" + } + +-target(core_generated_target_type, "core_generated") { ++target("jumbo_" + core_generated_target_type, "core_generated") { + # Add all sources generated by the targets above. + sources = [] + foreach(current, targets_generating_sources) { +@@ -1317,7 +1317,7 @@ fuzzer_test("text_resource_decoder_fuzzer") { + ] + } + +-source_set("unit_tests") { ++jumbo_source_set("unit_tests") { + testonly = true + + # If you create a new subdirectory 'foo' that contains unit tests, list them in +@@ -1480,7 +1480,7 @@ group("js_files_for_form_controls_web_tests") { + data_deps = [ ":form_controls_pickers_js" ] + } + +-source_set("perf_tests") { ++jumbo_source_set("perf_tests") { + testonly = true + sources = [ + "css/style_perftest.cc", +@@ -1505,7 +1505,7 @@ source_set("perf_tests") { + ] + } + +-source_set("unit_test_support") { ++jumbo_source_set("unit_test_support") { + testonly = true + sources = [ + "frame/frame_test_helpers.cc", +diff --git a/third_party/blink/renderer/core/core.gni b/third_party/blink/renderer/core/core.gni +index 443e3ffba..046fb8e8a 100644 +--- a/third_party/blink/renderer/core/core.gni ++++ b/third_party/blink/renderer/core/core.gni +@@ -3,6 +3,7 @@ + # found in the LICENSE file. + + import("//build/config/chrome_build.gni") ++import("//build/config/jumbo.gni") + import("//third_party/blink/renderer/config.gni") + + blink_core_output_dir = "$root_gen_dir/third_party/blink/renderer/core" +@@ -54,9 +55,9 @@ core_config_add += blink_symbols_config + # Normal meaning if defined. If undefined, defaults to everything in core. + template("blink_core_sources") { + if (is_component_build) { +- target_type = "source_set" ++ target_type = "jumbo_source_set" + } else { +- target_type = "static_library" ++ target_type = "jumbo_static_library" + } + target(target_type, target_name) { + # The visibility will get overridden by forward_variables_from below if the +diff --git a/third_party/blink/renderer/core/inspector/BUILD.gn b/third_party/blink/renderer/core/inspector/BUILD.gn +index 33e53526f..2946ef406 100644 +--- a/third_party/blink/renderer/core/inspector/BUILD.gn ++++ b/third_party/blink/renderer/core/inspector/BUILD.gn +@@ -2,6 +2,7 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//third_party/blink/renderer/bindings/bindings.gni") + import("//third_party/blink/renderer/core/core.gni") + import("//third_party/inspector_protocol/inspector_protocol.gni") +@@ -90,7 +91,7 @@ inspector_protocol_generate("protocol_sources") { + } + + # Compiles the sources generated above. +-source_set("generated") { ++jumbo_source_set("generated") { + sources = get_target_outputs(":protocol_sources") + + configs -= core_config_remove +diff --git a/third_party/blink/renderer/modules/BUILD.gn b/third_party/blink/renderer/modules/BUILD.gn +index df8cc60b5..e4abf3d79 100644 +--- a/third_party/blink/renderer/modules/BUILD.gn ++++ b/third_party/blink/renderer/modules/BUILD.gn +@@ -20,7 +20,7 @@ config("modules_implementation") { + defines = [ "BLINK_MODULES_IMPLEMENTATION=1" ] + } + +-component("modules") { ++jumbo_component("modules") { + output_name = "blink_modules" + + visibility = [] # Allow re-assignment of list. +@@ -204,7 +204,7 @@ component("modules") { + configs += blink_symbols_config + } + +-source_set("modules_testing") { ++jumbo_source_set("modules_testing") { + testonly = true + + sources = [ +@@ -408,7 +408,7 @@ blink_modules_sources("modules_generated") { + } + } + +-source_set("unit_tests") { ++jumbo_source_set("unit_tests") { + testonly = true + + sources = [ +diff --git a/third_party/blink/renderer/modules/gamepad/BUILD.gn b/third_party/blink/renderer/modules/gamepad/BUILD.gn +index fdc2eb785..921155f7a 100644 +--- a/third_party/blink/renderer/modules/gamepad/BUILD.gn ++++ b/third_party/blink/renderer/modules/gamepad/BUILD.gn +@@ -37,7 +37,7 @@ blink_modules_sources("gamepad") { + ] + } + +-source_set("unit_tests") { ++jumbo_source_set("unit_tests") { + testonly = true + sources = [ "gamepad_comparisons_test.cc" ] + +diff --git a/third_party/blink/renderer/modules/hid/BUILD.gn b/third_party/blink/renderer/modules/hid/BUILD.gn +index df06706c3..2bec1cbfe 100644 +--- a/third_party/blink/renderer/modules/hid/BUILD.gn ++++ b/third_party/blink/renderer/modules/hid/BUILD.gn +@@ -17,7 +17,7 @@ blink_modules_sources("hid") { + ] + } + +-source_set("unit_tests") { ++jumbo_source_set("unit_tests") { + testonly = true + sources = [ "hid_device_test.cc" ] + +diff --git a/third_party/blink/renderer/modules/media/BUILD.gn b/third_party/blink/renderer/modules/media/BUILD.gn +index 4f54fc2c3..52f80b8e7 100644 +--- a/third_party/blink/renderer/modules/media/BUILD.gn ++++ b/third_party/blink/renderer/modules/media/BUILD.gn +@@ -2,6 +2,7 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//third_party/blink/renderer/modules/modules.gni") + + blink_modules_sources("media") { +diff --git a/third_party/blink/renderer/modules/mediastream/BUILD.gn b/third_party/blink/renderer/modules/mediastream/BUILD.gn +index 398597446..8ce74e0a7 100644 +--- a/third_party/blink/renderer/modules/mediastream/BUILD.gn ++++ b/third_party/blink/renderer/modules/mediastream/BUILD.gn +@@ -2,6 +2,7 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//third_party/blink/renderer/modules/modules.gni") + + blink_modules_sources("mediastream") { +@@ -129,7 +130,7 @@ blink_modules_sources("mediastream") { + public_deps = [ "//media/capture:capture_lib" ] + } + +-source_set("test_support") { ++jumbo_source_set("test_support") { + testonly = true + + sources = [ +diff --git a/third_party/blink/renderer/modules/modules.gni b/third_party/blink/renderer/modules/modules.gni +index 5b252edfd..6f9aae8dd 100644 +--- a/third_party/blink/renderer/modules/modules.gni ++++ b/third_party/blink/renderer/modules/modules.gni +@@ -7,6 +7,7 @@ + # This file is shared with all modules' BUILD files which shouldn't need access + # to the huge and slow lists of sources. If sharing is necessary, make a + # separate .gni. ++import("//build/config/jumbo.gni") + import("//third_party/blink/renderer/config.gni") + blink_modules_output_dir = "$root_gen_dir/third_party/blink/renderer/modules" + +@@ -25,7 +26,7 @@ template("blink_modules_sources") { + target_type = "static_library" + } + +- target(target_type, target_name) { ++ target("jumbo_" + target_type, target_name) { + # The visibility will get overridden by forward_variables_from below if the + # invoker defined it. + visibility = [ "//third_party/blink/renderer/modules/*" ] +diff --git a/third_party/blink/renderer/modules/peerconnection/BUILD.gn b/third_party/blink/renderer/modules/peerconnection/BUILD.gn +index 31a6b976c..a3434145e 100644 +--- a/third_party/blink/renderer/modules/peerconnection/BUILD.gn ++++ b/third_party/blink/renderer/modules/peerconnection/BUILD.gn +@@ -175,7 +175,7 @@ blink_modules_sources("peerconnection") { + [ "//third_party/blink/renderer/modules/mediastream" ] + } + +-source_set("test_support") { ++jumbo_source_set("test_support") { + testonly = true + + sources = [ +diff --git a/third_party/blink/renderer/modules/storage/BUILD.gn b/third_party/blink/renderer/modules/storage/BUILD.gn +index def668aa1..056722af5 100644 +--- a/third_party/blink/renderer/modules/storage/BUILD.gn ++++ b/third_party/blink/renderer/modules/storage/BUILD.gn +@@ -27,7 +27,7 @@ blink_modules_sources("storage") { + ] + } + +-source_set("unit_tests") { ++jumbo_source_set("unit_tests") { + testonly = true + sources = [ + "cached_storage_area_test.cc", +diff --git a/third_party/blink/renderer/modules/webrtc/BUILD.gn b/third_party/blink/renderer/modules/webrtc/BUILD.gn +index f06918f31..e87c5354b 100644 +--- a/third_party/blink/renderer/modules/webrtc/BUILD.gn ++++ b/third_party/blink/renderer/modules/webrtc/BUILD.gn +@@ -2,6 +2,7 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//third_party/blink/renderer/modules/modules.gni") + + blink_modules_sources("webrtc") { +diff --git a/third_party/blink/renderer/modules/webtransport/BUILD.gn b/third_party/blink/renderer/modules/webtransport/BUILD.gn +index e5865de82..70e678bee 100644 +--- a/third_party/blink/renderer/modules/webtransport/BUILD.gn ++++ b/third_party/blink/renderer/modules/webtransport/BUILD.gn +@@ -25,7 +25,7 @@ blink_modules_sources("webtransport") { + ] + } + +-source_set("unit_tests") { ++jumbo_source_set("unit_tests") { + testonly = true + sources = [ + "bidirectional_stream_test.cc", +diff --git a/third_party/blink/renderer/platform/BUILD.gn b/third_party/blink/renderer/platform/BUILD.gn +index f4559b5ee..415d024f2 100644 +--- a/third_party/blink/renderer/platform/BUILD.gn ++++ b/third_party/blink/renderer/platform/BUILD.gn +@@ -7,6 +7,7 @@ import("//build/buildflag_header.gni") + import("//build/compiled_action.gni") + import("//build/config/compiler/compiler.gni") + import("//build/config/features.gni") ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + import("//build/nocompile.gni") + import("//media/media_options.gni") +@@ -278,7 +279,7 @@ source_set("allow_discouraged_type") { + visibility = [ "//third_party/blink/renderer/platform/*" ] + } + +-component("platform") { ++jumbo_component("platform") { + visibility = [] # Allow re-assignment of list. + visibility = [ + "//third_party/blink/*", +@@ -1847,7 +1848,7 @@ component("platform") { + configs += blink_symbols_config + } + +-static_library("test_support") { ++jumbo_static_library("test_support") { + visibility += [ + "//third_party/blink/*", + "//tools/privacy_budget/font_indexer:*", +@@ -2002,7 +2003,7 @@ test("blink_platform_unittests") { + } + } + +-source_set("blink_platform_unittests_sources") { ++jumbo_source_set("blink_platform_unittests_sources") { + visibility = [] # Allow re-assignment of list. + visibility = [ "*" ] + testonly = true +@@ -2455,7 +2456,7 @@ test("blink_fuzzer_unittests") { + + # This source set is used for fuzzers that need an environment similar to unit + # tests. +-source_set("blink_fuzzer_test_support") { ++jumbo_source_set("blink_fuzzer_test_support") { + testonly = true + visibility = [] # Allow re-assignment of list. + visibility = [ "*" ] +@@ -2637,7 +2638,7 @@ blink_text_codec_fuzzer("WINDOWS_1252") { + # NOTE: These are legacy unit tests and tests that require a Platform + # object. Do not add more unless the test requires a Platform object. + # These tests are a part of the blink_unittests binary. +-source_set("unit_tests") { ++jumbo_source_set("unit_tests") { + testonly = true + visibility = [] + visibility = [ "//third_party/blink/renderer/*" ] +diff --git a/third_party/blink/renderer/platform/blob/BUILD.gn b/third_party/blink/renderer/platform/blob/BUILD.gn +index 280ba683b..471c4bf9f 100644 +--- a/third_party/blink/renderer/platform/blob/BUILD.gn ++++ b/third_party/blink/renderer/platform/blob/BUILD.gn +@@ -2,6 +2,7 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//third_party/blink/renderer/platform/platform.gni") + + # Intentionally depends on generator targets so to depend only on generated +@@ -10,7 +11,7 @@ import("//third_party/blink/renderer/platform/platform.gni") + # There is no tool to detect missing indirect generated header dependency today + # and this is easy to be broken when mojom files are updated to depend on + # another. +-source_set("generator") { ++jumbo_source_set("generator") { + public_deps = [ + "//third_party/blink/public/mojom:mojom_platform_blink_headers", + "//url/mojom:url_mojom_gurl_blink_headers", +@@ -39,7 +40,7 @@ blink_platform_sources("blob") { + ] + } + +-source_set("unit_tests") { ++jumbo_source_set("unit_tests") { + visibility = [ "//third_party/blink/renderer/platform:*" ] + testonly = true + +@@ -60,7 +61,7 @@ source_set("unit_tests") { + ] + } + +-source_set("test_support") { ++jumbo_source_set("test_support") { + # This target defines test files for platform:test_support that + # blink_platform_unittests and blink_unittests can use. + visibility = [ "//third_party/blink/renderer/platform:test_support" ] +diff --git a/third_party/blink/renderer/platform/heap/BUILD.gn b/third_party/blink/renderer/platform/heap/BUILD.gn +index ae0183e9d..dec9d08d2 100644 +--- a/third_party/blink/renderer/platform/heap/BUILD.gn ++++ b/third_party/blink/renderer/platform/heap/BUILD.gn +@@ -4,6 +4,7 @@ + + import("//build/buildflag_header.gni") + import("//build/config/compiler/compiler.gni") ++import("//build/config/jumbo.gni") + import("//build/config/sanitizers/sanitizers.gni") + import("//testing/test.gni") + import("//third_party/blink/public/public_features.gni") +@@ -86,7 +87,7 @@ blink_platform_sources("heap") { + ] + } + +-source_set("test_support") { ++jumbo_source_set("test_support") { + testonly = true + + sources = [ +@@ -136,7 +137,7 @@ test("blink_heap_unittests") { + } + } + +-source_set("blink_heap_unittests_sources") { ++jumbo_source_set("blink_heap_unittests_sources") { + testonly = true + + sources = [ +diff --git a/third_party/blink/renderer/platform/instrumentation/BUILD.gn b/third_party/blink/renderer/platform/instrumentation/BUILD.gn +index 9a9b63602..ef64a8332 100644 +--- a/third_party/blink/renderer/platform/instrumentation/BUILD.gn ++++ b/third_party/blink/renderer/platform/instrumentation/BUILD.gn +@@ -2,6 +2,7 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//third_party/blink/renderer/platform/platform.gni") + + blink_platform_sources("instrumentation") { +@@ -43,7 +44,7 @@ blink_platform_sources("instrumentation") { + allow_circular_includes_from = public_deps + } + +-source_set("unit_tests") { ++jumbo_source_set("unit_tests") { + testonly = true + + sources = [ +diff --git a/third_party/blink/renderer/platform/loader/BUILD.gn b/third_party/blink/renderer/platform/loader/BUILD.gn +index 1e0d9ed68..bfeb9be0f 100644 +--- a/third_party/blink/renderer/platform/loader/BUILD.gn ++++ b/third_party/blink/renderer/platform/loader/BUILD.gn +@@ -2,6 +2,7 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//third_party/blink/renderer/build/scripts/scripts.gni") + import("//third_party/blink/renderer/platform/platform.gni") + import("//third_party/blink/renderer/platform/platform_generated.gni") +@@ -194,7 +195,7 @@ blink_platform_sources("loader") { + [ "//third_party/blink/renderer/platform/network:network" ] + } + +-source_set("unit_tests") { ++jumbo_source_set("unit_tests") { + # This target defines test files for blink_platform_unittests and only the + # blink_platform_unittests target should depend on it. + visibility = [ "//third_party/blink/renderer/platform:*" ] +@@ -251,7 +252,7 @@ source_set("unit_tests") { + ] + } + +-source_set("test_support") { ++jumbo_source_set("test_support") { + # This target defines test files for platform:test_support that + # blink_platform_unittests and blink_unittests can use. + visibility = [ "//third_party/blink/renderer/platform:test_support" ] +diff --git a/third_party/blink/renderer/platform/network/BUILD.gn b/third_party/blink/renderer/platform/network/BUILD.gn +index 9ea9032d8..cdaa4017c 100644 +--- a/third_party/blink/renderer/platform/network/BUILD.gn ++++ b/third_party/blink/renderer/platform/network/BUILD.gn +@@ -2,6 +2,7 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//third_party/blink/renderer/build/scripts/scripts.gni") + import("//third_party/blink/renderer/platform/platform.gni") + import("//third_party/blink/renderer/platform/platform_generated.gni") +@@ -73,7 +74,7 @@ blink_platform_sources("network") { + ] + } + +-source_set("unit_tests") { ++jumbo_source_set("unit_tests") { + visibility = [ "//third_party/blink/renderer/platform:*" ] + testonly = true + +@@ -101,7 +102,7 @@ source_set("unit_tests") { + public_deps = [ "//third_party/blink/renderer/platform:platform" ] + } + +-source_set("test_support") { ++jumbo_source_set("test_support") { + visibility = [ "//third_party/blink/renderer/platform:test_support" ] + testonly = true + +diff --git a/third_party/blink/renderer/platform/platform.gni b/third_party/blink/renderer/platform/platform.gni +index aa98a0432..972945ff5 100644 +--- a/third_party/blink/renderer/platform/platform.gni ++++ b/third_party/blink/renderer/platform/platform.gni +@@ -2,6 +2,8 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") ++ + platform_config_add = [ + "//build/config/compiler:wexit_time_destructors", + "//third_party/blink/renderer:config", +@@ -14,7 +16,7 @@ platform_config_add = [ + platform_config_remove = [] + + template("blink_platform_sources") { +- source_set(target_name) { ++ jumbo_source_set(target_name) { + # Only platform can directly depend on this. + # Any target outside platform should instead depend on platform. + visibility = [ "//third_party/blink/renderer/platform/*" ] +diff --git a/third_party/blink/renderer/platform/scheduler/BUILD.gn b/third_party/blink/renderer/platform/scheduler/BUILD.gn +index 24b34e4e6..01dffab03 100644 +--- a/third_party/blink/renderer/platform/scheduler/BUILD.gn ++++ b/third_party/blink/renderer/platform/scheduler/BUILD.gn +@@ -2,6 +2,7 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//testing/libfuzzer/fuzzer_test.gni") + import("//third_party/blink/renderer/platform/platform.gni") + import("//third_party/protobuf/proto_library.gni") +@@ -199,7 +200,7 @@ blink_platform_sources("scheduler") { + ] + } + +-source_set("test_support") { ++jumbo_source_set("test_support") { + testonly = true + + sources = [ +@@ -230,7 +231,7 @@ source_set("test_support") { + configs += [ "//third_party/blink/renderer/platform:blink_platform_config" ] + } + +-source_set("unit_tests") { ++jumbo_source_set("unit_tests") { + testonly = true + + sources = [ +@@ -282,7 +283,7 @@ source_set("unit_tests") { + configs += [ "//third_party/blink/renderer/platform:blink_platform_config" ] + } + +-source_set("scheduler_fuzzer_tests") { ++jumbo_source_set("scheduler_fuzzer_tests") { + testonly = true + + sources = [] +diff --git a/third_party/blink/renderer/platform/wtf/BUILD.gn b/third_party/blink/renderer/platform/wtf/BUILD.gn +index 99b403ace..33da51102 100644 +--- a/third_party/blink/renderer/platform/wtf/BUILD.gn ++++ b/third_party/blink/renderer/platform/wtf/BUILD.gn +@@ -6,6 +6,7 @@ assert(!is_ios) + + import("//build/buildflag_header.gni") + import("//build/config/compiler/compiler.gni") ++import("//build/config/jumbo.gni") + import("//testing/test.gni") + import("//third_party/blink/public/public_features.gni") + import("//third_party/blink/renderer/config.gni") +@@ -35,7 +36,7 @@ config("wtf_config") { + } + } + +-component("wtf") { ++jumbo_component("wtf") { + output_name = "blink_platform_wtf" + + sources = [ +@@ -284,7 +285,7 @@ test("wtf_unittests") { + deps = [ ":wtf_unittests_sources" ] + } + +-source_set("wtf_unittests_sources") { ++jumbo_source_set("wtf_unittests_sources") { + visibility = [] # Allow re-assignment of list. + visibility = [ "*" ] + testonly = true +diff --git a/third_party/inspector_protocol/BUILD.gn b/third_party/inspector_protocol/BUILD.gn +index 646e0cf92..6131bb250 100644 +--- a/third_party/inspector_protocol/BUILD.gn ++++ b/third_party/inspector_protocol/BUILD.gn +@@ -2,7 +2,9 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + +-component("crdtp") { ++import("//build/config/jumbo.gni") ++ ++jumbo_component("crdtp") { + sources = [ + "crdtp/cbor.cc", + "crdtp/cbor.h", +diff --git a/ui/accessibility/BUILD.gn b/ui/accessibility/BUILD.gn +index 71d3b5922..6babc4c33 100644 +--- a/ui/accessibility/BUILD.gn ++++ b/ui/accessibility/BUILD.gn +@@ -3,6 +3,7 @@ + # found in the LICENSE file. + + import("//build/config/features.gni") ++import("//build/config/jumbo.gni") + import("//build/config/linux/pkg_config.gni") + import("//build/config/ui.gni") + import("//extensions/buildflags/buildflags.gni") +@@ -36,7 +37,7 @@ mojom_component("ax_enums_mojo") { + # included by Blink. The rule of thumb (for now) is that it's + # anything platform-neutral (no platform/ directory) that + # relates to a single accessibility node (no trees, etc.). +-component("ax_base") { ++jumbo_component("ax_base") { + defines = [ "AX_BASE_IMPLEMENTATION" ] + + sources = [ +@@ -124,7 +125,7 @@ group("accessibility") { + ] + } + +-component("accessibility_internal") { ++jumbo_component("accessibility_internal") { + defines = [ "AX_IMPLEMENTATION" ] + + sources = [ +diff --git a/ui/accessibility/platform/BUILD.gn b/ui/accessibility/platform/BUILD.gn +index 3bec9f0f7..32b684df0 100644 +--- a/ui/accessibility/platform/BUILD.gn ++++ b/ui/accessibility/platform/BUILD.gn +@@ -3,6 +3,7 @@ + # found in the LICENSE file. + + import("//build/config/features.gni") ++import("//build/config/jumbo.gni") + import("//build/config/linux/pkg_config.gni") + import("//build/config/ui.gni") + import("//extensions/buildflags/buildflags.gni") +diff --git a/ui/aura/BUILD.gn b/ui/aura/BUILD.gn +index 1beb9003b..a3ce2932f 100644 +--- a/ui/aura/BUILD.gn ++++ b/ui/aura/BUILD.gn +@@ -2,10 +2,11 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + import("//testing/test.gni") + +-component("aura") { ++jumbo_component("aura") { + public = [ + "client/aura_constants.h", + "client/capture_client.h", +@@ -178,7 +179,7 @@ component("aura") { + } + } + +-static_library("test_support") { ++jumbo_static_library("test_support") { + testonly = true + sources = [ + "test/aura_test_base.cc", +diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn +index acd063852..b2e7e5a28 100644 +--- a/ui/base/BUILD.gn ++++ b/ui/base/BUILD.gn +@@ -6,6 +6,7 @@ import("//build/buildflag_header.gni") + import("//build/config/chromeos/ui_mode.gni") + import("//build/config/compiler/compiler.gni") + import("//build/config/dcheck_always_on.gni") ++import("//build/config/jumbo.gni") + import("//build/config/linux/gtk/gtk.gni") + import("//build/config/linux/pangocairo/pangocairo.gni") + import("//build/config/locales.gni") +@@ -105,7 +106,7 @@ source_set("types") { + deps = [ "//build:chromeos_buildflags" ] + } + +-component("base") { ++jumbo_component("base") { + output_name = "ui_base" + + sources = [ +@@ -691,7 +692,7 @@ component("features") { + } + + if (is_win || is_mac || is_linux || is_chromeos) { +- static_library("pixel_diff_test_support") { ++ jumbo_static_library("pixel_diff_test_support") { + testonly = true + sources = [ + "test/skia_gold_matching_algorithm.cc", +@@ -734,7 +735,7 @@ if (!is_ios) { + } + } + +-static_library("test_support") { ++jumbo_static_library("test_support") { + testonly = true + sources = [ + "interaction/element_test_util.cc", +diff --git a/ui/base/clipboard/BUILD.gn b/ui/base/clipboard/BUILD.gn +index e6348b486..56d58ceb5 100644 +--- a/ui/base/clipboard/BUILD.gn ++++ b/ui/base/clipboard/BUILD.gn +@@ -4,10 +4,11 @@ + + import("///build/config/ozone.gni") + import("//build/config/chromeos/ui_mode.gni") ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + import("//testing/libfuzzer/fuzzer_test.gni") + +-component("clipboard_types") { ++jumbo_component("clipboard_types") { + output_name = "ui_base_clipboard_types" + sources = [ + "clipboard_buffer.h", +@@ -70,7 +71,7 @@ component("file_info") { + + # This is a source set because it needs to be included only on the Mac for the + # final executable, but needs to be included on any platform for the fuzzer. +-source_set("url_file_parser") { ++jumbo_source_set("url_file_parser") { + sources = [ + "url_file_parser.cc", + "url_file_parser.h", +@@ -79,7 +80,7 @@ source_set("url_file_parser") { + deps = [ "//base" ] + } + +-component("clipboard") { ++jumbo_component("clipboard") { + output_name = "ui_base_clipboard" + + sources = [ +@@ -176,7 +177,7 @@ component("clipboard") { + } + } + +-source_set("clipboard_test_support") { ++jumbo_source_set("clipboard_test_support") { + testonly = true + + if (!is_ios) { +diff --git a/ui/base/ime/BUILD.gn b/ui/base/ime/BUILD.gn +index 649e7175d..abc6e71db 100644 +--- a/ui/base/ime/BUILD.gn ++++ b/ui/base/ime/BUILD.gn +@@ -3,6 +3,7 @@ + # found in the LICENSE file. + + import("//build/config/chromeos/ui_mode.gni") ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + + source_set("text_input_types") { +@@ -14,7 +15,7 @@ source_set("text_input_types") { + ] + } + +-component("ime_types") { ++jumbo_component("ime_types") { + output_name = "ui_base_ime_types" + sources = [ + "candidate_window.cc", +@@ -54,7 +55,7 @@ component("ime_types") { + } + } + +-component("ime") { ++jumbo_component("ime") { + output_name = "ui_base_ime" + sources = [ + "constants.cc", +diff --git a/ui/base/ime/ash/BUILD.gn b/ui/base/ime/ash/BUILD.gn +index 58b747a73..af220adb0 100644 +--- a/ui/base/ime/ash/BUILD.gn ++++ b/ui/base/ime/ash/BUILD.gn +@@ -2,6 +2,7 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//build/config/chromeos/ui_mode.gni") + + assert(is_chromeos_ash) +@@ -22,7 +23,7 @@ source_set("typing_session_manager") { + ] + } + +-component("ash") { ++jumbo_component("ash") { + output_name = "ui_base_ime_ash" + + sources = [ +diff --git a/ui/base/ime/fuchsia/BUILD.gn b/ui/base/ime/fuchsia/BUILD.gn +index 4ceaf0be6..df2a01a78 100644 +--- a/ui/base/ime/fuchsia/BUILD.gn ++++ b/ui/base/ime/fuchsia/BUILD.gn +@@ -2,9 +2,11 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") ++ + assert(is_fuchsia) + +-component("fuchsia") { ++jumbo_component("fuchsia") { + output_name = "ui_base_ime_fuchsia" + + sources = [ +diff --git a/ui/base/ime/init/BUILD.gn b/ui/base/ime/init/BUILD.gn +index 1ff77334f..9a56d96eb 100644 +--- a/ui/base/ime/init/BUILD.gn ++++ b/ui/base/ime/init/BUILD.gn +@@ -3,9 +3,10 @@ + # found in the LICENSE file. + + import("//build/config/chromeos/ui_mode.gni") ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + +-component("init") { ++jumbo_component("init") { + output_name = "ui_base_ime_init" + + sources = [ +diff --git a/ui/base/ime/linux/BUILD.gn b/ui/base/ime/linux/BUILD.gn +index ec20ec866..e9f1a18f9 100644 +--- a/ui/base/ime/linux/BUILD.gn ++++ b/ui/base/ime/linux/BUILD.gn +@@ -2,12 +2,13 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//build/config/chromeos/ui_mode.gni") + import("//build/config/linux/pangocairo/pangocairo.gni") + + assert(is_linux || is_chromeos_lacros) + +-component("linux") { ++jumbo_component("linux") { + output_name = "ui_base_ime_linux" + sources = [ + "fake_input_method_context.cc", +diff --git a/ui/base/ime/mac/BUILD.gn b/ui/base/ime/mac/BUILD.gn +index fc5cb85b0..8e50ead62 100644 +--- a/ui/base/ime/mac/BUILD.gn ++++ b/ui/base/ime/mac/BUILD.gn +@@ -2,9 +2,11 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") ++ + assert(is_mac) + +-component("mac") { ++jumbo_component("mac") { + output_name = "ui_base_ime_mac" + + sources = [ +diff --git a/ui/base/ime/win/BUILD.gn b/ui/base/ime/win/BUILD.gn +index 1a2a40db4..67ff94a8c 100644 +--- a/ui/base/ime/win/BUILD.gn ++++ b/ui/base/ime/win/BUILD.gn +@@ -2,9 +2,11 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") ++ + assert(is_win) + +-component("win") { ++jumbo_component("win") { + output_name = "ui_base_ime_win" + sources = [ + "imm32_manager.cc", +diff --git a/ui/base/prediction/BUILD.gn b/ui/base/prediction/BUILD.gn +index 2e653b3df..dae307013 100644 +--- a/ui/base/prediction/BUILD.gn ++++ b/ui/base/prediction/BUILD.gn +@@ -2,7 +2,9 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + +-component("prediction") { ++import("//build/config/jumbo.gni") ++ ++jumbo_component("prediction") { + sources = [ + "empty_filter.cc", + "empty_filter.h", +diff --git a/ui/base/x/BUILD.gn b/ui/base/x/BUILD.gn +index 67a3aae27..70b57c65c 100644 +--- a/ui/base/x/BUILD.gn ++++ b/ui/base/x/BUILD.gn +@@ -2,6 +2,7 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//build/config/linux/gtk/gtk.gni") + import("//build/config/ozone.gni") + import("//build/config/ui.gni") +@@ -9,7 +10,7 @@ import("//testing/libfuzzer/fuzzer_test.gni") + + assert(ozone_platform_x11) + +-component("x") { ++jumbo_component("x") { + output_name = "ui_base_x" + + sources = [ +diff --git a/ui/color/BUILD.gn b/ui/color/BUILD.gn +index 3a9623e34..1179f2721 100644 +--- a/ui/color/BUILD.gn ++++ b/ui/color/BUILD.gn +@@ -4,11 +4,12 @@ + + import("//build/buildflag_header.gni") + import("//build/config/chromeos/ui_mode.gni") ++import("//build/config/jumbo.gni") + import("//mojo/public/tools/bindings/mojom.gni") + import("//testing/test.gni") + import("//ui/base/ui_features.gni") + +-source_set("color_headers") { ++jumbo_source_set("color_headers") { + sources = [ + "color_id.h", + "color_id_macros.inc", +@@ -29,7 +30,7 @@ source_set("color_headers") { + ] + } + +-component("color") { ++jumbo_component("color") { + sources = [ + "color_metrics.cc", + "color_mixer.cc", +@@ -122,7 +123,7 @@ if (is_win) { + } + } + +-component("mixers") { ++jumbo_component("mixers") { + sources = [ + "color_mixers.cc", + "color_mixers.h", +diff --git a/ui/compositor/BUILD.gn b/ui/compositor/BUILD.gn +index c0fbef6ec..2bba3fb1e 100644 +--- a/ui/compositor/BUILD.gn ++++ b/ui/compositor/BUILD.gn +@@ -2,10 +2,11 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + import("//testing/test.gni") + +-component("compositor") { ++jumbo_component("compositor") { + sources = [ + "animation_throughput_reporter.cc", + "animation_throughput_reporter.h", +@@ -121,7 +122,7 @@ component("compositor") { + } + } + +-static_library("test_support") { ++jumbo_static_library("test_support") { + testonly = true + sources = [ + "test/animation_throughput_reporter_test_base.cc", +diff --git a/ui/display/BUILD.gn b/ui/display/BUILD.gn +index aadf9f2a5..6a65be75f 100644 +--- a/ui/display/BUILD.gn ++++ b/ui/display/BUILD.gn +@@ -3,10 +3,11 @@ + # found in the LICENSE file. + + import("//build/config/chromeos/ui_mode.gni") ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + import("//testing/test.gni") + +-component("display") { ++jumbo_component("display") { + sources = [ + "display.cc", + "display.h", +@@ -150,7 +151,7 @@ if (is_chromeos_ash) { + } + } + +-static_library("test_support") { ++jumbo_static_library("test_support") { + testonly = true + sources = [ + "test/display_matchers.cc", +diff --git a/ui/display/fake/BUILD.gn b/ui/display/fake/BUILD.gn +index 64d377764..0a8843468 100644 +--- a/ui/display/fake/BUILD.gn ++++ b/ui/display/fake/BUILD.gn +@@ -2,11 +2,12 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + + # This target contains dummy or fake classes that can be used as + # placeholders when lacking something better, or for testing. +-component("fake") { ++jumbo_component("fake") { + sources = [ + "fake_display_delegate.cc", + "fake_display_delegate.h", +diff --git a/ui/display/manager/BUILD.gn b/ui/display/manager/BUILD.gn +index 257d9a20b..9281589b7 100644 +--- a/ui/display/manager/BUILD.gn ++++ b/ui/display/manager/BUILD.gn +@@ -3,11 +3,12 @@ + # found in the LICENSE file. + + import("//build/config/chromeos/ui_mode.gni") ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + + assert(is_chromeos_ash || is_castos || is_cast_android) + +-component("manager") { ++jumbo_component("manager") { + sources = [ + "display_manager_export.h", + "display_manager_util.cc", +diff --git a/ui/display/types/BUILD.gn b/ui/display/types/BUILD.gn +index d148b0949..b1cb48ffc 100644 +--- a/ui/display/types/BUILD.gn ++++ b/ui/display/types/BUILD.gn +@@ -2,7 +2,9 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + +-component("types") { ++import("//build/config/jumbo.gni") ++ ++jumbo_component("types") { + output_name = "display_types" + sources = [ + "display_configuration_params.cc", +diff --git a/ui/display/util/BUILD.gn b/ui/display/util/BUILD.gn +index 33731b1cc..64df64c32 100644 +--- a/ui/display/util/BUILD.gn ++++ b/ui/display/util/BUILD.gn +@@ -3,10 +3,11 @@ + # found in the LICENSE file. + + import("//build/config/chromeos/ui_mode.gni") ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + import("//testing/libfuzzer/fuzzer_test.gni") + +-component("util") { ++jumbo_component("util") { + output_name = "display_util" + sources = [ + "display_util.cc", +diff --git a/ui/events/BUILD.gn b/ui/events/BUILD.gn +index 3862f66a2..5de7dd52e 100644 +--- a/ui/events/BUILD.gn ++++ b/ui/events/BUILD.gn +@@ -3,6 +3,7 @@ + # found in the LICENSE file. + + import("//build/config/features.gni") ++import("//build/config/jumbo.gni") + import("//build/config/ozone.gni") + import("//build/config/ui.gni") + import("//testing/test.gni") +@@ -16,7 +17,7 @@ if (is_ios) { + import("//ios/build/config.gni") + } + +-static_library("dom_keycode_converter") { ++jumbo_static_library("dom_keycode_converter") { + public = [ + "keycodes/dom/dom_code.h", + "keycodes/dom/dom_codes_array.h", +@@ -94,7 +95,7 @@ source_set("platform_event") { + public_deps = [ "//base" ] + } + +-component("events_base") { ++jumbo_component("events_base") { + sources = [ + "base_event_utils.cc", + "base_event_utils.h", +@@ -192,7 +193,7 @@ component("events_base") { + } + } + +-component("events") { ++jumbo_component("events") { + public = [ + "cocoa/cocoa_event_utils.h", + "event.h", +@@ -380,7 +381,7 @@ component("events") { + } + } + +-component("keyboard_hook") { ++jumbo_component("keyboard_hook") { + public = [ "keyboard_hook.h" ] + + defines = [ "IS_KEYBOARD_HOOK_IMPL" ] +@@ -434,7 +435,7 @@ component("keyboard_hook") { + } + } + +-component("gesture_detection") { ++jumbo_component("gesture_detection") { + sources = [ + "gesture_detection/bitset_32.h", + "gesture_detection/filtered_gesture_provider.cc", +@@ -500,7 +501,7 @@ component("gesture_detection") { + } + } + +-static_library("test_support") { ++jumbo_static_library("test_support") { + sources = [ + "test/event_generator.cc", + "test/event_generator.h", +diff --git a/ui/events/blink/BUILD.gn b/ui/events/blink/BUILD.gn +index d707bb6e0..8b4d97f46 100644 +--- a/ui/events/blink/BUILD.gn ++++ b/ui/events/blink/BUILD.gn +@@ -2,9 +2,10 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + +-component("blink_features") { ++jumbo_component("blink_features") { + defines = [ "IS_BLINK_FEATURES_IMPL" ] + + sources = [ +@@ -15,7 +16,7 @@ component("blink_features") { + deps = [ "//base" ] + } + +-source_set("blink") { ++jumbo_source_set("blink") { + sources = [ + "blink_event_util.cc", + "blink_event_util.h", +diff --git a/ui/events/devices/BUILD.gn b/ui/events/devices/BUILD.gn +index 9cd3bd80b..ccd9bf547 100644 +--- a/ui/events/devices/BUILD.gn ++++ b/ui/events/devices/BUILD.gn +@@ -2,12 +2,14 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") ++ + if (is_android) { + import("//build/config/android/config.gni") + import("//build/config/android/rules.gni") + } + +-component("devices") { ++jumbo_component("devices") { + sources = [ + "device_data_manager.cc", + "device_data_manager.h", +diff --git a/ui/events/devices/x11/BUILD.gn b/ui/events/devices/x11/BUILD.gn +index ab1766bf2..02674d175 100644 +--- a/ui/events/devices/x11/BUILD.gn ++++ b/ui/events/devices/x11/BUILD.gn +@@ -2,12 +2,13 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//build/config/ozone.gni") + import("//build/config/ui.gni") + + assert(ozone_platform_x11) + +-component("x11") { ++jumbo_component("x11") { + output_name = "events_devices_x11" + + sources = [ +diff --git a/ui/events/ipc/BUILD.gn b/ui/events/ipc/BUILD.gn +index 5e2744b86..ff529c38e 100644 +--- a/ui/events/ipc/BUILD.gn ++++ b/ui/events/ipc/BUILD.gn +@@ -2,7 +2,9 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + +-component("ipc") { ++import("//build/config/jumbo.gni") ++ ++jumbo_component("ipc") { + output_name = "ui_events_ipc" + + sources = [ +diff --git a/ui/events/keycodes/BUILD.gn b/ui/events/keycodes/BUILD.gn +index 9cdd599f0..576002096 100644 +--- a/ui/events/keycodes/BUILD.gn ++++ b/ui/events/keycodes/BUILD.gn +@@ -2,11 +2,12 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//build/config/ozone.gni") + import("//build/config/ui.gni") + import("//ui/base/ui_features.gni") + +-source_set("xkb") { ++jumbo_source_set("xkb") { + sources = [ + "keyboard_code_conversion_xkb.cc", + "keyboard_code_conversion_xkb.h", +@@ -27,7 +28,7 @@ source_set("xkb") { + } + + if (ozone_platform_x11) { +- component("x11") { ++ jumbo_component("x11") { + output_name = "keycodes_x11" + + sources = [ +diff --git a/ui/events/platform/BUILD.gn b/ui/events/platform/BUILD.gn +index 1b54f4b46..1b6b162b0 100644 +--- a/ui/events/platform/BUILD.gn ++++ b/ui/events/platform/BUILD.gn +@@ -2,9 +2,10 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + +-component("platform") { ++jumbo_component("platform") { + sources = [ + # Allow this target to include events_export.h without depending on the + # events target (which would be circular). +diff --git a/ui/events/platform/x11/BUILD.gn b/ui/events/platform/x11/BUILD.gn +index 630c207d5..c3338effb 100644 +--- a/ui/events/platform/x11/BUILD.gn ++++ b/ui/events/platform/x11/BUILD.gn +@@ -3,12 +3,13 @@ + # found in the LICENSE file. + + import("//build/config/chromeos/ui_mode.gni") ++import("//build/config/jumbo.gni") + import("//build/config/ozone.gni") + import("//build/config/ui.gni") + + assert(ozone_platform_x11) + +-component("x11") { ++jumbo_component("x11") { + output_name = "x11_events_platform" + + sources = [ +diff --git a/ui/gfx/BUILD.gn b/ui/gfx/BUILD.gn +index d2692c742..fb96d4fb8 100644 +--- a/ui/gfx/BUILD.gn ++++ b/ui/gfx/BUILD.gn +@@ -2,6 +2,7 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//build/config/ozone.gni") + import("//build/config/ui.gni") + import("//device/vr/buildflags/buildflags.gni") +@@ -22,7 +23,7 @@ source_set("gfx_export") { + } + + # Used for color generation at build time without importing all the gfx. +-component("color_utils") { ++jumbo_component("color_utils") { + sources = [ + "color_palette.h", + "color_utils.cc", +@@ -37,7 +38,7 @@ component("color_utils") { + ] + } + +-component("gfx_skia") { ++jumbo_component("gfx_skia") { + sources = [ + "gfx_skia_export.h", + "skia_util.cc", +@@ -51,7 +52,7 @@ component("gfx_skia") { + defines = [ "GFX_SKIA_IMPLEMENTATION" ] + } + +-component("gfx") { ++jumbo_component("gfx") { + sources = [ + "break_list.h", + "color_analysis.cc", +@@ -414,7 +415,7 @@ component("gfx") { + } + } + +-component("color_space") { ++jumbo_component("color_space") { + sources = [ + "color_conversion_sk_filter_cache.cc", + "color_conversion_sk_filter_cache.h", +@@ -532,7 +533,7 @@ group("memory_buffer") { + } + + # Cannot be a static_library in component builds due to exported functions +-source_set("memory_buffer_sources") { ++jumbo_source_set("memory_buffer_sources") { + visibility = [ ":*" ] # Depend on through ":memory_buffer". + + # TODO(brettw) refactor this so these sources are in a coherent directory +@@ -620,7 +621,7 @@ source_set("memory_buffer_sources") { + } + + # TODO(ccameron): This can be moved into a separate source_set. +-component("gfx_switches") { ++jumbo_component("gfx_switches") { + sources = [ + "switches.cc", + "switches.h", +@@ -632,7 +633,7 @@ component("gfx_switches") { + deps = [ "//base" ] + } + +-static_library("test_support") { ++jumbo_static_library("test_support") { + testonly = true + sources = [ + "animation/animation_test_api.cc", +diff --git a/ui/gfx/animation/BUILD.gn b/ui/gfx/animation/BUILD.gn +index 9dabaaca3..151a60994 100644 +--- a/ui/gfx/animation/BUILD.gn ++++ b/ui/gfx/animation/BUILD.gn +@@ -3,6 +3,7 @@ + # found in the LICENSE file. + + import("//build/config/chromeos/ui_mode.gni") ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + + if (is_android) { +@@ -10,7 +11,7 @@ if (is_android) { + import("//build/config/android/rules.gni") + } + +-component("animation") { ++jumbo_component("animation") { + sources = [ + "animation.cc", + "animation.h", +diff --git a/ui/gfx/codec/BUILD.gn b/ui/gfx/codec/BUILD.gn +index c8a021173..efb03ea06 100644 +--- a/ui/gfx/codec/BUILD.gn ++++ b/ui/gfx/codec/BUILD.gn +@@ -2,9 +2,10 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + +-component("codec") { ++jumbo_component("codec") { + sources = [ + "codec_export.h", + "jpeg_codec.cc", +diff --git a/ui/gfx/geometry/BUILD.gn b/ui/gfx/geometry/BUILD.gn +index 9a17685c9..e2d00bbb6 100644 +--- a/ui/gfx/geometry/BUILD.gn ++++ b/ui/gfx/geometry/BUILD.gn +@@ -2,7 +2,9 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + +-component("geometry") { ++import("//build/config/jumbo.gni") ++ ++jumbo_component("geometry") { + sources = [ + "../gfx_export.h", + "angle_conversions.h", +diff --git a/ui/gfx/ipc/BUILD.gn b/ui/gfx/ipc/BUILD.gn +index 83f5cd0b1..44f4ad493 100644 +--- a/ui/gfx/ipc/BUILD.gn ++++ b/ui/gfx/ipc/BUILD.gn +@@ -2,7 +2,9 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + +-component("ipc") { ++import("//build/config/jumbo.gni") ++ ++jumbo_component("ipc") { + output_name = "gfx_ipc" + + sources = [ +diff --git a/ui/gfx/ipc/buffer_types/BUILD.gn b/ui/gfx/ipc/buffer_types/BUILD.gn +index 550b4f0ed..957f9d9e6 100644 +--- a/ui/gfx/ipc/buffer_types/BUILD.gn ++++ b/ui/gfx/ipc/buffer_types/BUILD.gn +@@ -2,7 +2,9 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + +-component("buffer_types") { ++import("//build/config/jumbo.gni") ++ ++jumbo_component("buffer_types") { + output_name = "gfx_ipc_buffer_types" + + sources = [ +diff --git a/ui/gfx/ipc/color/BUILD.gn b/ui/gfx/ipc/color/BUILD.gn +index 38a069456..9bbf35412 100644 +--- a/ui/gfx/ipc/color/BUILD.gn ++++ b/ui/gfx/ipc/color/BUILD.gn +@@ -2,7 +2,9 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + +-component("color") { ++import("//build/config/jumbo.gni") ++ ++jumbo_component("color") { + output_name = "gfx_ipc_color" + + sources = [ +diff --git a/ui/gfx/ipc/geometry/BUILD.gn b/ui/gfx/ipc/geometry/BUILD.gn +index 4d0a15040..bd24a217e 100644 +--- a/ui/gfx/ipc/geometry/BUILD.gn ++++ b/ui/gfx/ipc/geometry/BUILD.gn +@@ -2,7 +2,9 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + +-component("geometry") { ++import("//build/config/jumbo.gni") ++ ++jumbo_component("geometry") { + output_name = "gfx_ipc_geometry" + + sources = [ +diff --git a/ui/gfx/ipc/skia/BUILD.gn b/ui/gfx/ipc/skia/BUILD.gn +index b96b1c754..d6178dcba 100644 +--- a/ui/gfx/ipc/skia/BUILD.gn ++++ b/ui/gfx/ipc/skia/BUILD.gn +@@ -2,7 +2,9 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + +-component("skia") { ++import("//build/config/jumbo.gni") ++ ++jumbo_component("skia") { + output_name = "gfx_ipc_skia" + + sources = [ +diff --git a/ui/gfx/range/BUILD.gn b/ui/gfx/range/BUILD.gn +index aa17a9745..e1c9b52f1 100644 +--- a/ui/gfx/range/BUILD.gn ++++ b/ui/gfx/range/BUILD.gn +@@ -2,7 +2,9 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + +-component("range") { ++import("//build/config/jumbo.gni") ++ ++jumbo_component("range") { + sources = [ + "gfx_range_export.h", + "range.cc", +diff --git a/ui/gfx/x/BUILD.gn b/ui/gfx/x/BUILD.gn +index 623635136..f49995f8a 100644 +--- a/ui/gfx/x/BUILD.gn ++++ b/ui/gfx/x/BUILD.gn +@@ -2,6 +2,7 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//build/config/ozone.gni") + import("//build/config/ui.gni") + import("//tools/generate_library_loader/generate_library_loader.gni") +@@ -191,7 +192,7 @@ source_set("xproto") { + libs = [ "xcb" ] + } + +-component("x") { ++jumbo_component("x") { + output_name = "gfx_x11" + + sources = [ +diff --git a/ui/gl/BUILD.gn b/ui/gl/BUILD.gn +index 1e71ae443..a7fa6c74c 100644 +--- a/ui/gl/BUILD.gn ++++ b/ui/gl/BUILD.gn +@@ -6,6 +6,7 @@ import("//build/buildflag_header.gni") + import("//build/config/chrome_build.gni") + import("//build/config/chromecast_build.gni") + import("//build/config/chromeos/ui_mode.gni") ++import("//build/config/jumbo.gni") + import("//build/config/linux/pkg_config.gni") + import("//build/config/ozone.gni") + import("//build/config/ui.gni") +@@ -45,7 +46,7 @@ config("gl_config") { + } + } + +-component("gl") { ++jumbo_component("gl") { + output_name = "gl_wrapper" # Avoid colliding with OS X"s libGL.dylib. + + sources = [ +@@ -454,7 +455,7 @@ if (is_mac) { + } + } + +-static_library("gl_unittest_utils") { ++jumbo_static_library("gl_unittest_utils") { + testonly = true + sources = [ + "egl_bindings_autogen_mock.cc", +@@ -480,7 +481,7 @@ static_library("gl_unittest_utils") { + ] + } + +-static_library("test_support") { ++jumbo_static_library("test_support") { + testonly = true + sources = [ + "test/gl_image_test_support.cc", +diff --git a/ui/gl/init/BUILD.gn b/ui/gl/init/BUILD.gn +index f6b4cf961..78a7d81dd 100644 +--- a/ui/gl/init/BUILD.gn ++++ b/ui/gl/init/BUILD.gn +@@ -2,10 +2,11 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + import("//ui/gl/features.gni") + +-component("init") { ++jumbo_component("init") { + output_name = "gl_init" + + public = [ +diff --git a/ui/gtk/BUILD.gn b/ui/gtk/BUILD.gn +index 4fc6b6d61..21849421f 100644 +--- a/ui/gtk/BUILD.gn ++++ b/ui/gtk/BUILD.gn +@@ -4,6 +4,7 @@ + + import("//build/config/chromeos/ui_mode.gni") + import("//build/config/features.gni") ++import("//build/config/jumbo.gni") + import("//build/config/linux/gtk/gtk.gni") + import("//build/config/linux/pkg_config.gni") + import("//build/config/ozone.gni") +@@ -68,10 +69,9 @@ generate_stubs("gtk_stubs") { + logging_include = "ui/gtk/log_noop.h" + } + +-component("gtk") { ++jumbo_component("gtk") { + visibility = [ "//ui/linux:linux_ui_factory" ] + public = [ "gtk_ui_factory.h" ] +- + sources = [ + "gtk_color_mixers.cc", + "gtk_color_mixers.h", +diff --git a/ui/latency/BUILD.gn b/ui/latency/BUILD.gn +index 6e8ca7dba..3019b821d 100644 +--- a/ui/latency/BUILD.gn ++++ b/ui/latency/BUILD.gn +@@ -2,9 +2,10 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//testing/test.gni") + +-source_set("latency") { ++jumbo_source_set("latency") { + sources = [ + "latency_info.cc", + "latency_info.h", +@@ -21,7 +22,7 @@ source_set("latency") { + public_deps = [ "//services/metrics/public/cpp:metrics_cpp" ] + } + +-source_set("test_support") { ++jumbo_source_set("test_support") { + testonly = true + sources = [ "latency_info_test_support.cc" ] + +diff --git a/ui/message_center/BUILD.gn b/ui/message_center/BUILD.gn +index 1bd8354cd..d24f08b3e 100644 +--- a/ui/message_center/BUILD.gn ++++ b/ui/message_center/BUILD.gn +@@ -3,6 +3,7 @@ + # found in the LICENSE file. + + import("//build/config/features.gni") ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + import("//components/vector_icons/vector_icons.gni") + import("//testing/test.gni") +@@ -23,7 +24,7 @@ aggregate_vector_icons("message_center_vector_icons") { + } + + # TODO(msw|mukai|dewittj): Move ash-specific files: crbug.com/585175 +-component("message_center") { ++jumbo_component("message_center") { + deps = [ + "//base", + "//build:chromeos_buildflags", +diff --git a/ui/message_center/public/cpp/BUILD.gn b/ui/message_center/public/cpp/BUILD.gn +index 1e9e3ec8d..33925d047 100644 +--- a/ui/message_center/public/cpp/BUILD.gn ++++ b/ui/message_center/public/cpp/BUILD.gn +@@ -2,10 +2,11 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + + # C++ headers and sources that can be used outside message_center. +-component("cpp") { ++jumbo_component("cpp") { + output_name = "ui_message_center_cpp" + + sources = [ +diff --git a/ui/native_theme/BUILD.gn b/ui/native_theme/BUILD.gn +index 6b022564c..b714e00e0 100644 +--- a/ui/native_theme/BUILD.gn ++++ b/ui/native_theme/BUILD.gn +@@ -2,6 +2,7 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + import("//testing/test.gni") + +@@ -22,7 +23,7 @@ component("features") { + ] + } + +-component("native_theme") { ++jumbo_component("native_theme") { + sources = [ + "caption_style.cc", + "caption_style.h", +@@ -103,7 +104,7 @@ component("native_theme") { + } + + if (is_win) { +- component("native_theme_browser") { ++ jumbo_component("native_theme_browser") { + defines = [ "NATIVE_THEME_IMPLEMENTATION" ] + + # These files cannot work in the renderer on Windows. +@@ -125,11 +126,11 @@ if (is_win) { + libs = [ "uxtheme.lib" ] + } + } else { +- source_set("native_theme_browser") { ++ jumbo_source_set("native_theme_browser") { + } + } + +-source_set("test_support") { ++jumbo_source_set("test_support") { + testonly = true + + deps = [ +diff --git a/ui/ozone/BUILD.gn b/ui/ozone/BUILD.gn +index bc1d2cf52..10951066a 100644 +--- a/ui/ozone/BUILD.gn ++++ b/ui/ozone/BUILD.gn +@@ -3,6 +3,7 @@ + # found in the LICENSE file. + + import("//build/buildflag_header.gni") ++import("//build/config/jumbo.gni") + import("//build/config/ozone.gni") + import("//build/config/python.gni") + import("//build/config/ui.gni") +@@ -83,7 +84,7 @@ constructor_list_cc_file = "$target_gen_dir/constructor_list.cc" + + test_constructor_list_cc_file = "$target_gen_dir/test_constructor_list.cc" + +-component("ozone_base") { ++jumbo_component("ozone_base") { + sources = [ + "public/gl_ozone.h", + "public/gpu_platform_support_host.cc", +@@ -246,7 +247,7 @@ source_set("ozone_switches") { + ] + } + +-component("ozone") { ++jumbo_component("ozone") { + visibility = [] + visibility = [ "*" ] + public_deps = [ +@@ -255,7 +256,7 @@ component("ozone") { + ] + } + +-source_set("test_support_internal") { ++jumbo_source_set("test_support_internal") { + testonly = true + + sources = [ +@@ -278,7 +279,7 @@ source_set("test_support_internal") { + public_deps = [ "//base/test:test_support" ] + } + +-static_library("ui_test_support") { ++jumbo_static_library("ui_test_support") { + visibility = [] + visibility = [ "//ui/views:test_support" ] + +@@ -314,7 +315,7 @@ source_set("ozone_interactive_ui_tests") { + deps = ozone_platform_interactive_ui_tests_sources + } + +-static_library("test_support") { ++jumbo_static_library("test_support") { + visibility = [] + visibility = [ + ":*", +diff --git a/ui/platform_window/stub/BUILD.gn b/ui/platform_window/stub/BUILD.gn +index 5f4194932..1d64d126b 100644 +--- a/ui/platform_window/stub/BUILD.gn ++++ b/ui/platform_window/stub/BUILD.gn +@@ -2,7 +2,9 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + +-component("stub") { ++import("//build/config/jumbo.gni") ++ ++jumbo_component("stub") { + output_name = "stub_window" + + deps = [ +diff --git a/ui/platform_window/win/BUILD.gn b/ui/platform_window/win/BUILD.gn +index e172d7b2b..f57d6db0d 100644 +--- a/ui/platform_window/win/BUILD.gn ++++ b/ui/platform_window/win/BUILD.gn +@@ -2,7 +2,9 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + +-component("win") { ++import("//build/config/jumbo.gni") ++ ++jumbo_component("win") { + output_name = "win_window" + + deps = [ +diff --git a/ui/resources/BUILD.gn b/ui/resources/BUILD.gn +index 67a0edca7..c86b02b1c 100644 +--- a/ui/resources/BUILD.gn ++++ b/ui/resources/BUILD.gn +@@ -3,6 +3,7 @@ + # found in the LICENSE file. + + import("//build/config/chromeos/ui_mode.gni") ++import("//build/config/jumbo.gni") + import("//tools/grit/grit_rule.gni") + import("//tools/grit/repack.gni") + import("//ui/webui/webui_features.gni") +diff --git a/ui/shell_dialogs/BUILD.gn b/ui/shell_dialogs/BUILD.gn +index 7d1dbaca0..3697bf169 100644 +--- a/ui/shell_dialogs/BUILD.gn ++++ b/ui/shell_dialogs/BUILD.gn +@@ -3,6 +3,7 @@ + # found in the LICENSE file. + + import("//build/config/chromeos/ui_mode.gni") ++import("//build/config/jumbo.gni") + import("//build/config/features.gni") + import("//build/config/ui.gni") + import("//testing/test.gni") +@@ -14,7 +15,7 @@ if (is_mac) { + import("//build/config/mac/rules.gni") + } + +-component("shell_dialogs") { ++jumbo_component("shell_dialogs") { + sources = [ + "base_shell_dialog.cc", + "base_shell_dialog.h", +diff --git a/ui/snapshot/BUILD.gn b/ui/snapshot/BUILD.gn +index 34e4040c3..c7c1cfabc 100644 +--- a/ui/snapshot/BUILD.gn ++++ b/ui/snapshot/BUILD.gn +@@ -2,10 +2,11 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + import("//testing/test.gni") + +-component("snapshot") { ++jumbo_component("snapshot") { + sources = [ + "screenshot_grabber.cc", + "screenshot_grabber.h", +@@ -79,7 +80,7 @@ component("snapshot") { + } + } + +-source_set("snapshot_export") { ++jumbo_source_set("snapshot_export") { + sources = [ "snapshot_export.h" ] + visibility = [ ":*" ] + } +diff --git a/ui/surface/BUILD.gn b/ui/surface/BUILD.gn +index 531dbf120..1d2751db6 100644 +--- a/ui/surface/BUILD.gn ++++ b/ui/surface/BUILD.gn +@@ -2,9 +2,10 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + +-component("surface") { ++jumbo_component("surface") { + sources = [ + "surface_export.h", + "transport_dib.cc", +diff --git a/ui/touch_selection/BUILD.gn b/ui/touch_selection/BUILD.gn +index 219b8ee61..852fd7cb9 100644 +--- a/ui/touch_selection/BUILD.gn ++++ b/ui/touch_selection/BUILD.gn +@@ -2,6 +2,7 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + import("//testing/test.gni") + +@@ -9,7 +10,7 @@ if (is_android) { + import("//build/config/android/rules.gni") + } + +-component("touch_selection") { ++jumbo_component("touch_selection") { + output_name = "ui_touch_selection" + + sources = [ +diff --git a/ui/views/BUILD.gn b/ui/views/BUILD.gn +index accb86903..d871768c9 100644 +--- a/ui/views/BUILD.gn ++++ b/ui/views/BUILD.gn +@@ -5,6 +5,7 @@ + import("//build/buildflag_header.gni") + import("//build/config/chromeos/ui_mode.gni") + import("//build/config/features.gni") ++import("//build/config/jumbo.gni") + import("//build/config/ozone.gni") + import("//build/config/ui.gni") + import("//components/vector_icons/vector_icons.gni") +@@ -57,7 +58,7 @@ buildflag_header("buildflags") { + flags = [ "ENABLE_DESKTOP_AURA=$enable_desktop_aura" ] + } + +-component("views") { ++jumbo_component("views") { + all_dependent_configs = [ ":flags" ] + + public = [ +@@ -923,7 +924,7 @@ component("views") { + } + + if (is_win || is_mac || is_linux || is_chromeos) { +- static_library("view_pixel_diff_test_support") { ++ jumbo_static_library("view_pixel_diff_test_support") { + testonly = true + sources = [ + "test/view_skia_gold_pixel_diff.cc", +@@ -942,7 +943,7 @@ if (is_win || is_mac || is_linux || is_chromeos) { + } + } + +-source_set("test_support") { ++jumbo_source_set("test_support") { + testonly = true + sources = [ + "animation/test/flood_fill_ink_drop_ripple_test_api.cc", +diff --git a/ui/views/controls/webview/BUILD.gn b/ui/views/controls/webview/BUILD.gn +index f37a5a881..a0c34efce 100644 +--- a/ui/views/controls/webview/BUILD.gn ++++ b/ui/views/controls/webview/BUILD.gn +@@ -2,9 +2,10 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//build/config/ozone.gni") + +-component("webview") { ++jumbo_component("webview") { + sources = [ + "unhandled_keyboard_event_handler.cc", + "unhandled_keyboard_event_handler.h", +diff --git a/ui/views/examples/BUILD.gn b/ui/views/examples/BUILD.gn +index 05338165a..6ebe3fc5c 100644 +--- a/ui/views/examples/BUILD.gn ++++ b/ui/views/examples/BUILD.gn +@@ -3,11 +3,12 @@ + # found in the LICENSE file. + + import("//build/config/chromeos/ui_mode.gni") ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + import("//testing/test.gni") + import("//tools/grit/grit_rule.gni") + +-component("views_examples_lib") { ++jumbo_component("views_examples_lib") { + testonly = true + + sources = [ +@@ -221,7 +222,7 @@ executable("views_examples") { + ] + } + +-component("views_examples_with_content_lib") { ++jumbo_component("views_examples_with_content_lib") { + testonly = true + sources = [ + "examples_window_with_content.cc", +diff --git a/ui/views_content_client/BUILD.gn b/ui/views_content_client/BUILD.gn +index e01d44b0c..11684632b 100644 +--- a/ui/views_content_client/BUILD.gn ++++ b/ui/views_content_client/BUILD.gn +@@ -3,9 +3,10 @@ + # found in the LICENSE file. + + import("//build/config/chromeos/ui_mode.gni") ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + +-component("views_content_client") { ++jumbo_component("views_content_client") { + testonly = true + sources = [ + "views_content_browser_client.cc", +diff --git a/ui/web_dialogs/BUILD.gn b/ui/web_dialogs/BUILD.gn +index fd379adfc..1655faa7c 100644 +--- a/ui/web_dialogs/BUILD.gn ++++ b/ui/web_dialogs/BUILD.gn +@@ -2,7 +2,9 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + +-component("web_dialogs") { ++import("//build/config/jumbo.gni") ++ ++jumbo_component("web_dialogs") { + sources = [ + "web_dialog_delegate.cc", + "web_dialog_delegate.h", +@@ -31,7 +33,7 @@ component("web_dialogs") { + } + } + +-static_library("test_support") { ++jumbo_static_library("test_support") { + sources = [ + "test/test_web_contents_handler.cc", + "test/test_web_contents_handler.h", +diff --git a/ui/wm/BUILD.gn b/ui/wm/BUILD.gn +index 2450d399f..5f8a4e73d 100644 +--- a/ui/wm/BUILD.gn ++++ b/ui/wm/BUILD.gn +@@ -3,12 +3,13 @@ + # found in the LICENSE file. + + import("//build/config/chromeos/ui_mode.gni") ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + import("//testing/test.gni") + + assert(use_aura) + +-component("wm") { ++jumbo_component("wm") { + output_name = "ui_wm" + sources = [ + "core/accelerator_delegate.h", +@@ -102,7 +103,7 @@ component("wm") { + } + } + +-static_library("test_support") { ++jumbo_static_library("test_support") { + testonly = true + sources = [ + "test/testing_cursor_client_observer.cc", +diff --git a/ui/wm/public/BUILD.gn b/ui/wm/public/BUILD.gn +index e27ef11fd..15b7e911c 100644 +--- a/ui/wm/public/BUILD.gn ++++ b/ui/wm/public/BUILD.gn +@@ -2,11 +2,12 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + + assert(use_aura) + +-component("public") { ++jumbo_component("public") { + output_name = "wm_public" + + public = [ +-- +2.43.0 + diff --git a/x11-packages/carbonyl-host-tools/patches/0101-fixes-for-jumbo-build.patch b/x11-packages/carbonyl-host-tools/patches/0101-fixes-for-jumbo-build.patch new file mode 100644 index 000000000000000..5b289d785ef8417 --- /dev/null +++ b/x11-packages/carbonyl-host-tools/patches/0101-fixes-for-jumbo-build.patch @@ -0,0 +1,7330 @@ +From 8b6d4e7552132d1c536d39ae7111ef1692fafe5a Mon Sep 17 00:00:00 2001 +From: Chongyun Lee +Date: Wed, 29 Jan 2025 22:54:37 +0800 +Subject: [PATCH] Fixes for jumbo build + +Based on https://github.com/qt/qtwebengine-chromium/commit/93e068edee318bb23af7a5a85b12d629123491fc + +--- + base/BUILD.gn | 11 ++ + base/task/sequence_manager/task_order.cc | 10 +- + base/task/single_thread_task_runner.cc | 18 +-- + build/config/jumbo.gni | 2 +- + cc/metrics/compositor_frame_reporter.cc | 16 +- + .../compositor_frame_reporting_controller.cc | 14 +- + cc/metrics/frame_sequence_tracker.cc | 6 +- + cc/metrics/jank_injector.cc | 4 +- + cc/metrics/jank_metrics.cc | 8 +- + components/guest_view/browser/BUILD.gn | 4 +- + components/guest_view/renderer/BUILD.gn | 4 +- + components/metrics/metrics_log.cc | 4 +- + components/metrics/metrics_state_manager.cc | 4 +- + components/performance_manager/BUILD.gn | 4 +- + .../decorators/page_live_state_decorator.cc | 4 +- + .../decorators/page_load_tracker_decorator.cc | 4 +- + .../frame_audible_voter.cc | 8 +- + .../frame_visibility_voter.cc | 16 +- + .../inherit_client_priority_voter.cc | 36 ++--- + .../graph/frame_node_impl_describer.cc | 4 +- + .../graph/page_node_impl_describer.cc | 4 +- + .../graph/process_node_impl_describer.cc | 4 +- + .../graph/worker_node_impl_describer.cc | 4 +- + .../performance_manager_registry_impl.cc | 14 +- + .../site_data/site_data_cache_factory.cc | 12 +- + .../core/common/policy_proto_decoders.cc | 4 +- + components/printing/browser/BUILD.gn | 4 +- + components/storage_monitor/BUILD.gn | 3 +- + components/viz/common/BUILD.gn | 1 + + components/viz/service/BUILD.gn | 14 ++ + .../display/display_resource_provider.h | 2 +- + .../skia_output_device_webview.cc | 8 +- + .../transferable_resource_tracker.cc | 2 +- + content/browser/BUILD.gn | 152 +++++++++++------- + .../attribution_internals_handler_impl.cc | 10 +- + .../attribution_storage_sql.cc | 4 +- + .../cookie_change_subscription.cc | 7 +- + content/browser/devtools/BUILD.gn | 2 +- + .../browser/devtools/protocol/page_handler.cc | 4 +- + .../web_contents_devtools_agent_host.cc | 18 +-- + .../first_party_set_parser.cc | 2 +- + .../first_party_sets_handler_impl.cc | 6 +- + content/browser/gpu/compositor_util.cc | 16 +- + content/browser/gpu/gpu_process_host.cc | 2 +- + .../interest_group_manager_impl.cc | 4 +- + .../interest_group_permissions_checker.cc | 4 +- + .../media/media_internals_cdm_helper.cc | 4 +- + .../cross_origin_embedder_policy_reporter.cc | 6 +- + .../prerender/prerender_host_registry.cc | 2 +- + .../push_messaging/push_messaging_router.cc | 4 +- + .../agent_scheduling_group_host.cc | 32 ++-- + .../renderer_host/code_cache_host_impl.h | 6 +- + .../media/media_stream_manager.cc | 88 +++++----- + .../media/media_stream_power_logger.cc | 10 +- + .../pepper_internal_file_ref_backend.cc | 4 +- + .../renderer_host/render_frame_proxy_host.cc | 12 +- + .../embedded_worker_instance.cc | 4 +- + .../service_worker_context_wrapper.cc | 6 +- + ...rvice_worker_controllee_request_handler.cc | 16 +- + content/child/BUILD.gn | 5 +- + content/common/BUILD.gn | 8 +- + .../pepper/pepper_plugin_instance_impl.h | 5 + + .../web_service_worker_provider_impl.cc | 8 +- + dbus/message.cc | 4 +- + device/fido/cable/cable_discovery_data.h | 2 +- + .../fido/public_key_credential_descriptor.h | 4 +- + device/fido/public_key_credential_params.h | 4 +- + device/fido/public_key_credential_rp_entity.h | 4 +- + .../fido/public_key_credential_user_entity.h | 4 +- + .../webrequest_condition.cc | 16 +- + .../webrequest_condition_attribute.cc | 82 +++++----- + .../api/hid/hid_connection_resource.cc | 4 +- + .../browser/api/hid/hid_device_manager.cc | 6 +- + .../browser/api/usb/usb_device_manager.cc | 4 +- + .../browser/api/usb/usb_device_resource.cc | 4 +- + .../api/web_request/upload_data_presenter.cc | 6 +- + .../api/web_request/web_request_api.cc | 134 +++++++-------- + .../api/web_request/web_request_info.cc | 8 +- + ...web_request_proxying_url_loader_factory.cc | 18 +-- + .../web_request_proxying_url_loader_factory.h | 2 +- + extensions/browser/app_window/app_window.cc | 4 +- + .../browser/extension_message_filter.cc | 20 +-- + ...extension_service_worker_message_filter.cc | 20 +-- + extensions/common/BUILD.gn | 5 + + .../manifest_handlers/shared_module_info.cc | 10 +- + gpu/command_buffer/service/BUILD.gn | 7 +- + gpu/config/BUILD.gn | 3 +- + .../h265_to_annex_b_bitstream_converter.cc | 30 ++-- + .../mac/audio_toolbox_audio_encoder.cc | 8 +- + media/filters/media_file_checker.cc | 4 +- + .../services/gpu_mojo_media_client_cros.cc | 5 +- + .../services/gpu_mojo_media_client_mac.cc | 3 +- + .../services/gpu_mojo_media_client_stubs.cc | 4 +- + .../services/gpu_mojo_media_client_win.cc | 3 +- + mojo/public/tools/bindings/mojom.gni | 5 +- + services/network/public/cpp/BUILD.gn | 5 + + .../web_bundle_url_loader_factory.cc | 4 +- + storage/browser/BUILD.gn | 4 + + storage/browser/blob/blob_url_registry.cc | 8 +- + storage/browser/quota/quota_settings.cc | 9 +- + .../common/frame/user_activation_state.cc | 4 +- + .../common/user_agent/user_agent_metadata.cc | 6 +- + .../scripts/bind_gen/callback_interface.py | 1 + + .../bindings/scripts/bind_gen/interface.py | 33 +++- + third_party/blink/renderer/core/BUILD.gn | 13 +- + .../blink/renderer/core/animation/BUILD.gn | 3 + + .../css_shadow_list_interpolation_type.cc | 2 +- + .../css/box_shadow_paint_image_generator.cc | 10 +- + .../css/clip_path_paint_image_generator.cc | 10 +- + .../core/frame/local_frame_mojo_handler.cc | 4 +- + .../renderer/core/frame/sticky_ad_detector.cc | 8 +- + .../core/html/forms/html_input_element.cc | 6 +- + .../core/html/forms/html_text_area_element.cc | 6 +- + .../core/html/parser/html_tree_builder.cc | 4 +- + .../renderer/core/html/track/cue_timeline.cc | 2 +- + .../renderer/core/html/track/text_track.cc | 4 +- + .../core/imagebitmap/image_bitmap_source.cc | 4 +- + .../core/layout/flexible_box_algorithm.cc | 8 +- + .../core/layout/flexible_box_algorithm.h | 4 +- + .../ng/flex/ng_flex_layout_algorithm.cc | 50 +++--- + .../core/layout/ng/grid/ng_grid_item.cc | 4 +- + .../core/layout/ng/grid/ng_grid_item.h | 6 +- + .../ng/grid/ng_grid_layout_algorithm.cc | 18 +-- + .../ng_math_scripts_layout_algorithm.cc | 4 +- + .../core/layout/ng/ng_baseline_utils.h | 10 +- + .../blink/renderer/core/page/drag_image.cc | 3 + + .../core/paint/ng/ng_highlight_painter.cc | 14 +- + .../core/paint/pre_paint_tree_walk.cc | 4 +- + .../speculation_rules/speculation_rule_set.cc | 44 ++--- + .../core/timing/performance_timing.cc | 6 +- + .../inspector_type_builder_helper.cc | 6 +- + .../modules/bluetooth/bluetooth_device.cc | 6 +- + ...edia_stream_video_track_underlying_sink.cc | 6 +- + .../blink/renderer/modules/canvas/BUILD.gn | 4 + + .../credentials_container.cc | 30 ++-- + .../federated_credential.cc | 4 +- + .../identity_credential.cc | 4 +- + .../credentialmanagement/otp_credential.cc | 6 +- + .../blink/renderer/modules/hid/hid_device.cc | 6 +- + .../modules/mediarecorder/h264_encoder.cc | 12 +- + .../modules/mediarecorder/vpx_encoder.cc | 58 ++++--- + .../renderer/modules/mediastream/BUILD.gn | 7 + + .../modules/payments/payment_instruments.cc | 14 +- + .../renderer/modules/peerconnection/BUILD.gn | 6 + + .../peerconnection/rtc_peer_connection.cc | 6 +- + .../renderer/modules/permissions/BUILD.gn | 1 + + .../modules/webaudio/analyser_handler.cc | 8 +- + .../webaudio/audio_buffer_source_handler.cc | 4 +- + .../modules/webaudio/audio_worklet_handler.cc | 4 +- + .../modules/webaudio/biquad_filter_node.cc | 4 +- + .../webaudio/constant_source_handler.cc | 4 +- + .../modules/webaudio/convolver_handler.cc | 4 +- + .../webaudio/dynamics_compressor_handler.cc | 6 +- + .../modules/webaudio/iir_filter_handler.cc | 4 +- + .../media_element_audio_source_handler.cc | 4 +- + .../modules/webaudio/oscillator_handler.cc | 4 +- + .../webaudio/realtime_audio_worklet_thread.cc | 16 +- + .../semi_realtime_audio_worklet_thread.cc | 16 +- + .../modules/webaudio/stereo_panner_handler.cc | 16 +- + .../modules/webaudio/wave_shaper_handler.cc | 4 +- + .../blink/renderer/modules/webcodecs/BUILD.gn | 5 + + .../modules/webcodecs/decoder_template.cc | 18 +-- + .../modules/webcodecs/encoder_base.cc | 20 +-- + .../webcodecs/gpu_factories_retriever.cc | 6 +- + .../blink/renderer/modules/webgpu/BUILD.gn | 2 + + third_party/blink/renderer/platform/BUILD.gn | 9 ++ + .../cpu/x86/audio_delay_dsp_kernel_sse2.cc | 2 + + .../renderer/platform/audio/hrtf_panner.cc | 16 +- + .../platform/fonts/shaping/harfbuzz_shaper.cc | 22 +-- + .../compositing/paint_artifact_compositor.cc | 2 +- + .../image-decoders/jpeg/jpeg_image_decoder.cc | 4 + + .../platform/loader/web_url_request_util.cc | 1 + + .../stats_collecting_decoder.cc | 12 +- + .../widget/compositing/layer_tree_view.cc | 4 +- + .../input/elastic_overscroll_controller.cc | 2 +- + .../widget/input/widget_base_input_handler.cc | 4 +- + ui/base/BUILD.gn | 4 + + ui/base/ime/win/BUILD.gn | 1 + + ui/base/x/BUILD.gn | 3 +- + ui/color/BUILD.gn | 7 +- + ui/gfx/geometry/transform_operations.cc | 6 +- + ui/gl/BUILD.gn | 4 + + ui/gl/direct_composition_surface_win.cc | 6 +- + ui/native_theme/BUILD.gn | 9 +- + 184 files changed, 1035 insertions(+), 878 deletions(-) + +diff --git a/base/BUILD.gn b/base/BUILD.gn +index e0139a879..8eb16b4fc 100644 +--- a/base/BUILD.gn ++++ b/base/BUILD.gn +@@ -1404,6 +1404,11 @@ jumbo_component("base") { + ] + } + ++ jumbo_excluded_sources = [ ++ "logging.cc", ++ "strings/string_piece.cc", ++ ] ++ + if (is_linux || is_chromeos) { + sources += [ + "debug/proc_maps_linux.cc", +@@ -1421,6 +1426,7 @@ jumbo_component("base") { + "threading/thread_type_delegate.cc", + "threading/thread_type_delegate.h", + ] ++ jumbo_excluded_sources += [ "process/memory_linux.cc" ] + } + + if (is_linux || is_chromeos || is_android || is_fuchsia) { +@@ -2097,6 +2103,11 @@ jumbo_component("base") { + "file_descriptor_store.h", + ] + ++ # winternl.h and NTSecAPI.h have different definitions of UNICODE_STRING. ++ # There's only one client of NTSecAPI.h in base but several of winternl.h, ++ # so exclude the NTSecAPI.h one. ++ jumbo_excluded_sources += [ "rand_util_win.cc" ] ++ + deps += [ "//base/win:base_win_buildflags" ] + + data_deps += [ "//build/win:runtime_libs" ] +diff --git a/base/task/sequence_manager/task_order.cc b/base/task/sequence_manager/task_order.cc +index b2bdae4e9..1e9635b28 100644 +--- a/base/task/sequence_manager/task_order.cc ++++ b/base/task/sequence_manager/task_order.cc +@@ -17,7 +17,7 @@ namespace { + // Returns true iff `task_order1` Comparator{} `task_order2`. Used to + // implement other comparison operators. + template +-static bool Compare(const base::sequence_manager::TaskOrder& task_order1, ++static bool CompareTO(const base::sequence_manager::TaskOrder& task_order1, + const base::sequence_manager::TaskOrder& task_order2) { + Comparator cmp{}; + +@@ -60,19 +60,19 @@ TaskOrder& TaskOrder::operator=(const TaskOrder& other) = default; + TaskOrder::~TaskOrder() = default; + + bool TaskOrder::operator>(const TaskOrder& other) const { +- return Compare>(*this, other); ++ return CompareTO>(*this, other); + } + + bool TaskOrder::operator<(const TaskOrder& other) const { +- return Compare>(*this, other); ++ return CompareTO>(*this, other); + } + + bool TaskOrder::operator<=(const TaskOrder& other) const { +- return Compare>(*this, other); ++ return CompareTO>(*this, other); + } + + bool TaskOrder::operator>=(const TaskOrder& other) const { +- return Compare>(*this, other); ++ return CompareTO>(*this, other); + } + + bool TaskOrder::operator==(const TaskOrder& other) const { +diff --git a/base/task/single_thread_task_runner.cc b/base/task/single_thread_task_runner.cc +index ebf286712..ca1f9279e 100644 +--- a/base/task/single_thread_task_runner.cc ++++ b/base/task/single_thread_task_runner.cc +@@ -21,7 +21,7 @@ namespace base { + namespace { + + ThreadLocalPointer& +-CurrentDefaultHandleTls() { ++CurrentDefaultHandleTls2() { + static NoDestructor< + ThreadLocalPointer> + instance; +@@ -34,7 +34,7 @@ CurrentDefaultHandleTls() { + const scoped_refptr& + SingleThreadTaskRunner::GetCurrentDefault() { + const SingleThreadTaskRunner::CurrentDefaultHandle* current_default = +- CurrentDefaultHandleTls().Get(); ++ CurrentDefaultHandleTls2().Get(); + CHECK(current_default) + << "Error: This caller requires a single-threaded context (i.e. the " + "current task needs to run from a SingleThreadTaskRunner). If you're " +@@ -50,7 +50,7 @@ SingleThreadTaskRunner::GetCurrentDefault() { + + // static + bool SingleThreadTaskRunner::HasCurrentDefault() { +- return !!CurrentDefaultHandleTls().Get(); ++ return !!CurrentDefaultHandleTls2().Get(); + } + + SingleThreadTaskRunner::CurrentDefaultHandle::CurrentDefaultHandle( +@@ -58,14 +58,14 @@ SingleThreadTaskRunner::CurrentDefaultHandle::CurrentDefaultHandle( + : task_runner_(std::move(task_runner)), + sequenced_task_runner_current_default_(task_runner_) { + DCHECK(task_runner_->BelongsToCurrentThread()); +- DCHECK(!CurrentDefaultHandleTls().Get()); +- CurrentDefaultHandleTls().Set(this); ++ DCHECK(!CurrentDefaultHandleTls2().Get()); ++ CurrentDefaultHandleTls2().Set(this); + } + + SingleThreadTaskRunner::CurrentDefaultHandle::~CurrentDefaultHandle() { + DCHECK(task_runner_->BelongsToCurrentThread()); +- DCHECK_EQ(CurrentDefaultHandleTls().Get(), this); +- CurrentDefaultHandleTls().Set(nullptr); ++ DCHECK_EQ(CurrentDefaultHandleTls2().Get(), this); ++ CurrentDefaultHandleTls2().Set(nullptr); + } + + SingleThreadTaskRunner::CurrentHandleOverride::CurrentHandleOverride( +@@ -89,7 +89,7 @@ SingleThreadTaskRunner::CurrentHandleOverride::CurrentHandleOverride( + expected_task_runner_before_restore_ = overriding_task_runner.get(); + #endif + SingleThreadTaskRunner::CurrentDefaultHandle* current_default = +- CurrentDefaultHandleTls().Get(); ++ CurrentDefaultHandleTls2().Get(); + SequencedTaskRunner::SetCurrentDefaultHandleTaskRunner( + current_default->sequenced_task_runner_current_default_, + overriding_task_runner); +@@ -108,7 +108,7 @@ SingleThreadTaskRunner::CurrentHandleOverride::CurrentHandleOverride( + SingleThreadTaskRunner::CurrentHandleOverride::~CurrentHandleOverride() { + if (task_runner_to_restore_) { + SingleThreadTaskRunner::CurrentDefaultHandle* current_default = +- CurrentDefaultHandleTls().Get(); ++ CurrentDefaultHandleTls2().Get(); + + #if DCHECK_IS_ON() + DCHECK_EQ(expected_task_runner_before_restore_, +diff --git a/build/config/jumbo.gni b/build/config/jumbo.gni +index dd8972423..025314908 100644 +--- a/build/config/jumbo.gni ++++ b/build/config/jumbo.gni +@@ -78,7 +78,7 @@ template("internal_jumbo_target") { + if (defined(invoker.never_build_jumbo) && invoker.never_build_jumbo) { + use_jumbo_build_for_target = false + } +- if (is_nacl_irt || is_nacl_nonsfi) { ++ if (is_nacl_irt) { + # The code is barely compatible with the nacl toolchain anymore and we + # don't want to stress it further with jumbo compilation units. + use_jumbo_build_for_target = false +diff --git a/cc/metrics/compositor_frame_reporter.cc b/cc/metrics/compositor_frame_reporter.cc +index 2187f7f62..1fcb907be 100644 +--- a/cc/metrics/compositor_frame_reporter.cc ++++ b/cc/metrics/compositor_frame_reporter.cc +@@ -172,7 +172,7 @@ void ReportEventLatencyMetric( + } + } + +-constexpr char kTraceCategory[] = ++constexpr char kTraceCategory2[] = + "cc,benchmark," TRACE_DISABLED_BY_DEFAULT("devtools.timeline.frame"); + + base::TimeTicks ComputeSafeDeadlineForFrame(const viz::BeginFrameArgs& args) { +@@ -1145,7 +1145,7 @@ void CompositorFrameReporter::ReportCompositorLatencyTraceEvents( + const auto trace_track = + perfetto::Track(base::trace_event::GetNextGlobalTraceId()); + TRACE_EVENT_BEGIN( +- kTraceCategory, "PipelineReporter", trace_track, args_.frame_time, ++ kTraceCategory2, "PipelineReporter", trace_track, args_.frame_time, + [&](perfetto::EventContext context) { + using perfetto::protos::pbzero::ChromeFrameReporter; + ChromeFrameReporter::State state; +@@ -1226,7 +1226,7 @@ void CompositorFrameReporter::ReportCompositorLatencyTraceEvents( + + if (stage.stage_type == StageType::kSendBeginMainFrameToCommit) { + TRACE_EVENT_BEGIN( +- kTraceCategory, perfetto::StaticString{stage_name}, trace_track, ++ kTraceCategory2, perfetto::StaticString{stage_name}, trace_track, + stage.start_time, [&](perfetto::EventContext context) { + DCHECK(processed_blink_breakdown_); + auto* reporter = +@@ -1276,7 +1276,7 @@ void CompositorFrameReporter::ReportCompositorLatencyTraceEvents( + } + }); + } else { +- TRACE_EVENT_BEGIN(kTraceCategory, perfetto::StaticString{stage_name}, ++ TRACE_EVENT_BEGIN(kTraceCategory2, perfetto::StaticString{stage_name}, + trace_track, stage.start_time); + } + +@@ -1290,16 +1290,16 @@ void CompositorFrameReporter::ReportCompositorLatencyTraceEvents( + if (start_time >= end_time) + continue; + const char* breakdown_name = GetVizBreakdownName(it.GetBreakdown()); +- TRACE_EVENT_BEGIN(kTraceCategory, ++ TRACE_EVENT_BEGIN(kTraceCategory2, + perfetto::StaticString{breakdown_name}, trace_track, + start_time); +- TRACE_EVENT_END(kTraceCategory, trace_track, end_time); ++ TRACE_EVENT_END(kTraceCategory2, trace_track, end_time); + } + } +- TRACE_EVENT_END(kTraceCategory, trace_track, stage.end_time); ++ TRACE_EVENT_END(kTraceCategory2, trace_track, stage.end_time); + } + +- TRACE_EVENT_END(kTraceCategory, trace_track, frame_termination_time_); ++ TRACE_EVENT_END(kTraceCategory2, trace_track, frame_termination_time_); + } + + void CompositorFrameReporter::ReportScrollJankMetrics() const { +diff --git a/cc/metrics/compositor_frame_reporting_controller.cc b/cc/metrics/compositor_frame_reporting_controller.cc +index b14a9e941..e599d0350 100644 +--- a/cc/metrics/compositor_frame_reporting_controller.cc ++++ b/cc/metrics/compositor_frame_reporting_controller.cc +@@ -22,10 +22,10 @@ using SmoothThread = CompositorFrameReporter::SmoothThread; + using StageType = CompositorFrameReporter::StageType; + using FrameTerminationStatus = CompositorFrameReporter::FrameTerminationStatus; + +-constexpr char kTraceCategory[] = "cc,benchmark"; +-constexpr int kNumOfCompositorStages = ++constexpr char kTraceCategory3[] = "cc,benchmark"; ++constexpr int kNumOfCompositorStages3 = + static_cast(StageType::kStageTypeCount) - 1; +-constexpr int kNumDispatchStages = ++constexpr int kNumDispatchStages3 = + static_cast(EventMetrics::DispatchStage::kMaxValue); + constexpr base::TimeDelta kDefaultLatencyPredictionDeviationThreshold = + viz::BeginFrameArgs::DefaultInterval() / 2; +@@ -41,8 +41,8 @@ CompositorFrameReportingController::CompositorFrameReportingController( + previous_latency_predictions_main_(base::Microseconds(-1)), + previous_latency_predictions_impl_(base::Microseconds(-1)), + event_latency_predictions_( +- CompositorFrameReporter::EventLatencyInfo(kNumDispatchStages, +- kNumOfCompositorStages)) { ++ CompositorFrameReporter::EventLatencyInfo(kNumDispatchStages3, ++ kNumOfCompositorStages3)) { + if (should_report_ukm) { + // UKM metrics should be reported if and only if `latency_ukm_reporter` is + // set on `global_trackers_`. +@@ -446,9 +446,9 @@ void CompositorFrameReportingController::ReportMultipleSwaps( + + const auto trace_track = + perfetto::Track(base::trace_event::GetNextGlobalTraceId()); +- TRACE_EVENT_BEGIN(kTraceCategory, "MultipleSwaps", trace_track, ++ TRACE_EVENT_BEGIN(kTraceCategory3, "MultipleSwaps", trace_track, + latest_swap_times_.front()); +- TRACE_EVENT_END(kTraceCategory, trace_track, latest_swap_times_.back()); ++ TRACE_EVENT_END(kTraceCategory3, trace_track, latest_swap_times_.back()); + } + } + } +diff --git a/cc/metrics/frame_sequence_tracker.cc b/cc/metrics/frame_sequence_tracker.cc +index 7d00a3869..640ad838b 100644 +--- a/cc/metrics/frame_sequence_tracker.cc ++++ b/cc/metrics/frame_sequence_tracker.cc +@@ -38,7 +38,7 @@ namespace cc { + + namespace { + +-constexpr char kTraceCategory[] = ++constexpr char kTraceCategoryFST[] = + "cc,benchmark," TRACE_DISABLED_BY_DEFAULT("devtools.timeline.frame"); + + } // namespace +@@ -95,7 +95,7 @@ FrameSequenceTracker::FrameSequenceTracker( + // TODO(crbug.com/1158439): remove the trace event once the validation is + // completed. + TRACE_EVENT_NESTABLE_ASYNC_BEGIN_WITH_TIMESTAMP1( +- kTraceCategory, "TrackerValidation", TRACE_ID_LOCAL(this), ++ kTraceCategoryFST, "TrackerValidation", TRACE_ID_LOCAL(this), + base::TimeTicks::Now(), "name", GetFrameSequenceTrackerTypeName(type)); + } + +@@ -112,7 +112,7 @@ FrameSequenceTracker::FrameSequenceTracker( + + FrameSequenceTracker::~FrameSequenceTracker() { + TRACE_EVENT_NESTABLE_ASYNC_END_WITH_TIMESTAMP2( +- kTraceCategory, "TrackerValidation", TRACE_ID_LOCAL(this), ++ kTraceCategoryFST, "TrackerValidation", TRACE_ID_LOCAL(this), + base::TimeTicks::Now(), "aborted_main", aborted_main_frame_, + "no_damage_main", no_damage_draw_main_frames_); + CleanUp(); +diff --git a/cc/metrics/jank_injector.cc b/cc/metrics/jank_injector.cc +index 659a87079..4bea2cec6 100644 +--- a/cc/metrics/jank_injector.cc ++++ b/cc/metrics/jank_injector.cc +@@ -26,7 +26,7 @@ namespace cc { + + namespace { + +-constexpr char kTraceCategory[] = ++constexpr char kTraceCategoryJI[] = + "cc,benchmark," TRACE_DISABLED_BY_DEFAULT("devtools.timeline.frame"); + + const char kJankInjectionAllowedURLs[] = "allowed_urls"; +@@ -93,7 +93,7 @@ bool IsJankInjectionEnabledForURL(const GURL& url) { + } + + void RunJank(JankInjectionParams params) { +- TRACE_EVENT0(kTraceCategory, "Injected Jank"); ++ TRACE_EVENT0(kTraceCategoryJI, "Injected Jank"); + if (params.busy_loop) { + // Do some useless work, and prevent any weird compiler optimization from + // doing anything here. +diff --git a/cc/metrics/jank_metrics.cc b/cc/metrics/jank_metrics.cc +index f2265296c..b11ac934d 100644 +--- a/cc/metrics/jank_metrics.cc ++++ b/cc/metrics/jank_metrics.cc +@@ -21,10 +21,10 @@ namespace cc { + namespace { + + constexpr uint64_t kMaxNoUpdateFrameQueueLength = 100; +-constexpr int kBuiltinSequenceNum = ++constexpr int kBuiltinJankSequenceNum = + static_cast(FrameSequenceTrackerType::kMaxType) + 1; +-constexpr int kMaximumJankHistogramIndex = 2 * kBuiltinSequenceNum; +-constexpr int kMaximumStaleHistogramIndex = kBuiltinSequenceNum; ++constexpr int kMaximumJankHistogramIndex = 2 * kBuiltinJankSequenceNum; ++constexpr int kMaximumStaleHistogramIndex = kBuiltinJankSequenceNum; + + constexpr base::TimeDelta kStaleHistogramMin = base::Microseconds(1); + constexpr base::TimeDelta kStaleHistogramMax = base::Milliseconds(1000); +@@ -57,7 +57,7 @@ int GetIndexForJankMetric(FrameInfo::SmoothEffectDrivingThread thread_type, + return static_cast(type); + + DCHECK_EQ(thread_type, FrameInfo::SmoothEffectDrivingThread::kCompositor); +- return static_cast(type) + kBuiltinSequenceNum; ++ return static_cast(type) + kBuiltinJankSequenceNum; + } + + int GetIndexForStaleMetric(FrameSequenceTrackerType type) { +diff --git a/components/guest_view/browser/BUILD.gn b/components/guest_view/browser/BUILD.gn +index 522080d36..ca05994da 100644 +--- a/components/guest_view/browser/BUILD.gn ++++ b/components/guest_view/browser/BUILD.gn +@@ -8,7 +8,9 @@ + # remove this assert. + assert(!is_android && !is_ios) + +-static_library("browser") { ++import("//build/config/jumbo.gni") ++ ++jumbo_static_library("browser") { + output_name = "guest_view_browser" + sources = [ + "//components/guest_view/browser/bad_message.cc", +diff --git a/components/guest_view/renderer/BUILD.gn b/components/guest_view/renderer/BUILD.gn +index d12cd543e..b6d983891 100644 +--- a/components/guest_view/renderer/BUILD.gn ++++ b/components/guest_view/renderer/BUILD.gn +@@ -8,7 +8,9 @@ + # remove this assert. + assert(!is_android && !is_ios) + +-static_library("renderer") { ++import("//build/config/jumbo.gni") ++ ++jumbo_static_library("renderer") { + sources = [ + "guest_view_container.cc", + "guest_view_container.h", +diff --git a/components/metrics/metrics_log.cc b/components/metrics/metrics_log.cc +index a5710fd56..6a24d2f0e 100644 +--- a/components/metrics/metrics_log.cc ++++ b/components/metrics/metrics_log.cc +@@ -305,8 +305,8 @@ void MetricsLog::RecordCoreSystemProfile(MetricsServiceClient* client, + // Exclude these switches which are very frequently on the command line but + // serve no meaningful purpose. + static const char* const kSwitchesToFilter[] = { +- switches::kFlagSwitchesBegin, +- switches::kFlagSwitchesEnd, ++ ::switches::kFlagSwitchesBegin, ++ ::switches::kFlagSwitchesEnd, + }; + + for (const char* filter_switch : kSwitchesToFilter) +diff --git a/components/metrics/metrics_state_manager.cc b/components/metrics/metrics_state_manager.cc +index 7fdd69f29..ac83d6ebf 100644 +--- a/components/metrics/metrics_state_manager.cc ++++ b/components/metrics/metrics_state_manager.cc +@@ -545,8 +545,8 @@ MetricsStateManager::CreateEntropyProviders() { + return std::make_unique( + GetHighEntropySource(), + variations::ValueInRange{ +- .value = base::checked_cast(GetLowEntropySource()), +- .range = EntropyState::kMaxLowEntropySize}, ++ /*.value =*/ base::checked_cast(GetLowEntropySource()), ++ /*.range =*/ EntropyState::kMaxLowEntropySize}, + ShouldEnableBenchmarking(entropy_params_.force_benchmarking_mode)); + } + +diff --git a/components/performance_manager/BUILD.gn b/components/performance_manager/BUILD.gn +index 76794b25e..70974514a 100644 +--- a/components/performance_manager/BUILD.gn ++++ b/components/performance_manager/BUILD.gn +@@ -2,13 +2,14 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/jumbo.gni") + import("//third_party/protobuf/proto_library.gni") + + proto_library("site_data_proto") { + sources = [ "persistence/site_data/site_data.proto" ] + } + +-static_library("performance_manager") { ++jumbo_static_library("performance_manager") { + sources = [ + "binders.cc", + "browser_child_process_host_proxy.cc", +@@ -244,6 +245,7 @@ static_library("performance_manager") { + "graph/policies/bfcache_policy.cc", + "graph/policies/bfcache_policy.h", + ] ++ jumbo_excluded_sources = [ "decorators/site_data_recorder.cc" ] + + public_deps += [ + ":site_data_proto", +diff --git a/components/performance_manager/decorators/page_live_state_decorator.cc b/components/performance_manager/decorators/page_live_state_decorator.cc +index 07c8c7b74..5869fe958 100644 +--- a/components/performance_manager/decorators/page_live_state_decorator.cc ++++ b/components/performance_manager/decorators/page_live_state_decorator.cc +@@ -236,8 +236,6 @@ class PageLiveStateDataImpl + const raw_ptr page_node_; + }; + +-const char kDescriberName[] = "PageLiveStateDecorator"; +- + } // namespace + + void PageLiveStateDecorator::Delegate::GetContentSettingsAndReply( +@@ -356,7 +354,7 @@ void PageLiveStateDecorator::SetContentSettings( + + void PageLiveStateDecorator::OnPassedToGraph(Graph* graph) { + graph->GetNodeDataDescriberRegistry()->RegisterDescriber(this, +- kDescriberName); ++ "PageLiveStateDecorator"); + graph->AddPageNodeObserver(this); + } + +diff --git a/components/performance_manager/decorators/page_load_tracker_decorator.cc b/components/performance_manager/decorators/page_load_tracker_decorator.cc +index 9323c673c..3d6b66eda 100644 +--- a/components/performance_manager/decorators/page_load_tracker_decorator.cc ++++ b/components/performance_manager/decorators/page_load_tracker_decorator.cc +@@ -68,8 +68,6 @@ const char* ToString(LoadIdleState state) { + } + } + +-const char kDescriberName[] = "PageLoadTrackerDecorator"; +- + } // namespace + + // static +@@ -94,7 +92,7 @@ void PageLoadTrackerDecorator::OnNetworkAlmostIdleChanged( + void PageLoadTrackerDecorator::OnPassedToGraph(Graph* graph) { + RegisterObservers(graph); + graph->GetNodeDataDescriberRegistry()->RegisterDescriber(this, +- kDescriberName); ++ "PageLoadTrackerDecorator"); + } + + void PageLoadTrackerDecorator::OnTakenFromGraph(Graph* graph) { +diff --git a/components/performance_manager/execution_context_priority/frame_audible_voter.cc b/components/performance_manager/execution_context_priority/frame_audible_voter.cc +index c1ed0a54a..4eef64fef 100644 +--- a/components/performance_manager/execution_context_priority/frame_audible_voter.cc ++++ b/components/performance_manager/execution_context_priority/frame_audible_voter.cc +@@ -13,7 +13,7 @@ namespace execution_context_priority { + + namespace { + +-const execution_context::ExecutionContext* GetExecutionContext( ++const execution_context::ExecutionContext* GetExecutionContext2( + const FrameNode* frame_node) { + return execution_context::ExecutionContextRegistry::GetFromGraph( + frame_node->GetGraph()) +@@ -43,16 +43,16 @@ void FrameAudibleVoter::SetVotingChannel(VotingChannel voting_channel) { + + void FrameAudibleVoter::OnFrameNodeAdded(const FrameNode* frame_node) { + const Vote vote = GetVote(frame_node->IsAudible()); +- voting_channel_.SubmitVote(GetExecutionContext(frame_node), vote); ++ voting_channel_.SubmitVote(GetExecutionContext2(frame_node), vote); + } + + void FrameAudibleVoter::OnBeforeFrameNodeRemoved(const FrameNode* frame_node) { +- voting_channel_.InvalidateVote(GetExecutionContext(frame_node)); ++ voting_channel_.InvalidateVote(GetExecutionContext2(frame_node)); + } + + void FrameAudibleVoter::OnIsAudibleChanged(const FrameNode* frame_node) { + const Vote new_vote = GetVote(frame_node->IsAudible()); +- voting_channel_.ChangeVote(GetExecutionContext(frame_node), new_vote); ++ voting_channel_.ChangeVote(GetExecutionContext2(frame_node), new_vote); + } + + } // namespace execution_context_priority +diff --git a/components/performance_manager/execution_context_priority/frame_visibility_voter.cc b/components/performance_manager/execution_context_priority/frame_visibility_voter.cc +index 669177017..75a854150 100644 +--- a/components/performance_manager/execution_context_priority/frame_visibility_voter.cc ++++ b/components/performance_manager/execution_context_priority/frame_visibility_voter.cc +@@ -14,7 +14,7 @@ namespace execution_context_priority { + + namespace { + +-const execution_context::ExecutionContext* GetExecutionContext( ++const execution_context::ExecutionContext* GetExecutionContext5( + const FrameNode* frame_node) { + return execution_context::ExecutionContextRegistry::GetFromGraph( + frame_node->GetGraph()) +@@ -23,7 +23,7 @@ const execution_context::ExecutionContext* GetExecutionContext( + + // Returns a vote with the appropriate priority depending on the frame's + // |visibility|. +-Vote GetVote(FrameNode::Visibility visibility) { ++Vote GetVote2(FrameNode::Visibility visibility) { + base::TaskPriority priority; + switch (visibility) { + case FrameNode::Visibility::kUnknown: +@@ -53,25 +53,25 @@ void FrameVisibilityVoter::SetVotingChannel(VotingChannel voting_channel) { + } + + void FrameVisibilityVoter::OnFrameNodeAdded(const FrameNode* frame_node) { +- const Vote vote = GetVote(frame_node->GetVisibility()); +- voting_channel_.SubmitVote(GetExecutionContext(frame_node), vote); ++ const Vote vote = GetVote2(frame_node->GetVisibility()); ++ voting_channel_.SubmitVote(GetExecutionContext5(frame_node), vote); + } + + void FrameVisibilityVoter::OnBeforeFrameNodeRemoved( + const FrameNode* frame_node) { +- voting_channel_.InvalidateVote(GetExecutionContext(frame_node)); ++ voting_channel_.InvalidateVote(GetExecutionContext5(frame_node)); + } + + void FrameVisibilityVoter::OnFrameVisibilityChanged( + const FrameNode* frame_node, + FrameNode::Visibility previous_value) { +- const Vote new_vote = GetVote(frame_node->GetVisibility()); ++ const Vote new_vote = GetVote2(frame_node->GetVisibility()); + + // Nothing to change if the new priority is the same as the old one. +- if (new_vote == GetVote(previous_value)) ++ if (new_vote == GetVote2(previous_value)) + return; + +- voting_channel_.ChangeVote(GetExecutionContext(frame_node), new_vote); ++ voting_channel_.ChangeVote(GetExecutionContext5(frame_node), new_vote); + } + + } // namespace execution_context_priority +diff --git a/components/performance_manager/execution_context_priority/inherit_client_priority_voter.cc b/components/performance_manager/execution_context_priority/inherit_client_priority_voter.cc +index 3b637f8d0..54a877287 100644 +--- a/components/performance_manager/execution_context_priority/inherit_client_priority_voter.cc ++++ b/components/performance_manager/execution_context_priority/inherit_client_priority_voter.cc +@@ -16,14 +16,14 @@ namespace execution_context_priority { + + namespace { + +-const execution_context::ExecutionContext* GetExecutionContext( ++const execution_context::ExecutionContext* GetExecutionContext_ICPV( + const FrameNode* frame_node) { + return execution_context::ExecutionContextRegistry::GetFromGraph( + frame_node->GetGraph()) + ->GetExecutionContextForFrameNode(frame_node); + } + +-const execution_context::ExecutionContext* GetExecutionContext( ++const execution_context::ExecutionContext* GetExecutionContext_ICPV( + const WorkerNode* worker_node) { + return execution_context::ExecutionContextRegistry::GetFromGraph( + worker_node->GetGraph()) +@@ -50,7 +50,7 @@ void InheritClientPriorityVoter::SetVotingChannel( + + void InheritClientPriorityVoter::OnFrameNodeAdded(const FrameNode* frame_node) { + bool inserted = voting_channels_ +- .emplace(GetExecutionContext(frame_node), ++ .emplace(GetExecutionContext_ICPV(frame_node), + max_vote_aggregator_.GetVotingChannel()) + .second; + DCHECK(inserted); +@@ -60,7 +60,7 @@ void InheritClientPriorityVoter::OnFrameNodeAdded(const FrameNode* frame_node) { + void InheritClientPriorityVoter::OnBeforeFrameNodeRemoved( + const FrameNode* frame_node) { + DCHECK(frame_node->GetChildWorkerNodes().empty()); +- size_t removed = voting_channels_.erase(GetExecutionContext(frame_node)); ++ size_t removed = voting_channels_.erase(GetExecutionContext_ICPV(frame_node)); + DCHECK_EQ(removed, 1u); + } + +@@ -70,7 +70,7 @@ void InheritClientPriorityVoter::OnPriorityAndReasonChanged( + // The priority of a frame changed. All its children must inherit the new + // priority. + +- auto it = voting_channels_.find(GetExecutionContext(frame_node)); ++ auto it = voting_channels_.find(GetExecutionContext_ICPV(frame_node)); + + // Unknown |frame_node|. Just ignore it until we get notified of its existence + // via OnFrameNodeAdded(). This can happen because another voter received the +@@ -86,7 +86,7 @@ void InheritClientPriorityVoter::OnPriorityAndReasonChanged( + for (const WorkerNode* child_worker_node : + frame_node->GetChildWorkerNodes()) { + const ExecutionContext* child_execution_context = +- GetExecutionContext(child_worker_node); ++ GetExecutionContext_ICPV(child_worker_node); + voting_channel.ChangeVote(child_execution_context, inherited_vote); + } + } +@@ -94,7 +94,7 @@ void InheritClientPriorityVoter::OnPriorityAndReasonChanged( + void InheritClientPriorityVoter::OnWorkerNodeAdded( + const WorkerNode* worker_node) { + bool inserted = voting_channels_ +- .emplace(GetExecutionContext(worker_node), ++ .emplace(GetExecutionContext_ICPV(worker_node), + max_vote_aggregator_.GetVotingChannel()) + .second; + DCHECK(inserted); +@@ -104,7 +104,7 @@ void InheritClientPriorityVoter::OnWorkerNodeAdded( + void InheritClientPriorityVoter::OnBeforeWorkerNodeRemoved( + const WorkerNode* worker_node) { + DCHECK(worker_node->GetChildWorkers().empty()); +- size_t removed = voting_channels_.erase(GetExecutionContext(worker_node)); ++ size_t removed = voting_channels_.erase(GetExecutionContext_ICPV(worker_node)); + DCHECK_EQ(removed, 1u); + } + +@@ -115,14 +115,14 @@ void InheritClientPriorityVoter::OnClientFrameAdded( + // priority. + + // Get the voting channel for the client. +- auto it = voting_channels_.find(GetExecutionContext(client_frame_node)); ++ auto it = voting_channels_.find(GetExecutionContext_ICPV(client_frame_node)); + DCHECK(it != voting_channels_.end()); + auto* voting_channel = &it->second; + + const Vote inherited_vote( + client_frame_node->GetPriorityAndReason().priority(), + kPriorityInheritedReason); +- voting_channel->SubmitVote(GetExecutionContext(worker_node), inherited_vote); ++ voting_channel->SubmitVote(GetExecutionContext_ICPV(worker_node), inherited_vote); + } + + void InheritClientPriorityVoter::OnBeforeClientFrameRemoved( +@@ -132,11 +132,11 @@ void InheritClientPriorityVoter::OnBeforeClientFrameRemoved( + // vote must be invalidated. + + // Get the voting channel for the client. +- auto it = voting_channels_.find(GetExecutionContext(client_frame_node)); ++ auto it = voting_channels_.find(GetExecutionContext_ICPV(client_frame_node)); + DCHECK(it != voting_channels_.end()); + auto* voting_channel = &it->second; + +- voting_channel->InvalidateVote(GetExecutionContext(worker_node)); ++ voting_channel->InvalidateVote(GetExecutionContext_ICPV(worker_node)); + } + + void InheritClientPriorityVoter::OnClientWorkerAdded( +@@ -146,14 +146,14 @@ void InheritClientPriorityVoter::OnClientWorkerAdded( + // priority. + + // Get the voting channel for the client. +- auto it = voting_channels_.find(GetExecutionContext(client_worker_node)); ++ auto it = voting_channels_.find(GetExecutionContext_ICPV(client_worker_node)); + DCHECK(it != voting_channels_.end()); + auto* voting_channel = &it->second; + + const Vote inherited_vote( + client_worker_node->GetPriorityAndReason().priority(), + kPriorityInheritedReason); +- voting_channel->SubmitVote(GetExecutionContext(worker_node), inherited_vote); ++ voting_channel->SubmitVote(GetExecutionContext_ICPV(worker_node), inherited_vote); + } + + void InheritClientPriorityVoter::OnBeforeClientWorkerRemoved( +@@ -163,11 +163,11 @@ void InheritClientPriorityVoter::OnBeforeClientWorkerRemoved( + // vote must be invalidated. + + // Get the voting channel for the client. +- auto it = voting_channels_.find(GetExecutionContext(client_worker_node)); ++ auto it = voting_channels_.find(GetExecutionContext_ICPV(client_worker_node)); + DCHECK(it != voting_channels_.end()); + auto* voting_channel = &it->second; + +- voting_channel->InvalidateVote(GetExecutionContext(worker_node)); ++ voting_channel->InvalidateVote(GetExecutionContext_ICPV(worker_node)); + } + + void InheritClientPriorityVoter::OnPriorityAndReasonChanged( +@@ -176,7 +176,7 @@ void InheritClientPriorityVoter::OnPriorityAndReasonChanged( + // The priority of a worker changed. All its children must inherit the new + // priority. + +- auto it = voting_channels_.find(GetExecutionContext(worker_node)); ++ auto it = voting_channels_.find(GetExecutionContext_ICPV(worker_node)); + + // Unknown |worker_node|. Just ignore it until we get notified of its + // existence via OnWorkerNodeAdded(). +@@ -189,7 +189,7 @@ void InheritClientPriorityVoter::OnPriorityAndReasonChanged( + kPriorityInheritedReason); + for (const WorkerNode* child_worker_node : worker_node->GetChildWorkers()) { + const ExecutionContext* child_execution_context = +- GetExecutionContext(child_worker_node); ++ GetExecutionContext_ICPV(child_worker_node); + voting_channel.ChangeVote(child_execution_context, inherited_vote); + } + } +diff --git a/components/performance_manager/graph/frame_node_impl_describer.cc b/components/performance_manager/graph/frame_node_impl_describer.cc +index 9cc282c2b..6b49ef634 100644 +--- a/components/performance_manager/graph/frame_node_impl_describer.cc ++++ b/components/performance_manager/graph/frame_node_impl_describer.cc +@@ -17,8 +17,6 @@ namespace performance_manager { + + namespace { + +-const char kDescriberName[] = "FrameNodeImpl"; +- + std::string ViewportIntersectionToString( + const absl::optional& viewport_intersection) { + if (!viewport_intersection.has_value()) +@@ -45,7 +43,7 @@ FrameNodeImplDescriber::~FrameNodeImplDescriber() = default; + + void FrameNodeImplDescriber::OnPassedToGraph(Graph* graph) { + graph->GetNodeDataDescriberRegistry()->RegisterDescriber(this, +- kDescriberName); ++ "FrameNodeImpl"); + } + + void FrameNodeImplDescriber::OnTakenFromGraph(Graph* graph) { +diff --git a/components/performance_manager/graph/page_node_impl_describer.cc b/components/performance_manager/graph/page_node_impl_describer.cc +index 46049ddc0..6af5d681a 100644 +--- a/components/performance_manager/graph/page_node_impl_describer.cc ++++ b/components/performance_manager/graph/page_node_impl_describer.cc +@@ -15,8 +15,6 @@ namespace performance_manager { + + namespace { + +-const char kDescriberName[] = "PageNodeImpl"; +- + const char* FreezingVoteToString( + absl::optional freezing_vote) { + if (!freezing_vote) +@@ -32,7 +30,7 @@ PageNodeImplDescriber::~PageNodeImplDescriber() = default; + + void PageNodeImplDescriber::OnPassedToGraph(Graph* graph) { + graph->GetNodeDataDescriberRegistry()->RegisterDescriber(this, +- kDescriberName); ++ "PageNodeImpl"); + } + + void PageNodeImplDescriber::OnTakenFromGraph(Graph* graph) { +diff --git a/components/performance_manager/graph/process_node_impl_describer.cc b/components/performance_manager/graph/process_node_impl_describer.cc +index 31cd844d9..d27751643 100644 +--- a/components/performance_manager/graph/process_node_impl_describer.cc ++++ b/components/performance_manager/graph/process_node_impl_describer.cc +@@ -26,8 +26,6 @@ namespace performance_manager { + + namespace { + +-const char kDescriberName[] = "ProcessNodeImpl"; +- + std::string ContentTypeToString(ProcessNode::ContentType content_type) { + switch (content_type) { + case ProcessNode::ContentType::kExtension: +@@ -125,7 +123,7 @@ base::Time TicksToTime(base::TimeTicks ticks) { + + void ProcessNodeImplDescriber::OnPassedToGraph(Graph* graph) { + graph->GetNodeDataDescriberRegistry()->RegisterDescriber(this, +- kDescriberName); ++ "ProcessNodeImpl"); + } + + void ProcessNodeImplDescriber::OnTakenFromGraph(Graph* graph) { +diff --git a/components/performance_manager/graph/worker_node_impl_describer.cc b/components/performance_manager/graph/worker_node_impl_describer.cc +index 72db192b3..383019b7e 100644 +--- a/components/performance_manager/graph/worker_node_impl_describer.cc ++++ b/components/performance_manager/graph/worker_node_impl_describer.cc +@@ -12,8 +12,6 @@ namespace performance_manager { + + namespace { + +-const char kDescriberName[] = "WorkerNode"; +- + const char* WorkerTypeToString(WorkerNode::WorkerType state) { + switch (state) { + case WorkerNode::WorkerType::kDedicated: +@@ -29,7 +27,7 @@ const char* WorkerTypeToString(WorkerNode::WorkerType state) { + + void WorkerNodeImplDescriber::OnPassedToGraph(Graph* graph) { + graph->GetNodeDataDescriberRegistry()->RegisterDescriber(this, +- kDescriberName); ++ "WorkerNode"); + } + + void WorkerNodeImplDescriber::OnTakenFromGraph(Graph* graph) { +diff --git a/components/performance_manager/performance_manager_registry_impl.cc b/components/performance_manager/performance_manager_registry_impl.cc +index 51bd4bb57..4fead7728 100644 +--- a/components/performance_manager/performance_manager_registry_impl.cc ++++ b/components/performance_manager/performance_manager_registry_impl.cc +@@ -27,15 +27,15 @@ + + namespace performance_manager { + +-namespace { ++namespace performance_manager_registry_impl { + + PerformanceManagerRegistryImpl* g_instance = nullptr; + + } // namespace + + PerformanceManagerRegistryImpl::PerformanceManagerRegistryImpl() { +- DCHECK(!g_instance); +- g_instance = this; ++ DCHECK(!performance_manager_registry_impl::g_instance); ++ performance_manager_registry_impl::g_instance = this; + + // The registry should be created after the PerformanceManager. + DCHECK(PerformanceManager::IsAvailable()); +@@ -46,7 +46,7 @@ PerformanceManagerRegistryImpl::~PerformanceManagerRegistryImpl() { + // TearDown() should have been invoked to reset |g_instance| and clear + // |web_contents_| and |render_process_user_data_| prior to destroying the + // registry. +- DCHECK(!g_instance); ++ DCHECK(!performance_manager_registry_impl::g_instance); + DCHECK(web_contents_.empty()); + DCHECK(render_process_hosts_.empty()); + DCHECK(pm_owned_.empty()); +@@ -57,7 +57,7 @@ PerformanceManagerRegistryImpl::~PerformanceManagerRegistryImpl() { + + // static + PerformanceManagerRegistryImpl* PerformanceManagerRegistryImpl::GetInstance() { +- return g_instance; ++ return performance_manager_registry_impl::g_instance; + } + + void PerformanceManagerRegistryImpl::AddObserver( +@@ -241,8 +241,8 @@ void PerformanceManagerRegistryImpl::TearDown() { + for (auto& observer : observers_) + observer.OnBeforePerformanceManagerDestroyed(); + +- DCHECK_EQ(g_instance, this); +- g_instance = nullptr; ++ DCHECK_EQ(performance_manager_registry_impl::g_instance, this); ++ performance_manager_registry_impl::g_instance = nullptr; + + // Destroy WorkerNodes before ProcessNodes, because ProcessNode checks that it + // has no associated WorkerNode when torn down. +diff --git a/components/performance_manager/persistence/site_data/site_data_cache_factory.cc b/components/performance_manager/persistence/site_data/site_data_cache_factory.cc +index 9c8f5f591..ecdc53171 100644 +--- a/components/performance_manager/persistence/site_data/site_data_cache_factory.cc ++++ b/components/performance_manager/persistence/site_data/site_data_cache_factory.cc +@@ -18,29 +18,29 @@ + + namespace performance_manager { + +-namespace { ++namespace site_data_cache_factory { + SiteDataCacheFactory* g_instance = nullptr; + } // namespace + + SiteDataCacheFactory::SiteDataCacheFactory() { +- DCHECK(!g_instance); +- g_instance = this; ++ DCHECK(!site_data_cache_factory::g_instance); ++ site_data_cache_factory::g_instance = this; + } + + SiteDataCacheFactory::~SiteDataCacheFactory() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); +- DCHECK_EQ(this, g_instance); ++ DCHECK_EQ(this, site_data_cache_factory::g_instance); + // Clear the cache map before unsetting |g_instance| as this will cause some + // calls to |SetDataCacheInspectorForBrowserContext|. + data_cache_map_.clear(); + for (const auto& iter : data_cache_map_) + DCHECK_EQ(0, iter.second->Size()); +- g_instance = nullptr; ++ site_data_cache_factory::g_instance = nullptr; + } + + // static + SiteDataCacheFactory* SiteDataCacheFactory::GetInstance() { +- return g_instance; ++ return site_data_cache_factory::g_instance; + } + + SiteDataCache* SiteDataCacheFactory::GetDataCacheForBrowserContext( +diff --git a/components/policy/core/common/policy_proto_decoders.cc b/components/policy/core/common/policy_proto_decoders.cc +index 36ad07831..24cd0c900 100644 +--- a/components/policy/core/common/policy_proto_decoders.cc ++++ b/components/policy/core/common/policy_proto_decoders.cc +@@ -29,7 +29,7 @@ namespace { + + const char kValue[] = "Value"; + const char kLevel[] = "Level"; +-const char kRecommended[] = "Recommended"; ++const char kRecommendedLocal[] = "Recommended"; + + // Returns true and sets |level| to a PolicyLevel if the policy has been set + // at that level. Returns false if the policy is not set, or has been set at +@@ -254,7 +254,7 @@ bool ParseComponentPolicy(base::Value json, + + PolicyLevel level = POLICY_LEVEL_MANDATORY; + const std::string* level_string = description.FindStringKey(kLevel); +- if (level_string && *level_string == kRecommended) ++ if (level_string && *level_string == kRecommendedLocal) + level = POLICY_LEVEL_RECOMMENDED; + + policy->Set(policy_name, level, scope, source, std::move(value.value()), +diff --git a/components/printing/browser/BUILD.gn b/components/printing/browser/BUILD.gn +index cd2f244c1..a5f46dda2 100644 +--- a/components/printing/browser/BUILD.gn ++++ b/components/printing/browser/BUILD.gn +@@ -2,7 +2,9 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + +-static_library("browser") { ++import("//build/config/jumbo.gni") ++ ++jumbo_static_library("browser") { + sources = [ + "print_composite_client.cc", + "print_composite_client.h", +diff --git a/components/storage_monitor/BUILD.gn b/components/storage_monitor/BUILD.gn +index 546f194a2..4b2302105 100644 +--- a/components/storage_monitor/BUILD.gn ++++ b/components/storage_monitor/BUILD.gn +@@ -4,8 +4,9 @@ + + import("//build/config/chromeos/ui_mode.gni") + import("//build/config/features.gni") ++import("//build/config/jumbo.gni") + +-static_library("storage_monitor") { ++jumbo_static_library("storage_monitor") { + sources = [ + "media_storage_util.cc", + "media_storage_util.h", +diff --git a/components/viz/common/BUILD.gn b/components/viz/common/BUILD.gn +index d8075e84c..6052363c5 100644 +--- a/components/viz/common/BUILD.gn ++++ b/components/viz/common/BUILD.gn +@@ -48,6 +48,7 @@ viz_component("resource_format_utils") { + "viz_resource_format_export.h", + ] + ++ jumbo_excluded_sources = [ "resources/resource_format_utils.cc" ] + configs = [ "//third_party/khronos:khronos_headers" ] + + public_deps = [ ":resource_format" ] +diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn +index bebc21404..c980881f5 100644 +--- a/components/viz/service/BUILD.gn ++++ b/components/viz/service/BUILD.gn +@@ -222,6 +222,17 @@ viz_component("service") { + "viz_service_export.h", + ] + ++ jumbo_excluded_sources = [ ++ "display/display.cc", ++ "display/overlay_processor_on_gpu.cc", ++ "display_embedder/compositor_gpu_thread.cc", ++ "display_embedder/skia_output_device_gl.cc", ++ "display_embedder/skia_output_device_webview.cc", ++ "display_embedder/skia_output_surface_impl_on_gpu.cc", ++ "frame_sinks/frame_sink_manager_impl.cc", ++ "frame_sinks/video_capture/frame_sink_video_capturer_impl.cc", ++ ] ++ + defines = [ "VIZ_SERVICE_IMPLEMENTATION" ] + + deps = [ +@@ -377,6 +388,9 @@ viz_component("service") { + "gl/info_collection_gpu_service_impl.cc", + "gl/info_collection_gpu_service_impl.h", + ] ++ jumbo_excluded_sources += [ ++ "display_embedder/skia_output_device_dcomp.cc", ++ ] + + # SkiaOutputDeviceBufferQueue doesn't support Windows. + sources -= [ +diff --git a/components/viz/service/display/display_resource_provider.h b/components/viz/service/display/display_resource_provider.h +index effa9bca4..b054841de 100644 +--- a/components/viz/service/display/display_resource_provider.h ++++ b/components/viz/service/display/display_resource_provider.h +@@ -28,7 +28,7 @@ + #include "components/viz/service/display/resource_fence.h" + #include "components/viz/service/viz_service_export.h" + #include "gpu/command_buffer/common/sync_token.h" +-#include "third_party/khronos/GLES2/gl2.h" ++//#include "third_party/khronos/GLES2/gl2.h" + #include "ui/gfx/geometry/rect_f.h" + #include "ui/gfx/geometry/size.h" + +diff --git a/components/viz/service/display_embedder/skia_output_device_webview.cc b/components/viz/service/display_embedder/skia_output_device_webview.cc +index 9ad49445e..756d8bb02 100644 +--- a/components/viz/service/display_embedder/skia_output_device_webview.cc ++++ b/components/viz/service/display_embedder/skia_output_device_webview.cc +@@ -18,7 +18,7 @@ + namespace viz { + + namespace { +-constexpr auto kSurfaceColorType = kRGBA_8888_SkColorType; ++constexpr auto kMySurfaceColorType = kRGBA_8888_SkColorType; + } + + SkiaOutputDeviceWebView::SkiaOutputDeviceWebView( +@@ -43,9 +43,9 @@ SkiaOutputDeviceWebView::SkiaOutputDeviceWebView( + DCHECK(context_state_->context()); + + capabilities_.sk_color_types[static_cast(gfx::BufferFormat::RGBA_8888)] = +- kSurfaceColorType; ++ kMySurfaceColorType; + capabilities_.sk_color_types[static_cast(gfx::BufferFormat::BGRA_8888)] = +- kSurfaceColorType; ++ kMySurfaceColorType; + } + + SkiaOutputDeviceWebView::~SkiaOutputDeviceWebView() = default; +@@ -104,7 +104,7 @@ void SkiaOutputDeviceWebView::InitSkiaSurface(unsigned int fbo) { + GrGLFramebufferInfo framebuffer_info; + framebuffer_info.fFBOID = fbo; + framebuffer_info.fFormat = GL_RGBA8; +- SkColorType color_type = kSurfaceColorType; ++ SkColorType color_type = kMySurfaceColorType; + + GrBackendRenderTarget render_target(size_.width(), size_.height(), + /*sampleCnt=*/0, +diff --git a/components/viz/service/transitions/transferable_resource_tracker.cc b/components/viz/service/transitions/transferable_resource_tracker.cc +index a60e0b588..d801bee73 100644 +--- a/components/viz/service/transitions/transferable_resource_tracker.cc ++++ b/components/viz/service/transitions/transferable_resource_tracker.cc +@@ -4,7 +4,7 @@ + + #include "components/viz/service/transitions/transferable_resource_tracker.h" + +-#include ++#include "third_party/khronos/GLES2/gl2.h" + + #include + #include +diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn +index 24283757c..41136221f 100644 +--- a/content/browser/BUILD.gn ++++ b/content/browser/BUILD.gn +@@ -37,6 +37,88 @@ buildflag_header("buildflags") { + flags = [ "USE_SOCKET_BROKER=$use_socket_broker" ] + } + ++jumbo_static_library("devtools_protocol") { ++ configs += [ ++ "//build/config:precompiled_headers", ++ "//content:content_implementation", ++ ] ++ ++ deps = [ ++ "//base", ++ "//content/browser/devtools:devtools_background_services_proto", ++ "//content/browser/devtools:protocol_sources", ++ "//content/common:buildflags", ++ "//services/viz/privileged/mojom", ++ "//third_party/blink/public/mojom:mojom_platform", ++ "//third_party/inspector_protocol:crdtp", ++ ] ++ ++ sources = [ ++ "$target_gen_dir/devtools/protocol/audits.cc", ++ "$target_gen_dir/devtools/protocol/audits.h", ++ "$target_gen_dir/devtools/protocol/background_service.cc", ++ "$target_gen_dir/devtools/protocol/background_service.h", ++ "$target_gen_dir/devtools/protocol/browser.cc", ++ "$target_gen_dir/devtools/protocol/browser.h", ++ "$target_gen_dir/devtools/protocol/dom.cc", ++ "$target_gen_dir/devtools/protocol/dom.h", ++ "$target_gen_dir/devtools/protocol/emulation.cc", ++ "$target_gen_dir/devtools/protocol/emulation.h", ++ "$target_gen_dir/devtools/protocol/fetch.cc", ++ "$target_gen_dir/devtools/protocol/fetch.h", ++ "$target_gen_dir/devtools/protocol/forward.h", ++ "$target_gen_dir/devtools/protocol/input.cc", ++ "$target_gen_dir/devtools/protocol/input.h", ++ "$target_gen_dir/devtools/protocol/inspector.cc", ++ "$target_gen_dir/devtools/protocol/inspector.h", ++ "$target_gen_dir/devtools/protocol/io.cc", ++ "$target_gen_dir/devtools/protocol/io.h", ++ "$target_gen_dir/devtools/protocol/log.cc", ++ "$target_gen_dir/devtools/protocol/log.h", ++ "$target_gen_dir/devtools/protocol/memory.cc", ++ "$target_gen_dir/devtools/protocol/memory.h", ++ "$target_gen_dir/devtools/protocol/network.cc", ++ "$target_gen_dir/devtools/protocol/network.h", ++ "$target_gen_dir/devtools/protocol/overlay.cc", ++ "$target_gen_dir/devtools/protocol/overlay.h", ++ "$target_gen_dir/devtools/protocol/page.cc", ++ "$target_gen_dir/devtools/protocol/page.h", ++ "$target_gen_dir/devtools/protocol/protocol.h", ++ "$target_gen_dir/devtools/protocol/runtime.cc", ++ "$target_gen_dir/devtools/protocol/runtime.h", ++ "$target_gen_dir/devtools/protocol/schema.cc", ++ "$target_gen_dir/devtools/protocol/schema.h", ++ "$target_gen_dir/devtools/protocol/security.cc", ++ "$target_gen_dir/devtools/protocol/security.h", ++ "$target_gen_dir/devtools/protocol/service_worker.cc", ++ "$target_gen_dir/devtools/protocol/service_worker.h", ++ "$target_gen_dir/devtools/protocol/storage.cc", ++ "$target_gen_dir/devtools/protocol/storage.h", ++ "$target_gen_dir/devtools/protocol/system_info.cc", ++ "$target_gen_dir/devtools/protocol/system_info.h", ++ "$target_gen_dir/devtools/protocol/target.cc", ++ "$target_gen_dir/devtools/protocol/target.h", ++ "$target_gen_dir/devtools/protocol/tethering.cc", ++ "$target_gen_dir/devtools/protocol/tethering.h", ++ "$target_gen_dir/devtools/protocol/tracing.cc", ++ "$target_gen_dir/devtools/protocol/tracing.h", ++ ] ++ if (!is_android) { ++ # The WebAuthn devtools protocol API is not supported in Android yet. ++ sources += [ ++ "$target_gen_dir/devtools/protocol/web_authn.cc", ++ "$target_gen_dir/devtools/protocol/web_authn.h", ++ ] ++ } ++ ++ if (use_viz_debugger) { ++ sources += [ ++ "$target_gen_dir/devtools/protocol/visual_debugger.cc", ++ "$target_gen_dir/devtools/protocol/visual_debugger.h", ++ ] ++ } ++} ++ + jumbo_source_set("browser") { + # Only the public target should depend on this. All other targets (even + # internal content ones) should depend on the public one. +@@ -134,8 +218,6 @@ jumbo_source_set("browser") { + "//content/browser/cache_storage:cache_storage_proto", + "//content/browser/content_index:content_index_proto", + "//content/browser/cookie_store:cookie_store_proto", +- "//content/browser/devtools:devtools_background_services_proto", +- "//content/browser/devtools:protocol_sources", + "//content/browser/download:proto", + "//content/browser/file_system_access:proto", + "//content/browser/indexed_db:mojo_bindings", +@@ -292,6 +374,7 @@ jumbo_source_set("browser") { + "//ui/strings:ax_strings", + "//ui/touch_selection", + "//v8:v8_version", ++ ":devtools_protocol", + ] + + public_deps = [ +@@ -307,54 +390,6 @@ jumbo_source_set("browser") { + ] + + sources = [ +- "$target_gen_dir/devtools/protocol/audits.cc", +- "$target_gen_dir/devtools/protocol/audits.h", +- "$target_gen_dir/devtools/protocol/background_service.cc", +- "$target_gen_dir/devtools/protocol/background_service.h", +- "$target_gen_dir/devtools/protocol/browser.cc", +- "$target_gen_dir/devtools/protocol/browser.h", +- "$target_gen_dir/devtools/protocol/dom.cc", +- "$target_gen_dir/devtools/protocol/dom.h", +- "$target_gen_dir/devtools/protocol/emulation.cc", +- "$target_gen_dir/devtools/protocol/emulation.h", +- "$target_gen_dir/devtools/protocol/fetch.cc", +- "$target_gen_dir/devtools/protocol/fetch.h", +- "$target_gen_dir/devtools/protocol/forward.h", +- "$target_gen_dir/devtools/protocol/input.cc", +- "$target_gen_dir/devtools/protocol/input.h", +- "$target_gen_dir/devtools/protocol/inspector.cc", +- "$target_gen_dir/devtools/protocol/inspector.h", +- "$target_gen_dir/devtools/protocol/io.cc", +- "$target_gen_dir/devtools/protocol/io.h", +- "$target_gen_dir/devtools/protocol/log.cc", +- "$target_gen_dir/devtools/protocol/log.h", +- "$target_gen_dir/devtools/protocol/memory.cc", +- "$target_gen_dir/devtools/protocol/memory.h", +- "$target_gen_dir/devtools/protocol/network.cc", +- "$target_gen_dir/devtools/protocol/network.h", +- "$target_gen_dir/devtools/protocol/overlay.cc", +- "$target_gen_dir/devtools/protocol/overlay.h", +- "$target_gen_dir/devtools/protocol/page.cc", +- "$target_gen_dir/devtools/protocol/page.h", +- "$target_gen_dir/devtools/protocol/protocol.h", +- "$target_gen_dir/devtools/protocol/runtime.cc", +- "$target_gen_dir/devtools/protocol/runtime.h", +- "$target_gen_dir/devtools/protocol/schema.cc", +- "$target_gen_dir/devtools/protocol/schema.h", +- "$target_gen_dir/devtools/protocol/security.cc", +- "$target_gen_dir/devtools/protocol/security.h", +- "$target_gen_dir/devtools/protocol/service_worker.cc", +- "$target_gen_dir/devtools/protocol/service_worker.h", +- "$target_gen_dir/devtools/protocol/storage.cc", +- "$target_gen_dir/devtools/protocol/storage.h", +- "$target_gen_dir/devtools/protocol/system_info.cc", +- "$target_gen_dir/devtools/protocol/system_info.h", +- "$target_gen_dir/devtools/protocol/target.cc", +- "$target_gen_dir/devtools/protocol/target.h", +- "$target_gen_dir/devtools/protocol/tethering.cc", +- "$target_gen_dir/devtools/protocol/tethering.h", +- "$target_gen_dir/devtools/protocol/tracing.cc", +- "$target_gen_dir/devtools/protocol/tracing.h", + "about_url_loader_factory.cc", + "about_url_loader_factory.h", + "accessibility/accessibility_tree_formatter_blink.cc", +@@ -2326,6 +2361,8 @@ jumbo_source_set("browser") { + ] + } + ++ jumbo_excluded_sources = [] ++ + # TODO(crbug.com/1327384): Remove `permissions_common`. + # DO NOT add unrelated entries to this block. + deps += [ "//components/permissions:permissions_common" ] +@@ -2339,8 +2376,6 @@ jumbo_source_set("browser") { + + if (use_viz_debugger) { + sources += [ +- "$target_gen_dir/devtools/protocol/visual_debugger.cc", +- "$target_gen_dir/devtools/protocol/visual_debugger.h", + "devtools/protocol/visual_debugger_handler.cc", + "devtools/protocol/visual_debugger_handler.h", + ] +@@ -2624,6 +2659,9 @@ jumbo_source_set("browser") { + ] + public_deps += [ "//ui/base/cursor" ] + deps += [ "//third_party/webrtc_overrides:webrtc_component" ] ++ jumbo_excluded_sources += [ ++ "media/capture/desktop_capture_device.cc", ++ ] + } + if (use_aura) { + sources += [ +@@ -3068,6 +3106,12 @@ jumbo_source_set("browser") { + "webauth/web_authentication_delegate_android.cc", + ] + ++ jumbo_excluded_sources += [ ++ # Files with kJavaLangClass and similar constants: ++ # Bug https://crbug.com/787557. ++ "android/java/java_method.cc", # and in gin_java_bound_object.cc. ++ ] ++ + deps += [ + ":reflection_jni_headers", + "//build/config/freetype", +@@ -3098,10 +3142,6 @@ jumbo_source_set("browser") { + } else { + # Not Android. + sources += [ +- # The WebAuthn devtools protocol API is not supported in Android yet. +- "$target_gen_dir/devtools/protocol/web_authn.cc", +- "$target_gen_dir/devtools/protocol/web_authn.h", +- + # Devtools frontend not included in Android + "devtools/devtools_frontend_host_impl.cc", + "devtools/devtools_frontend_host_impl.h", +diff --git a/content/browser/attribution_reporting/attribution_internals_handler_impl.cc b/content/browser/attribution_reporting/attribution_internals_handler_impl.cc +index 3f7ac7a50..c44d4a5c3 100644 +--- a/content/browser/attribution_reporting/attribution_internals_handler_impl.cc ++++ b/content/browser/attribution_reporting/attribution_internals_handler_impl.cc +@@ -103,7 +103,7 @@ attribution_internals::mojom::WebUISourcePtr WebUISource( + debug_reporting_enabled, attributability); + } + +-void ForwardSourcesToWebUI( ++void ForwardSourcesToWebUI2( + attribution_internals::mojom::Handler::GetActiveSourcesCallback + web_ui_callback, + std::vector active_sources) { +@@ -180,7 +180,7 @@ attribution_internals::mojom::WebUIReportPtr WebUIReport( + return ai_mojom::WebUIReportData::NewAggregatableAttributionData( + ai_mojom::WebUIReportAggregatableAttributionData::New( + std::move(contributions), std::move(attestation_token), +- aggregation_service::SerializeAggregationCoordinator( ++ ::aggregation_service::SerializeAggregationCoordinator( + aggregatable_data.aggregation_coordinator))); + }, + }, +@@ -194,7 +194,7 @@ attribution_internals::mojom::WebUIReportPtr WebUIReport( + std::move(status), std::move(data)); + } + +-void ForwardReportsToWebUI( ++void ForwardReportsToWebUI2( + attribution_internals::mojom::Handler::GetReportsCallback web_ui_callback, + std::vector pending_reports) { + std::vector web_ui_reports; +@@ -242,7 +242,7 @@ void AttributionInternalsHandlerImpl::GetActiveSources( + if (AttributionManager* manager = + AttributionManager::FromWebContents(web_ui_->GetWebContents())) { + manager->GetActiveSourcesForWebUI( +- base::BindOnce(&ForwardSourcesToWebUI, std::move(callback))); ++ base::BindOnce(&ForwardSourcesToWebUI2, std::move(callback))); + } else { + std::move(callback).Run({}); + } +@@ -256,7 +256,7 @@ void AttributionInternalsHandlerImpl::GetReports( + manager->GetPendingReportsForInternalUse( + AttributionReport::Types{report_type}, + /*limit=*/1000, +- base::BindOnce(&ForwardReportsToWebUI, std::move(callback))); ++ base::BindOnce(&ForwardReportsToWebUI2, std::move(callback))); + } else { + std::move(callback).Run({}); + } +diff --git a/content/browser/attribution_reporting/attribution_storage_sql.cc b/content/browser/attribution_reporting/attribution_storage_sql.cc +index 70ae8f52f..c8bd2311b 100644 +--- a/content/browser/attribution_reporting/attribution_storage_sql.cc ++++ b/content/browser/attribution_reporting/attribution_storage_sql.cc +@@ -90,7 +90,7 @@ using EventLevelResult = ::content::AttributionTrigger::EventLevelResult; + + using ::attribution_reporting::SuitableOrigin; + +-const base::FilePath::CharType kDatabasePath[] = ++const base::FilePath::CharType kDatabasePathAttr[] = + FILE_PATH_LITERAL("Conversions"); + + constexpr int64_t kUnsetReportId = -1; +@@ -429,7 +429,7 @@ absl::optional ReadSourceToAttribute( + } + + base::FilePath DatabasePath(const base::FilePath& user_data_directory) { +- return user_data_directory.Append(kDatabasePath); ++ return user_data_directory.Append(kDatabasePathAttr); + } + + } // namespace +diff --git a/content/browser/cookie_store/cookie_change_subscription.cc b/content/browser/cookie_store/cookie_change_subscription.cc +index fd51ab0f7..3232ad7ba 100644 +--- a/content/browser/cookie_store/cookie_change_subscription.cc ++++ b/content/browser/cookie_store/cookie_change_subscription.cc +@@ -14,14 +14,15 @@ + #include "net/cookies/cookie_util.h" + #include "net/first_party_sets/same_party_context.h" + #include "services/network/public/cpp/is_potentially_trustworthy.h" ++#include "third_party/blink/renderer/platform/wtf/assertions.h" + + namespace content { + + namespace { + +-#define STATIC_ASSERT_ENUM(a, b) \ +- static_assert(static_cast(a) == static_cast(b), \ +- "mismatching enums: " #a) ++//#define STATIC_ASSERT_ENUM(a, b) \ ++// static_assert(static_cast(a) == static_cast(b), \ ++// "mismatching enums: " #a) + + STATIC_ASSERT_ENUM(network::mojom::CookieMatchType::EQUALS, + proto::CookieMatchType::EQUALS); +diff --git a/content/browser/devtools/BUILD.gn b/content/browser/devtools/BUILD.gn +index 85be27d29..a16c94dce 100644 +--- a/content/browser/devtools/BUILD.gn ++++ b/content/browser/devtools/BUILD.gn +@@ -82,7 +82,7 @@ action("concatenate_protocols") { + } + + inspector_protocol_generate("protocol_sources") { +- visibility = [ "//content/browser" ] ++ visibility = [ "//content/browser:*" ] + deps = [ ":concatenate_protocols" ] + inspector_protocol_dir = "//third_party/inspector_protocol" + out_dir = target_gen_dir +diff --git a/content/browser/devtools/protocol/page_handler.cc b/content/browser/devtools/protocol/page_handler.cc +index bbb8bc041..1206401de 100644 +--- a/content/browser/devtools/protocol/page_handler.cc ++++ b/content/browser/devtools/protocol/page_handler.cc +@@ -83,7 +83,7 @@ namespace { + constexpr const char* kMhtml = "mhtml"; + constexpr int kDefaultScreenshotQuality = 80; + constexpr int kMaxScreencastFramesInFlight = 2; +-constexpr char kCommandIsOnlyAvailableAtTopTarget[] = ++constexpr char kCommandIsOnlyAvailableAtTopTarget2[] = + "Command can only be executed on top-level targets"; + constexpr char kErrorNotAttached[] = "Not attached to a page"; + constexpr char kErrorInactivePage[] = "Not attached to an active page"; +@@ -2018,7 +2018,7 @@ Response PageHandler::AssureTopLevelActiveFrame() { + return Response::ServerError(kErrorNotAttached); + + if (host_->GetParentOrOuterDocument()) +- return Response::ServerError(kCommandIsOnlyAvailableAtTopTarget); ++ return Response::ServerError(kCommandIsOnlyAvailableAtTopTarget2); + + if (!host_->IsActive()) + return Response::ServerError(kErrorInactivePage); +diff --git a/content/browser/devtools/web_contents_devtools_agent_host.cc b/content/browser/devtools/web_contents_devtools_agent_host.cc +index 2b4276b51..28604a064 100644 +--- a/content/browser/devtools/web_contents_devtools_agent_host.cc ++++ b/content/browser/devtools/web_contents_devtools_agent_host.cc +@@ -17,14 +17,14 @@ namespace content { + namespace { + using WebContentsDevToolsMap = + std::map; +-base::LazyInstance::Leaky g_agent_host_instances = ++base::LazyInstance::Leaky g_agent_host_instances2 = + LAZY_INSTANCE_INITIALIZER; + + WebContentsDevToolsAgentHost* FindAgentHost(WebContents* wc) { +- if (!g_agent_host_instances.IsCreated()) ++ if (!g_agent_host_instances2.IsCreated()) + return nullptr; +- auto it = g_agent_host_instances.Get().find(wc); +- return it == g_agent_host_instances.Get().end() ? nullptr : it->second; ++ auto it = g_agent_host_instances2.Get().find(wc); ++ return it == g_agent_host_instances2.Get().end() ? nullptr : it->second; + } + + bool ShouldCreateDevToolsAgentHost(WebContents* wc) { +@@ -146,7 +146,7 @@ WebContentsDevToolsAgentHost::WebContentsDevToolsAgentHost(WebContents* wc) + auto_attacher_(std::make_unique(wc)) { + DCHECK(web_contents()); + bool inserted = +- g_agent_host_instances.Get().insert(std::make_pair(wc, this)).second; ++ g_agent_host_instances2.Get().insert(std::make_pair(wc, this)).second; + DCHECK(inserted); + // Once created, persist till underlying WC is destroyed, so that + // the target id is retained. +@@ -160,10 +160,10 @@ void WebContentsDevToolsAgentHost::PortalActivated(const Portal& portal) { + WebContents* new_wc = portal.GetPortalContents(); + // Assure instrumentation calls for the new WC would be routed here. + DCHECK(new_wc->GetResponsibleWebContents() == new_wc); +- DCHECK(g_agent_host_instances.Get()[old_wc] == this); ++ DCHECK(g_agent_host_instances2.Get()[old_wc] == this); + +- g_agent_host_instances.Get().erase(old_wc); +- g_agent_host_instances.Get()[new_wc] = this; ++ g_agent_host_instances2.Get().erase(old_wc); ++ g_agent_host_instances2.Get()[new_wc] = this; + Observe(portal.GetPortalContents()); + } + DCHECK(auto_attacher_); +@@ -323,7 +323,7 @@ void WebContentsDevToolsAgentHost::WebContentsDestroyed() { + DCHECK_EQ(this, FindAgentHost(web_contents())); + ForceDetachAllSessions(); + auto_attacher_.reset(); +- g_agent_host_instances.Get().erase(web_contents()); ++ g_agent_host_instances2.Get().erase(web_contents()); + Observe(nullptr); + // We may or may not be destruced here, depending on embedders + // potentially retaining references. +diff --git a/content/browser/first_party_sets/first_party_set_parser.cc b/content/browser/first_party_sets/first_party_set_parser.cc +index 9c15a7d2a..61f7ad8a1 100644 +--- a/content/browser/first_party_sets/first_party_set_parser.cc ++++ b/content/browser/first_party_sets/first_party_set_parser.cc +@@ -307,7 +307,7 @@ base::expected ParseSet( + exempt_from_limits + ? absl::nullopt + : absl::make_optional( +- features::kFirstPartySetsMaxAssociatedSites.Get()), ++ ::features::kFirstPartySetsMaxAssociatedSites.Get()), + }, + { + .field_name = kFirstPartySetServiceSitesField, +diff --git a/content/browser/first_party_sets/first_party_sets_handler_impl.cc b/content/browser/first_party_sets/first_party_sets_handler_impl.cc +index 529537fef..c83ba73fe 100644 +--- a/content/browser/first_party_sets/first_party_sets_handler_impl.cc ++++ b/content/browser/first_party_sets/first_party_sets_handler_impl.cc +@@ -262,7 +262,7 @@ absl::optional FirstPartySetsHandlerImpl::FindEntry( + const net::SchemefulSite& site, + const net::FirstPartySetsContextConfig& config) const { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); +- if (!base::FeatureList::IsEnabled(features::kFirstPartySets) || ++ if (!base::FeatureList::IsEnabled(::features::kFirstPartySets) || + !global_sets_.has_value()) { + return absl::nullopt; + } +@@ -283,7 +283,7 @@ void FirstPartySetsHandlerImpl::ClearSiteDataOnChangedSetsForContext( + net::FirstPartySetsCacheFilter)> callback) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + +- if (!enabled_ || !features::kFirstPartySetsClearSiteDataOnChangedSets.Get()) { ++ if (!enabled_ || !::features::kFirstPartySetsClearSiteDataOnChangedSets.Get()) { + std::move(callback).Run(std::move(context_config), + net::FirstPartySetsCacheFilter()); + return; +@@ -312,7 +312,7 @@ void FirstPartySetsHandlerImpl::ClearSiteDataOnChangedSetsForContextInternal( + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK(global_sets_.has_value()); + DCHECK(!browser_context_id.empty()); +- DCHECK(enabled_ && features::kFirstPartySetsClearSiteDataOnChangedSets.Get()); ++ DCHECK(enabled_ && ::features::kFirstPartySetsClearSiteDataOnChangedSets.Get()); + + if (db_helper_.is_null()) { + VLOG(1) << "Invalid First-Party Sets database. Failed to clear site data " +diff --git a/content/browser/gpu/compositor_util.cc b/content/browser/gpu/compositor_util.cc +index 4c013275a..1cae7beb4 100644 +--- a/content/browser/gpu/compositor_util.cc ++++ b/content/browser/gpu/compositor_util.cc +@@ -108,7 +108,7 @@ const GpuFeatureData GetGpuFeatureData( + {"canvas_oop_rasterization", + SafeGetFeatureStatus(gpu_feature_info, + gpu::GPU_FEATURE_TYPE_CANVAS_OOP_RASTERIZATION), +- !base::FeatureList::IsEnabled(features::kCanvasOopRasterization) || ++ !base::FeatureList::IsEnabled(::features::kCanvasOopRasterization) || + command_line.HasSwitch(switches::kDisableAccelerated2dCanvas), + #if 0 + // TODO(crbug.com/1240756): Remove the "#if 0" once OOPR-Canvas is fully +@@ -184,7 +184,7 @@ const GpuFeatureData GetGpuFeatureData( + #if BUILDFLAG(ENABLE_VULKAN) + {"vulkan", + SafeGetFeatureStatus(gpu_feature_info, gpu::GPU_FEATURE_TYPE_VULKAN), +- !features::IsUsingVulkan() && ++ !::features::IsUsingVulkan() && + !command_line.HasSwitch(switches::kUseVulkan) /* disabled */, + DisableInfo::NotProblem(), false /* fallback_to_software */}, + #endif +@@ -195,7 +195,7 @@ const GpuFeatureData GetGpuFeatureData( + {"surface_control", + SafeGetFeatureStatus(gpu_feature_info, + gpu::GPU_FEATURE_TYPE_ANDROID_SURFACE_CONTROL), +- !features::IsAndroidSurfaceControlEnabled(), ++ !::features::IsAndroidSurfaceControlEnabled(), + DisableInfo::Problem( + "Surface Control has been disabled by Finch trial or command line."), + false}, +@@ -208,15 +208,15 @@ const GpuFeatureData GetGpuFeatureData( + DisableInfo::Problem( + "WebGL2 has been disabled via blocklist or the command line."), + false}, +- {"raw_draw", gpu::kGpuFeatureStatusEnabled, !features::IsUsingRawDraw(), ++ {"raw_draw", gpu::kGpuFeatureStatusEnabled, !::features::IsUsingRawDraw(), + DisableInfo::NotProblem(), false}, + {"direct_rendering_display_compositor", gpu::kGpuFeatureStatusEnabled, +- !features::IsDrDcEnabled(), DisableInfo::NotProblem(), false}, ++ !::features::IsDrDcEnabled(), DisableInfo::NotProblem(), false}, + {"webgpu", + SafeGetFeatureStatus(gpu_feature_info, + gpu::GPU_FEATURE_TYPE_ACCELERATED_WEBGPU), + !command_line.HasSwitch(switches::kEnableUnsafeWebGPU) && +- !base::FeatureList::IsEnabled(features::kWebGPUService), ++ !base::FeatureList::IsEnabled(::features::kWebGPUService), + DisableInfo::Problem( + "WebGPU has been disabled via blocklist or the command line."), + false}, +@@ -448,7 +448,7 @@ bool IsZeroCopyUploadEnabled() { + + bool IsPartialRasterEnabled() { + // Partial raster is not supported with RawDraw. +- if (features::IsUsingRawDraw()) ++ if (::features::IsUsingRawDraw()) + return false; + const auto& command_line = *base::CommandLine::ForCurrentProcess(); + return !command_line.HasSwitch(blink::switches::kDisablePartialRaster); +@@ -457,7 +457,7 @@ bool IsPartialRasterEnabled() { + bool IsGpuMemoryBufferCompositorResourcesEnabled() { + // To use Raw Draw, the Raw Draw shared image backing should be used, so + // not use GPU memory buffer shared image backings for compositor resources. +- if (features::IsUsingRawDraw()) { ++ if (::features::IsUsingRawDraw()) { + return false; + } + const base::CommandLine& command_line = +diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc +index 9f1efcdd0..4c798248d 100644 +--- a/content/browser/gpu/gpu_process_host.cc ++++ b/content/browser/gpu/gpu_process_host.cc +@@ -721,7 +721,7 @@ GpuProcessHost::GpuProcessHost(int host_id, GpuProcessKind kind) + #if !BUILDFLAG(IS_ANDROID) + if (!in_process_ && kind != GPU_PROCESS_KIND_INFO_COLLECTION && + base::FeatureList::IsEnabled( +- features::kForwardMemoryPressureEventsToGpuProcess)) { ++ ::features::kForwardMemoryPressureEventsToGpuProcess)) { + memory_pressure_listener_ = std::make_unique( + FROM_HERE, base::BindRepeating(&GpuProcessHost::OnMemoryPressure, + base::Unretained(this))); +diff --git a/content/browser/interest_group/interest_group_manager_impl.cc b/content/browser/interest_group/interest_group_manager_impl.cc +index bd0493b0a..d3593bc84 100644 +--- a/content/browser/interest_group/interest_group_manager_impl.cc ++++ b/content/browser/interest_group/interest_group_manager_impl.cc +@@ -43,7 +43,7 @@ constexpr base::TimeDelta kMaxReportingRoundDuration = base::Minutes(10); + // The time interval to wait before sending the next report after sending one. + constexpr base::TimeDelta kReportingInterval = base::Milliseconds(50); + +-constexpr net::NetworkTrafficAnnotationTag kTrafficAnnotation = ++constexpr net::NetworkTrafficAnnotationTag kTrafficAnnotationIGMI = + net::DefineNetworkTrafficAnnotation("auction_report_sender", R"( + semantics { + sender: "Interest group based Ad Auction report" +@@ -85,7 +85,7 @@ std::unique_ptr BuildSimpleUrlLoader( + resource_request->trusted_params->client_security_state = + std::move(client_security_state); + auto simple_url_loader = network::SimpleURLLoader::Create( +- std::move(resource_request), kTrafficAnnotation); ++ std::move(resource_request), kTrafficAnnotationIGMI); + simple_url_loader->SetTimeoutDuration(base::Seconds(30)); + return simple_url_loader; + } +diff --git a/content/browser/interest_group/interest_group_permissions_checker.cc b/content/browser/interest_group/interest_group_permissions_checker.cc +index 476d997dc..1ef941343 100644 +--- a/content/browser/interest_group/interest_group_permissions_checker.cc ++++ b/content/browser/interest_group/interest_group_permissions_checker.cc +@@ -28,7 +28,7 @@ namespace content { + + namespace { + +-constexpr net::NetworkTrafficAnnotationTag kTrafficAnnotation = ++constexpr net::NetworkTrafficAnnotationTag kTrafficAnnotationIGPC = + net::DefineNetworkTrafficAnnotation("interest_group_well_known_fetcher", R"( + semantics { + sender: "Interest group well-known fetcher" +@@ -142,7 +142,7 @@ void InterestGroupPermissionsChecker::CheckPermissions( + + active_request->second->simple_url_loader = + network::SimpleURLLoader::Create(std::move(resource_request), +- kTrafficAnnotation); ++ kTrafficAnnotationIGPC); + active_request->second->simple_url_loader->SetTimeoutDuration( + kRequestTimeout); + active_request->second->simple_url_loader->SetRequestID( +diff --git a/content/browser/media/media_internals_cdm_helper.cc b/content/browser/media/media_internals_cdm_helper.cc +index 9b7e9b27c..2d6172898 100644 +--- a/content/browser/media/media_internals_cdm_helper.cc ++++ b/content/browser/media/media_internals_cdm_helper.cc +@@ -116,7 +116,7 @@ base::Value::Dict CdmInfoToDict(const CdmInfo& cdm_info) { + return dict; + } + +-std::u16string SerializeUpdate(base::StringPiece function, ++std::u16string SerializeUpdate2(base::StringPiece function, + const base::Value::List& value) { + base::ValueView args[] = {value}; + return content::WebUI::GetJavascriptCall(function, args); +@@ -147,7 +147,7 @@ void MediaInternalsCdmHelper::OnKeySystemCapabilitiesUpdated( + } + + return MediaInternals::GetInstance()->SendUpdate( +- SerializeUpdate("media.updateRegisteredCdms", cdm_list)); ++ SerializeUpdate2("media.updateRegisteredCdms", cdm_list)); + } + + } // namespace content +diff --git a/content/browser/network/cross_origin_embedder_policy_reporter.cc b/content/browser/network/cross_origin_embedder_policy_reporter.cc +index c6e078400..3ad7a82a1 100644 +--- a/content/browser/network/cross_origin_embedder_policy_reporter.cc ++++ b/content/browser/network/cross_origin_embedder_policy_reporter.cc +@@ -14,7 +14,7 @@ namespace content { + + namespace { + +-constexpr char kType[] = "coep"; ++constexpr char kTypeCoep[] = "coep"; + + GURL StripUsernameAndPassword(const GURL& url) { + GURL::Replacements replacements; +@@ -109,7 +109,7 @@ void CrossOriginEmbedderPolicyReporter::QueueAndNotify( + blink::mojom::ReportBodyElement::New("disposition", disposition)); + + observer_->Notify(blink::mojom::Report::New( +- kType, context_url_, blink::mojom::ReportBody::New(std::move(list)))); ++ kTypeCoep, context_url_, blink::mojom::ReportBody::New(std::move(list)))); + } + if (endpoint) { + base::Value::Dict body_to_pass; +@@ -120,7 +120,7 @@ void CrossOriginEmbedderPolicyReporter::QueueAndNotify( + + if (auto* storage_partition = storage_partition_.get()) { + storage_partition->GetNetworkContext()->QueueReport( +- kType, *endpoint, context_url_, reporting_source_, ++ kTypeCoep, *endpoint, context_url_, reporting_source_, + network_anonymization_key_, + /*user_agent=*/absl::nullopt, std::move(body_to_pass)); + } +diff --git a/content/browser/preloading/prerender/prerender_host_registry.cc b/content/browser/preloading/prerender/prerender_host_registry.cc +index 1061f157c..940f00897 100644 +--- a/content/browser/preloading/prerender/prerender_host_registry.cc ++++ b/content/browser/preloading/prerender/prerender_host_registry.cc +@@ -235,7 +235,7 @@ int PrerenderHostRegistry::CreateAndStartHost( + initiator_rfh && + RenderFrameDevToolsAgentHost::GetFor(initiator_rfh) != nullptr; + if (!should_prerender2holdback_be_overridden && +- base::FeatureList::IsEnabled(features::kPrerender2Holdback)) { ++ base::FeatureList::IsEnabled(::features::kPrerender2Holdback)) { + if (attempt) + attempt->SetHoldbackStatus(PreloadingHoldbackStatus::kHoldback); + return RenderFrameHost::kNoFrameTreeNodeId; +diff --git a/content/browser/push_messaging/push_messaging_router.cc b/content/browser/push_messaging/push_messaging_router.cc +index f88e11c5c..4a74837a5 100644 +--- a/content/browser/push_messaging/push_messaging_router.cc ++++ b/content/browser/push_messaging/push_messaging_router.cc +@@ -257,7 +257,7 @@ void PushMessagingRouter::FireSubscriptionChangeEvent( + blink::mojom::PushSubscriptionPtr old_subscription, + PushEventCallback subscription_change_callback) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); +- DCHECK(base::FeatureList::IsEnabled(features::kPushSubscriptionChangeEvent)); ++ DCHECK(base::FeatureList::IsEnabled(::features::kPushSubscriptionChangeEvent)); + + StartServiceWorkerForDispatch( + ServiceWorkerMetrics::EventType::PUSH_SUBSCRIPTION_CHANGE, +@@ -276,7 +276,7 @@ void PushMessagingRouter::FireSubscriptionChangeEventToWorker( + scoped_refptr devtools_context, + blink::ServiceWorkerStatusCode status) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); +- DCHECK(base::FeatureList::IsEnabled(features::kPushSubscriptionChangeEvent)); ++ DCHECK(base::FeatureList::IsEnabled(::features::kPushSubscriptionChangeEvent)); + + if (!service_worker) { + DCHECK_NE(blink::ServiceWorkerStatusCode::kOk, status); +diff --git a/content/browser/renderer_host/agent_scheduling_group_host.cc b/content/browser/renderer_host/agent_scheduling_group_host.cc +index a6d974dce..d6a445355 100644 +--- a/content/browser/renderer_host/agent_scheduling_group_host.cc ++++ b/content/browser/renderer_host/agent_scheduling_group_host.cc +@@ -31,14 +31,6 @@ namespace { + using ::IPC::ChannelMojo; + using ::IPC::ChannelProxy; + using ::IPC::Listener; +-using ::mojo::AssociatedReceiver; +-using ::mojo::AssociatedRemote; +-using ::mojo::PendingAssociatedReceiver; +-using ::mojo::PendingAssociatedRemote; +-using ::mojo::PendingReceiver; +-using ::mojo::PendingRemote; +-using ::mojo::Receiver; +-using ::mojo::Remote; + + static constexpr char kAgentSchedulingGroupHostDataKey[] = + "AgentSchedulingGroupHostUserDataKey"; +@@ -63,10 +55,10 @@ struct AgentSchedulingGroupHostUserData : public base::SupportsUserData::Data { + #endif + }; + +-static features::MBIMode GetMBIMode() { +- return base::FeatureList::IsEnabled(features::kMBIMode) +- ? features::kMBIModeParam.Get() +- : features::MBIMode::kLegacy; ++static ::features::MBIMode GetMBIMode() { ++ return base::FeatureList::IsEnabled(::features::kMBIMode) ++ ? ::features::kMBIModeParam.Get() ++ : ::features::MBIMode::kLegacy; + } + + } // namespace +@@ -88,8 +80,8 @@ AgentSchedulingGroupHost* AgentSchedulingGroupHost::GetOrCreate( + + DCHECK(data); + +- if (GetMBIMode() == features::MBIMode::kLegacy || +- GetMBIMode() == features::MBIMode::kEnabledPerRenderProcessHost) { ++ if (GetMBIMode() == ::features::MBIMode::kLegacy || ++ GetMBIMode() == ::features::MBIMode::kEnabledPerRenderProcessHost) { + // We don't use |data->site_instance_groups| at all when + // AgentSchedulingGroupHost is 1:1 with RenderProcessHost. + #if DCHECK_IS_ON() +@@ -113,7 +105,7 @@ AgentSchedulingGroupHost* AgentSchedulingGroupHost::GetOrCreate( + return data->owned_host_set.begin()->get(); + } + +- DCHECK_EQ(GetMBIMode(), features::MBIMode::kEnabledPerSiteInstance); ++ DCHECK_EQ(GetMBIMode(), ::features::MBIMode::kEnabledPerSiteInstance); + + // If we're in an MBI mode that creates multiple AgentSchedulingGroupHosts + // per RenderProcessHost, then this will be called whenever SiteInstance needs +@@ -231,7 +223,7 @@ void AgentSchedulingGroupHost::AddFilter(BrowserMessageFilter* filter) { + DCHECK(filter); + // When MBI mode is disabled, we forward these kinds of requests straight to + // the underlying `RenderProcessHost`. +- if (GetMBIMode() == features::MBIMode::kLegacy) { ++ if (GetMBIMode() == ::features::MBIMode::kLegacy) { + process_->AddFilter(filter); + return; + } +@@ -272,7 +264,7 @@ base::SafeRef AgentSchedulingGroupHost::GetSafeRef() + ChannelProxy* AgentSchedulingGroupHost::GetChannel() { + DCHECK_EQ(state_, LifecycleState::kBound); + +- if (GetMBIMode() == features::MBIMode::kLegacy) ++ if (GetMBIMode() == ::features::MBIMode::kLegacy) + return process_->GetChannel(); + + DCHECK(channel_); +@@ -284,7 +276,7 @@ bool AgentSchedulingGroupHost::Send(IPC::Message* message) { + + std::unique_ptr msg(message); + +- if (GetMBIMode() == features::MBIMode::kLegacy) ++ if (GetMBIMode() == ::features::MBIMode::kLegacy) + return process_->Send(msg.release()); + + // This DCHECK is too idealistic for now - messages that are handled by +@@ -414,7 +406,7 @@ void AgentSchedulingGroupHost::SetUpIPC() { + // 3. All the ASGH's other associated interfaces can now be initialized via + // `mojo_remote_`, and will be transitively associated with the appropriate + // IPC channel/pipe. +- if (GetMBIMode() == features::MBIMode::kLegacy) { ++ if (GetMBIMode() == ::features::MBIMode::kLegacy) { + process_->GetRendererInterface()->CreateAssociatedAgentSchedulingGroup( + mojo_remote_.BindNewEndpointAndPassReceiver(), + broker_receiver_.BindNewPipeAndPassRemote()); +@@ -422,7 +414,7 @@ void AgentSchedulingGroupHost::SetUpIPC() { + auto io_task_runner = GetIOThreadTaskRunner({}); + + // Empty interface endpoint to pass pipes more easily. +- PendingRemote bootstrap; ++ mojo::PendingRemote bootstrap; + + process_->GetRendererInterface()->CreateAgentSchedulingGroup( + bootstrap.InitWithNewPipeAndPassReceiver(), +diff --git a/content/browser/renderer_host/code_cache_host_impl.h b/content/browser/renderer_host/code_cache_host_impl.h +index d6742b024..b9f34730a 100644 +--- a/content/browser/renderer_host/code_cache_host_impl.h ++++ b/content/browser/renderer_host/code_cache_host_impl.h +@@ -12,6 +12,8 @@ + #include "base/memory/weak_ptr.h" + #include "build/build_config.h" + #include "components/services/storage/public/mojom/cache_storage_control.mojom.h" ++#include "content/browser/code_cache/generated_code_cache.h" ++#include "content/browser/code_cache/generated_code_cache_context.h" + #include "content/common/content_export.h" + #include "mojo/public/cpp/base/big_buffer.h" + #include "mojo/public/cpp/bindings/pending_receiver.h" +@@ -28,8 +30,8 @@ class Origin; + + namespace content { + +-class GeneratedCodeCache; +-class GeneratedCodeCacheContext; ++// class GeneratedCodeCache; ++// class GeneratedCodeCacheContext; + + // The implementation of a CodeCacheHost, which stores and retrieves resource + // metadata, either bytecode or native code, generated by a renderer process. +diff --git a/content/browser/renderer_host/media/media_stream_manager.cc b/content/browser/renderer_host/media/media_stream_manager.cc +index b45f3f65a..f7c81e687 100644 +--- a/content/browser/renderer_host/media/media_stream_manager.cc ++++ b/content/browser/renderer_host/media/media_stream_manager.cc +@@ -201,7 +201,7 @@ MediaDeviceType ConvertToMediaDeviceType(MediaStreamType stream_type) { + return MediaDeviceType::NUM_MEDIA_DEVICE_TYPES; + } + +-const char* DeviceTypeToString(MediaDeviceType type) { ++const char* DeviceTypeToStringMSM(MediaDeviceType type) { + switch (type) { + case MediaDeviceType::MEDIA_AUDIO_INPUT: + return "DEVICE_AUDIO_INPUT"; +@@ -366,7 +366,7 @@ std::string GetStopStreamDeviceLogString( + session_id.ToString().c_str()); + } + +-void SendLogMessage(const std::string& message) { ++void SendLogMessageMSM(const std::string& message) { + MediaStreamManager::SendMessageToNativeLog("MSM::" + message); + } + +@@ -762,7 +762,7 @@ class MediaStreamManager::DeviceRequest { + video_type_(MediaStreamType::NO_SERVICE), + target_process_id_(-1), + target_frame_id_(-1) { +- SendLogMessage(base::StringPrintf( ++ SendLogMessageMSM(base::StringPrintf( + "DR::DeviceRequest({requesting_process_id=%d}, " + "{requesting_frame_id=%d}, {requester_id=%d}, {request_type=%s})", + requesting_process_id, requesting_frame_id, requester_id, +@@ -779,7 +779,7 @@ class MediaStreamManager::DeviceRequest { + void SetAudioType(MediaStreamType audio_type) { + DCHECK(blink::IsAudioInputMediaType(audio_type) || + audio_type == MediaStreamType::NO_SERVICE); +- SendLogMessage(base::StringPrintf( ++ SendLogMessageMSM(base::StringPrintf( + "DR::SetAudioType([requester_id=%d] {audio_type=%s})", requester_id, + StreamTypeToString(audio_type))); + audio_type_ = audio_type; +@@ -800,7 +800,7 @@ class MediaStreamManager::DeviceRequest { + void CreateUIRequest(const std::string& requested_audio_device_id, + const std::string& requested_video_device_id) { + DCHECK(!ui_request_); +- SendLogMessage(base::StringPrintf( ++ SendLogMessageMSM(base::StringPrintf( + "DR::CreateUIRequest([requester_id=%d] {requested_audio_device_id=%s}, " + "{requested_video_device_id=%s})", + requester_id, requested_audio_device_id.c_str(), +@@ -844,7 +844,7 @@ class MediaStreamManager::DeviceRequest { + + // Update the request state and notify observers. + void SetState(MediaStreamType stream_type, MediaRequestState new_state) { +- SendLogMessage(base::StringPrintf( ++ SendLogMessageMSM(base::StringPrintf( + "DR::SetState([requester_id=%d] {stream_type=%s}, {new_state=%s})", + requester_id, StreamTypeToString(stream_type), + RequestStateToString(new_state))); +@@ -1136,7 +1136,7 @@ class MediaStreamManager::MediaAccessRequest + const blink::mojom::StreamDevicesSet& stream_devices_set) override { + DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK(media_access_request_cb_); +- SendLogMessage(base::StringPrintf( ++ SendLogMessageMSM(base::StringPrintf( + "FinalizeMediaAccessRequest({label=%s}, {requester_id=" + "%d}, {request_type=%s})", + label.c_str(), requester_id, RequestTypeToString(request_type()))); +@@ -1202,7 +1202,7 @@ class MediaStreamManager::CreateDeviceRequest + const blink::mojom::StreamDevices& new_devices = + *stream_devices_set.stream_devices[0]; + +- SendLogMessage(base::StringPrintf( ++ SendLogMessageMSM(base::StringPrintf( + "FinalizeChangeDevice({label=%s}, {requester_id=" + "%d}, {request_type=%s})", + label.c_str(), requester_id, RequestTypeToString(request_type()))); +@@ -1486,7 +1486,7 @@ class MediaStreamManager::OpenDeviceRequest + void FinalizeRequest(const std::string& label) override { + DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK(open_device_cb_); +- SendLogMessage(base::StringPrintf( ++ SendLogMessageMSM(base::StringPrintf( + "FinalizeOpenDevice({label=%s}, {requester_id=" + "%d}, {request_type=%s})", + label.c_str(), requester_id, RequestTypeToString(request_type()))); +@@ -1530,7 +1530,7 @@ void MediaStreamManager::SendMessageToNativeLog(const std::string& message) { + + MediaStreamManager::MediaStreamManager(media::AudioSystem* audio_system) + : MediaStreamManager(audio_system, nullptr) { +- SendLogMessage(base::StringPrintf("MediaStreamManager([this=%p]))", this)); ++ SendLogMessageMSM(base::StringPrintf("MediaStreamManager([this=%p]))", this)); + } + + MediaStreamManager::MediaStreamManager( +@@ -1709,7 +1709,7 @@ void MediaStreamManager::GenerateStreams( + DeviceRequestStateChangeCallback device_request_state_change_cb, + DeviceCaptureHandleChangeCallback device_capture_handle_change_cb) { + DCHECK_CURRENTLY_ON(BrowserThread::IO); +- SendLogMessage(GetGenerateStreamsLogString(render_process_id, render_frame_id, ++ SendLogMessageMSM(GetGenerateStreamsLogString(render_process_id, render_frame_id, + requester_id, page_request_id)); + std::unique_ptr request = + std::make_unique( +@@ -1828,7 +1828,7 @@ void MediaStreamManager::CancelRequest(const std::string& label) { + + const DeviceRequests::const_iterator request_it = FindRequestIterator(label); + if (request_it == requests_.end()) { +- SendLogMessage( ++ SendLogMessageMSM( + base::StringPrintf("CancelRequest({label=%s})", label.c_str())); + LOG(ERROR) << "The request with label = " << label << " does not exist."; + return; +@@ -1847,7 +1847,7 @@ void MediaStreamManager::CancelRequest( + const std::string& label = request_it->first; + DeviceRequest* const request = request_it->second.get(); + +- SendLogMessage( ++ SendLogMessageMSM( + base::StringPrintf("CancelRequest({label=%s})", label.c_str())); + + // This is a request for closing one or more devices. +@@ -1906,7 +1906,7 @@ void MediaStreamManager::StopStreamDevice( + const std::string& device_id, + const base::UnguessableToken& session_id) { + DCHECK_CURRENTLY_ON(BrowserThread::IO); +- SendLogMessage(GetStopStreamDeviceLogString( ++ SendLogMessageMSM(GetStopStreamDeviceLogString( + render_process_id, render_frame_id, requester_id, device_id, session_id)); + + // Find the first request for this |render_process_id| and |render_frame_id| +@@ -2007,7 +2007,7 @@ base::UnguessableToken MediaStreamManager::VideoDeviceIdToSessionId( + void MediaStreamManager::StopDevice(MediaStreamType type, + const base::UnguessableToken& session_id) { + DCHECK_CURRENTLY_ON(BrowserThread::IO); +- SendLogMessage(base::StringPrintf("StopDevice({type=%s}, {session_id=%s})", ++ SendLogMessageMSM(base::StringPrintf("StopDevice({type=%s}, {session_id=%s})", + StreamTypeToString(type), + session_id.ToString().c_str())); + DeviceRequests::const_iterator request_it = requests_.begin(); +@@ -2070,7 +2070,7 @@ void MediaStreamManager::StopDevice(MediaStreamType type, + void MediaStreamManager::CloseDevice(MediaStreamType type, + const base::UnguessableToken& session_id) { + DCHECK_CURRENTLY_ON(BrowserThread::IO); +- SendLogMessage(base::StringPrintf("CloseDevice({type=%s}, {session_id=%s})", ++ SendLogMessageMSM(base::StringPrintf("CloseDevice({type=%s}, {session_id=%s})", + StreamTypeToString(type), + session_id.ToString().c_str())); + GetDeviceManager(type)->Close(session_id); +@@ -2127,7 +2127,7 @@ void MediaStreamManager::OpenDevice(int render_process_id, + DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK(type == MediaStreamType::DEVICE_AUDIO_CAPTURE || + type == MediaStreamType::DEVICE_VIDEO_CAPTURE); +- SendLogMessage(GetOpenDeviceLogString(render_process_id, render_frame_id, ++ SendLogMessageMSM(GetOpenDeviceLogString(render_process_id, render_frame_id, + requester_id, page_request_id, + device_id, type)); + StreamControls controls; +@@ -2197,9 +2197,9 @@ void MediaStreamManager::StopRemovedDevice( + DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK(type == MediaDeviceType::MEDIA_AUDIO_INPUT || + type == MediaDeviceType::MEDIA_VIDEO_INPUT); +- SendLogMessage(base::StringPrintf( ++ SendLogMessageMSM(base::StringPrintf( + "StopRemovedDevice({type=%s}, {device=[id: %s, name: %s]}", +- DeviceTypeToString(type), ++ DeviceTypeToStringMSM(type), + media_device_info.device_id.c_str(), + media_device_info.label.c_str()) + .c_str()); +@@ -2289,7 +2289,7 @@ void MediaStreamManager::TranslateDeviceIdToSourceId( + void MediaStreamManager::StartEnumeration(DeviceRequest* request, + const std::string& label) { + DCHECK_CURRENTLY_ON(BrowserThread::IO); +- SendLogMessage( ++ SendLogMessageMSM( + base::StringPrintf("StartEnumeration({requester_id=%d}, {label=%s})", + request->requester_id, label.c_str())); + +@@ -2334,7 +2334,7 @@ MediaStreamManager::AddRequest(std::unique_ptr request) { + unique_label = base::GenerateGUID(); + } while (FindRequest(unique_label) != nullptr); + +- SendLogMessage( ++ SendLogMessageMSM( + base::StringPrintf("AddRequest([requester_id=%d]) => (label=%s)", + request->requester_id, unique_label.c_str())); + request->SetLabel(unique_label); +@@ -2449,7 +2449,7 @@ void MediaStreamManager::DeleteRequest( + DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK(request_it != requests_.end()); + +- SendLogMessage(base::StringPrintf("DeleteRequest([label=%s])", ++ SendLogMessageMSM(base::StringPrintf("DeleteRequest([label=%s])", + request_it->first.c_str())); + #if BUILDFLAG(IS_CHROMEOS) + if (request_it->second->IsGetDisplayMediaSet()) { +@@ -2505,7 +2505,7 @@ void MediaStreamManager::PostRequestToUI( + return; + } + DCHECK(request->HasUIRequest()); +- SendLogMessage( ++ SendLogMessageMSM( + base::StringPrintf("PostRequestToUI({label=%s}, ", label.c_str())); + + const MediaStreamType audio_type = request->audio_type(); +@@ -2543,7 +2543,7 @@ void MediaStreamManager::SetUpRequest(const std::string& label) { + } + DeviceRequest* const request = request_it->second.get(); + +- SendLogMessage( ++ SendLogMessageMSM( + base::StringPrintf("SetUpRequest([requester_id=%d] {label=%s})", + request->requester_id, label.c_str())); + +@@ -2650,7 +2650,7 @@ bool MediaStreamManager::SetUpDeviceCaptureRequest( + request->audio_type() == MediaStreamType::NO_SERVICE) && + (request->video_type() == MediaStreamType::DEVICE_VIDEO_CAPTURE || + request->video_type() == MediaStreamType::NO_SERVICE)); +- SendLogMessage(base::StringPrintf( ++ SendLogMessageMSM(base::StringPrintf( + "SetUpDeviceCaptureRequest([requester_id=%d])", request->requester_id)); + std::string audio_device_id; + if (request->stream_controls().audio.requested() && +@@ -2904,7 +2904,7 @@ void MediaStreamManager::FinalizeGenerateStreams(const std::string& label, + DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK(request); + DCHECK_EQ(request->request_type(), blink::MEDIA_GENERATE_STREAM); +- SendLogMessage( ++ SendLogMessageMSM( + base::StringPrintf("FinalizeGenerateStreams({label=%s}, {requester_id=" + "%d}, {request_type=%s})", + label.c_str(), request->requester_id, +@@ -2947,7 +2947,7 @@ void MediaStreamManager::FinalizeGetOpenDevice(const std::string& label, + DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK(request); + DCHECK_EQ(request->request_type(), blink::MEDIA_GET_OPEN_DEVICE); +- SendLogMessage( ++ SendLogMessageMSM( + base::StringPrintf("FinalizeGetOpenDevice({label=%s}, {requester_id=" + "%d}, {request_type=%s})", + label.c_str(), request->requester_id, +@@ -2987,7 +2987,7 @@ void MediaStreamManager::PanTiltZoomPermissionChecked( + return; + } + +- SendLogMessage(base::StringPrintf( ++ SendLogMessageMSM(base::StringPrintf( + "PanTiltZoomPermissionChecked({label=%s}, {requester_id=" + "%d}, {request_type=%s}, {pan_tilt_zoom_allowed=%d})", + label.c_str(), request->requester_id, +@@ -3039,7 +3039,7 @@ void MediaStreamManager::FinalizeRequestFailed( + + DeviceRequest* const request = request_it->second.get(); + +- SendLogMessage(base::StringPrintf( ++ SendLogMessageMSM(base::StringPrintf( + "FinalizeRequestFailed({label=%s}, {requester_id=%d}, {result=%s})", + request_it->first.c_str(), request->requester_id, + RequestResultToString(result))); +@@ -3132,7 +3132,7 @@ void MediaStreamManager::InitializeMaybeAsync( + std::move(video_capture_provider))); + return; + } +- SendLogMessage(base::StringPrintf("InitializeMaybeAsync([this=%p])", this)); ++ SendLogMessageMSM(base::StringPrintf("InitializeMaybeAsync([this=%p])", this)); + + // Store a pointer to |this| on the IO thread to avoid having to jump to + // the UI thread to fetch a pointer to the MSM. In particular on Android, +@@ -3169,7 +3169,7 @@ void MediaStreamManager::Opened( + MediaStreamType stream_type, + const base::UnguessableToken& capture_session_id) { + DCHECK_CURRENTLY_ON(BrowserThread::IO); +- SendLogMessage(base::StringPrintf("Opened({stream_type=%s}, {session_id=%s})", ++ SendLogMessageMSM(base::StringPrintf("Opened({stream_type=%s}, {session_id=%s})", + StreamTypeToString(stream_type), + capture_session_id.ToString().c_str())); + +@@ -3282,7 +3282,7 @@ void MediaStreamManager::Closed( + MediaStreamType stream_type, + const base::UnguessableToken& capture_session_id) { + DCHECK_CURRENTLY_ON(BrowserThread::IO); +- SendLogMessage(base::StringPrintf("Closed({stream_type=%s}, {session_id=%s})", ++ SendLogMessageMSM(base::StringPrintf("Closed({stream_type=%s}, {session_id=%s})", + StreamTypeToString(stream_type), + capture_session_id.ToString().c_str())); + } +@@ -3300,7 +3300,7 @@ void MediaStreamManager::DevicesEnumerated( + } + DeviceRequest* const request = request_it->second.get(); + +- SendLogMessage(base::StringPrintf( ++ SendLogMessageMSM(base::StringPrintf( + "DevicesEnumerated({label=%s}, {requester_id=%d}, {request_type=%s})", + label.c_str(), request->requester_id, + RequestTypeToString(request->request_type()))); +@@ -3331,7 +3331,7 @@ void MediaStreamManager::Aborted( + MediaStreamType stream_type, + const base::UnguessableToken& capture_session_id) { + DCHECK_CURRENTLY_ON(BrowserThread::IO); +- SendLogMessage(base::StringPrintf( ++ SendLogMessageMSM(base::StringPrintf( + "Aborted({stream_type=%s}, {session_id=%s})", + StreamTypeToString(stream_type), capture_session_id.ToString().c_str())); + StopDevice(stream_type, capture_session_id); +@@ -3397,7 +3397,7 @@ void MediaStreamManager::HandleAccessRequestResponse( + } + DeviceRequest* const request = request_it->second.get(); + +- SendLogMessage(base::StringPrintf( ++ SendLogMessageMSM(base::StringPrintf( + "HandleAccessRequestResponse({label=%s}, {request=%s}, {result=%s})", + label.c_str(), RequestTypeToString(request->request_type()), + RequestResultToString(result))); +@@ -3493,7 +3493,7 @@ void MediaStreamManager::HandleAccessRequestResponse( + *request->stream_devices_set.stream_devices[stream_index], + device); + request->SetState(device.type, state); +- SendLogMessage(base::StringPrintf( ++ SendLogMessageMSM(base::StringPrintf( + "HandleAccessRequestResponse([label=%s]) => " + "(already opened device: [id: %s, session_id: %s])", + label.c_str(), device.id.c_str(), +@@ -3510,7 +3510,7 @@ void MediaStreamManager::HandleAccessRequestResponse( + current_state != MEDIA_REQUEST_STATE_ERROR) { + request->SetState(device.type, MEDIA_REQUEST_STATE_OPENING); + } +- SendLogMessage( ++ SendLogMessageMSM( + base::StringPrintf("HandleAccessRequestResponse([label=%s]) => " + "(opening device: [id: %s, session_id: %s])", + label.c_str(), device.id.c_str(), +@@ -3589,7 +3589,7 @@ void MediaStreamManager::StopMediaStreamFromBrowser(const std::string& label) { + } + DeviceRequest* const request = request_it->second.get(); + +- SendLogMessage(base::StringPrintf("StopMediaStreamFromBrowser({label=%s})", ++ SendLogMessageMSM(base::StringPrintf("StopMediaStreamFromBrowser({label=%s})", + label.c_str())); + + // Notify renderers that the devices in the stream will be stopped. +@@ -3643,7 +3643,7 @@ void MediaStreamManager::ChangeMediaStreamSourceFromBrowser( + } + } + +- SendLogMessage(base::StringPrintf( ++ SendLogMessageMSM(base::StringPrintf( + "ChangeMediaStreamSourceFromBrowser({label=%s})", label.c_str())); + + SetUpDesktopCaptureChangeSourceRequest(request, label, media_id); +@@ -3661,7 +3661,7 @@ void MediaStreamManager::OnRequestStateChangeFromBrowser( + return; + } + +- SendLogMessage(base::StringPrintf("RequestStateChangeFromBrowser({label=%s})", ++ SendLogMessageMSM(base::StringPrintf("RequestStateChangeFromBrowser({label=%s})", + label.c_str())); + + request->OnRequestStateChangeFromBrowser(label, media_id, new_state); +@@ -3692,8 +3692,8 @@ void MediaStreamManager::NotifyDevicesChanged( + MediaDeviceType device_type, + const blink::WebMediaDeviceInfoArray& devices) { + DCHECK_CURRENTLY_ON(BrowserThread::IO); +- SendLogMessage(base::StringPrintf("NotifyDevicesChanged({device_type=%s})", +- DeviceTypeToString(device_type))); ++ SendLogMessageMSM(base::StringPrintf("NotifyDevicesChanged({device_type=%s})", ++ DeviceTypeToStringMSM(device_type))); + + MediaObserver* media_observer = + GetContentClient()->browser()->GetMediaObserver(); +@@ -3721,7 +3721,7 @@ void MediaStreamManager::NotifyDevicesChanged( + + bool MediaStreamManager::RequestDone(const DeviceRequest& request) const { + DCHECK_CURRENTLY_ON(BrowserThread::IO); +- SendLogMessage(base::StringPrintf( ++ SendLogMessageMSM(base::StringPrintf( + "RequestDone({requester_id=%d}, {request_type=%s})", request.requester_id, + RequestTypeToString(request.request_type()))); + +@@ -3985,7 +3985,7 @@ void MediaStreamManager::OnStreamStarted(const std::string& label) { + if (!request) { + return; + } +- SendLogMessage(base::StringPrintf( ++ SendLogMessageMSM(base::StringPrintf( + "OnStreamStarted({label=%s}, {requester_id=%d}, {request_type=%s})", + label.c_str(), request->requester_id, + RequestTypeToString(request->request_type()))); +diff --git a/content/browser/renderer_host/media/media_stream_power_logger.cc b/content/browser/renderer_host/media/media_stream_power_logger.cc +index 733d66510..450a1eb28 100644 +--- a/content/browser/renderer_host/media/media_stream_power_logger.cc ++++ b/content/browser/renderer_host/media/media_stream_power_logger.cc +@@ -11,7 +11,7 @@ + namespace content { + + namespace { +-void SendLogMessage(const std::string& message) { ++void SendLogMessageMSPL(const std::string& message) { + MediaStreamManager::SendMessageToNativeLog("MSPL::" + message); + } + } // namespace +@@ -27,23 +27,23 @@ MediaStreamPowerLogger::~MediaStreamPowerLogger() { + } + + void MediaStreamPowerLogger::OnSuspend() { +- SendLogMessage(base::StringPrintf("OnSuspend([this=%p])", this)); ++ SendLogMessageMSPL(base::StringPrintf("OnSuspend([this=%p])", this)); + } + + void MediaStreamPowerLogger::OnResume() { +- SendLogMessage(base::StringPrintf("OnResume([this=%p])", this)); ++ SendLogMessageMSPL(base::StringPrintf("OnResume([this=%p])", this)); + } + + void MediaStreamPowerLogger::OnThermalStateChange( + base::PowerThermalObserver::DeviceThermalState new_state) { + const char* state_name = + base::PowerMonitorSource::DeviceThermalStateToString(new_state); +- SendLogMessage(base::StringPrintf( ++ SendLogMessageMSPL(base::StringPrintf( + "OnThermalStateChange({this=%p}, {new_state=%s})", this, state_name)); + } + + void MediaStreamPowerLogger::OnSpeedLimitChange(int new_limit) { +- SendLogMessage(base::StringPrintf( ++ SendLogMessageMSPL(base::StringPrintf( + "OnSpeedLimitChange({this=%p}, {new_limit=%d})", this, new_limit)); + } + +diff --git a/content/browser/renderer_host/pepper/pepper_internal_file_ref_backend.cc b/content/browser/renderer_host/pepper/pepper_internal_file_ref_backend.cc +index a1e16c8e7..09a6976d1 100644 +--- a/content/browser/renderer_host/pepper/pepper_internal_file_ref_backend.cc ++++ b/content/browser/renderer_host/pepper/pepper_internal_file_ref_backend.cc +@@ -81,7 +81,7 @@ void CallRemove(scoped_refptr file_system_context, + std::move(callback)); + } + +-void CallTouchFile( ++void CallTouchFile2( + scoped_refptr file_system_context, + const storage::FileSystemURL& url, + const base::Time& last_access_time, +@@ -246,7 +246,7 @@ int32_t PepperInternalFileRefBackend::Touch( + GetIOThreadTaskRunner({})->PostTask( + FROM_HERE, + base::BindOnce( +- CallTouchFile, GetFileSystemContext(), GetFileSystemURL(), ++ CallTouchFile2, GetFileSystemContext(), GetFileSystemURL(), + last_access_time, last_modified_time, + base::BindOnce(&PepperInternalFileRefBackend::DidFinishOnIOThread, + weak_factory_.GetWeakPtr(), reply_context, +diff --git a/content/browser/renderer_host/render_frame_proxy_host.cc b/content/browser/renderer_host/render_frame_proxy_host.cc +index 9fe6bf4e2..20d2ee941 100644 +--- a/content/browser/renderer_host/render_frame_proxy_host.cc ++++ b/content/browser/renderer_host/render_frame_proxy_host.cc +@@ -65,10 +65,10 @@ typedef std::unordered_map::DestructorAtExit + g_routing_id_frame_proxy_map = LAZY_INSTANCE_INITIALIZER; + +-using TokenFrameMap = std::unordered_map; +-base::LazyInstance::Leaky g_token_frame_proxy_map = ++using TokenFrameProxyMap = std::unordered_map; ++base::LazyInstance::Leaky g_token_frame_proxy_map = + LAZY_INSTANCE_INITIALIZER; + + } // namespace +@@ -94,7 +94,7 @@ RenderFrameProxyHost* RenderFrameProxyHost::FromFrameToken( + int process_id, + const blink::RemoteFrameToken& frame_token) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); +- TokenFrameMap* frames = g_token_frame_proxy_map.Pointer(); ++ TokenFrameProxyMap* frames = g_token_frame_proxy_map.Pointer(); + auto it = frames->find(frame_token); + // The check against |process_id| isn't strictly necessary, but represents + // an extra level of protection against a renderer trying to force a frame +@@ -108,7 +108,7 @@ RenderFrameProxyHost* RenderFrameProxyHost::FromFrameToken( + bool RenderFrameProxyHost::IsFrameTokenInUse( + const blink::RemoteFrameToken& frame_token) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); +- TokenFrameMap* frames = g_token_frame_proxy_map.Pointer(); ++ TokenFrameProxyMap* frames = g_token_frame_proxy_map.Pointer(); + return frames->find(frame_token) != frames->end(); + } + +diff --git a/content/browser/service_worker/embedded_worker_instance.cc b/content/browser/service_worker/embedded_worker_instance.cc +index 2f01803d5..3e817c255 100644 +--- a/content/browser/service_worker/embedded_worker_instance.cc ++++ b/content/browser/service_worker/embedded_worker_instance.cc +@@ -872,7 +872,7 @@ EmbeddedWorkerInstance::CreateFactoryBundle( + non_network_factories[url::kDataScheme] = DataURLLoaderFactory::Create(); + // Allow service workers for chrome:// or chrome-untrusted:// based on flags. + if (base::FeatureList::IsEnabled( +- features::kEnableServiceWorkersForChromeScheme) && ++ ::features::kEnableServiceWorkersForChromeScheme) && + origin.scheme() == content::kChromeUIScheme) { + non_network_factories.emplace( + content::kChromeUIScheme, +@@ -880,7 +880,7 @@ EmbeddedWorkerInstance::CreateFactoryBundle( + content::kChromeUIScheme, + base::flat_set())); + } else if (base::FeatureList::IsEnabled( +- features::kEnableServiceWorkersForChromeUntrusted) && ++ ::features::kEnableServiceWorkersForChromeUntrusted) && + origin.scheme() == content::kChromeUIUntrustedScheme) { + non_network_factories.emplace( + content::kChromeUIUntrustedScheme, +diff --git a/content/browser/service_worker/service_worker_context_wrapper.cc b/content/browser/service_worker/service_worker_context_wrapper.cc +index 88a5ecbb0..eb845c720 100644 +--- a/content/browser/service_worker/service_worker_context_wrapper.cc ++++ b/content/browser/service_worker/service_worker_context_wrapper.cc +@@ -1699,7 +1699,7 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest( + } else { + DCHECK(storage_partition()); + if (base::FeatureList::IsEnabled( +- features::kPrivateNetworkAccessForWorkers)) { ++ ::features::kPrivateNetworkAccessForWorkers)) { + if (g_loader_factory_interceptor.Get()) { + g_loader_factory_interceptor.Get().Run(&pending_receiver); + } +@@ -1740,7 +1740,7 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest( + // create a `WebUI` or a `WebUIController` for WebUI Service Workers so we + // register the URLDataSource directly. + if (base::FeatureList::IsEnabled( +- features::kEnableServiceWorkersForChromeScheme) && ++ ::features::kEnableServiceWorkersForChromeScheme) && + scope.scheme_piece() == kChromeUIScheme) { + config->RegisterURLDataSource(browser_context()); + static_cast( +@@ -1750,7 +1750,7 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest( + browser_context(), kChromeUIScheme, + base::flat_set())); + } else if (base::FeatureList::IsEnabled( +- features::kEnableServiceWorkersForChromeUntrusted) && ++ ::features::kEnableServiceWorkersForChromeUntrusted) && + scope.scheme_piece() == kChromeUIUntrustedScheme) { + config->RegisterURLDataSource(browser_context()); + static_cast( +diff --git a/content/browser/service_worker/service_worker_controllee_request_handler.cc b/content/browser/service_worker/service_worker_controllee_request_handler.cc +index e82496b98..7b273e0ac 100644 +--- a/content/browser/service_worker/service_worker_controllee_request_handler.cc ++++ b/content/browser/service_worker/service_worker_controllee_request_handler.cc +@@ -89,7 +89,7 @@ const char* FetchHandlerTypeToString( + const base::flat_set FetchHandlerBypassedHashStrings() { + const static base::NoDestructor> result( + base::SplitString( +- features::kServiceWorkerBypassFetchHandlerBypassedHashStrings.Get(), ++ ::features::kServiceWorkerBypassFetchHandlerBypassedHashStrings.Get(), + ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY)); + + return *result; +@@ -98,22 +98,22 @@ const base::flat_set FetchHandlerBypassedHashStrings() { + bool ShouldBypassFetchHandlerForMainResource( + const std::string& sha256_script_checksum) { + if (!base::FeatureList::IsEnabled( +- features::kServiceWorkerBypassFetchHandler)) { ++ ::features::kServiceWorkerBypassFetchHandler)) { + return false; + } + +- if (features::kServiceWorkerBypassFetchHandlerTarget.Get() != +- features::ServiceWorkerBypassFetchHandlerTarget::kMainResource) { ++ if (::features::kServiceWorkerBypassFetchHandlerTarget.Get() != ++ ::features::ServiceWorkerBypassFetchHandlerTarget::kMainResource) { + return false; + } + + // If the feature is enabled, the main resource request bypasses ServiceWorker + // and starts the worker in parallel for subsequent subresources. +- switch (features::kServiceWorkerBypassFetchHandlerStrategy.Get()) { ++ switch (::features::kServiceWorkerBypassFetchHandlerStrategy.Get()) { + // kFeatureOptIn means that the feature relies on the manual feature + // toggle from about://flags etc, which is triggered by developers. We + // bypass fetch handler regardless of the url matching in this case. +- case features::ServiceWorkerBypassFetchHandlerStrategy::kFeatureOptIn: ++ case ::features::ServiceWorkerBypassFetchHandlerStrategy::kFeatureOptIn: + RecordSkipReason( + ServiceWorkerControlleeRequestHandler::FetchHandlerSkipReason:: + kMainResourceSkippedDueToFeatureFlag); +@@ -121,7 +121,7 @@ bool ShouldBypassFetchHandlerForMainResource( + // If kAllowList, the allowlist should be specified. In this case, main + // resource fetch handlers are bypassed only when the sha256 checksum of the + // script is in the allowlist. +- case features::ServiceWorkerBypassFetchHandlerStrategy::kAllowList: ++ case ::features::ServiceWorkerBypassFetchHandlerStrategy::kAllowList: + if (FetchHandlerBypassedHashStrings().contains(sha256_script_checksum)) { + RecordSkipReason( + ServiceWorkerControlleeRequestHandler::FetchHandlerSkipReason:: +@@ -535,7 +535,7 @@ void ServiceWorkerControlleeRequestHandler::ContinueWithActivatedVersion( + registration->active_version()->CountFeature( + blink::mojom::WebFeature::kServiceWorkerSkippedForEmptyFetchHandler); + CompleteWithoutLoader(); +- if (!features::kStartServiceWorkerForEmptyFetchHandler.Get()) { ++ if (!::features::kStartServiceWorkerForEmptyFetchHandler.Get()) { + return; + } + // Start service worker if it is not running so that we run the code +diff --git a/content/child/BUILD.gn b/content/child/BUILD.gn +index 2a07e5889..e8fb5d7af 100644 +--- a/content/child/BUILD.gn ++++ b/content/child/BUILD.gn +@@ -3,6 +3,7 @@ + # found in the LICENSE file. + + import("//build/config/features.gni") ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + import("//device/vr/buildflags/buildflags.gni") + import("//ppapi/buildflags/buildflags.gni") +@@ -12,9 +13,9 @@ if (is_android) { + } + + if (is_component_build) { +- link_target_type = "source_set" ++ link_target_type = "jumbo_source_set" + } else { +- link_target_type = "static_library" ++ link_target_type = "jumbo_static_library" + } + target(link_target_type, "child") { + # Targets external to content should always link to the public API. +diff --git a/content/common/BUILD.gn b/content/common/BUILD.gn +index d01ad9dbe..4b04d2463 100644 +--- a/content/common/BUILD.gn ++++ b/content/common/BUILD.gn +@@ -4,6 +4,7 @@ + + import("//build/buildflag_header.gni") + import("//build/config/features.gni") ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + import("//content/public/common/zygote/features.gni") + import("//ipc/features.gni") +@@ -59,7 +60,7 @@ if (is_linux || is_chromeos) { + } + } + +-source_set("common") { ++jumbo_source_set("common") { + # Targets external to content should always link to the public API. + # In addition, targets outside of the content component (shell and tests) + # must not link to this because it will duplicate the code in the component +@@ -165,6 +166,11 @@ source_set("common") { + "webid/identity_url_loader_throttle.cc", + "webid/identity_url_loader_throttle.h", + ] ++ jumbo_excluded_sources = [ ++ "common_param_traits.cc", ++ "content_message_generator.cc", ++ "content_param_traits.cc", ++ ] + + configs += [ + "//content:content_implementation", +diff --git a/content/renderer/pepper/pepper_plugin_instance_impl.h b/content/renderer/pepper/pepper_plugin_instance_impl.h +index a3f99906e..0c4e9ede8 100644 +--- a/content/renderer/pepper/pepper_plugin_instance_impl.h ++++ b/content/renderer/pepper/pepper_plugin_instance_impl.h +@@ -66,6 +66,11 @@ + #include "v8/include/v8-forward.h" + #include "v8/include/v8-persistent-handle.h" + ++// Windows defines 'PostMessage', so we have to undef it. ++#ifdef PostMessage ++#undef PostMessage ++#endif ++ + struct PP_Point; + + namespace blink { +diff --git a/content/renderer/service_worker/web_service_worker_provider_impl.cc b/content/renderer/service_worker/web_service_worker_provider_impl.cc +index fa4ee1380..f834261cd 100644 +--- a/content/renderer/service_worker/web_service_worker_provider_impl.cc ++++ b/content/renderer/service_worker/web_service_worker_provider_impl.cc +@@ -32,7 +32,7 @@ const char kLostConnectionErrorMessage[] = + "Lost connection to the service worker system."; + + template +-static std::string MojoEnumToString(T mojo_enum) { ++static std::string MojoEnumToString2(T mojo_enum) { + std::ostringstream oss; + oss << mojo_enum; + return oss.str(); +@@ -232,7 +232,7 @@ void WebServiceWorkerProviderImpl::OnRegistered( + blink::mojom::ServiceWorkerRegistrationObjectInfoPtr registration) { + TRACE_EVENT_NESTABLE_ASYNC_END2( + "ServiceWorker", "WebServiceWorkerProviderImpl::RegisterServiceWorker", +- TRACE_ID_LOCAL(this), "Error", MojoEnumToString(error), "Message", ++ TRACE_ID_LOCAL(this), "Error", MojoEnumToString2(error), "Message", + error_msg ? *error_msg : "Success"); + if (error != blink::mojom::ServiceWorkerErrorType::kNone) { + DCHECK(error_msg); +@@ -258,7 +258,7 @@ void WebServiceWorkerProviderImpl::OnDidGetRegistration( + blink::mojom::ServiceWorkerRegistrationObjectInfoPtr registration) { + TRACE_EVENT_NESTABLE_ASYNC_END2( + "ServiceWorker", "WebServiceWorkerProviderImpl::GetRegistration", +- TRACE_ID_LOCAL(this), "Error", MojoEnumToString(error), "Message", ++ TRACE_ID_LOCAL(this), "Error", MojoEnumToString2(error), "Message", + error_msg ? *error_msg : "Success"); + if (error != blink::mojom::ServiceWorkerErrorType::kNone) { + DCHECK(error_msg); +@@ -288,7 +288,7 @@ void WebServiceWorkerProviderImpl::OnDidGetRegistrations( + infos) { + TRACE_EVENT_NESTABLE_ASYNC_END2( + "ServiceWorker", "WebServiceWorkerProviderImpl::GetRegistrations", +- TRACE_ID_LOCAL(this), "Error", MojoEnumToString(error), "Message", ++ TRACE_ID_LOCAL(this), "Error", MojoEnumToString2(error), "Message", + error_msg ? *error_msg : "Success"); + if (error != blink::mojom::ServiceWorkerErrorType::kNone) { + DCHECK(error_msg); +diff --git a/dbus/message.cc b/dbus/message.cc +index 949ee5d59..47d73816d 100644 +--- a/dbus/message.cc ++++ b/dbus/message.cc +@@ -767,7 +767,7 @@ bool MessageReader::PopBool(bool* value) { + // Like MessageWriter::AppendBool(), we should copy |value| to + // dbus_bool_t, as dbus_message_iter_get_basic() used in PopBasic() + // expects four bytes for DBUS_TYPE_BOOLEAN. +- dbus_bool_t dbus_value = FALSE; ++ dbus_bool_t dbus_value = 0; //FALSE; + const bool success = PopBasic(DBUS_TYPE_BOOLEAN, &dbus_value); + *value = static_cast(dbus_value); + return success; +@@ -962,7 +962,7 @@ bool MessageReader::PopVariantOfByte(uint8_t* value) { + + bool MessageReader::PopVariantOfBool(bool* value) { + // See the comment at MessageReader::PopBool(). +- dbus_bool_t dbus_value = FALSE; ++ dbus_bool_t dbus_value = 0; //FALSE; + const bool success = PopVariantOfBasic(DBUS_TYPE_BOOLEAN, &dbus_value); + *value = static_cast(dbus_value); + return success; +diff --git a/device/fido/cable/cable_discovery_data.h b/device/fido/cable/cable_discovery_data.h +index 66aa16179..8efe2e3f5 100644 +--- a/device/fido/cable/cable_discovery_data.h ++++ b/device/fido/cable/cable_discovery_data.h +@@ -139,7 +139,7 @@ struct COMPONENT_EXPORT(DEVICE_FIDO) Pairing { + // within the structure is validated by using `local_identity_seed` and + // `handshake_hash`. + static absl::optional> Parse( +- const cbor::Value& cbor, ++ const ::cbor::Value& cbor, + tunnelserver::KnownDomainID domain, + base::span local_identity_seed, + base::span handshake_hash); +diff --git a/device/fido/public_key_credential_descriptor.h b/device/fido/public_key_credential_descriptor.h +index d6b40f93e..9ba5c7456 100644 +--- a/device/fido/public_key_credential_descriptor.h ++++ b/device/fido/public_key_credential_descriptor.h +@@ -25,7 +25,7 @@ namespace device { + class COMPONENT_EXPORT(DEVICE_FIDO) PublicKeyCredentialDescriptor { + public: + static absl::optional CreateFromCBORValue( +- const cbor::Value& cbor); ++ const ::cbor::Value& cbor); + + PublicKeyCredentialDescriptor(); + PublicKeyCredentialDescriptor(CredentialType credential_type, +@@ -54,7 +54,7 @@ class COMPONENT_EXPORT(DEVICE_FIDO) PublicKeyCredentialDescriptor { + }; + + COMPONENT_EXPORT(DEVICE_FIDO) +-cbor::Value AsCBOR(const PublicKeyCredentialDescriptor&); ++::cbor::Value AsCBOR(const PublicKeyCredentialDescriptor&); + + } // namespace device + +diff --git a/device/fido/public_key_credential_params.h b/device/fido/public_key_credential_params.h +index fe0c3b063..34a266efb 100644 +--- a/device/fido/public_key_credential_params.h ++++ b/device/fido/public_key_credential_params.h +@@ -31,7 +31,7 @@ class COMPONENT_EXPORT(DEVICE_FIDO) PublicKeyCredentialParams { + }; + + static absl::optional CreateFromCBORValue( +- const cbor::Value& cbor_value); ++ const ::cbor::Value& cbor_value); + + explicit PublicKeyCredentialParams( + std::vector credential_params); +@@ -49,7 +49,7 @@ class COMPONENT_EXPORT(DEVICE_FIDO) PublicKeyCredentialParams { + std::vector public_key_credential_params_; + }; + +-cbor::Value AsCBOR(const PublicKeyCredentialParams&); ++::cbor::Value AsCBOR(const PublicKeyCredentialParams&); + + } // namespace device + +diff --git a/device/fido/public_key_credential_rp_entity.h b/device/fido/public_key_credential_rp_entity.h +index d59250fd1..5a3c194b0 100644 +--- a/device/fido/public_key_credential_rp_entity.h ++++ b/device/fido/public_key_credential_rp_entity.h +@@ -21,7 +21,7 @@ namespace device { + struct COMPONENT_EXPORT(DEVICE_FIDO) PublicKeyCredentialRpEntity { + public: + static absl::optional CreateFromCBORValue( +- const cbor::Value& cbor); ++ const ::cbor::Value& cbor); + + PublicKeyCredentialRpEntity(); + explicit PublicKeyCredentialRpEntity(std::string id); +@@ -38,7 +38,7 @@ struct COMPONENT_EXPORT(DEVICE_FIDO) PublicKeyCredentialRpEntity { + absl::optional name; + }; + +-cbor::Value AsCBOR(const PublicKeyCredentialRpEntity&); ++::cbor::Value AsCBOR(const PublicKeyCredentialRpEntity&); + + } // namespace device + +diff --git a/device/fido/public_key_credential_user_entity.h b/device/fido/public_key_credential_user_entity.h +index 88e554744..87a3febf4 100644 +--- a/device/fido/public_key_credential_user_entity.h ++++ b/device/fido/public_key_credential_user_entity.h +@@ -23,7 +23,7 @@ namespace device { + class COMPONENT_EXPORT(DEVICE_FIDO) PublicKeyCredentialUserEntity { + public: + static absl::optional CreateFromCBORValue( +- const cbor::Value& cbor); ++ const ::cbor::Value& cbor); + + PublicKeyCredentialUserEntity(); + explicit PublicKeyCredentialUserEntity(std::vector id); +@@ -44,7 +44,7 @@ class COMPONENT_EXPORT(DEVICE_FIDO) PublicKeyCredentialUserEntity { + absl::optional display_name; + }; + +-cbor::Value AsCBOR(const PublicKeyCredentialUserEntity&); ++::cbor::Value AsCBOR(const PublicKeyCredentialUserEntity&); + + } // namespace device + +diff --git a/extensions/browser/api/declarative_webrequest/webrequest_condition.cc b/extensions/browser/api/declarative_webrequest/webrequest_condition.cc +index 4023f6750..36345455c 100644 +--- a/extensions/browser/api/declarative_webrequest/webrequest_condition.cc ++++ b/extensions/browser/api/declarative_webrequest/webrequest_condition.cc +@@ -18,8 +18,6 @@ using url_matcher::URLMatcherConditionFactory; + using url_matcher::URLMatcherConditionSet; + using url_matcher::URLMatcherFactory; + +-namespace keys = extensions::declarative_webrequest_constants; +- + namespace { + static base::MatcherStringPattern::ID g_next_id = 0; + +@@ -38,7 +36,7 @@ const char kConditionCannotBeFulfilled[] = "A condition can never be " + + namespace extensions { + +-namespace keys = declarative_webrequest_constants; ++namespace keys_wrc = declarative_webrequest_constants; + + // + // WebRequestData +@@ -128,12 +126,12 @@ std::unique_ptr WebRequestCondition::Create( + + // Verify that we are dealing with a Condition whose type we understand. + const std::string* instance_type = +- condition_dict->FindString(keys::kInstanceTypeKey); ++ condition_dict->FindString(keys_wrc::kInstanceTypeKey); + if (!instance_type) { + *error = kConditionWithoutInstanceType; + return nullptr; + } +- if (*instance_type != keys::kRequestMatcherType) { ++ if (*instance_type != keys_wrc::kRequestMatcherType) { + *error = kExpectedOtherConditionType; + return nullptr; + } +@@ -144,12 +142,12 @@ std::unique_ptr WebRequestCondition::Create( + for (const auto entry : *condition_dict) { + const std::string& condition_attribute_name = entry.first; + const base::Value& condition_attribute_value = entry.second; +- if (condition_attribute_name == keys::kInstanceTypeKey || ++ if (condition_attribute_name == keys_wrc::kInstanceTypeKey || + condition_attribute_name == +- keys::kDeprecatedFirstPartyForCookiesUrlKey || +- condition_attribute_name == keys::kDeprecatedThirdPartyKey) { ++ keys_wrc::kDeprecatedFirstPartyForCookiesUrlKey || ++ condition_attribute_name == keys_wrc::kDeprecatedThirdPartyKey) { + // Skip this. +- } else if (condition_attribute_name == keys::kUrlKey) { ++ } else if (condition_attribute_name == keys_wrc::kUrlKey) { + const base::Value::Dict* dict = condition_attribute_value.GetIfDict(); + if (!dict) { + *error = base::StringPrintf(kInvalidTypeOfParamter, +diff --git a/extensions/browser/api/declarative_webrequest/webrequest_condition_attribute.cc b/extensions/browser/api/declarative_webrequest/webrequest_condition_attribute.cc +index 89d1208d8..5c7237de0 100644 +--- a/extensions/browser/api/declarative_webrequest/webrequest_condition_attribute.cc ++++ b/extensions/browser/api/declarative_webrequest/webrequest_condition_attribute.cc +@@ -35,7 +35,7 @@ using base::CaseInsensitiveCompareASCII; + using base::Value; + + namespace helpers = extension_web_request_api_helpers; +-namespace keys = extensions::declarative_webrequest_constants; ++namespace keys_wrca = extensions::declarative_webrequest_constants; + + namespace extensions { + +@@ -50,31 +50,31 @@ struct WebRequestConditionAttributeFactory { + + WebRequestConditionAttributeFactory() : factory(5) { + factory.RegisterFactoryMethod( +- keys::kResourceTypeKey, FactoryT::IS_PARAMETERIZED, ++ keys_wrca::kResourceTypeKey, FactoryT::IS_PARAMETERIZED, + &WebRequestConditionAttributeResourceType::Create); + + factory.RegisterFactoryMethod( +- keys::kContentTypeKey, FactoryT::IS_PARAMETERIZED, ++ keys_wrca::kContentTypeKey, FactoryT::IS_PARAMETERIZED, + &WebRequestConditionAttributeContentType::Create); + factory.RegisterFactoryMethod( +- keys::kExcludeContentTypeKey, FactoryT::IS_PARAMETERIZED, ++ keys_wrca::kExcludeContentTypeKey, FactoryT::IS_PARAMETERIZED, + &WebRequestConditionAttributeContentType::Create); + + factory.RegisterFactoryMethod( +- keys::kRequestHeadersKey, FactoryT::IS_PARAMETERIZED, ++ keys_wrca::kRequestHeadersKey, FactoryT::IS_PARAMETERIZED, + &WebRequestConditionAttributeRequestHeaders::Create); + factory.RegisterFactoryMethod( +- keys::kExcludeRequestHeadersKey, FactoryT::IS_PARAMETERIZED, ++ keys_wrca::kExcludeRequestHeadersKey, FactoryT::IS_PARAMETERIZED, + &WebRequestConditionAttributeRequestHeaders::Create); + + factory.RegisterFactoryMethod( +- keys::kResponseHeadersKey, FactoryT::IS_PARAMETERIZED, ++ keys_wrca::kResponseHeadersKey, FactoryT::IS_PARAMETERIZED, + &WebRequestConditionAttributeResponseHeaders::Create); + factory.RegisterFactoryMethod( +- keys::kExcludeResponseHeadersKey, FactoryT::IS_PARAMETERIZED, ++ keys_wrca::kExcludeResponseHeadersKey, FactoryT::IS_PARAMETERIZED, + &WebRequestConditionAttributeResponseHeaders::Create); + +- factory.RegisterFactoryMethod(keys::kStagesKey, FactoryT::IS_PARAMETERIZED, ++ factory.RegisterFactoryMethod(keys_wrca::kStagesKey, FactoryT::IS_PARAMETERIZED, + &WebRequestConditionAttributeStages::Create); + } + }; +@@ -128,10 +128,10 @@ WebRequestConditionAttributeResourceType::Create( + const base::Value* value, + std::string* error, + bool* bad_message) { +- DCHECK(instance_type == keys::kResourceTypeKey); ++ DCHECK(instance_type == keys_wrca::kResourceTypeKey); + if (!value->is_list()) { + *error = ErrorUtils::FormatErrorMessage(kInvalidValue, +- keys::kResourceTypeKey); ++ keys_wrca::kResourceTypeKey); + return nullptr; + } + const base::Value::List& list = value->GetList(); +@@ -147,7 +147,7 @@ WebRequestConditionAttributeResourceType::Create( + !ParseWebRequestResourceType(resource_type_string, + &passed_types.back())) { + *error = ErrorUtils::FormatErrorMessage(kInvalidValue, +- keys::kResourceTypeKey); ++ keys_wrca::kResourceTypeKey); + return nullptr; + } + } +@@ -175,7 +175,7 @@ WebRequestConditionAttributeResourceType::GetType() const { + } + + std::string WebRequestConditionAttributeResourceType::GetName() const { +- return keys::kResourceTypeKey; ++ return keys_wrca::kResourceTypeKey; + } + + bool WebRequestConditionAttributeResourceType::Equals( +@@ -208,7 +208,7 @@ WebRequestConditionAttributeContentType::Create( + const base::Value* value, + std::string* error, + bool* bad_message) { +- DCHECK(name == keys::kContentTypeKey || name == keys::kExcludeContentTypeKey); ++ DCHECK(name == keys_wrca::kContentTypeKey || name == keys_wrca::kExcludeContentTypeKey); + + if (!value->is_list()) { + *error = ErrorUtils::FormatErrorMessage(kInvalidValue, name); +@@ -225,7 +225,7 @@ WebRequestConditionAttributeContentType::Create( + + return scoped_refptr( + new WebRequestConditionAttributeContentType( +- content_types, name == keys::kContentTypeKey)); ++ content_types, name == keys_wrca::kContentTypeKey)); + } + + int WebRequestConditionAttributeContentType::GetStages() const { +@@ -259,7 +259,7 @@ WebRequestConditionAttributeContentType::GetType() const { + } + + std::string WebRequestConditionAttributeContentType::GetName() const { +- return (inclusive_ ? keys::kContentTypeKey : keys::kExcludeContentTypeKey); ++ return (inclusive_ ? keys_wrca::kContentTypeKey : keys_wrca::kExcludeContentTypeKey); + } + + bool WebRequestConditionAttributeContentType::Equals( +@@ -458,25 +458,25 @@ HeaderMatcher::HeaderMatchTest::Create(const base::Value::Dict& tests) { + for (const auto entry : tests) { + bool is_name = false; // Is this test for header name? + StringMatchTest::MatchType match_type; +- if (entry.first == keys::kNamePrefixKey) { ++ if (entry.first == keys_wrca::kNamePrefixKey) { + is_name = true; + match_type = StringMatchTest::kPrefix; +- } else if (entry.first == keys::kNameSuffixKey) { ++ } else if (entry.first == keys_wrca::kNameSuffixKey) { + is_name = true; + match_type = StringMatchTest::kSuffix; +- } else if (entry.first == keys::kNameContainsKey) { ++ } else if (entry.first == keys_wrca::kNameContainsKey) { + is_name = true; + match_type = StringMatchTest::kContains; +- } else if (entry.first == keys::kNameEqualsKey) { ++ } else if (entry.first == keys_wrca::kNameEqualsKey) { + is_name = true; + match_type = StringMatchTest::kEquals; +- } else if (entry.first == keys::kValuePrefixKey) { ++ } else if (entry.first == keys_wrca::kValuePrefixKey) { + match_type = StringMatchTest::kPrefix; +- } else if (entry.first == keys::kValueSuffixKey) { ++ } else if (entry.first == keys_wrca::kValueSuffixKey) { + match_type = StringMatchTest::kSuffix; +- } else if (entry.first == keys::kValueContainsKey) { ++ } else if (entry.first == keys_wrca::kValueContainsKey) { + match_type = StringMatchTest::kContains; +- } else if (entry.first == keys::kValueEqualsKey) { ++ } else if (entry.first == keys_wrca::kValueEqualsKey) { + match_type = StringMatchTest::kEquals; + } else { + NOTREACHED(); // JSON schema type checking should prevent this. +@@ -566,8 +566,8 @@ WebRequestConditionAttributeRequestHeaders::Create( + const base::Value* value, + std::string* error, + bool* bad_message) { +- DCHECK(name == keys::kRequestHeadersKey || +- name == keys::kExcludeRequestHeadersKey); ++ DCHECK(name == keys_wrca::kRequestHeadersKey || ++ name == keys_wrca::kExcludeRequestHeadersKey); + + std::unique_ptr header_matcher( + PrepareHeaderMatcher(name, value, error)); +@@ -576,7 +576,7 @@ WebRequestConditionAttributeRequestHeaders::Create( + + return scoped_refptr( + new WebRequestConditionAttributeRequestHeaders( +- std::move(header_matcher), name == keys::kRequestHeadersKey)); ++ std::move(header_matcher), name == keys_wrca::kRequestHeadersKey)); + } + + int WebRequestConditionAttributeRequestHeaders::GetStages() const { +@@ -609,8 +609,8 @@ WebRequestConditionAttributeRequestHeaders::GetType() const { + } + + std::string WebRequestConditionAttributeRequestHeaders::GetName() const { +- return (positive_ ? keys::kRequestHeadersKey +- : keys::kExcludeRequestHeadersKey); ++ return (positive_ ? keys_wrca::kRequestHeadersKey ++ : keys_wrca::kExcludeRequestHeadersKey); + } + + bool WebRequestConditionAttributeRequestHeaders::Equals( +@@ -639,8 +639,8 @@ WebRequestConditionAttributeResponseHeaders::Create( + const base::Value* value, + std::string* error, + bool* bad_message) { +- DCHECK(name == keys::kResponseHeadersKey || +- name == keys::kExcludeResponseHeadersKey); ++ DCHECK(name == keys_wrca::kResponseHeadersKey || ++ name == keys_wrca::kExcludeResponseHeadersKey); + + std::unique_ptr header_matcher( + PrepareHeaderMatcher(name, value, error)); +@@ -649,7 +649,7 @@ WebRequestConditionAttributeResponseHeaders::Create( + + return scoped_refptr( + new WebRequestConditionAttributeResponseHeaders( +- std::move(header_matcher), name == keys::kResponseHeadersKey)); ++ std::move(header_matcher), name == keys_wrca::kResponseHeadersKey)); + } + + int WebRequestConditionAttributeResponseHeaders::GetStages() const { +@@ -689,8 +689,8 @@ WebRequestConditionAttributeResponseHeaders::GetType() const { + } + + std::string WebRequestConditionAttributeResponseHeaders::GetName() const { +- return (positive_ ? keys::kResponseHeadersKey +- : keys::kExcludeResponseHeadersKey); ++ return (positive_ ? keys_wrca::kResponseHeadersKey ++ : keys_wrca::kExcludeResponseHeadersKey); + } + + bool WebRequestConditionAttributeResponseHeaders::Equals( +@@ -723,13 +723,13 @@ bool ParseListOfStages(const base::Value& value, int* out_stages) { + if (!entry.is_string()) + return false; + const std::string& stage_name = entry.GetString(); +- if (stage_name == keys::kOnBeforeRequestEnum) { ++ if (stage_name == keys_wrca::kOnBeforeRequestEnum) { + stages |= ON_BEFORE_REQUEST; +- } else if (stage_name == keys::kOnBeforeSendHeadersEnum) { ++ } else if (stage_name == keys_wrca::kOnBeforeSendHeadersEnum) { + stages |= ON_BEFORE_SEND_HEADERS; +- } else if (stage_name == keys::kOnHeadersReceivedEnum) { ++ } else if (stage_name == keys_wrca::kOnHeadersReceivedEnum) { + stages |= ON_HEADERS_RECEIVED; +- } else if (stage_name == keys::kOnAuthRequiredEnum) { ++ } else if (stage_name == keys_wrca::kOnAuthRequiredEnum) { + stages |= ON_AUTH_REQUIRED; + } else { + NOTREACHED(); // JSON schema checks prevent getting here. +@@ -749,12 +749,12 @@ WebRequestConditionAttributeStages::Create(const std::string& name, + const base::Value* value, + std::string* error, + bool* bad_message) { +- DCHECK(name == keys::kStagesKey); ++ DCHECK(name == keys_wrca::kStagesKey); + + int allowed_stages = 0; + if (!ParseListOfStages(*value, &allowed_stages)) { + *error = ErrorUtils::FormatErrorMessage(kInvalidValue, +- keys::kStagesKey); ++ keys_wrca::kStagesKey); + return nullptr; + } + +@@ -778,7 +778,7 @@ WebRequestConditionAttributeStages::GetType() const { + } + + std::string WebRequestConditionAttributeStages::GetName() const { +- return keys::kStagesKey; ++ return keys_wrca::kStagesKey; + } + + bool WebRequestConditionAttributeStages::Equals( +diff --git a/extensions/browser/api/hid/hid_connection_resource.cc b/extensions/browser/api/hid/hid_connection_resource.cc +index 3105a0d20..337747d59 100644 +--- a/extensions/browser/api/hid/hid_connection_resource.cc ++++ b/extensions/browser/api/hid/hid_connection_resource.cc +@@ -13,14 +13,14 @@ + namespace extensions { + + static base::LazyInstance>>::DestructorAtExit g_factory = ++ ApiResourceManager>>::DestructorAtExit g_factoryHCR = + LAZY_INSTANCE_INITIALIZER; + + // static + template <> + BrowserContextKeyedAPIFactory >* + ApiResourceManager::GetFactoryInstance() { +- return &g_factory.Get(); ++ return &g_factoryHCR.Get(); + } + + HidConnectionResource::HidConnectionResource( +diff --git a/extensions/browser/api/hid/hid_device_manager.cc b/extensions/browser/api/hid/hid_device_manager.cc +index 7c189966f..633879bdf 100644 +--- a/extensions/browser/api/hid/hid_device_manager.cc ++++ b/extensions/browser/api/hid/hid_device_manager.cc +@@ -89,7 +89,7 @@ bool WillDispatchDeviceEvent( + return false; + } + +-HidDeviceManager::HidManagerBinder& GetHidManagerBinderOverride() { ++HidDeviceManager::HidManagerBinder& GetHidDeviceManagerBinderOverride() { + static base::NoDestructor binder; + return *binder; + } +@@ -293,7 +293,7 @@ void HidDeviceManager::LazyInitialize() { + + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); + auto receiver = hid_manager_.BindNewPipeAndPassReceiver(); +- const auto& binder = GetHidManagerBinderOverride(); ++ const auto& binder = GetHidDeviceManagerBinderOverride(); + if (binder) + binder.Run(std::move(receiver)); + else +@@ -314,7 +314,7 @@ void HidDeviceManager::LazyInitialize() { + // static + void HidDeviceManager::OverrideHidManagerBinderForTesting( + HidManagerBinder binder) { +- GetHidManagerBinderOverride() = std::move(binder); ++ GetHidDeviceManagerBinderOverride() = std::move(binder); + } + + base::Value::List HidDeviceManager::CreateApiDeviceList( +diff --git a/extensions/browser/api/usb/usb_device_manager.cc b/extensions/browser/api/usb/usb_device_manager.cc +index 46bdeb624..3153f20c3 100644 +--- a/extensions/browser/api/usb/usb_device_manager.cc ++++ b/extensions/browser/api/usb/usb_device_manager.cc +@@ -68,7 +68,7 @@ bool ShouldExposeDevice(const device::mojom::UsbDeviceInfo& device_info) { + + // Returns true if the given extension has permission to receive events + // regarding this device. +-bool WillDispatchDeviceEvent( ++bool MyWillDispatchDeviceEvent( + const device::mojom::UsbDeviceInfo& device_info, + content::BrowserContext* browser_context, + Feature::Context target_context, +@@ -390,7 +390,7 @@ void UsbDeviceManager::DispatchEvent( + } + + event->will_dispatch_callback = +- base::BindRepeating(&WillDispatchDeviceEvent, std::cref(device_info)); ++ base::BindRepeating(&MyWillDispatchDeviceEvent, std::cref(device_info)); + event_router->BroadcastEvent(std::move(event)); + } + } +diff --git a/extensions/browser/api/usb/usb_device_resource.cc b/extensions/browser/api/usb/usb_device_resource.cc +index 78116ed87..b720bd492 100644 +--- a/extensions/browser/api/usb/usb_device_resource.cc ++++ b/extensions/browser/api/usb/usb_device_resource.cc +@@ -21,14 +21,14 @@ using content::BrowserThread; + namespace extensions { + + static base::LazyInstance>>::DestructorAtExit g_factory = ++ ApiResourceManager>>::DestructorAtExit g_factory2 = + LAZY_INSTANCE_INITIALIZER; + + // static + template <> + BrowserContextKeyedAPIFactory >* + ApiResourceManager::GetFactoryInstance() { +- return g_factory.Pointer(); ++ return g_factory2.Pointer(); + } + + UsbDeviceResource::UsbDeviceResource( +diff --git a/extensions/browser/api/web_request/upload_data_presenter.cc b/extensions/browser/api/web_request/upload_data_presenter.cc +index 7ace7a2a2..c48eb8184 100644 +--- a/extensions/browser/api/web_request/upload_data_presenter.cc ++++ b/extensions/browser/api/web_request/upload_data_presenter.cc +@@ -15,7 +15,7 @@ + #include "extensions/browser/api/web_request/web_request_api_constants.h" + #include "net/base/upload_file_element_reader.h" + +-namespace keys = extension_web_request_api_constants; ++namespace keys_udp = extension_web_request_api_constants; + + namespace { + +@@ -69,13 +69,13 @@ absl::optional RawDataPresenter::TakeResult() { + + void RawDataPresenter::FeedNextBytes(const char* bytes, size_t size) { + subtle::AppendKeyValuePair( +- keys::kRequestBodyRawBytesKey, ++ keys_udp::kRequestBodyRawBytesKey, + base::Value(base::as_bytes(base::make_span(bytes, size))), list_); + } + + void RawDataPresenter::FeedNextFile(const std::string& filename) { + // Insert the file path instead of the contents, which may be too large. +- subtle::AppendKeyValuePair(keys::kRequestBodyRawFileKey, ++ subtle::AppendKeyValuePair(keys_udp::kRequestBodyRawFileKey, + base::Value(filename), list_); + } + +diff --git a/extensions/browser/api/web_request/web_request_api.cc b/extensions/browser/api/web_request/web_request_api.cc +index 21ba17ede..72af15032 100644 +--- a/extensions/browser/api/web_request/web_request_api.cc ++++ b/extensions/browser/api/web_request/web_request_api.cc +@@ -102,7 +102,7 @@ using extensions::mojom::APIPermissionID; + + namespace activity_log = activity_log_web_request_constants; + namespace helpers = extension_web_request_api_helpers; +-namespace keys = extension_web_request_api_constants; ++namespace keys_wra = extension_web_request_api_constants; + using URLLoaderFactoryType = + content::ContentBrowserClient::URLLoaderFactoryType; + using DNRRequestAction = extensions::declarative_net_request::RequestAction; +@@ -144,15 +144,15 @@ const char kWebRequestEventPrefix[] = "webRequest."; + // handled as a normal event (as opposed to a WebRequestEvent at the bindings + // layer). + const char* const kWebRequestEvents[] = { +- keys::kOnBeforeRedirectEvent, ++ keys_wra::kOnBeforeRedirectEvent, + web_request::OnBeforeRequest::kEventName, +- keys::kOnBeforeSendHeadersEvent, +- keys::kOnCompletedEvent, ++ keys_wra::kOnBeforeSendHeadersEvent, ++ keys_wra::kOnCompletedEvent, + web_request::OnErrorOccurred::kEventName, +- keys::kOnSendHeadersEvent, +- keys::kOnAuthRequiredEvent, +- keys::kOnResponseStartedEvent, +- keys::kOnHeadersReceivedEvent, ++ keys_wra::kOnSendHeadersEvent, ++ keys_wra::kOnAuthRequiredEvent, ++ keys_wra::kOnResponseStartedEvent, ++ keys_wra::kOnHeadersReceivedEvent, + }; + + const char* GetRequestStageAsString( +@@ -161,23 +161,23 @@ const char* GetRequestStageAsString( + case ExtensionWebRequestEventRouter::kInvalidEvent: + return "Invalid"; + case ExtensionWebRequestEventRouter::kOnBeforeRequest: +- return keys::kOnBeforeRequest; ++ return keys_wra::kOnBeforeRequest; + case ExtensionWebRequestEventRouter::kOnBeforeSendHeaders: +- return keys::kOnBeforeSendHeaders; ++ return keys_wra::kOnBeforeSendHeaders; + case ExtensionWebRequestEventRouter::kOnSendHeaders: +- return keys::kOnSendHeaders; ++ return keys_wra::kOnSendHeaders; + case ExtensionWebRequestEventRouter::kOnHeadersReceived: +- return keys::kOnHeadersReceived; ++ return keys_wra::kOnHeadersReceived; + case ExtensionWebRequestEventRouter::kOnBeforeRedirect: +- return keys::kOnBeforeRedirect; ++ return keys_wra::kOnBeforeRedirect; + case ExtensionWebRequestEventRouter::kOnAuthRequired: +- return keys::kOnAuthRequired; ++ return keys_wra::kOnAuthRequired; + case ExtensionWebRequestEventRouter::kOnResponseStarted: +- return keys::kOnResponseStarted; ++ return keys_wra::kOnResponseStarted; + case ExtensionWebRequestEventRouter::kOnErrorOccurred: +- return keys::kOnErrorOccurred; ++ return keys_wra::kOnErrorOccurred; + case ExtensionWebRequestEventRouter::kOnCompleted: +- return keys::kOnCompleted; ++ return keys_wra::kOnCompleted; + } + NOTREACHED(); + return "Not reached"; +@@ -197,23 +197,23 @@ ExtensionWebRequestEventRouter::EventTypes GetEventTypeFromEventName( + static base::NoDestructor> + kRequestStageMap( +- {{keys::kOnBeforeRequest, ++ {{keys_wra::kOnBeforeRequest, + ExtensionWebRequestEventRouter::kOnBeforeRequest}, +- {keys::kOnBeforeSendHeaders, ++ {keys_wra::kOnBeforeSendHeaders, + ExtensionWebRequestEventRouter::kOnBeforeSendHeaders}, +- {keys::kOnSendHeaders, ++ {keys_wra::kOnSendHeaders, + ExtensionWebRequestEventRouter::kOnSendHeaders}, +- {keys::kOnHeadersReceived, ++ {keys_wra::kOnHeadersReceived, + ExtensionWebRequestEventRouter::kOnHeadersReceived}, +- {keys::kOnBeforeRedirect, ++ {keys_wra::kOnBeforeRedirect, + ExtensionWebRequestEventRouter::kOnBeforeRedirect}, +- {keys::kOnAuthRequired, ++ {keys_wra::kOnAuthRequired, + ExtensionWebRequestEventRouter::kOnAuthRequired}, +- {keys::kOnResponseStarted, ++ {keys_wra::kOnResponseStarted, + ExtensionWebRequestEventRouter::kOnResponseStarted}, +- {keys::kOnErrorOccurred, ++ {keys_wra::kOnErrorOccurred, + ExtensionWebRequestEventRouter::kOnErrorOccurred}, +- {keys::kOnCompleted, ExtensionWebRequestEventRouter::kOnCompleted}}); ++ {keys_wra::kOnCompleted, ExtensionWebRequestEventRouter::kOnCompleted}}); + + DCHECK_EQ(kRequestStageMap->size(), std::size(kWebRequestEvents)); + +@@ -271,15 +271,15 @@ bool IsRequestFromExtension(const WebRequestInfo& request, + bool FromHeaderDictionary(const base::Value::Dict& header_value, + std::string* name, + std::string* out_value) { +- const std::string* name_ptr = header_value.FindString(keys::kHeaderNameKey); ++ const std::string* name_ptr = header_value.FindString(keys_wra::kHeaderNameKey); + if (!name) + return false; + *name = *name_ptr; + + // We require either a "value" or a "binaryValue" entry. +- const base::Value* value = header_value.Find(keys::kHeaderValueKey); ++ const base::Value* value = header_value.Find(keys_wra::kHeaderValueKey); + const base::Value* binary_value = +- header_value.Find(keys::kHeaderBinaryValueKey); ++ header_value.Find(keys_wra::kHeaderBinaryValueKey); + if (!((value != nullptr) ^ (binary_value != nullptr))) { + return false; + } +@@ -380,18 +380,18 @@ events::HistogramValue GetEventHistogramValue(const std::string& event_name) { + events::HistogramValue histogram_value; + const char* const event_name; + } values_and_names[] = { +- {events::WEB_REQUEST_ON_BEFORE_REDIRECT, keys::kOnBeforeRedirectEvent}, ++ {events::WEB_REQUEST_ON_BEFORE_REDIRECT, keys_wra::kOnBeforeRedirectEvent}, + {events::WEB_REQUEST_ON_BEFORE_REQUEST, + web_request::OnBeforeRequest::kEventName}, + {events::WEB_REQUEST_ON_BEFORE_SEND_HEADERS, +- keys::kOnBeforeSendHeadersEvent}, +- {events::WEB_REQUEST_ON_COMPLETED, keys::kOnCompletedEvent}, ++ keys_wra::kOnBeforeSendHeadersEvent}, ++ {events::WEB_REQUEST_ON_COMPLETED, keys_wra::kOnCompletedEvent}, + {events::WEB_REQUEST_ON_ERROR_OCCURRED, + web_request::OnErrorOccurred::kEventName}, +- {events::WEB_REQUEST_ON_SEND_HEADERS, keys::kOnSendHeadersEvent}, +- {events::WEB_REQUEST_ON_AUTH_REQUIRED, keys::kOnAuthRequiredEvent}, +- {events::WEB_REQUEST_ON_RESPONSE_STARTED, keys::kOnResponseStartedEvent}, +- {events::WEB_REQUEST_ON_HEADERS_RECEIVED, keys::kOnHeadersReceivedEvent}}; ++ {events::WEB_REQUEST_ON_SEND_HEADERS, keys_wra::kOnSendHeadersEvent}, ++ {events::WEB_REQUEST_ON_AUTH_REQUIRED, keys_wra::kOnAuthRequiredEvent}, ++ {events::WEB_REQUEST_ON_RESPONSE_STARTED, keys_wra::kOnResponseStartedEvent}, ++ {events::WEB_REQUEST_ON_HEADERS_RECEIVED, keys_wra::kOnHeadersReceivedEvent}}; + static_assert(std::size(kWebRequestEvents) == std::size(values_and_names), + "kWebRequestEvents and values_and_names must be the same"); + for (const ValueAndName& value_and_name : values_and_names) { +@@ -651,13 +651,13 @@ void WebRequestAPI::Shutdown() { + } + + static base::LazyInstance< +- BrowserContextKeyedAPIFactory>::DestructorAtExit g_factory = ++ BrowserContextKeyedAPIFactory>::DestructorAtExit g_factory_wra = + LAZY_INSTANCE_INITIALIZER; + + // static + BrowserContextKeyedAPIFactory* + WebRequestAPI::GetFactoryInstance() { +- return g_factory.Pointer(); ++ return g_factory_wra.Pointer(); + } + + void WebRequestAPI::OnListenerRemoved(const EventListenerInfo& details) { +@@ -1030,7 +1030,7 @@ bool ExtensionWebRequestEventRouter::RequestFilter::InitFromValue( + if (url.empty() || + pattern.Parse(url) != URLPattern::ParseResult::kSuccess) { + *error = ErrorUtils::FormatErrorMessage( +- keys::kInvalidRequestFilterUrl, url); ++ keys_wra::kInvalidRequestFilterUrl, url); + return false; + } + urls.AddPattern(pattern); +@@ -1285,7 +1285,7 @@ int ExtensionWebRequestEventRouter::OnBeforeSendHeaders( + bool initialize_blocked_requests = false; + + initialize_blocked_requests |= +- ProcessDeclarativeRules(browser_context, keys::kOnBeforeSendHeadersEvent, ++ ProcessDeclarativeRules(browser_context, keys_wra::kOnBeforeSendHeadersEvent, + request, ON_BEFORE_SEND_HEADERS, nullptr); + + DCHECK(request->dnr_actions); +@@ -1297,7 +1297,7 @@ int ExtensionWebRequestEventRouter::OnBeforeSendHeaders( + + int extra_info_spec = 0; + RawListeners listeners = +- GetMatchingListeners(browser_context, keys::kOnBeforeSendHeadersEvent, ++ GetMatchingListeners(browser_context, keys_wra::kOnBeforeSendHeadersEvent, + request, &extra_info_spec); + if (!listeners.empty() && + !GetAndSetSignaled(request->id, kOnBeforeSendHeaders)) { +@@ -1341,7 +1341,7 @@ void ExtensionWebRequestEventRouter::OnSendHeaders( + + int extra_info_spec = 0; + RawListeners listeners = GetMatchingListeners( +- browser_context, keys::kOnSendHeadersEvent, request, &extra_info_spec); ++ browser_context, keys_wra::kOnSendHeadersEvent, request, &extra_info_spec); + if (listeners.empty()) + return; + +@@ -1372,12 +1372,12 @@ int ExtensionWebRequestEventRouter::OnHeadersReceived( + }); + + initialize_blocked_requests |= ProcessDeclarativeRules( +- browser_context, keys::kOnHeadersReceivedEvent, request, ++ browser_context, keys_wra::kOnHeadersReceivedEvent, request, + ON_HEADERS_RECEIVED, original_response_headers); + + int extra_info_spec = 0; + RawListeners listeners = +- GetMatchingListeners(browser_context, keys::kOnHeadersReceivedEvent, ++ GetMatchingListeners(browser_context, keys_wra::kOnHeadersReceivedEvent, + request, &extra_info_spec); + + if (!listeners.empty() && +@@ -1427,7 +1427,7 @@ ExtensionWebRequestEventRouter::OnAuthRequired( + + int extra_info_spec = 0; + RawListeners listeners = GetMatchingListeners( +- browser_context, keys::kOnAuthRequiredEvent, request, &extra_info_spec); ++ browser_context, keys_wra::kOnAuthRequiredEvent, request, &extra_info_spec); + if (listeners.empty()) + return AuthRequiredResponse::AUTH_REQUIRED_RESPONSE_NO_ACTION; + +@@ -1466,7 +1466,7 @@ void ExtensionWebRequestEventRouter::OnBeforeRedirect( + + int extra_info_spec = 0; + RawListeners listeners = GetMatchingListeners( +- browser_context, keys::kOnBeforeRedirectEvent, request, &extra_info_spec); ++ browser_context, keys_wra::kOnBeforeRedirectEvent, request, &extra_info_spec); + if (listeners.empty()) + return; + +@@ -1474,7 +1474,7 @@ void ExtensionWebRequestEventRouter::OnBeforeRedirect( + CreateEventDetails(*request, extra_info_spec)); + event_details->SetResponseHeaders(*request, request->response_headers.get()); + event_details->SetResponseSource(*request); +- event_details->SetString(keys::kRedirectUrlKey, new_location.spec()); ++ event_details->SetString(keys_wra::kRedirectUrlKey, new_location.spec()); + + DispatchEvent(browser_context, request, listeners, std::move(event_details)); + } +@@ -1494,7 +1494,7 @@ void ExtensionWebRequestEventRouter::OnResponseStarted( + + int extra_info_spec = 0; + RawListeners listeners = +- GetMatchingListeners(browser_context, keys::kOnResponseStartedEvent, ++ GetMatchingListeners(browser_context, keys_wra::kOnResponseStartedEvent, + request, &extra_info_spec); + if (listeners.empty()) + return; +@@ -1533,7 +1533,7 @@ void ExtensionWebRequestEventRouter::OnCompleted( + + int extra_info_spec = 0; + RawListeners listeners = GetMatchingListeners( +- browser_context, keys::kOnCompletedEvent, request, &extra_info_spec); ++ browser_context, keys_wra::kOnCompletedEvent, request, &extra_info_spec); + if (listeners.empty()) + return; + +@@ -1595,8 +1595,8 @@ void ExtensionWebRequestEventRouter::OnErrorOccurred( + if (started) + event_details->SetResponseSource(*request); + else +- event_details->SetBoolean(keys::kFromCache, request->response_from_cache); +- event_details->SetString(keys::kErrorKey, net::ErrorToString(net_error)); ++ event_details->SetBoolean(keys_wra::kFromCache, request->response_from_cache); ++ event_details->SetString(keys_wra::kErrorKey, net::ErrorToString(net_error)); + + DispatchEvent(browser_context, request, listeners, std::move(event_details)); + } +@@ -2557,8 +2557,8 @@ void ExtensionWebRequestEventRouter::SendMessages( + for (const std::string& message : messages) { + std::unique_ptr event_details(CreateEventDetails( + *blocked_request.request, /* extra_info_spec */ 0)); +- event_details->SetString(keys::kMessageKey, message); +- event_details->SetString(keys::kStageKey, ++ event_details->SetString(keys_wra::kMessageKey, message); ++ event_details->SetString(keys_wra::kStageKey, + GetRequestStageAsString(blocked_request.event)); + SendOnMessageEventOnUI(browser_context, delta.extension_id, + blocked_request.request->is_web_view, +@@ -2936,7 +2936,7 @@ WebRequestInternalAddEventListenerFunction::Run() { + return true; + } + +- return event_name == keys::kOnAuthRequiredEvent && ++ return event_name == keys_wra::kOnAuthRequiredEvent && + extension->permissions_data()->HasAPIPermission( + APIPermissionID::kWebRequestAuthProvider); + }; +@@ -2947,7 +2947,7 @@ WebRequestInternalAddEventListenerFunction::Run() { + bool is_blocking = extra_info_spec & (ExtraInfoSpec::BLOCKING | + ExtraInfoSpec::ASYNC_BLOCKING); + if (is_blocking && !has_blocking_permission()) { +- return RespondNow(Error(keys::kBlockingPermissionRequired)); ++ return RespondNow(Error(keys_wra::kBlockingPermissionRequired)); + } + + // We allow to subscribe to patterns that are broader than the host +@@ -2963,7 +2963,7 @@ WebRequestInternalAddEventListenerFunction::Run() { + ->withheld_permissions() + .explicit_hosts() + .is_empty()) { +- return RespondNow(Error(keys::kHostPermissionsRequired)); ++ return RespondNow(Error(keys_wra::kHostPermissionsRequired)); + } + } + +@@ -3031,7 +3031,7 @@ WebRequestInternalEventHandledFunction::Run() { + + const base::Value* redirect_url_value = dict_value.Find("redirectUrl"); + const base::Value* auth_credentials_value = +- dict_value.Find(keys::kAuthCredentialsKey); ++ dict_value.Find(keys_wra::kAuthCredentialsKey); + const base::Value* request_headers_value = + dict_value.Find("requestHeaders"); + const base::Value* response_headers_value = +@@ -3043,7 +3043,7 @@ WebRequestInternalEventHandledFunction::Run() { + if (dict_value.size() != 1) { + OnError(event_name, sub_event_name, request_id, render_process_id, + web_view_instance_id, std::move(response)); +- return RespondNow(Error(keys::kInvalidBlockingResponse)); ++ return RespondNow(Error(keys_wra::kInvalidBlockingResponse)); + } + + EXTENSION_FUNCTION_VALIDATE(cancel_value->is_bool()); +@@ -3057,7 +3057,7 @@ WebRequestInternalEventHandledFunction::Run() { + if (!response->new_url.is_valid()) { + OnError(event_name, sub_event_name, request_id, render_process_id, + web_view_instance_id, std::move(response)); +- return RespondNow(Error(keys::kInvalidRedirectUrl, new_url_str)); ++ return RespondNow(Error(keys_wra::kInvalidRedirectUrl, new_url_str)); + } + } + +@@ -3068,7 +3068,7 @@ WebRequestInternalEventHandledFunction::Run() { + // Allow only one of the keys, not both. + OnError(event_name, sub_event_name, request_id, render_process_id, + web_view_instance_id, std::move(response)); +- return RespondNow(Error(keys::kInvalidHeaderKeyCombination)); ++ return RespondNow(Error(keys_wra::kInvalidHeaderKeyCombination)); + } + + const base::Value::List* headers_value = nullptr; +@@ -3076,10 +3076,10 @@ WebRequestInternalEventHandledFunction::Run() { + std::unique_ptr response_headers; + if (has_request_headers) { + request_headers = std::make_unique(); +- headers_value = dict_value.FindList(keys::kRequestHeadersKey); ++ headers_value = dict_value.FindList(keys_wra::kRequestHeadersKey); + } else { + response_headers = std::make_unique(); +- headers_value = dict_value.FindList(keys::kResponseHeadersKey); ++ headers_value = dict_value.FindList(keys_wra::kResponseHeadersKey); + } + EXTENSION_FUNCTION_VALIDATE(headers_value); + +@@ -3093,17 +3093,17 @@ WebRequestInternalEventHandledFunction::Run() { + base::JSONWriter::Write(header_value, &serialized_header); + OnError(event_name, sub_event_name, request_id, render_process_id, + web_view_instance_id, std::move(response)); +- return RespondNow(Error(keys::kInvalidHeader, serialized_header)); ++ return RespondNow(Error(keys_wra::kInvalidHeader, serialized_header)); + } + if (!net::HttpUtil::IsValidHeaderName(name)) { + OnError(event_name, sub_event_name, request_id, render_process_id, + web_view_instance_id, std::move(response)); +- return RespondNow(Error(keys::kInvalidHeaderName)); ++ return RespondNow(Error(keys_wra::kInvalidHeaderName)); + } + if (!net::HttpUtil::IsValidHeaderValue(value)) { + OnError(event_name, sub_event_name, request_id, render_process_id, + web_view_instance_id, std::move(response)); +- return RespondNow(Error(keys::kInvalidHeaderValue, name)); ++ return RespondNow(Error(keys_wra::kInvalidHeaderValue, name)); + } + if (has_request_headers) { + request_headers->SetHeader(name, value); +@@ -3123,9 +3123,9 @@ WebRequestInternalEventHandledFunction::Run() { + auth_credentials_value->GetIfDict(); + EXTENSION_FUNCTION_VALIDATE(credentials_value); + const std::string* username = +- credentials_value->FindString(keys::kUsernameKey); ++ credentials_value->FindString(keys_wra::kUsernameKey); + const std::string* password = +- credentials_value->FindString(keys::kPasswordKey); ++ credentials_value->FindString(keys_wra::kPasswordKey); + EXTENSION_FUNCTION_VALIDATE(username); + EXTENSION_FUNCTION_VALIDATE(password); + response->auth_credentials = net::AuthCredentials( +diff --git a/extensions/browser/api/web_request/web_request_info.cc b/extensions/browser/api/web_request/web_request_info.cc +index 7863345bc..9eb1c999e 100644 +--- a/extensions/browser/api/web_request/web_request_info.cc ++++ b/extensions/browser/api/web_request/web_request_info.cc +@@ -29,7 +29,7 @@ + #include "services/network/url_loader.h" + #include "third_party/abseil-cpp/absl/types/optional.h" + +-namespace keys = extension_web_request_api_constants; ++namespace keys_wri = extension_web_request_api_constants; + + namespace extensions { + +@@ -129,8 +129,8 @@ absl::optional CreateRequestBodyData( + &raw_data_presenter // 2: any data at all? (Non-specific.) + }; + // Keys for the results of the corresponding presenters. +- static const char* const kKeys[] = {keys::kRequestBodyFormDataKey, +- keys::kRequestBodyRawKey}; ++ static const char* const kKeys[] = {keys_wri::kRequestBodyFormDataKey, ++ keys_wri::kRequestBodyRawKey}; + bool some_succeeded = false; + if (!data_sources.empty()) { + for (size_t i = 0; i < std::size(presenters); ++i) { +@@ -145,7 +145,7 @@ absl::optional CreateRequestBodyData( + } + + if (!some_succeeded) { +- request_body_data.Set(keys::kRequestBodyErrorKey, "Unknown error."); ++ request_body_data.Set(keys_wri::kRequestBodyErrorKey, "Unknown error."); + } + + return request_body_data; +diff --git a/extensions/browser/api/web_request/web_request_proxying_url_loader_factory.cc b/extensions/browser/api/web_request/web_request_proxying_url_loader_factory.cc +index 09437c18a..987128531 100644 +--- a/extensions/browser/api/web_request/web_request_proxying_url_loader_factory.cc ++++ b/extensions/browser/api/web_request/web_request_proxying_url_loader_factory.cc +@@ -78,26 +78,26 @@ constexpr char kWebRequestProxyingURLLoaderFactoryScope[] = + // This shutdown notifier makes sure the proxy is destroyed if an incognito + // browser context is destroyed. This is needed because WebRequestAPI only + // clears the proxies when the original browser context is destroyed. +-class ShutdownNotifierFactory ++class ShutdownNotifierFactory2 + : public BrowserContextKeyedServiceShutdownNotifierFactory { + public: +- ShutdownNotifierFactory(const ShutdownNotifierFactory&) = delete; +- ShutdownNotifierFactory& operator=(const ShutdownNotifierFactory&) = delete; ++ ShutdownNotifierFactory2(const ShutdownNotifierFactory2&) = delete; ++ ShutdownNotifierFactory2& operator=(const ShutdownNotifierFactory2&) = delete; + +- static ShutdownNotifierFactory* GetInstance() { +- static base::NoDestructor factory; ++ static ShutdownNotifierFactory2* GetInstance() { ++ static base::NoDestructor factory; + return factory.get(); + } + + private: +- friend class base::NoDestructor; ++ friend class base::NoDestructor; + +- ShutdownNotifierFactory() ++ ShutdownNotifierFactory2() + : BrowserContextKeyedServiceShutdownNotifierFactory( + "WebRequestProxyingURLLoaderFactory") { + DependsOn(PermissionHelper::GetFactoryInstance()); + } +- ~ShutdownNotifierFactory() override {} ++ ~ShutdownNotifierFactory2() override {} + }; + + // Creates simulated net::RedirectInfo when an extension redirects a request, +@@ -1443,7 +1443,7 @@ WebRequestProxyingURLLoaderFactory::WebRequestProxyingURLLoaderFactory( + // canceled when |shutdown_notifier_subscription_| is destroyed, and + // |proxies_| owns this. + shutdown_notifier_subscription_ = +- ShutdownNotifierFactory::GetInstance() ++ ShutdownNotifierFactory2::GetInstance() + ->Get(browser_context) + ->Subscribe(base::BindRepeating(&WebRequestAPI::ProxySet::RemoveProxy, + base::Unretained(proxies_), this)); +diff --git a/extensions/browser/api/web_request/web_request_proxying_url_loader_factory.h b/extensions/browser/api/web_request/web_request_proxying_url_loader_factory.h +index 11c58337e..c53676bab 100644 +--- a/extensions/browser/api/web_request/web_request_proxying_url_loader_factory.h ++++ b/extensions/browser/api/web_request/web_request_proxying_url_loader_factory.h +@@ -39,7 +39,7 @@ + #include "url/gurl.h" + #include "url/origin.h" + +-namespace { ++namespace content { + class BrowserContext; + } + +diff --git a/extensions/browser/app_window/app_window.cc b/extensions/browser/app_window/app_window.cc +index 7546c00df..a1328f641 100644 +--- a/extensions/browser/app_window/app_window.cc ++++ b/extensions/browser/app_window/app_window.cc +@@ -235,7 +235,7 @@ gfx::Size AppWindow::CreateParams::GetWindowMaximumSize( + + // AppWindow + +-AppWindow::AppWindow(BrowserContext* context, ++AppWindow::AppWindow(content::BrowserContext* context, + std::unique_ptr app_delegate, + const Extension* extension) + : browser_context_(context), +@@ -954,7 +954,7 @@ content::WebContents* AppWindow::GetAssociatedWebContents() const { + return web_contents(); + } + +-void AppWindow::OnExtensionUnloaded(BrowserContext* browser_context, ++void AppWindow::OnExtensionUnloaded(content::BrowserContext* browser_context, + const Extension* extension, + UnloadedExtensionReason reason) { + if (extension_id_ == extension->id()) +diff --git a/extensions/browser/extension_message_filter.cc b/extensions/browser/extension_message_filter.cc +index 9e24cefb4..d08c9f4d6 100644 +--- a/extensions/browser/extension_message_filter.cc ++++ b/extensions/browser/extension_message_filter.cc +@@ -18,25 +18,25 @@ namespace extensions { + + namespace { + +-class ShutdownNotifierFactory ++class ShutdownNotifierFactoryForExtensionMessageFilter + : public BrowserContextKeyedServiceShutdownNotifierFactory { + public: +- ShutdownNotifierFactory(const ShutdownNotifierFactory&) = delete; +- ShutdownNotifierFactory& operator=(const ShutdownNotifierFactory&) = delete; ++ ShutdownNotifierFactoryForExtensionMessageFilter(const ShutdownNotifierFactoryForExtensionMessageFilter&) = delete; ++ ShutdownNotifierFactoryForExtensionMessageFilter& operator=(const ShutdownNotifierFactoryForExtensionMessageFilter&) = delete; + +- static ShutdownNotifierFactory* GetInstance() { +- return base::Singleton::get(); ++ static ShutdownNotifierFactoryForExtensionMessageFilter* GetInstance() { ++ return base::Singleton::get(); + } + + private: +- friend struct base::DefaultSingletonTraits; ++ friend struct base::DefaultSingletonTraits; + +- ShutdownNotifierFactory() ++ ShutdownNotifierFactoryForExtensionMessageFilter() + : BrowserContextKeyedServiceShutdownNotifierFactory( + "ExtensionMessageFilter") { + DependsOn(ProcessManagerFactory::GetInstance()); + } +- ~ShutdownNotifierFactory() override {} ++ ~ShutdownNotifierFactoryForExtensionMessageFilter() override {} + }; + + } // namespace +@@ -48,13 +48,13 @@ ExtensionMessageFilter::ExtensionMessageFilter(int render_process_id, + browser_context_(context) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + shutdown_notifier_subscription_ = +- ShutdownNotifierFactory::GetInstance()->Get(context)->Subscribe( ++ ShutdownNotifierFactoryForExtensionMessageFilter::GetInstance()->Get(context)->Subscribe( + base::BindRepeating(&ExtensionMessageFilter::ShutdownOnUIThread, + base::Unretained(this))); + } + + void ExtensionMessageFilter::EnsureShutdownNotifierFactoryBuilt() { +- ShutdownNotifierFactory::GetInstance(); ++ ShutdownNotifierFactoryForExtensionMessageFilter::GetInstance(); + } + + ExtensionMessageFilter::~ExtensionMessageFilter() { +diff --git a/extensions/browser/extension_service_worker_message_filter.cc b/extensions/browser/extension_service_worker_message_filter.cc +index 5fca5696a..11321038d 100644 +--- a/extensions/browser/extension_service_worker_message_filter.cc ++++ b/extensions/browser/extension_service_worker_message_filter.cc +@@ -28,27 +28,27 @@ namespace extensions { + + namespace { + +-class ShutdownNotifierFactory ++class ShutdownNotifierFactoryForExtensionServiceWorkerMessageFilter + : public BrowserContextKeyedServiceShutdownNotifierFactory { + public: +- ShutdownNotifierFactory(const ShutdownNotifierFactory&) = delete; +- ShutdownNotifierFactory& operator=(const ShutdownNotifierFactory&) = delete; ++ ShutdownNotifierFactoryForExtensionServiceWorkerMessageFilter(const ShutdownNotifierFactoryForExtensionServiceWorkerMessageFilter&) = delete; ++ ShutdownNotifierFactoryForExtensionServiceWorkerMessageFilter& operator=(const ShutdownNotifierFactoryForExtensionServiceWorkerMessageFilter&) = delete; + +- static ShutdownNotifierFactory* GetInstance() { +- return base::Singleton::get(); ++ static ShutdownNotifierFactoryForExtensionServiceWorkerMessageFilter* GetInstance() { ++ return base::Singleton::get(); + } + + private: +- friend struct base::DefaultSingletonTraits; ++ friend struct base::DefaultSingletonTraits; + +- ShutdownNotifierFactory() ++ ShutdownNotifierFactoryForExtensionServiceWorkerMessageFilter() + : BrowserContextKeyedServiceShutdownNotifierFactory( + "ExtensionServiceWorkerMessageFilter") { + DependsOn(ExtensionRegistryFactory::GetInstance()); + DependsOn(EventRouterFactory::GetInstance()); + DependsOn(ProcessManagerFactory::GetInstance()); + } +- ~ShutdownNotifierFactory() override = default; ++ ~ShutdownNotifierFactoryForExtensionServiceWorkerMessageFilter() override = default; + }; + + } // namespace +@@ -64,7 +64,7 @@ ExtensionServiceWorkerMessageFilter::ExtensionServiceWorkerMessageFilter( + dispatcher_(new ExtensionFunctionDispatcher(context)) { + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); + shutdown_notifier_subscription_ = +- ShutdownNotifierFactory::GetInstance()->Get(context)->Subscribe( ++ ShutdownNotifierFactoryForExtensionServiceWorkerMessageFilter::GetInstance()->Get(context)->Subscribe( + base::BindRepeating( + &ExtensionServiceWorkerMessageFilter::ShutdownOnUIThread, + base::Unretained(this))); +@@ -80,7 +80,7 @@ void ExtensionServiceWorkerMessageFilter::OnDestruct() const { + } + + void ExtensionServiceWorkerMessageFilter::EnsureShutdownNotifierFactoryBuilt() { +- ShutdownNotifierFactory::GetInstance(); ++ ShutdownNotifierFactoryForExtensionServiceWorkerMessageFilter::GetInstance(); + } + + ExtensionServiceWorkerMessageFilter::~ExtensionServiceWorkerMessageFilter() {} +diff --git a/extensions/common/BUILD.gn b/extensions/common/BUILD.gn +index 97c23c3ae..1297328ef 100644 +--- a/extensions/common/BUILD.gn ++++ b/extensions/common/BUILD.gn +@@ -476,6 +476,11 @@ jumbo_static_library("common") { + # from mojom/permission_set_mojom_traits.cc. + allow_circular_includes_from = [ ":mojom" ] + ++ jumbo_excluded_sources = [ ++ "manifest_handlers/file_handler_info.cc", ++ "manifest_handlers/permissions_parser.cc", ++ ] ++ + deps = [ + "//base", + "//build:branding_buildflags", +diff --git a/extensions/common/manifest_handlers/shared_module_info.cc b/extensions/common/manifest_handlers/shared_module_info.cc +index 0661cbb80..b19c778c5 100644 +--- a/extensions/common/manifest_handlers/shared_module_info.cc ++++ b/extensions/common/manifest_handlers/shared_module_info.cc +@@ -35,7 +35,7 @@ namespace { + + const char kSharedModule[] = "shared_module"; + +-using ManifestKeys = api::shared_module::ManifestKeys; ++using ManifestKeys2 = api::shared_module::ManifestKeys; + + static base::LazyInstance::DestructorAtExit + g_empty_shared_module_info = LAZY_INSTANCE_INITIALIZER; +@@ -130,8 +130,8 @@ SharedModuleHandler::SharedModuleHandler() = default; + SharedModuleHandler::~SharedModuleHandler() = default; + + bool SharedModuleHandler::Parse(Extension* extension, std::u16string* error) { +- ManifestKeys manifest_keys; +- if (!ManifestKeys::ParseFromDictionary( ++ ManifestKeys2 manifest_keys; ++ if (!ManifestKeys2::ParseFromDictionary( + extension->manifest()->available_values(), &manifest_keys, error)) { + return false; + } +@@ -210,8 +210,8 @@ bool SharedModuleHandler::Validate( + } + + base::span SharedModuleHandler::Keys() const { +- static constexpr const char* kKeys[] = {ManifestKeys::kImport, +- ManifestKeys::kExport}; ++ static constexpr const char* kKeys[] = {ManifestKeys2::kImport, ++ ManifestKeys2::kExport}; + return kKeys; + } + +diff --git a/gpu/command_buffer/service/BUILD.gn b/gpu/command_buffer/service/BUILD.gn +index 2e0a3176b..375215e6b 100644 +--- a/gpu/command_buffer/service/BUILD.gn ++++ b/gpu/command_buffer/service/BUILD.gn +@@ -2,7 +2,6 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + +-import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + import("//gpu/vulkan/features.gni") + import("//skia/features.gni") +@@ -27,9 +26,9 @@ group("gles2") { + } + + if (is_component_build) { +- link_target_type = "jumbo_source_set" ++ link_target_type = "source_set" + } else { +- link_target_type = "jumbo_static_library" ++ link_target_type = "static_library" + } + target(link_target_type, "service_sources") { + # External code should depend on this via //gpu/command_buffer/service above +@@ -594,7 +593,7 @@ proto_library("disk_cache_proto") { + } + + if (is_android) { +- jumbo_static_library("android_texture_owner_test_support") { ++ static_library("android_texture_owner_test_support") { + testonly = true + sources = [ + "mock_abstract_texture.cc", +diff --git a/gpu/config/BUILD.gn b/gpu/config/BUILD.gn +index 4f552bc9f..d8ee27329 100644 +--- a/gpu/config/BUILD.gn ++++ b/gpu/config/BUILD.gn +@@ -5,7 +5,6 @@ + import("//build/config/chrome_build.gni") + import("//build/config/chromecast_build.gni") + import("//build/config/chromeos/ui_mode.gni") +-import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + import("//gpu/vulkan/features.gni") + import("//skia/features.gni") +@@ -114,7 +113,7 @@ if (enable_vulkan) { + } + } + +-jumbo_source_set("config_sources") { ++source_set("config_sources") { + # External code should depend on this via //gpu/config above rather than + # depending on this directly or the component build will break. + visibility = [ "//gpu/*" ] +diff --git a/media/filters/h265_to_annex_b_bitstream_converter.cc b/media/filters/h265_to_annex_b_bitstream_converter.cc +index 60af198f9..4bc2033a1 100644 +--- a/media/filters/h265_to_annex_b_bitstream_converter.cc ++++ b/media/filters/h265_to_annex_b_bitstream_converter.cc +@@ -14,12 +14,12 @@ + namespace media { + namespace { + +-static const uint8_t kStartCodePrefix[3] = {0, 0, 1}; +-static const uint32_t kParamSetStartCodeSize = 1 + sizeof(kStartCodePrefix); ++static const uint8_t kStartCodePrefix2[3] = {0, 0, 1}; ++static const uint32_t kParamSetStartCodeSize2 = 1 + sizeof(kStartCodePrefix2); + + // Helper function which determines whether NAL unit of given type marks + // access unit boundary. +-static bool IsAccessUnitBoundaryNal(int nal_unit_type) { ++static bool IsAccessUnitBoundaryNal2(int nal_unit_type) { + // Spec 7.4.2.4.4 + // Check if this packet marks access unit boundary by checking the + // packet type. +@@ -64,7 +64,7 @@ uint32_t H265ToAnnexBBitstreamConverter::GetConfigSize( + + for (auto& nalu_array : hevc_config.arrays) { + for (auto& nalu : nalu_array.units) { +- config_size += kParamSetStartCodeSize + nalu.size(); ++ config_size += kParamSetStartCodeSize2 + nalu.size(); + } + } + return config_size; +@@ -118,12 +118,12 @@ uint32_t H265ToAnnexBBitstreamConverter::CalculateNeededOutputBufferSize( + // nal_unit_type. + int nal_unit_type = (*input >> 1) & 0x3F; + if (first_nal_in_this_access_unit || +- IsAccessUnitBoundaryNal(nal_unit_type)) { ++ IsAccessUnitBoundaryNal2(nal_unit_type)) { + output_size += 1; // Extra zero_byte for these nal units + first_nal_in_this_access_unit = false; + } + // Start code prefix +- output_size += sizeof(kStartCodePrefix); ++ output_size += sizeof(kStartCodePrefix2); + // Actual NAL unit size + output_size += nal_unit_length; + input += nal_unit_length; +@@ -218,8 +218,8 @@ bool H265ToAnnexBBitstreamConverter::ConvertNalUnitStreamToByteStream( + } + uint32_t start_code_len; + first_nal_unit_in_access_unit_ +- ? start_code_len = sizeof(kStartCodePrefix) + 1 +- : start_code_len = sizeof(kStartCodePrefix); ++ ? start_code_len = sizeof(kStartCodePrefix2) + 1 ++ : start_code_len = sizeof(kStartCodePrefix2); + if (static_cast(outscan - output) + start_code_len + + nal_unit_length > + *output_size) { +@@ -229,7 +229,7 @@ bool H265ToAnnexBBitstreamConverter::ConvertNalUnitStreamToByteStream( + + // Check if this packet marks access unit boundary by checking the + // packet type. +- if (IsAccessUnitBoundaryNal(nal_unit_type)) { ++ if (IsAccessUnitBoundaryNal2(nal_unit_type)) { + first_nal_unit_in_access_unit_ = true; + } + +@@ -243,8 +243,8 @@ bool H265ToAnnexBBitstreamConverter::ConvertNalUnitStreamToByteStream( + + // No need to write leading zero bits. + // Write start-code prefix. +- memcpy(outscan, kStartCodePrefix, sizeof(kStartCodePrefix)); +- outscan += sizeof(kStartCodePrefix); ++ memcpy(outscan, kStartCodePrefix2, sizeof(kStartCodePrefix2)); ++ outscan += sizeof(kStartCodePrefix2); + // Then write the actual NAL unit from the input buffer. + memcpy(outscan, inscan, nal_unit_length); + inscan += nal_unit_length; +@@ -270,8 +270,8 @@ bool H265ToAnnexBBitstreamConverter::WriteParamSet( + + // Verify space. + uint32_t bytes_left = *out_size; +- if (bytes_left < kParamSetStartCodeSize || +- bytes_left - kParamSetStartCodeSize < size) { ++ if (bytes_left < kParamSetStartCodeSize2 || ++ bytes_left - kParamSetStartCodeSize2 < size) { + return false; + } + +@@ -280,8 +280,8 @@ bool H265ToAnnexBBitstreamConverter::WriteParamSet( + + // Write the 4 byte Annex B start code. + *buf++ = 0; // zero byte +- memcpy(buf, kStartCodePrefix, sizeof(kStartCodePrefix)); +- buf += sizeof(kStartCodePrefix); ++ memcpy(buf, kStartCodePrefix2, sizeof(kStartCodePrefix2)); ++ buf += sizeof(kStartCodePrefix2); + + // Copy the data. + memcpy(buf, ¶m_set[0], size); +diff --git a/media/filters/mac/audio_toolbox_audio_encoder.cc b/media/filters/mac/audio_toolbox_audio_encoder.cc +index c1875279f..0329077f8 100644 +--- a/media/filters/mac/audio_toolbox_audio_encoder.cc ++++ b/media/filters/mac/audio_toolbox_audio_encoder.cc +@@ -20,7 +20,7 @@ namespace media { + + namespace { + +-struct InputData { ++struct InputData2 { + raw_ptr bus = nullptr; + bool flushing = false; + }; +@@ -28,12 +28,12 @@ struct InputData { + constexpr int kAacFramesPerBuffer = 1024; + + // Callback used to provide input data to the AudioConverter. +-OSStatus ProvideInputCallback(AudioConverterRef decoder, ++OSStatus ProvideInputCallback2(AudioConverterRef decoder, + UInt32* num_packets, + AudioBufferList* buffer_list, + AudioStreamPacketDescription** packets, + void* user_data) { +- auto* input_data = reinterpret_cast(user_data); ++ auto* input_data = reinterpret_cast(user_data); + if (input_data->flushing) { + *num_packets = 0; + return noErr; +@@ -294,7 +294,7 @@ bool AudioToolboxAudioEncoder::CreateEncoder( + void AudioToolboxAudioEncoder::DoEncode(AudioBus* input_bus) { + bool is_flushing = !input_bus; + +- InputData input_data; ++ InputData2 input_data; + input_data.bus = input_bus; + input_data.flushing = is_flushing; + +diff --git a/media/filters/media_file_checker.cc b/media/filters/media_file_checker.cc +index dca328bc6..a2d475758 100644 +--- a/media/filters/media_file_checker.cc ++++ b/media/filters/media_file_checker.cc +@@ -29,7 +29,7 @@ void OnMediaFileCheckerError(bool* called) { + *called = false; + } + +-struct Decoder { ++struct DecoderStruct { + std::unique_ptr context; + std::unique_ptr loop; + }; +@@ -59,7 +59,7 @@ bool MediaFileChecker::Start(base::TimeDelta check_time) { + + // Remember the codec context for any decodable audio or video streams. + bool found_streams = false; +- std::vector stream_contexts(format_context->nb_streams); ++ std::vector stream_contexts(format_context->nb_streams); + for (size_t i = 0; i < format_context->nb_streams; ++i) { + AVCodecParameters* cp = format_context->streams[i]->codecpar; + +diff --git a/media/mojo/services/gpu_mojo_media_client_cros.cc b/media/mojo/services/gpu_mojo_media_client_cros.cc +index 7cc7e9d60..389b71b7b 100644 +--- a/media/mojo/services/gpu_mojo_media_client_cros.cc ++++ b/media/mojo/services/gpu_mojo_media_client_cros.cc +@@ -10,6 +10,7 @@ + #include "build/build_config.h" + #include "media/base/audio_decoder.h" + #include "media/base/audio_encoder.h" ++#include "media/base/cdm_factory.h" + #include "media/base/media_switches.h" + #include "media/gpu/chromeos/mailbox_video_frame_converter.h" + #include "media/gpu/chromeos/platform_video_frame_pool.h" +@@ -224,10 +225,6 @@ std::unique_ptr CreatePlatformAudioEncoder( + return nullptr; + } + +-#if !BUILDFLAG(IS_CHROMEOS) +-class CdmFactory {}; +-#endif // !BUILDFLAG(IS_CHROMEOS) +- + std::unique_ptr CreatePlatformCdmFactory( + mojom::FrameInterfaceFactory* frame_interfaces) { + #if BUILDFLAG(IS_CHROMEOS) +diff --git a/media/mojo/services/gpu_mojo_media_client_mac.cc b/media/mojo/services/gpu_mojo_media_client_mac.cc +index 7ddaadc74..cc7a68134 100644 +--- a/media/mojo/services/gpu_mojo_media_client_mac.cc ++++ b/media/mojo/services/gpu_mojo_media_client_mac.cc +@@ -6,6 +6,7 @@ + #include "base/task/single_thread_task_runner.h" + #include "base/task/thread_pool.h" + #include "media/base/audio_decoder.h" ++#include "media/base/cdm_factory.h" + #include "media/base/offloading_audio_encoder.h" + #include "media/filters/mac/audio_toolbox_audio_decoder.h" + #include "media/filters/mac/audio_toolbox_audio_encoder.h" +@@ -46,7 +47,7 @@ std::unique_ptr CreatePlatformAudioEncoder( + } + + // This class doesn't exist on mac, so we need a stub for unique_ptr. +-class CdmFactory {}; ++//class CdmFactory {}; + + std::unique_ptr CreatePlatformCdmFactory( + mojom::FrameInterfaceFactory* frame_interfaces) { +diff --git a/media/mojo/services/gpu_mojo_media_client_stubs.cc b/media/mojo/services/gpu_mojo_media_client_stubs.cc +index 990226164..fd8fc1032 100644 +--- a/media/mojo/services/gpu_mojo_media_client_stubs.cc ++++ b/media/mojo/services/gpu_mojo_media_client_stubs.cc +@@ -6,6 +6,7 @@ + #include "base/task/single_thread_task_runner.h" + #include "media/base/audio_decoder.h" + #include "media/base/audio_encoder.h" ++#include "media/base/cdm_factory.h" + #include "media/base/video_decoder.h" + #include "media/mojo/services/gpu_mojo_media_client.h" + +@@ -35,9 +36,6 @@ std::unique_ptr CreatePlatformAudioEncoder( + return nullptr; + } + +-// This class doesn't exist on any of the platforms that use the stubs. +-class CdmFactory {}; +- + std::unique_ptr CreatePlatformCdmFactory( + mojom::FrameInterfaceFactory* frame_interfaces) { + return nullptr; +diff --git a/media/mojo/services/gpu_mojo_media_client_win.cc b/media/mojo/services/gpu_mojo_media_client_win.cc +index 624f1950e..4bfe1dd04 100644 +--- a/media/mojo/services/gpu_mojo_media_client_win.cc ++++ b/media/mojo/services/gpu_mojo_media_client_win.cc +@@ -8,6 +8,7 @@ + #include "base/task/single_thread_task_runner.h" + #include "base/task/thread_pool.h" + #include "media/base/audio_decoder.h" ++#include "media/base/cdm_factory.h" + #include "media/base/media_switches.h" + #include "media/base/offloading_audio_encoder.h" + #if BUILDFLAG(ENABLE_PLATFORM_DTS_AUDIO) +@@ -98,7 +99,7 @@ VideoDecoderType GetPlatformDecoderImplementationType( + } + + // There is no CdmFactory on windows, so just stub it out. +-class CdmFactory {}; ++//class CdmFactory {}; + std::unique_ptr CreatePlatformCdmFactory( + mojom::FrameInterfaceFactory* frame_interfaces) { + return nullptr; +diff --git a/mojo/public/tools/bindings/mojom.gni b/mojo/public/tools/bindings/mojom.gni +index 6b29f9c12..496934eeb 100644 +--- a/mojo/public/tools/bindings/mojom.gni ++++ b/mojo/public/tools/bindings/mojom.gni +@@ -2,7 +2,6 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + +-import("//build/config/jumbo.gni") + import("//third_party/closure_compiler/closure_args.gni") + import("//third_party/closure_compiler/compile_js.gni") + import("//third_party/protobuf/proto_library.gni") +@@ -947,7 +946,7 @@ template("mojom") { + } + + shared_cpp_sources_target_name = "${target_name}_shared_cpp_sources" +- jumbo_source_set(shared_cpp_sources_target_name) { ++ source_set(shared_cpp_sources_target_name) { + if (defined(invoker.testonly)) { + testonly = invoker.testonly + } +@@ -1567,7 +1566,7 @@ template("mojom") { + sources_target_name = output_target_name + } + +- target("jumbo_" + sources_target_type, sources_target_name) { ++ target(sources_target_type, sources_target_name) { + if (defined(output_name_override)) { + output_name = output_name_override + } +diff --git a/services/network/public/cpp/BUILD.gn b/services/network/public/cpp/BUILD.gn +index 8d757bb4e..ca0babdb0 100644 +--- a/services/network/public/cpp/BUILD.gn ++++ b/services/network/public/cpp/BUILD.gn +@@ -377,6 +377,10 @@ jumbo_component("cpp_base") { + "web_transport_error_mojom_traits.cc", + "web_transport_error_mojom_traits.h", + ] ++ jumbo_excluded_sources = [ ++ "network_ipc_param_traits.cc", ++ "url_request_mojom_traits.cc" ++ ] + + configs += [ "//build/config/compiler:wexit_time_destructors" ] + +@@ -413,6 +417,7 @@ jumbo_component("cpp_base") { + "p2p_param_traits.h", + "p2p_socket_type.h", + ] ++ jumbo_excluded_sources += [ "p2p_param_traits.cc" ] + + public_deps += [ "//third_party/webrtc_overrides:webrtc_component" ] + } +diff --git a/services/network/web_bundle/web_bundle_url_loader_factory.cc b/services/network/web_bundle/web_bundle_url_loader_factory.cc +index eba6b4fba..036cab919 100644 +--- a/services/network/web_bundle/web_bundle_url_loader_factory.cc ++++ b/services/network/web_bundle/web_bundle_url_loader_factory.cc +@@ -34,7 +34,7 @@ namespace network { + + namespace { + +-constexpr size_t kBlockedBodyAllocationSize = 1; ++constexpr size_t kBlockedBodyAllocationSize2 = 1; + + void DeleteProducerAndRunCallback( + std::unique_ptr producer, +@@ -86,7 +86,7 @@ class WebBundleURLLoaderClient : public network::mojom::URLLoaderClient { + options.struct_size = sizeof(MojoCreateDataPipeOptions); + options.flags = MOJO_CREATE_DATA_PIPE_FLAG_NONE; + options.element_num_bytes = 1; +- options.capacity_num_bytes = kBlockedBodyAllocationSize; ++ options.capacity_num_bytes = kBlockedBodyAllocationSize2; + mojo::ScopedDataPipeProducerHandle producer; + mojo::ScopedDataPipeConsumerHandle consumer; + MojoResult result = mojo::CreateDataPipe(&options, producer, consumer); +diff --git a/storage/browser/BUILD.gn b/storage/browser/BUILD.gn +index e30e9df29..e4768078a 100644 +--- a/storage/browser/BUILD.gn ++++ b/storage/browser/BUILD.gn +@@ -226,6 +226,10 @@ jumbo_component("browser") { + "quota/usage_tracker.h", + ] + ++ jumbo_excluded_sources = [ ++ "file_system/local_file_stream_reader.cc", ++ ] ++ + defines = [ "IS_STORAGE_BROWSER_IMPL" ] + configs += [ + "//build/config:precompiled_headers", +diff --git a/storage/browser/blob/blob_url_registry.cc b/storage/browser/blob/blob_url_registry.cc +index 95072bc21..2a0f7ea39 100644 +--- a/storage/browser/blob/blob_url_registry.cc ++++ b/storage/browser/blob/blob_url_registry.cc +@@ -15,7 +15,7 @@ namespace storage { + + namespace { + +-BlobUrlRegistry::URLStoreCreationHook* g_url_store_creation_hook = nullptr; ++BlobUrlRegistry::URLStoreCreationHook* g_url_store_creation_hook2 = nullptr; + + } + +@@ -35,8 +35,8 @@ void BlobUrlRegistry::AddReceiver( + std::make_unique(storage_key, AsWeakPtr()), + std::move(receiver)); + +- if (g_url_store_creation_hook) { +- g_url_store_creation_hook->Run(this, receiver_id); ++ if (g_url_store_creation_hook2) { ++ g_url_store_creation_hook2->Run(this, receiver_id); + } + } + +@@ -180,7 +180,7 @@ void BlobUrlRegistry::SetURLStoreCreationHookForTesting( + URLStoreCreationHook* hook) { + DCHECK( + base::FeatureList::IsEnabled(net::features::kSupportPartitionedBlobUrl)); +- g_url_store_creation_hook = hook; ++ g_url_store_creation_hook2 = hook; + } + + } // namespace storage +diff --git a/storage/browser/quota/quota_settings.cc b/storage/browser/quota/quota_settings.cc +index b90b65552..88ae48f60 100644 +--- a/storage/browser/quota/quota_settings.cc ++++ b/storage/browser/quota/quota_settings.cc +@@ -24,14 +24,14 @@ namespace storage { + + namespace { + +-const int64_t kMBytes = 1024 * 1024; ++const int64_t _kMBytes = 1024 * 1024; + const int kRandomizedPercentage = 10; + const double kDefaultPerStorageKeyRatio = 0.75; + const double kIncognitoQuotaRatioLowerBound = 0.15; + const double kIncognitoQuotaRatioUpperBound = 0.2; + + // Skews |value| by +/- |percent|. +-int64_t RandomizeByPercent(int64_t value, int percent) { ++int64_t MyRandomizeByPercent(int64_t value, int percent) { + double random_percent = (base::RandDouble() - 0.5) * percent * 2; + return value + (value * (random_percent / 100.0)); + } +@@ -117,7 +117,7 @@ absl::optional CalculateNominalDynamicSettings( + // SessionOnly (or ephemeral) origins are allotted a fraction of what + // normal origins are provided, and the amount is capped to a hard limit. + const double kSessionOnlyStorageKeyQuotaRatio = 0.1; // 10% +- const int64_t kMaxSessionOnlyStorageKeyQuota = 300 * kMBytes; ++ const int64_t kMaxSessionOnlyStorageKeyQuota = 300 * _kMBytes; + + QuotaSettings settings; + +@@ -144,10 +144,9 @@ absl::optional CalculateNominalDynamicSettings( + static_cast(total * kMustRemainAvailableRatio)); + settings.per_storage_key_quota = pool_size * kPerStorageKeyTemporaryRatio; + settings.session_only_per_storage_key_quota = std::min( +- RandomizeByPercent(kMaxSessionOnlyStorageKeyQuota, kRandomizedPercentage), ++ MyRandomizeByPercent(kMaxSessionOnlyStorageKeyQuota, kRandomizedPercentage), + static_cast(settings.per_storage_key_quota * + kSessionOnlyStorageKeyQuotaRatio)); +- settings.refresh_interval = base::Seconds(60); + return settings; + } + +diff --git a/third_party/blink/common/frame/user_activation_state.cc b/third_party/blink/common/frame/user_activation_state.cc +index de3b52d4b..e80da3f8b 100644 +--- a/third_party/blink/common/frame/user_activation_state.cc ++++ b/third_party/blink/common/frame/user_activation_state.cc +@@ -31,7 +31,7 @@ bool IsRestricted(UserActivationNotificationType notification_type) { + // The expiry time should be long enough to allow network round trips even in a + // very slow connection (to support xhr-like calls with user activation), yet + // not too long to make an "unattended" page feel activated. +-constexpr base::TimeDelta kActivationLifespan = base::Seconds(5); ++constexpr base::TimeDelta kActivationLifespan2 = base::Seconds(5); + + UserActivationState::UserActivationState() + : first_notification_type_(UserActivationNotificationType::kNone), +@@ -101,7 +101,7 @@ void UserActivationState::RecordPreconsumptionUma() const { + } + + void UserActivationState::ActivateTransientState() { +- transient_state_expiry_time_ = base::TimeTicks::Now() + kActivationLifespan; ++ transient_state_expiry_time_ = base::TimeTicks::Now() + kActivationLifespan2; + } + + void UserActivationState::DeactivateTransientState() { +diff --git a/third_party/blink/common/user_agent/user_agent_metadata.cc b/third_party/blink/common/user_agent/user_agent_metadata.cc +index 3b99c66c4..935b02967 100644 +--- a/third_party/blink/common/user_agent/user_agent_metadata.cc ++++ b/third_party/blink/common/user_agent/user_agent_metadata.cc +@@ -11,7 +11,7 @@ + namespace blink { + + namespace { +-constexpr uint32_t kVersion = 2u; ++constexpr uint32_t kVersionUA = 2u; + } // namespace + + UserAgentBrandVersion::UserAgentBrandVersion(const std::string& ua_brand, +@@ -56,7 +56,7 @@ absl::optional UserAgentMetadata::Marshal( + if (!in) + return absl::nullopt; + base::Pickle out; +- out.WriteUInt32(kVersion); ++ out.WriteUInt32(kVersionUA); + + out.WriteUInt32(in->brand_version_list.size()); + for (const auto& brand_version : in->brand_version_list) { +@@ -92,7 +92,7 @@ absl::optional UserAgentMetadata::Demarshal( + + uint32_t version; + UserAgentMetadata out; +- if (!in.ReadUInt32(&version) || version != kVersion) ++ if (!in.ReadUInt32(&version) || version != kVersionUA) + return absl::nullopt; + + uint32_t brand_version_size; +diff --git a/third_party/blink/renderer/bindings/scripts/bind_gen/callback_interface.py b/third_party/blink/renderer/bindings/scripts/bind_gen/callback_interface.py +index 6703feeb0..7478af1ef 100644 +--- a/third_party/blink/renderer/bindings/scripts/bind_gen/callback_interface.py ++++ b/third_party/blink/renderer/bindings/scripts/bind_gen/callback_interface.py +@@ -185,6 +185,7 @@ def generate_callback_interface(callback_interface_identifier): + cg_context, + FN_INSTALL_INTERFACE_TEMPLATE, + class_name=class_name, ++ api_class_name=class_name, + trampoline_var_name=None, + constructor_entries=[], + supplemental_install_node=SequenceNode(), +diff --git a/third_party/blink/renderer/bindings/scripts/bind_gen/interface.py b/third_party/blink/renderer/bindings/scripts/bind_gen/interface.py +index 1c163ff51..af714c4c6 100644 +--- a/third_party/blink/renderer/bindings/scripts/bind_gen/interface.py ++++ b/third_party/blink/renderer/bindings/scripts/bind_gen/interface.py +@@ -5689,7 +5689,7 @@ ${prototype_object}->GetPrototype().As()->Delete( + return SequenceNode(nodes) if nodes else None + + +-def make_install_interface_template(cg_context, function_name, class_name, ++def make_install_interface_template(cg_context, function_name, class_name, api_class_name, + trampoline_var_name, constructor_entries, + supplemental_install_node, + install_unconditional_func_name, +@@ -5813,7 +5813,7 @@ def make_install_interface_template(cg_context, function_name, class_name, + for entry in constructor_entries: + nodes = [ + FormatNode("${interface_function_template}->SetCallHandler({});", +- entry.ctor_callback_name), ++ api_class_name + "Callbacks::" + entry.ctor_callback_name), + FormatNode("${interface_function_template}->SetLength({});", + entry.ctor_func_length), + ] +@@ -6208,6 +6208,7 @@ ${instance_object} = ${v8_context}->Global()->GetPrototype().As();\ + if unconditional_entries: + body.append( + CxxBlockNode([ ++ TextNode("using namespace ${class_name}Callbacks;"), + make_table_func(table_name, unconditional_entries), + TextNode(installer_call_text), + ])) +@@ -6217,6 +6218,7 @@ ${instance_object} = ${v8_context}->Global()->GetPrototype().As();\ + CxxUnlikelyIfNode( + cond=conditional, + body=[ ++ TextNode("using namespace ${class_name}Callbacks;"), + make_table_func(table_name, entries), + TextNode(installer_call_text), + ])) +@@ -6368,6 +6370,8 @@ def make_indexed_and_named_property_callbacks_and_install_node(cg_context): + map(lambda flag: "int32_t({})".format(flag), flags)))) + pattern = """\ + // Named interceptors ++{{ ++using namespace ${class_name}Callbacks; + ${instance_object_template}->SetHandler( + v8::NamedPropertyHandlerConfiguration( + {impl_bridge}::NamedPropertyGetterCallback, +@@ -6388,7 +6392,9 @@ interface.indexed_and_named_properties.named_getter.extended_attributes: + {impl_bridge}::NamedPropertyDefinerCallback, + {impl_bridge}::NamedPropertyDescriptorCallback, + v8::Local(), +- {property_handler_flags}));""" ++ {property_handler_flags})); ++}} ++""" + install_node.append( + F(pattern, + impl_bridge=impl_bridge, +@@ -6428,6 +6434,8 @@ interface.indexed_and_named_properties.named_getter.extended_attributes: + property_handler_flags = flags[0] + pattern = """\ + // Indexed interceptors ++{{ ++using namespace ${class_name}Callbacks; + ${instance_object_template}->SetHandler( + v8::IndexedPropertyHandlerConfiguration( + {impl_bridge}::IndexedPropertyGetterCallback, +@@ -6442,7 +6450,8 @@ ${instance_object_template}->SetHandler( + {impl_bridge}::IndexedPropertyDefinerCallback, + {impl_bridge}::IndexedPropertyDescriptorCallback, + v8::Local(), +- {property_handler_flags}));""" ++ {property_handler_flags})); ++}}""" + install_node.append( + F(pattern, + impl_bridge=impl_bridge, +@@ -6503,6 +6512,8 @@ def make_named_properties_object_callbacks_and_install_node(cg_context): + callback_defs.append(EmptyNode()) + + text = """\ ++{{ ++using namespace ${class_name}Callbacks; + // Named interceptors + ${npo_prototype_template}->SetHandler( + v8::NamedPropertyHandlerConfiguration( +@@ -6528,7 +6539,8 @@ ${npo_prototype_template}->SetHandler( + NamedPropsObjIndexedDefinerCallback, + NamedPropsObjIndexedDescriptorCallback, + v8::Local(), +- v8::PropertyHandlerFlags::kNone));""" ++ v8::PropertyHandlerFlags::kNone)); ++}}""" + install_node.append(TextNode(text)) + + return callback_defs, install_node +@@ -6667,6 +6679,8 @@ def make_cross_origin_property_callbacks_and_install_node( + + text = """\ + // Cross origin properties ++{{ ++using namespace ${class_name}Callbacks; + ${instance_object_template}->SetAccessCheckCallbackAndHandler( + CrossOriginAccessCheckCallback, + v8::NamedPropertyHandlerConfiguration( +@@ -6692,6 +6706,7 @@ ${instance_object_template}->SetAccessCheckCallbackAndHandler( + v8::External::New( + ${isolate}, + const_cast(${class_name}::GetWrapperTypeInfo()))); ++}} + """ + install_node.append(TextNode(text)) + install_node.accumulate( +@@ -6724,6 +6739,8 @@ ${instance_object_template}->SetAccessCheckCallbackAndHandler( + callback_defs.append(EmptyNode()) + + text = """\ ++{{ ++using namespace ${class_name}Callbacks; + // Same origin interceptors + ${instance_object_template}->SetHandler( + v8::IndexedPropertyHandlerConfiguration( +@@ -6736,6 +6753,7 @@ ${instance_object_template}->SetHandler( + SameOriginIndexedDescriptorCallback, + v8::Local(), + v8::PropertyHandlerFlags::kNone)); ++}} + """ + install_node.append(TextNode(text)) + +@@ -6905,6 +6923,7 @@ def make_wrapper_type_info(cg_context, function_name, + ])) + + pattern = """\ ++namespace ${class_name}Callbacks {{ }} + // Construction of WrapperTypeInfo may require non-trivial initialization due + // to cross-component address resolution in order to load the pointer to the + // parent interface's WrapperTypeInfo. We ignore this issue because the issue +@@ -7112,6 +7131,7 @@ def _make_v8_context_snapshot_get_reference_table_function( + )), + filter(None, callback_names))) + table_node = ListNode([ ++ TextNode("using namespace ${class_name}Callbacks;"), + TextNode("static const intptr_t kReferenceTable[] = {"), + ListNode(entry_nodes), + TextNode("};"), +@@ -7568,6 +7588,7 @@ def generate_class_like(class_like, + cg_context, + FN_INSTALL_INTERFACE_TEMPLATE, + class_name=impl_class_name, ++ api_class_name=api_class_name, + trampoline_var_name=tp_install_interface_template, + constructor_entries=constructor_entries, + supplemental_install_node=supplemental_install_node, +@@ -7820,7 +7841,7 @@ def generate_class_like(class_like, + class_like.identifier) + impl_source_blink_ns.body.extend([ + CxxNamespaceNode( +- name="", ++ name=api_class_name + "Callbacks", + body=[ + # Enclose the implementations with a namespace just in order to + # include the class_like name in a stacktrace, such as +diff --git a/third_party/blink/renderer/core/BUILD.gn b/third_party/blink/renderer/core/BUILD.gn +index e1234cafb..b5867d2da 100644 +--- a/third_party/blink/renderer/core/BUILD.gn ++++ b/third_party/blink/renderer/core/BUILD.gn +@@ -5,6 +5,7 @@ + import("//build/config/chromecast_build.gni") + import("//build/config/compiler/compiler.gni") + import("//build/config/dcheck_always_on.gni") ++import("//build/config/jumbo.gni") + import("//build/config/ui.gni") + import("//build/toolchain/toolchain.gni") + import("//media/media_options.gni") +@@ -144,7 +145,7 @@ source_set("core_common") { + sources = [ "core_export.h" ] + } + +-source_set("prerequisites") { ++jumbo_source_set("prerequisites") { + public_deps = [ + "//services/network/public/cpp:cpp", + "//services/network/public/mojom", +@@ -186,7 +187,7 @@ source_set("prerequisites") { + ] + } + +-component("core") { ++jumbo_component("core") { + output_name = "blink_core" + + visibility = [] # Allow re-assignment of list. +@@ -361,6 +362,14 @@ component("core") { + "//third_party/blink/renderer/core/url_pattern", + "//third_party/blink/renderer/core/xml:xpath_generated", + ] ++ jumbo_excluded_sources = [ ] ++ jumbo_excluded_sources += rebase_path([ "frame_fetch_context.cc" ], "", "loader") ++ jumbo_excluded_sources += rebase_path([ "image_loader.cc" ], "", "loader") ++ jumbo_excluded_sources += rebase_path([ "create_window.cc" ], "", "page") ++ jumbo_excluded_sources += rebase_path([ "link_highlight_impl.cc" ], "", "paint") ++ jumbo_excluded_sources += rebase_path([ "scroll_animator.cc" ], "", "scroll") ++ jumbo_excluded_sources += rebase_path([ "grid_baseline_alignment.cc" ], "", "layout") ++ jumbo_excluded_sources += rebase_path([ "grid_track_sizing_algorithm.cc" ], "", "layout") + + public_configs = [ ":core_include_dirs" ] + +diff --git a/third_party/blink/renderer/core/animation/BUILD.gn b/third_party/blink/renderer/core/animation/BUILD.gn +index 4ce94baab..97a1f8811 100644 +--- a/third_party/blink/renderer/core/animation/BUILD.gn ++++ b/third_party/blink/renderer/core/animation/BUILD.gn +@@ -300,6 +300,9 @@ blink_core_sources("animation") { + "worklet_animation_controller.cc", + "worklet_animation_controller.h", + ] ++ jumbo_excluded_sources = [ ++ "css_transform_interpolation_type.cc", ++ ] + + deps = [ + ":buildflags", +diff --git a/third_party/blink/renderer/core/animation/css_shadow_list_interpolation_type.cc b/third_party/blink/renderer/core/animation/css_shadow_list_interpolation_type.cc +index 47ec7902e..6beb54e33 100644 +--- a/third_party/blink/renderer/core/animation/css_shadow_list_interpolation_type.cc ++++ b/third_party/blink/renderer/core/animation/css_shadow_list_interpolation_type.cc +@@ -207,7 +207,7 @@ CSSShadowListInterpolationType::PreInterpolationCompositeIfNeeded( + // to disable that caching in this case. + // TODO(crbug.com/1009230): Remove this once our interpolation code isn't + // caching composited values. +- conversion_checkers.push_back(std::make_unique()); ++ conversion_checkers.push_back(std::make_unique()); + auto interpolable_list = std::unique_ptr( + To(value.interpolable_value.release())); + if (composite == EffectModel::CompositeOperation::kCompositeAdd) { +diff --git a/third_party/blink/renderer/core/css/box_shadow_paint_image_generator.cc b/third_party/blink/renderer/core/css/box_shadow_paint_image_generator.cc +index 8554ef066..50ad55bc8 100644 +--- a/third_party/blink/renderer/core/css/box_shadow_paint_image_generator.cc ++++ b/third_party/blink/renderer/core/css/box_shadow_paint_image_generator.cc +@@ -11,22 +11,22 @@ namespace blink { + namespace { + + BoxShadowPaintImageGenerator::BoxShadowPaintImageGeneratorCreateFunction* +- g_create_function = nullptr; ++ g_create_function_bspig = nullptr; + + } // namespace + + // static + void BoxShadowPaintImageGenerator::Init( + BoxShadowPaintImageGeneratorCreateFunction* create_function) { +- DCHECK(!g_create_function); +- g_create_function = create_function; ++ DCHECK(!g_create_function_bspig); ++ g_create_function_bspig = create_function; + } + + BoxShadowPaintImageGenerator* BoxShadowPaintImageGenerator::Create( + LocalFrame& local_root) { +- DCHECK(g_create_function); ++ DCHECK(g_create_function_bspig); + DCHECK(local_root.IsLocalRoot()); +- return g_create_function(local_root); ++ return g_create_function_bspig(local_root); + } + + } // namespace blink +diff --git a/third_party/blink/renderer/core/css/clip_path_paint_image_generator.cc b/third_party/blink/renderer/core/css/clip_path_paint_image_generator.cc +index 84cae256f..f365766dd 100644 +--- a/third_party/blink/renderer/core/css/clip_path_paint_image_generator.cc ++++ b/third_party/blink/renderer/core/css/clip_path_paint_image_generator.cc +@@ -11,22 +11,22 @@ namespace blink { + namespace { + + ClipPathPaintImageGenerator::ClipPathPaintImageGeneratorCreateFunction* +- g_create_function = nullptr; ++ g_create_function2 = nullptr; + + } // namespace + + // static + void ClipPathPaintImageGenerator::Init( + ClipPathPaintImageGeneratorCreateFunction* create_function) { +- DCHECK(!g_create_function); +- g_create_function = create_function; ++ DCHECK(!g_create_function2); ++ g_create_function2 = create_function; + } + + ClipPathPaintImageGenerator* ClipPathPaintImageGenerator::Create( + LocalFrame& local_root) { +- DCHECK(g_create_function); ++ DCHECK(g_create_function2); + DCHECK(local_root.IsLocalRoot()); +- return g_create_function(local_root); ++ return g_create_function2(local_root); + } + + } // namespace blink +diff --git a/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc b/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc +index a9437500d..2029ebfbc 100644 +--- a/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc ++++ b/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc +@@ -90,7 +90,7 @@ size_t GetCurrentCursorPositionInFrame(LocalFrame* local_frame) { + } + #endif + +-RemoteFrame* SourceFrameForOptionalToken( ++RemoteFrame* SourceFrameForOptionalToken2( + const absl::optional& source_frame_token) { + if (!source_frame_token) + return nullptr; +@@ -710,7 +710,7 @@ void LocalFrameMojoHandler::AdvanceFocusInFrame( + mojom::blink::FocusType focus_type, + const absl::optional& source_frame_token) { + RemoteFrame* source_frame = +- source_frame_token ? SourceFrameForOptionalToken(*source_frame_token) ++ source_frame_token ? SourceFrameForOptionalToken2(*source_frame_token) + : nullptr; + if (!source_frame) { + SetInitialFocus(focus_type == mojom::blink::FocusType::kBackward); +diff --git a/third_party/blink/renderer/core/frame/sticky_ad_detector.cc b/third_party/blink/renderer/core/frame/sticky_ad_detector.cc +index efaeba07b..f108d589a 100644 +--- a/third_party/blink/renderer/core/frame/sticky_ad_detector.cc ++++ b/third_party/blink/renderer/core/frame/sticky_ad_detector.cc +@@ -22,8 +22,8 @@ namespace blink { + + namespace { + +-constexpr base::TimeDelta kFireInterval = base::Seconds(1); +-constexpr double kLargeAdSizeToViewportSizeThreshold = 0.3; ++constexpr base::TimeDelta kFireInterval2 = base::Seconds(1); ++constexpr double kLargeAdSizeToViewportSizeThreshold2 = 0.3; + + // An sticky element should have a non-default position w.r.t. the viewport. The + // main page should also be scrollable. +@@ -71,7 +71,7 @@ void StickyAdDetector::MaybeFireDetection(LocalFrame* outermost_main_frame) { + if (last_detection_time_.has_value() && + base::FeatureList::IsEnabled( + features::kFrequencyCappingForLargeStickyAdDetection) && +- current_time < last_detection_time_.value() + kFireInterval) { ++ current_time < last_detection_time_.value() + kFireInterval2) { + return; + } + +@@ -127,7 +127,7 @@ void StickyAdDetector::MaybeFireDetection(LocalFrame* outermost_main_frame) { + + bool is_large = + (overlay_rect.size().Area64() > outermost_main_frame_size.Area64() * +- kLargeAdSizeToViewportSizeThreshold); ++ kLargeAdSizeToViewportSizeThreshold2); + + bool is_main_page_scrollable = + element->GetDocument().GetLayoutView()->HasScrollableOverflowY(); +diff --git a/third_party/blink/renderer/core/html/forms/html_input_element.cc b/third_party/blink/renderer/core/html/forms/html_input_element.cc +index 475a7a583..bc81c05b4 100644 +--- a/third_party/blink/renderer/core/html/forms/html_input_element.cc ++++ b/third_party/blink/renderer/core/html/forms/html_input_element.cc +@@ -102,7 +102,7 @@ namespace { + + const unsigned kMaxEmailFieldLength = 254; + +-static bool is_default_font_prewarmed_ = false; ++static bool is_default_font_prewarmed_hie = false; + + } // namespace + +@@ -415,10 +415,10 @@ void HTMLInputElement::InitializeTypeInParsing() { + // Prewarm the default font family. Do this while parsing because the style + // recalc calls |TextControlInnerEditorElement::CreateInnerEditorStyle| which + // needs the primary font. +- if (!is_default_font_prewarmed_ && new_type_name == input_type_names::kText) { ++ if (!is_default_font_prewarmed_hie && new_type_name == input_type_names::kText) { + FontCache::PrewarmFamily(LayoutThemeFontProvider::SystemFontFamily( + CSSValueID::kWebkitSmallControl)); +- is_default_font_prewarmed_ = true; ++ is_default_font_prewarmed_hie = true; + } + } + +diff --git a/third_party/blink/renderer/core/html/forms/html_text_area_element.cc b/third_party/blink/renderer/core/html/forms/html_text_area_element.cc +index e2799c952..4d7c468c8 100644 +--- a/third_party/blink/renderer/core/html/forms/html_text_area_element.cc ++++ b/third_party/blink/renderer/core/html/forms/html_text_area_element.cc +@@ -67,7 +67,7 @@ namespace blink { + static const unsigned kDefaultRows = 2; + static const unsigned kDefaultCols = 20; + +-static bool is_default_font_prewarmed_ = false; ++static bool is_default_font_prewarmed_htae = false; + + static inline unsigned ComputeLengthForAPIValue(const String& text) { + unsigned length = text.length(); +@@ -93,14 +93,14 @@ HTMLTextAreaElement::HTMLTextAreaElement(Document& document) + is_placeholder_visible_(false) { + EnsureUserAgentShadowRoot(); + +- if (!is_default_font_prewarmed_) { ++ if (!is_default_font_prewarmed_htae) { + if (Settings* settings = document.GetSettings()) { + // Prewarm 'monospace', the default font family for `