Skip to content

Commit cb74bdf

Browse files
authored
Backporting --ozone-platform-hint fix (uplift to 1.65.x) (#23179)
Uplift of #23166 (squashed) to release
1 parent c4c1fde commit cb74bdf

3 files changed

+68
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
diff --git a/chrome/app/chrome_main_delegate.cc b/chrome/app/chrome_main_delegate.cc
2+
index 73b6ab0934b14609c5b4eba55b4cd0d0c09673af..0b4c44be679d0e92f9f3c206c98efd9cb37191bd 100644
3+
--- a/chrome/app/chrome_main_delegate.cc
4+
+++ b/chrome/app/chrome_main_delegate.cc
5+
@@ -249,6 +249,9 @@
6+
#include "base/scoped_add_feature_flags.h"
7+
#include "ui/base/ui_base_features.h"
8+
#include "ui/ozone/public/ozone_platform.h"
9+
+#if BUILDFLAG(IS_LINUX)
10+
+#include "chrome/browser/chrome_browser_main_extra_parts_linux.h"
11+
+#endif
12+
#endif // BUILDFLAG(IS_OZONE)
13+
14+
base::LazyInstance<ChromeContentGpuClient>::DestructorAtExit
15+
@@ -959,6 +962,9 @@ std::optional<int> ChromeMainDelegate::PostEarlyInitialization(
16+
// Initialize Ozone platform and add required feature flags as per platform's
17+
// properties. Must be added before feature list is created otherwise the
18+
// added flag won't be picked up.
19+
+#if BUILDFLAG(IS_LINUX)
20+
+ ChromeBrowserMainExtraPartsLinux::InitOzonePlatformHint();
21+
+#endif
22+
ui::OzonePlatform::PreEarlyInitialization();
23+
AddFeatureFlagsToCommandLine();
24+
#endif // BUILDFLAG(IS_OZONE)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
diff --git a/chrome/browser/chrome_browser_main_extra_parts_linux.cc b/chrome/browser/chrome_browser_main_extra_parts_linux.cc
2+
index dba7b116ecaa07b8dd085284b5bd38b172a8f250..ea0487022dcdcf45aac35bf6170a27141bcb1157 100644
3+
--- a/chrome/browser/chrome_browser_main_extra_parts_linux.cc
4+
+++ b/chrome/browser/chrome_browser_main_extra_parts_linux.cc
5+
@@ -168,7 +168,13 @@ ChromeBrowserMainExtraPartsLinux::ChromeBrowserMainExtraPartsLinux() = default;
6+
7+
ChromeBrowserMainExtraPartsLinux::~ChromeBrowserMainExtraPartsLinux() = default;
8+
9+
-void ChromeBrowserMainExtraPartsLinux::PreEarlyInitialization() {
10+
+void ChromeBrowserMainExtraPartsLinux::PostBrowserStart() {
11+
+ RecordDisplayServerProtocolSupport();
12+
+ ChromeBrowserMainExtraPartsOzone::PostBrowserStart();
13+
+}
14+
+
15+
+// static
16+
+void ChromeBrowserMainExtraPartsLinux::InitOzonePlatformHint() {
17+
#if BUILDFLAG(IS_LINUX)
18+
// On the desktop, we fix the platform name if necessary.
19+
// See https://crbug.com/1246928.
20+
@@ -189,8 +195,3 @@ void ChromeBrowserMainExtraPartsLinux::PreEarlyInitialization() {
21+
}
22+
#endif // BUILDFLAG(IS_LINUX)
23+
}
24+
-
25+
-void ChromeBrowserMainExtraPartsLinux::PostBrowserStart() {
26+
- RecordDisplayServerProtocolSupport();
27+
- ChromeBrowserMainExtraPartsOzone::PostBrowserStart();
28+
-}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
diff --git a/chrome/browser/chrome_browser_main_extra_parts_linux.h b/chrome/browser/chrome_browser_main_extra_parts_linux.h
2+
index 3847bd2090e282486717fb211308915ec9251abe..4f188a7bdfe3867bcdf83ce9e442e94a002095b6 100644
3+
--- a/chrome/browser/chrome_browser_main_extra_parts_linux.h
4+
+++ b/chrome/browser/chrome_browser_main_extra_parts_linux.h
5+
@@ -17,9 +17,10 @@ class ChromeBrowserMainExtraPartsLinux
6+
const ChromeBrowserMainExtraPartsLinux&) = delete;
7+
~ChromeBrowserMainExtraPartsLinux() override;
8+
9+
+ static void InitOzonePlatformHint();
10+
+
11+
private:
12+
// ChromeBrowserMainExtraParts overrides.
13+
- void PreEarlyInitialization() override;
14+
void PostBrowserStart() override;
15+
};
16+

0 commit comments

Comments
 (0)