[ozone] Added the --ozone-platform-hint flag. [chromium/src : main]

2,418 views
Skip to first unread message

Alexander Dunaev (Gerrit)

unread,
Oct 18, 2021, 1:34:34 AM10/18/21
to asvitki...@chromium.org, jmedle...@chromium.org, ozone-...@chromium.org

Attention is currently required from: Robert Kroeger, Alexander Dunaev, Nico Weber.

Alexander Dunaev uploaded patch set #24 to this change.

View Change

[ozone] Added the --ozone-platform-hint flag.

The Ozone platform is currently selected via the --ozone-platform
command line switch. This is not really handy, especially for desktop
users who would like to use a non-default platform daily, or for those
who switches between X11 and Wayland sessions.

This patch introduces the --ozone-platform-hint flag that suggests the
Ozone platform to use. A special "auto" value selects the Wayland
backend if the current session uses Wayland.

[1] https://chromium.googlesource.com/chromium/src/+/main/docs/configuration.md

Bug: 1246928
Change-Id: I602b27363cbdcc87b61b3335865502ea61b356d8
---
M chrome/browser/flag_descriptions.cc
M base/threading/thread_restrictions.h
M chrome/browser/about_flags.cc
M chrome/browser/flag_descriptions.h
M chrome/browser/flag-metadata.json
M ui/ozone/public/ozone_switches.cc
M tools/metrics/histograms/enums.xml
A chrome/browser/chrome_browser_main_extra_parts_linux.h
A chrome/browser/chrome_browser_main_extra_parts_linux.cc
M chrome/browser/chrome_browser_main_extra_parts_ozone.h
M ui/ozone/public/ozone_switches.h
M chrome/browser/BUILD.gn
M chrome/browser/chrome_content_browser_client.cc
13 files changed, 264 insertions(+), 5 deletions(-)

To view, visit change 3188974. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I602b27363cbdcc87b61b3335865502ea61b356d8
Gerrit-Change-Number: 3188974
Gerrit-PatchSet: 24
Gerrit-Owner: Alexander Dunaev <adu...@igalia.com>
Gerrit-Reviewer: Alexander Dunaev <adu...@igalia.com>
Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
Gerrit-Reviewer: Maksim Sisov <msi...@igalia.com>
Gerrit-Reviewer: Michael Spang <sp...@chromium.org>
Gerrit-Reviewer: Nico Weber <tha...@chromium.org>
Gerrit-Reviewer: Robert Kroeger <rjkr...@chromium.org>
Gerrit-CC: Nick Yamane <nick...@igalia.com>
Gerrit-CC: Thomas Anderson <thomasa...@chromium.org>
Gerrit-Attention: Robert Kroeger <rjkr...@chromium.org>
Gerrit-Attention: Alexander Dunaev <adu...@igalia.com>
Gerrit-Attention: Nico Weber <tha...@chromium.org>
Gerrit-MessageType: newpatchset

Alexander Dunaev (Gerrit)

unread,
Oct 18, 2021, 2:47:50 AM10/18/21
to asvitki...@chromium.org, jmedle...@chromium.org, ozone-...@chromium.org

Attention is currently required from: Robert Kroeger, Alexander Dunaev, Nico Weber.

Alexander Dunaev uploaded patch set #25 to this change.

View Change

[ozone] Added the --ozone-platform-hint flag.

To date, the only way to choose the Ozone platform is setting the
--ozone-platform command line switch. That is not really handy,

especially for desktop users who would like to use a non-default
platform daily, or for those who switches between X11 and Wayland
sessions.

This patch introduces the --ozone-platform-hint flag that suggests the
Ozone platform to use. A special "auto" value selects the Wayland
backend if the current session uses Wayland.

[1] https://chromium.googlesource.com/chromium/src/+/main/docs/configuration.md

Bug: 1246928
Change-Id: I602b27363cbdcc87b61b3335865502ea61b356d8
---
M chrome/browser/flag_descriptions.cc
M base/threading/thread_restrictions.h
M chrome/browser/about_flags.cc
M chrome/browser/flag_descriptions.h
M chrome/browser/flag-metadata.json
M ui/ozone/public/ozone_switches.cc
M tools/metrics/histograms/enums.xml
A chrome/browser/chrome_browser_main_extra_parts_linux.h
A chrome/browser/chrome_browser_main_extra_parts_linux.cc
M chrome/browser/chrome_browser_main_extra_parts_ozone.h
M ui/ozone/public/ozone_switches.h
M chrome/browser/BUILD.gn
M chrome/browser/chrome_content_browser_client.cc
13 files changed, 265 insertions(+), 5 deletions(-)

To view, visit change 3188974. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I602b27363cbdcc87b61b3335865502ea61b356d8
Gerrit-Change-Number: 3188974
Gerrit-PatchSet: 25

Alexander Dunaev (Gerrit)

unread,
Oct 18, 2021, 3:00:45 AM10/18/21
to asvitki...@chromium.org, jmedle...@chromium.org, ozone-...@chromium.org, Michael Spang, Daniel Cheng, Nico Weber, Robert Kroeger, Maksim Sisov, Nick Yamane, Thomas Anderson, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Michael Spang, Robert Kroeger, Nico Weber.

View Change

2 comments:

  • Patchset:

    • Patch Set #26:

      Michael, Nico, I have changed this after we discussed the changes. Please take one more look. I will wait for your remarks.

  • File chrome/browser/chrome_browser_main_extra_parts_linux.cc:

    • Patch Set #21, Line 126:

            base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
      switches::kOzonePlatform);

      This logic rewrites the command line which is a additional reason the flag will not work "normally". […]

      I agree that it is better to have this hint using its own switch, exactly due to reasons that Michael mentioned: we rewrite the command line, which makes things complicated if the same switch is used. I have changed the new logic to use the new --ozone-platform-hint switch. If the user runs chrome with --ozone-platform, the hint is ignored.

To view, visit change 3188974. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I602b27363cbdcc87b61b3335865502ea61b356d8
Gerrit-Change-Number: 3188974
Gerrit-PatchSet: 26
Gerrit-Owner: Alexander Dunaev <adu...@igalia.com>
Gerrit-Reviewer: Alexander Dunaev <adu...@igalia.com>
Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
Gerrit-Reviewer: Maksim Sisov <msi...@igalia.com>
Gerrit-Reviewer: Michael Spang <sp...@chromium.org>
Gerrit-Reviewer: Nico Weber <tha...@chromium.org>
Gerrit-Reviewer: Robert Kroeger <rjkr...@chromium.org>
Gerrit-CC: Nick Yamane <nick...@igalia.com>
Gerrit-CC: Thomas Anderson <thomasa...@chromium.org>
Gerrit-Attention: Michael Spang <sp...@chromium.org>
Gerrit-Attention: Robert Kroeger <rjkr...@chromium.org>
Gerrit-Attention: Nico Weber <tha...@chromium.org>
Gerrit-Comment-Date: Mon, 18 Oct 2021 07:00:33 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Michael Spang <sp...@chromium.org>
Comment-In-Reply-To: Alexander Dunaev <adu...@igalia.com>
Comment-In-Reply-To: Nico Weber <tha...@chromium.org>
Gerrit-MessageType: comment

Robert Kroeger (Gerrit)

unread,
Oct 18, 2021, 3:54:26 PM10/18/21
to Alexander Dunaev, asvitki...@chromium.org, jmedle...@chromium.org, ozone-...@chromium.org, Michael Spang, Daniel Cheng, Nico Weber, Maksim Sisov, Nick Yamane, Thomas Anderson, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Michael Spang, Alexander Dunaev, Nico Weber.

Patch set 27:Code-Review +1

View Change

    To view, visit change 3188974. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I602b27363cbdcc87b61b3335865502ea61b356d8
    Gerrit-Change-Number: 3188974
    Gerrit-PatchSet: 27
    Gerrit-Owner: Alexander Dunaev <adu...@igalia.com>
    Gerrit-Reviewer: Alexander Dunaev <adu...@igalia.com>
    Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
    Gerrit-Reviewer: Maksim Sisov <msi...@igalia.com>
    Gerrit-Reviewer: Michael Spang <sp...@chromium.org>
    Gerrit-Reviewer: Nico Weber <tha...@chromium.org>
    Gerrit-Reviewer: Robert Kroeger <rjkr...@chromium.org>
    Gerrit-CC: Nick Yamane <nick...@igalia.com>
    Gerrit-CC: Thomas Anderson <thomasa...@chromium.org>
    Gerrit-Attention: Michael Spang <sp...@chromium.org>
    Gerrit-Attention: Alexander Dunaev <adu...@igalia.com>
    Gerrit-Attention: Nico Weber <tha...@chromium.org>
    Gerrit-Comment-Date: Mon, 18 Oct 2021 19:54:16 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    Gerrit-MessageType: comment

    Alexander Dunaev (Gerrit)

    unread,
    Oct 19, 2021, 2:00:12 AM10/19/21
    to asvitki...@chromium.org, jmedle...@chromium.org, ozone-...@chromium.org, Robert Kroeger, Michael Spang, Daniel Cheng, Nico Weber, Maksim Sisov, Nick Yamane, Thomas Anderson, Chromium LUCI CQ, chromium...@chromium.org

    Attention is currently required from: Michael Spang, Nico Weber.

    Patch set 27:Commit-Queue +2

    View Change

    1 comment:

    To view, visit change 3188974. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I602b27363cbdcc87b61b3335865502ea61b356d8
    Gerrit-Change-Number: 3188974
    Gerrit-PatchSet: 27
    Gerrit-Owner: Alexander Dunaev <adu...@igalia.com>
    Gerrit-Reviewer: Alexander Dunaev <adu...@igalia.com>
    Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
    Gerrit-Reviewer: Maksim Sisov <msi...@igalia.com>
    Gerrit-Reviewer: Michael Spang <sp...@chromium.org>
    Gerrit-Reviewer: Nico Weber <tha...@chromium.org>
    Gerrit-Reviewer: Robert Kroeger <rjkr...@chromium.org>
    Gerrit-CC: Nick Yamane <nick...@igalia.com>
    Gerrit-CC: Thomas Anderson <thomasa...@chromium.org>
    Gerrit-Attention: Michael Spang <sp...@chromium.org>
    Gerrit-Attention: Nico Weber <tha...@chromium.org>
    Gerrit-Comment-Date: Tue, 19 Oct 2021 06:00:00 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Gerrit-MessageType: comment

    Chromium LUCI CQ (Gerrit)

    unread,
    Oct 19, 2021, 2:08:24 AM10/19/21
    to Alexander Dunaev, asvitki...@chromium.org, jmedle...@chromium.org, ozone-...@chromium.org, Robert Kroeger, Michael Spang, Daniel Cheng, Nico Weber, Maksim Sisov, Nick Yamane, Thomas Anderson, chromium...@chromium.org

    Chromium LUCI CQ submitted this change.

    View Change


    Approvals: Robert Kroeger: Looks good to me Daniel Cheng: Looks good to me Nico Weber: Looks good to me Michael Spang: Looks good to me Alexander Dunaev: Commit
    [ozone] Added the --ozone-platform-hint flag.

    To date, the only way to choose the Ozone platform is setting the
    --ozone-platform command line switch. That is not really handy,
    especially for desktop users who would like to use a non-default
    platform daily, or for those who switches between X11 and Wayland
    sessions.

    This patch introduces the --ozone-platform-hint flag that suggests the
    Ozone platform to use. A special "auto" value selects the Wayland
    backend if the current session uses Wayland.

    [1] https://chromium.googlesource.com/chromium/src/+/main/docs/configuration.md

    Bug: 1246928
    Change-Id: I602b27363cbdcc87b61b3335865502ea61b356d8
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3188974
    Reviewed-by: Robert Kroeger <rjkr...@chromium.org>
    Reviewed-by: Daniel Cheng <dch...@chromium.org>
    Reviewed-by: Michael Spang <sp...@chromium.org>
    Reviewed-by: Nico Weber <tha...@chromium.org>
    Commit-Queue: Alexander Dunaev <adu...@igalia.com>
    Cr-Commit-Position: refs/heads/main@{#932878}

    ---
    M chrome/browser/flag_descriptions.cc
    M base/threading/thread_restrictions.h
    M chrome/browser/about_flags.cc
    M chrome/browser/flag_descriptions.h
    M chrome/browser/flag-metadata.json
    M ui/ozone/public/ozone_switches.cc
    M tools/metrics/histograms/enums.xml
    A chrome/browser/chrome_browser_main_extra_parts_linux.h
    A chrome/browser/chrome_browser_main_extra_parts_linux.cc
    M chrome/browser/chrome_browser_main_extra_parts_ozone.h
    M ui/ozone/public/ozone_switches.h
    M chrome/browser/BUILD.gn
    M chrome/browser/chrome_content_browser_client.cc
    13 files changed, 273 insertions(+), 5 deletions(-)


    To view, visit change 3188974. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I602b27363cbdcc87b61b3335865502ea61b356d8
    Gerrit-Change-Number: 3188974
    Gerrit-PatchSet: 28
    Gerrit-Owner: Alexander Dunaev <adu...@igalia.com>
    Gerrit-Reviewer: Alexander Dunaev <adu...@igalia.com>
    Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
    Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
    Gerrit-Reviewer: Maksim Sisov <msi...@igalia.com>
    Gerrit-Reviewer: Michael Spang <sp...@chromium.org>
    Gerrit-Reviewer: Nico Weber <tha...@chromium.org>
    Gerrit-Reviewer: Robert Kroeger <rjkr...@chromium.org>
    Gerrit-CC: Nick Yamane <nick...@igalia.com>
    Gerrit-CC: Thomas Anderson <thomasa...@chromium.org>
    Gerrit-MessageType: merged
    Reply all
    Reply to author
    Forward
    0 new messages