This repository has been archived by the owner on May 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backport fix for --ozone-platform-hint
Partially fixes flathub/org.chromium.Chromium#385. Signed-off-by: Ryan Gonzalez <[email protected]>
- Loading branch information
Showing
2 changed files
with
97 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
From 2893d7921a7f7beb79445e7815dfb901a1835128 Mon Sep 17 00:00:00 2001 | ||
From: Tom Anderson <[email protected]> | ||
Date: Wed, 20 Mar 2024 00:00:12 +0000 | ||
Subject: [PATCH] Fix --ozone-platform-hint | ||
|
||
This fixes a regression after r1269993 which moved ozone platform | ||
early initialization before the ozone platform hint flag was | ||
processed. This CL ensures the flag processing happens even earlier. | ||
|
||
R=sky | ||
|
||
Change-Id: Icc9649beb0b86753265be2b6cdf3059611eb410f | ||
Bug: None | ||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5375669 | ||
Reviewed-by: Scott Violet <[email protected]> | ||
Auto-Submit: Thomas Anderson <[email protected]> | ||
Commit-Queue: Thomas Anderson <[email protected]> | ||
Cr-Commit-Position: refs/heads/main@{#1275306} | ||
--- | ||
chrome/app/chrome_main_delegate.cc | 6 ++++++ | ||
.../chrome_browser_main_extra_parts_linux.cc | 13 +++++++------ | ||
.../browser/chrome_browser_main_extra_parts_linux.h | 3 ++- | ||
3 files changed, 15 insertions(+), 7 deletions(-) | ||
|
||
diff --git a/chrome/app/chrome_main_delegate.cc b/chrome/app/chrome_main_delegate.cc | ||
index 73b6ab0934b14..0b4c44be679d0 100644 | ||
--- a/chrome/app/chrome_main_delegate.cc | ||
+++ b/chrome/app/chrome_main_delegate.cc | ||
@@ -249,6 +249,9 @@ | ||
#include "base/scoped_add_feature_flags.h" | ||
#include "ui/base/ui_base_features.h" | ||
#include "ui/ozone/public/ozone_platform.h" | ||
+#if BUILDFLAG(IS_LINUX) | ||
+#include "chrome/browser/chrome_browser_main_extra_parts_linux.h" | ||
+#endif | ||
#endif // BUILDFLAG(IS_OZONE) | ||
|
||
base::LazyInstance<ChromeContentGpuClient>::DestructorAtExit | ||
@@ -959,6 +962,9 @@ std::optional<int> ChromeMainDelegate::PostEarlyInitialization( | ||
// Initialize Ozone platform and add required feature flags as per platform's | ||
// properties. Must be added before feature list is created otherwise the | ||
// added flag won't be picked up. | ||
+#if BUILDFLAG(IS_LINUX) | ||
+ ChromeBrowserMainExtraPartsLinux::InitOzonePlatformHint(); | ||
+#endif | ||
ui::OzonePlatform::PreEarlyInitialization(); | ||
AddFeatureFlagsToCommandLine(); | ||
#endif // BUILDFLAG(IS_OZONE) | ||
diff --git a/chrome/browser/chrome_browser_main_extra_parts_linux.cc b/chrome/browser/chrome_browser_main_extra_parts_linux.cc | ||
index dba7b116ecaa0..ea0487022dcdc 100644 | ||
--- a/chrome/browser/chrome_browser_main_extra_parts_linux.cc | ||
+++ b/chrome/browser/chrome_browser_main_extra_parts_linux.cc | ||
@@ -168,7 +168,13 @@ ChromeBrowserMainExtraPartsLinux::ChromeBrowserMainExtraPartsLinux() = default; | ||
|
||
ChromeBrowserMainExtraPartsLinux::~ChromeBrowserMainExtraPartsLinux() = default; | ||
|
||
-void ChromeBrowserMainExtraPartsLinux::PreEarlyInitialization() { | ||
+void ChromeBrowserMainExtraPartsLinux::PostBrowserStart() { | ||
+ RecordDisplayServerProtocolSupport(); | ||
+ ChromeBrowserMainExtraPartsOzone::PostBrowserStart(); | ||
+} | ||
+ | ||
+// static | ||
+void ChromeBrowserMainExtraPartsLinux::InitOzonePlatformHint() { | ||
#if BUILDFLAG(IS_LINUX) | ||
// On the desktop, we fix the platform name if necessary. | ||
// See https://crbug.com/1246928. | ||
@@ -189,8 +195,3 @@ void ChromeBrowserMainExtraPartsLinux::PreEarlyInitialization() { | ||
} | ||
#endif // BUILDFLAG(IS_LINUX) | ||
} | ||
- | ||
-void ChromeBrowserMainExtraPartsLinux::PostBrowserStart() { | ||
- RecordDisplayServerProtocolSupport(); | ||
- ChromeBrowserMainExtraPartsOzone::PostBrowserStart(); | ||
-} | ||
diff --git a/chrome/browser/chrome_browser_main_extra_parts_linux.h b/chrome/browser/chrome_browser_main_extra_parts_linux.h | ||
index 3847bd2090e28..4f188a7bdfe38 100644 | ||
--- a/chrome/browser/chrome_browser_main_extra_parts_linux.h | ||
+++ b/chrome/browser/chrome_browser_main_extra_parts_linux.h | ||
@@ -17,9 +17,10 @@ class ChromeBrowserMainExtraPartsLinux | ||
const ChromeBrowserMainExtraPartsLinux&) = delete; | ||
~ChromeBrowserMainExtraPartsLinux() override; | ||
|
||
+ static void InitOzonePlatformHint(); | ||
+ | ||
private: | ||
// ChromeBrowserMainExtraParts overrides. | ||
- void PreEarlyInitialization() override; | ||
void PostBrowserStart() override; | ||
}; | ||
|
||
-- | ||
2.44.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters