AWC window.maximize, minimize and restore promises implemented [chromium/src : main]

0 views
Skip to first unread message

Patryk Chodur (Gerrit)

unread,
Nov 4, 2025, 11:16:44 AMNov 4
to Code Review Nudger, Olga Korokhina, Andrew Rayskiy, Daniel Cheng, AyeAye, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin, blink-revi...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, creis...@chromium.org, gavinp...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org
Attention needed from Andrew Rayskiy and Olga Korokhina

Patryk Chodur added 1 comment

File third_party/blink/renderer/core/page/chrome_client_impl.cc
Line 256, Patchset 8: std::move(callback).Run(/*minimized=*/false);
Andrew Rayskiy . resolved

You're removing this branching in https://chromium-review.googlesource.com/c/chromium/src/+/7106319/1/third_party/blink/renderer/core/page/chrome_client_impl.h. Is it really necessary for the API to include true/false return values?

Patryk Chodur

After I remove the `#ifdefs` I think no. I plan to add timeouts to the callbacks which will require that, but given that it will be done in a different CL I can remove them when rebasing.

Patryk Chodur

Discussed in chat. Keeping if for now for the timeouts.

Open in Gerrit

Related details

Attention is currently required from:
  • Andrew Rayskiy
  • Olga Korokhina
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I212501e1b8f0750becdd0c9aa3a474d4bb687f5e
Gerrit-Change-Number: 7041143
Gerrit-PatchSet: 13
Gerrit-Owner: Patryk Chodur <pch...@google.com>
Gerrit-Reviewer: Andrew Rayskiy <green...@google.com>
Gerrit-Reviewer: Olga Korokhina <koro...@google.com>
Gerrit-Reviewer: Patryk Chodur <pch...@google.com>
Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
Gerrit-CC: Daniel Cheng <dch...@chromium.org>
Gerrit-CC: Nate Chapin <jap...@chromium.org>
Gerrit-Attention: Andrew Rayskiy <green...@google.com>
Gerrit-Attention: Olga Korokhina <koro...@google.com>
Gerrit-Comment-Date: Tue, 04 Nov 2025 16:16:30 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Patryk Chodur <pch...@google.com>
Comment-In-Reply-To: Andrew Rayskiy <green...@google.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Olga Korokhina (Gerrit)

unread,
Nov 4, 2025, 11:29:46 AMNov 4
to Patryk Chodur, Code Review Nudger, Andrew Rayskiy, Daniel Cheng, AyeAye, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin, blink-revi...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, creis...@chromium.org, gavinp...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org
Attention needed from Andrew Rayskiy and Patryk Chodur

Olga Korokhina added 1 comment

File third_party/blink/renderer/modules/awc/additional_windowing_controls.cc
Line 165, Patchset 7: "Could not restore the window."));
Olga Korokhina . resolved

Can we have a bit more of a context/reason here, f.i. "Window could not be restored due to [reason]", or this is not needed @greengrape ?

Patryk Chodur

As of now these callbacks can't really be rejected unless somebody breaks something in the code. The checks for whether the API is allowed and makes sense were earlier, for example in the `IsPermissionGranted` function.

Olga Korokhina

Got it, so we don't have a reason here, just a fact. Thank you.

Open in Gerrit

Related details

Attention is currently required from:
  • Andrew Rayskiy
  • Patryk Chodur
Gerrit-Attention: Patryk Chodur <pch...@google.com>
Gerrit-Attention: Andrew Rayskiy <green...@google.com>
Gerrit-Comment-Date: Tue, 04 Nov 2025 16:29:27 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Patryk Chodur <pch...@google.com>
Comment-In-Reply-To: Olga Korokhina <koro...@google.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Andrew Rayskiy (Gerrit)

unread,
Nov 4, 2025, 11:50:12 AMNov 4
to Patryk Chodur, Code Review Nudger, Olga Korokhina, Daniel Cheng, AyeAye, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin, blink-revi...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, creis...@chromium.org, gavinp...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org
Attention needed from Olga Korokhina and Patryk Chodur

Andrew Rayskiy voted and added 4 comments

Votes added by Andrew Rayskiy

Code-Review+1

4 comments

File third_party/blink/renderer/core/exported/web_view_impl.h
Line 1032, Patchset 8: Vector<MinimizeCallback> minimize_callbacks_;
Andrew Rayskiy . resolved

Maybe use `base/callback_list.h` here? I'm not sure what the guidance here is.

Patryk Chodur

I don't see it being used in the blink code ([here](https://source.chromium.org/search?q=CallbackList%20path:blink&sq=)) whereas a `Vector` with callbacks is used in many places ([here](https://source.chromium.org/search?q=case:yes%20pcre:yes%20Vector%3C%5B%5Cw%3C%3E%5Cs:%5D%2B%5BcC%5Dallback%5Cw%2B;%20path:blink)). Besides, `CallbackList` is mostly useful for fixing lifetime issues (with the `CallbackListSubscription`), but the promise resolved in these callbacks is garbage collected, so _as far as I understand_ there's no problem.

Andrew Rayskiy

Ack!

File third_party/blink/renderer/core/frame/web_frame_widget_impl.cc
Line 1818, Patchset 13 (Latest): ui::mojom::blink::WindowShowState old_show_state = window_show_state_;
Andrew Rayskiy . unresolved

nit: I'd do a func-local `using WindowShowState = ui::mojom::blink::WindowShowState;` -- this might simplify the switch too

File third_party/blink/renderer/modules/awc/additional_windowing_controls.cc
Line 65, Patchset 13 (Latest): ui::mojom::blink::WindowShowState::kMaximized;
Andrew Rayskiy . unresolved

nit: `using ui::mojom::blink::WindowShowState` in the anon namespace

Line 110, Patchset 7: if (window->GetFrame()->GetWidgetForLocalRoot()->WindowShowState() ==
Andrew Rayskiy . resolved

(here and elsewhere) this condition is hard to read. How about an anon func?
```
bool IsMaximized(LocalDOMWindow* window) { return ... }
```

and then...
```
if (IsMaximized(window)) {
resolver->Resolve();
return;
}

// inline the callback here...

window->GetFrame()->GetChromeClient().Maximize(*window->GetFrame(),
std::move(callback));
```

Is there any sense in allowing parallel requests btw? i.e. calling minimize() while a maximize() call is in progress?

Olga Korokhina

+1, as long as there are more than 1 inclusions of this check this seems to be reasonable.

Patryk Chodur

Added the anon function and inlined the callback.

As for whether it makes sense to issue parallel requests – in general it doesn't make much sense to do it, but it's likely going to happen because:

  • this is a UI thing and we're resolving the promises when the OS changes the window state. In case of any lag the user will likely try to hit various buttons and the app will issue appropriate requests
  • the OS can ignore the requests to change the window state. What will happen right now is we'll never resolve nor reject the promise. I plan to add some timeouts, but even then we can have 2 pending promises waiting to be resolved or rejected.
Andrew Rayskiy

Acknowledged

Open in Gerrit

Related details

Attention is currently required from:
  • Olga Korokhina
  • Patryk Chodur
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I212501e1b8f0750becdd0c9aa3a474d4bb687f5e
    Gerrit-Change-Number: 7041143
    Gerrit-PatchSet: 13
    Gerrit-Owner: Patryk Chodur <pch...@google.com>
    Gerrit-Reviewer: Andrew Rayskiy <green...@google.com>
    Gerrit-Reviewer: Olga Korokhina <koro...@google.com>
    Gerrit-Reviewer: Patryk Chodur <pch...@google.com>
    Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
    Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
    Gerrit-CC: Daniel Cheng <dch...@chromium.org>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-Attention: Patryk Chodur <pch...@google.com>
    Gerrit-Attention: Olga Korokhina <koro...@google.com>
    Gerrit-Comment-Date: Tue, 04 Nov 2025 16:49:56 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Patryk Chodur <pch...@google.com>
    Comment-In-Reply-To: Andrew Rayskiy <green...@google.com>
    Comment-In-Reply-To: Olga Korokhina <koro...@google.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Olga Korokhina (Gerrit)

    unread,
    Nov 4, 2025, 11:57:29 AMNov 4
    to Patryk Chodur, Andrew Rayskiy, Code Review Nudger, Daniel Cheng, AyeAye, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin, blink-revi...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, creis...@chromium.org, gavinp...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org
    Attention needed from Patryk Chodur

    Olga Korokhina voted Code-Review+1

    Code-Review+1
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Patryk Chodur
    Gerrit-Comment-Date: Tue, 04 Nov 2025 16:57:10 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Olga Korokhina (Gerrit)

    unread,
    Nov 4, 2025, 11:57:59 AMNov 4
    to Patryk Chodur, Andrew Rayskiy, Code Review Nudger, Daniel Cheng, AyeAye, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin, blink-revi...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, creis...@chromium.org, gavinp...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org
    Attention needed from Patryk Chodur

    Olga Korokhina added 1 comment

    Patchset-level comments
    File-level comment, Patchset 13 (Latest):
    Olga Korokhina . resolved

    +1 after tests fixed.

    Gerrit-Comment-Date: Tue, 04 Nov 2025 16:57:44 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Patryk Chodur (Gerrit)

    unread,
    Nov 4, 2025, 12:57:27 PMNov 4
    to Olga Korokhina, Andrew Rayskiy, Code Review Nudger, Daniel Cheng, AyeAye, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin, blink-revi...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, creis...@chromium.org, gavinp...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org

    Patryk Chodur added 2 comments

    File third_party/blink/renderer/core/frame/web_frame_widget_impl.cc
    Line 1818, Patchset 13: ui::mojom::blink::WindowShowState old_show_state = window_show_state_;
    Andrew Rayskiy . resolved

    nit: I'd do a func-local `using WindowShowState = ui::mojom::blink::WindowShowState;` -- this might simplify the switch too

    Patryk Chodur

    Done

    File third_party/blink/renderer/modules/awc/additional_windowing_controls.cc
    Line 65, Patchset 13: ui::mojom::blink::WindowShowState::kMaximized;
    Andrew Rayskiy . resolved

    nit: `using ui::mojom::blink::WindowShowState` in the anon namespace

    Patryk Chodur

    Done

    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I212501e1b8f0750becdd0c9aa3a474d4bb687f5e
      Gerrit-Change-Number: 7041143
      Gerrit-PatchSet: 14
      Gerrit-Owner: Patryk Chodur <pch...@google.com>
      Gerrit-Reviewer: Andrew Rayskiy <green...@google.com>
      Gerrit-Reviewer: Olga Korokhina <koro...@google.com>
      Gerrit-Reviewer: Patryk Chodur <pch...@google.com>
      Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
      Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
      Gerrit-CC: Daniel Cheng <dch...@chromium.org>
      Gerrit-CC: Nate Chapin <jap...@chromium.org>
      Gerrit-Comment-Date: Tue, 04 Nov 2025 17:57:06 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Andrew Rayskiy <green...@google.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Mike Wasserman (Gerrit)

      unread,
      Nov 5, 2025, 1:44:17 PMNov 5
      to Patryk Chodur, Olga Korokhina, Andrew Rayskiy, Code Review Nudger, Daniel Cheng, AyeAye, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin, blink-revi...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, creis...@chromium.org, gavinp...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org
      Attention needed from Patryk Chodur

      Mike Wasserman added 6 comments

      File chrome/browser/ui/views/web_apps/frame_toolbar/web_app_frame_toolbar_browsertest.cc
      Line 2340, Patchset 15 (Latest): const char restore_script[] =
      Mike Wasserman . unresolved

      optional nit: extract shared script string literals or test helper methods

      I suggest a helper that takes the API method name and expected state, e.g.:
      ```
      EvalJsResult EvalDisplayStateChange(
      const ToRenderFrameHost& execution_target,
      std::string_view window_method,
      std::string_view expected_state) {
      const char script[] =
      R"(new Promise((resolve, reject) => {
      window.$1().then(() => {
      if (window.matchMedia('(display-state: $2)').matches) {
      resolve('window.$1() succeeded.');
      } else {
      reject('window.$1() resolved, but ' +
      '`display-state: $2` not matched.');
      }
      }).catch(() => reject('window.$1() rejected.'));
      });)";
      return content::EvalJs(web_contents, content::JsReplace(script, window_method, expected_state));
      ```
      File third_party/blink/renderer/core/exported/web_view_impl.h
      Line 616, Patchset 15 (Latest): void WasMinimized();
      Mike Wasserman . unresolved

      Consider adding a single `OnWindowShowStateChanged(ui::mojom::blink::WindowShowState)` instead.

      File third_party/blink/renderer/core/exported/web_view_impl.cc
      Line 3191, Patchset 15 (Latest): for (auto& callback : callbacks) {
      Mike Wasserman . unresolved

      This is a great improvement over the initial impl, thank you.

      Still, this won't work really well when a sequence of JS methods are invoked, then promises are resolved out of order e.g. `m1 = minimize(); r1 = restore(); m2 = minimize();` m2 will resolve when the first minimize() completes, potentially before the window is restored and minimized a second time.

      Getting this right depends on how requests are issued to the WM (looks like we don't currently queue requests internally, we just issue them to the WM directly) and how the underlying WM handles our requests. If the WM treats requests in a FIFO queue, we could probably keep a single ordered list of all callbacks (with an associated type), and resolve everything at the front of the queue matching the state surfaced here.

      Getting this correct wouldn't be easy, so API spec/docs should explain what behavior clients can expect.

      Maybe rejecting requests when another request is in flight would yield a simpler and more reliable impl?

      File third_party/blink/renderer/core/frame/web_frame_widget_impl.cc
      Line 1878, Patchset 15 (Latest): if (old_show_state != window_show_state_) {
      Mike Wasserman . unresolved

      There's no clear request denial signal at this layer, right? If so, when the WM silently ignores a request, the JS promise will hang indefinitely. I wonder if the promises should reject with some timeout? (e.g. no window state change in 3s?). Again, we don't need a perfect impl, but having something well documented and reliable would be great.

      Line 1889, Patchset 15 (Latest): if (old_show_state == WindowShowState::kMinimized ||
      old_show_state == WindowShowState::kFullscreen) {
      // We cannot reliably tell whether the change was caused by restoring
      // the window or maximizing it.
      View()->WasRestored();
      }
      Mike Wasserman . unresolved

      Clients like WebViewImpl would be better served be a single notification of window state change (as I suggested above). Then WebViewImpl can decide how to resolve its own callbacks from the clearest underlying signals, not from potentially ambiguous interpretations encapsulated here.

      File third_party/blink/renderer/modules/awc/additional_windowing_controls.cc
      Line 112, Patchset 15 (Latest): const String& error_message, bool maximized) {
      Mike Wasserman . unresolved
      This represents success for any of the operations, not just maximized
      ```suggestion
      const String& error_message, bool result) {
      ```
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Patryk Chodur
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I212501e1b8f0750becdd0c9aa3a474d4bb687f5e
        Gerrit-Change-Number: 7041143
        Gerrit-PatchSet: 15
        Gerrit-Owner: Patryk Chodur <pch...@google.com>
        Gerrit-Reviewer: Andrew Rayskiy <green...@google.com>
        Gerrit-Reviewer: Mike Wasserman <m...@chromium.org>
        Gerrit-Reviewer: Olga Korokhina <koro...@google.com>
        Gerrit-Reviewer: Patryk Chodur <pch...@google.com>
        Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
        Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
        Gerrit-CC: Daniel Cheng <dch...@chromium.org>
        Gerrit-CC: Nate Chapin <jap...@chromium.org>
        Gerrit-Attention: Patryk Chodur <pch...@google.com>
        Gerrit-Comment-Date: Wed, 05 Nov 2025 18:44:06 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Patryk Chodur (Gerrit)

        unread,
        Nov 8, 2025, 7:55:38 AMNov 8
        to Mike Wasserman, Olga Korokhina, Andrew Rayskiy, Code Review Nudger, Daniel Cheng, AyeAye, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin, pwa-com...@google.com, blink-revi...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, creis...@chromium.org, gavinp...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org
        Attention needed from Mike Wasserman

        Patryk Chodur added 6 comments

        File chrome/browser/ui/views/web_apps/frame_toolbar/web_app_frame_toolbar_browsertest.cc
        Line 2340, Patchset 15: const char restore_script[] =
        Mike Wasserman . resolved

        optional nit: extract shared script string literals or test helper methods

        I suggest a helper that takes the API method name and expected state, e.g.:
        ```
        EvalJsResult EvalDisplayStateChange(
        const ToRenderFrameHost& execution_target,
        std::string_view window_method,
        std::string_view expected_state) {
        const char script[] =
        R"(new Promise((resolve, reject) => {
        window.$1().then(() => {
        if (window.matchMedia('(display-state: $2)').matches) {
        resolve('window.$1() succeeded.');
        } else {
        reject('window.$1() resolved, but ' +
        '`display-state: $2` not matched.');
        }
        }).catch(() => reject('window.$1() rejected.'));
        });)";
        return content::EvalJs(web_contents, content::JsReplace(script, window_method, expected_state));
        ```
        Patryk Chodur

        Done. I had to use `base::ReplaceStringPlaceholders`, because otherwise the names were quoted, and it didn't work with `std::string_view`.

        File third_party/blink/renderer/core/exported/web_view_impl.h
        Line 616, Patchset 15: void WasMinimized();
        Mike Wasserman . resolved

        Consider adding a single `OnWindowShowStateChanged(ui::mojom::blink::WindowShowState)` instead.

        Patryk Chodur

        Done

        File third_party/blink/renderer/core/exported/web_view_impl.cc
        Line 3191, Patchset 15: for (auto& callback : callbacks) {
        Mike Wasserman . unresolved

        This is a great improvement over the initial impl, thank you.

        Still, this won't work really well when a sequence of JS methods are invoked, then promises are resolved out of order e.g. `m1 = minimize(); r1 = restore(); m2 = minimize();` m2 will resolve when the first minimize() completes, potentially before the window is restored and minimized a second time.

        Getting this right depends on how requests are issued to the WM (looks like we don't currently queue requests internally, we just issue them to the WM directly) and how the underlying WM handles our requests. If the WM treats requests in a FIFO queue, we could probably keep a single ordered list of all callbacks (with an associated type), and resolve everything at the front of the queue matching the state surfaced here.

        Getting this correct wouldn't be easy, so API spec/docs should explain what behavior clients can expect.

        Maybe rejecting requests when another request is in flight would yield a simpler and more reliable impl?

        Patryk Chodur

        The behavior of issuing multiple requests is very platform specific. As far as I remember, issuing multiple calls at the same time can cause the state changes to be merged/skipped. For example, when I tried minimizing and restoring on Wayland, only the first action was performed.

        Additional problem is what happens if the user minimizes the window manually just before the `window.minimize()` was called. It'll result in a single minimization of the window. Should we resolve the promise in such case?

        If we were to support sequences of window changes, _I think_ we would need to queue them on our own and issue the next request when the previous is finished. The problem here, as well as with rejecting promises, is what should happen if WM refuses to change the state. It can be fixed with a timeout though.

        My idea was to guarantee only issuing request to the WM and resolving promises when the state is changed, but that would imply the developer shouldn't issue multiple requests at the same time. I resolve all of them simply because it's doable, and could be easier for developers if the user spammed one button because of WM lag. That solution might be too undefined for the web though, so I'm open to suggestions.

        What do you think?

        File third_party/blink/renderer/core/frame/web_frame_widget_impl.cc
        Line 1878, Patchset 15: if (old_show_state != window_show_state_) {
        Mike Wasserman . unresolved

        There's no clear request denial signal at this layer, right? If so, when the WM silently ignores a request, the JS promise will hang indefinitely. I wonder if the promises should reject with some timeout? (e.g. no window state change in 3s?). Again, we don't need a perfect impl, but having something well documented and reliable would be great.

        Patryk Chodur

        That's correct, the promise won't be resolved. I was also thinking about a timeout. I plan to add it in a follow up CL.

        Line 1889, Patchset 15: if (old_show_state == WindowShowState::kMinimized ||

        old_show_state == WindowShowState::kFullscreen) {
        // We cannot reliably tell whether the change was caused by restoring
        // the window or maximizing it.
        View()->WasRestored();
        }
        Mike Wasserman . resolved

        Clients like WebViewImpl would be better served be a single notification of window state change (as I suggested above). Then WebViewImpl can decide how to resolve its own callbacks from the clearest underlying signals, not from potentially ambiguous interpretations encapsulated here.

        Patryk Chodur

        Done

        File third_party/blink/renderer/modules/awc/additional_windowing_controls.cc
        Line 112, Patchset 15: const String& error_message, bool maximized) {
        Mike Wasserman . resolved
        This represents success for any of the operations, not just maximized
        ```suggestion
        const String& error_message, bool result) {
        ```
        Patryk Chodur

        Done

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Mike Wasserman
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I212501e1b8f0750becdd0c9aa3a474d4bb687f5e
        Gerrit-Change-Number: 7041143
        Gerrit-PatchSet: 17
        Gerrit-Owner: Patryk Chodur <pch...@google.com>
        Gerrit-Reviewer: Andrew Rayskiy <green...@google.com>
        Gerrit-Reviewer: Mike Wasserman <m...@chromium.org>
        Gerrit-Reviewer: Olga Korokhina <koro...@google.com>
        Gerrit-Reviewer: Patryk Chodur <pch...@google.com>
        Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
        Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
        Gerrit-CC: Daniel Cheng <dch...@chromium.org>
        Gerrit-CC: Nate Chapin <jap...@chromium.org>
        Gerrit-Attention: Mike Wasserman <m...@chromium.org>
        Gerrit-Comment-Date: Sat, 08 Nov 2025 12:55:15 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Mike Wasserman <m...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Mike Wasserman (Gerrit)

        unread,
        Dec 4, 2025, 5:15:23 PM (3 days ago) Dec 4
        to Patryk Chodur, Olga Korokhina, Andrew Rayskiy, Code Review Nudger, Daniel Cheng, AyeAye, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin, pwa-com...@google.com, blink-revi...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, creis...@chromium.org, gavinp...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org
        Attention needed from Patryk Chodur

        Mike Wasserman voted and added 5 comments

        Votes added by Mike Wasserman

        Code-Review+1

        5 comments

        Patchset-level comments
        File-level comment, Patchset 17 (Latest):
        Mike Wasserman . resolved

        lgtm with some non-blocking comments, and I'm happy to look over updates. I hope we can actually just reject simultaneous requests for now, otherwise the API contract is quite strange.

        File chrome/browser/ui/views/web_apps/frame_toolbar/web_app_frame_toolbar_browsertest.cc
        Line 2461, Patchset 17 (Latest): EXPECT_FALSE(helper()->browser_view()->IsMaximized());
        Mike Wasserman . unresolved

        I wonder if any of these might need RunUntil (ditto elsewhere exiting fullscreen)

        Line 2488, Patchset 17 (Latest): // Enter fullscreen
        Mike Wasserman . unresolved

        optional nit: a helper method might be useful (this is done 3+ times), it's quite close to EvalDisplayStateChange, but creating a parallel fullscreen helper is likely better than generalizing a shared helper.

        File third_party/blink/renderer/core/exported/web_view_impl.cc
        Line 3191, Patchset 15: for (auto& callback : callbacks) {
        Mike Wasserman . unresolved

        This is a great improvement over the initial impl, thank you.

        Still, this won't work really well when a sequence of JS methods are invoked, then promises are resolved out of order e.g. `m1 = minimize(); r1 = restore(); m2 = minimize();` m2 will resolve when the first minimize() completes, potentially before the window is restored and minimized a second time.

        Getting this right depends on how requests are issued to the WM (looks like we don't currently queue requests internally, we just issue them to the WM directly) and how the underlying WM handles our requests. If the WM treats requests in a FIFO queue, we could probably keep a single ordered list of all callbacks (with an associated type), and resolve everything at the front of the queue matching the state surfaced here.

        Getting this correct wouldn't be easy, so API spec/docs should explain what behavior clients can expect.

        Maybe rejecting requests when another request is in flight would yield a simpler and more reliable impl?

        Patryk Chodur

        The behavior of issuing multiple requests is very platform specific. As far as I remember, issuing multiple calls at the same time can cause the state changes to be merged/skipped. For example, when I tried minimizing and restoring on Wayland, only the first action was performed.

        Additional problem is what happens if the user minimizes the window manually just before the `window.minimize()` was called. It'll result in a single minimization of the window. Should we resolve the promise in such case?

        If we were to support sequences of window changes, _I think_ we would need to queue them on our own and issue the next request when the previous is finished. The problem here, as well as with rejecting promises, is what should happen if WM refuses to change the state. It can be fixed with a timeout though.

        My idea was to guarantee only issuing request to the WM and resolving promises when the state is changed, but that would imply the developer shouldn't issue multiple requests at the same time. I resolve all of them simply because it's doable, and could be easier for developers if the user spammed one button because of WM lag. That solution might be too undefined for the web though, so I'm open to suggestions.

        What do you think?

        Mike Wasserman

        This is a thorny area for sure, perhaps we should start simpler by just rejecting simultaneous requests?

        Ultimately, I think queueing/coalescing/dropping WM requests ourselves and keeping a FIFO queue of promise callbacks might better match dev expectations than resolving all pending requests of the same type as this CL currently does.

        File third_party/blink/renderer/core/frame/web_frame_widget_impl.cc
        Line 1878, Patchset 15: if (old_show_state != window_show_state_) {
        Mike Wasserman . unresolved

        There's no clear request denial signal at this layer, right? If so, when the WM silently ignores a request, the JS promise will hang indefinitely. I wonder if the promises should reject with some timeout? (e.g. no window state change in 3s?). Again, we don't need a perfect impl, but having something well documented and reliable would be great.

        Patryk Chodur

        That's correct, the promise won't be resolved. I was also thinking about a timeout. I plan to add it in a follow up CL.

        Mike Wasserman

        Rejecting after a timeout seems like a good near-term followup. Letting promises hang indefinitely is not a good API contract.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Patryk Chodur
        Gerrit-Attention: Patryk Chodur <pch...@google.com>
        Gerrit-Comment-Date: Thu, 04 Dec 2025 22:15:08 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        Comment-In-Reply-To: Mike Wasserman <m...@chromium.org>
        Comment-In-Reply-To: Patryk Chodur <pch...@google.com>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Patryk Chodur (Gerrit)

        unread,
        Dec 5, 2025, 12:01:56 PM (2 days ago) Dec 5
        to Mike Wasserman, Olga Korokhina, Andrew Rayskiy, Code Review Nudger, Daniel Cheng, AyeAye, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin, pwa-com...@google.com, blink-revi...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, creis...@chromium.org, gavinp...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org

        Patryk Chodur added 4 comments

        File chrome/browser/ui/views/web_apps/frame_toolbar/web_app_frame_toolbar_browsertest.cc
        Line 2461, Patchset 17: EXPECT_FALSE(helper()->browser_view()->IsMaximized());
        Mike Wasserman . resolved

        I wonder if any of these might need RunUntil (ditto elsewhere exiting fullscreen)

        Patryk Chodur

        We don't need to, because we wait for a promise to resolve in `EvalDisplayStateChange`.

        Line 2488, Patchset 17: // Enter fullscreen
        Mike Wasserman . resolved

        optional nit: a helper method might be useful (this is done 3+ times), it's quite close to EvalDisplayStateChange, but creating a parallel fullscreen helper is likely better than generalizing a shared helper.

        Patryk Chodur

        Done.

        File third_party/blink/renderer/core/exported/web_view_impl.cc
        Line 3191, Patchset 15: for (auto& callback : callbacks) {
        Mike Wasserman . resolved

        This is a great improvement over the initial impl, thank you.

        Still, this won't work really well when a sequence of JS methods are invoked, then promises are resolved out of order e.g. `m1 = minimize(); r1 = restore(); m2 = minimize();` m2 will resolve when the first minimize() completes, potentially before the window is restored and minimized a second time.

        Getting this right depends on how requests are issued to the WM (looks like we don't currently queue requests internally, we just issue them to the WM directly) and how the underlying WM handles our requests. If the WM treats requests in a FIFO queue, we could probably keep a single ordered list of all callbacks (with an associated type), and resolve everything at the front of the queue matching the state surfaced here.

        Getting this correct wouldn't be easy, so API spec/docs should explain what behavior clients can expect.

        Maybe rejecting requests when another request is in flight would yield a simpler and more reliable impl?

        Patryk Chodur

        The behavior of issuing multiple requests is very platform specific. As far as I remember, issuing multiple calls at the same time can cause the state changes to be merged/skipped. For example, when I tried minimizing and restoring on Wayland, only the first action was performed.

        Additional problem is what happens if the user minimizes the window manually just before the `window.minimize()` was called. It'll result in a single minimization of the window. Should we resolve the promise in such case?

        If we were to support sequences of window changes, _I think_ we would need to queue them on our own and issue the next request when the previous is finished. The problem here, as well as with rejecting promises, is what should happen if WM refuses to change the state. It can be fixed with a timeout though.

        My idea was to guarantee only issuing request to the WM and resolving promises when the state is changed, but that would imply the developer shouldn't issue multiple requests at the same time. I resolve all of them simply because it's doable, and could be easier for developers if the user spammed one button because of WM lag. That solution might be too undefined for the web though, so I'm open to suggestions.

        What do you think?

        Mike Wasserman

        This is a thorny area for sure, perhaps we should start simpler by just rejecting simultaneous requests?

        Ultimately, I think queueing/coalescing/dropping WM requests ourselves and keeping a FIFO queue of promise callbacks might better match dev expectations than resolving all pending requests of the same type as this CL currently does.

        Patryk Chodur

        Ok. I implemented rejecting simultaneous requests.

        File third_party/blink/renderer/core/frame/web_frame_widget_impl.cc
        Line 1878, Patchset 15: if (old_show_state != window_show_state_) {
        Mike Wasserman . resolved

        There's no clear request denial signal at this layer, right? If so, when the WM silently ignores a request, the JS promise will hang indefinitely. I wonder if the promises should reject with some timeout? (e.g. no window state change in 3s?). Again, we don't need a perfect impl, but having something well documented and reliable would be great.

        Patryk Chodur

        That's correct, the promise won't be resolved. I was also thinking about a timeout. I plan to add it in a follow up CL.

        Mike Wasserman

        Rejecting after a timeout seems like a good near-term followup. Letting promises hang indefinitely is not a good API contract.

        Patryk Chodur

        Great! I'll add it in a follow up CL and I added a `TODO` just for now.

        Open in Gerrit

        Related details

        Attention set is empty
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I212501e1b8f0750becdd0c9aa3a474d4bb687f5e
          Gerrit-Change-Number: 7041143
          Gerrit-PatchSet: 18
          Gerrit-Owner: Patryk Chodur <pch...@google.com>
          Gerrit-Reviewer: Andrew Rayskiy <green...@google.com>
          Gerrit-Reviewer: Mike Wasserman <m...@chromium.org>
          Gerrit-Reviewer: Olga Korokhina <koro...@google.com>
          Gerrit-Reviewer: Patryk Chodur <pch...@google.com>
          Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
          Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
          Gerrit-CC: Daniel Cheng <dch...@chromium.org>
          Gerrit-CC: Nate Chapin <jap...@chromium.org>
          Gerrit-Comment-Date: Fri, 05 Dec 2025 17:01:37 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Mike Wasserman (Gerrit)

          unread,
          Dec 5, 2025, 1:50:10 PM (2 days ago) Dec 5
          to Patryk Chodur, Nate Chapin, Olga Korokhina, Andrew Rayskiy, Code Review Nudger, Daniel Cheng, AyeAye, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, pwa-com...@google.com, blink-revi...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, creis...@chromium.org, gavinp...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org
          Attention needed from Nate Chapin and Patryk Chodur

          Mike Wasserman voted and added 1 comment

          Votes added by Mike Wasserman

          Code-Review+1

          1 comment

          Patchset-level comments
          File-level comment, Patchset 19 (Latest):
          Mike Wasserman . resolved

          lgtm, thanks

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Nate Chapin
          • Patryk Chodur
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I212501e1b8f0750becdd0c9aa3a474d4bb687f5e
          Gerrit-Change-Number: 7041143
          Gerrit-PatchSet: 19
          Gerrit-Owner: Patryk Chodur <pch...@google.com>
          Gerrit-Reviewer: Andrew Rayskiy <green...@google.com>
          Gerrit-Reviewer: Mike Wasserman <m...@chromium.org>
          Gerrit-Reviewer: Nate Chapin <jap...@chromium.org>
          Gerrit-Reviewer: Olga Korokhina <koro...@google.com>
          Gerrit-Reviewer: Patryk Chodur <pch...@google.com>
          Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
          Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
          Gerrit-CC: Daniel Cheng <dch...@chromium.org>
          Gerrit-Attention: Patryk Chodur <pch...@google.com>
          Gerrit-Attention: Nate Chapin <jap...@chromium.org>
          Gerrit-Comment-Date: Fri, 05 Dec 2025 18:49:53 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Patryk Chodur (Gerrit)

          unread,
          Dec 5, 2025, 2:57:02 PM (2 days ago) Dec 5
          to Nate Chapin, Mike Wasserman, Olga Korokhina, Andrew Rayskiy, Code Review Nudger, Daniel Cheng, AyeAye, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, pwa-com...@google.com, blink-revi...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, creis...@chromium.org, gavinp...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org
          Attention needed from Nate Chapin

          Patryk Chodur added 1 comment

          Patchset-level comments
          File-level comment, Patchset 19:
          Patryk Chodur . resolved

          I had to disable 2 tests on Mac after running them manually with utr. There are other problems with window state transitions on Mac that I plan to tackle in https://crbug.com/458599317

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Nate Chapin
          Gerrit-Attention: Nate Chapin <jap...@chromium.org>
          Gerrit-Comment-Date: Fri, 05 Dec 2025 19:56:39 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Andrew Rayskiy (Gerrit)

          unread,
          Dec 5, 2025, 5:37:03 PM (2 days ago) Dec 5
          to Patryk Chodur, Nate Chapin, Mike Wasserman, Olga Korokhina, Code Review Nudger, Daniel Cheng, AyeAye, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, pwa-com...@google.com, blink-revi...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, creis...@chromium.org, gavinp...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org
          Attention needed from Nate Chapin and Patryk Chodur

          Andrew Rayskiy voted Code-Review+1

          Code-Review+1
          Open in Gerrit

          Related details

          Attention is currently required from:
          • Nate Chapin
          • Patryk Chodur
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I212501e1b8f0750becdd0c9aa3a474d4bb687f5e
          Gerrit-Change-Number: 7041143
          Gerrit-PatchSet: 20
          Gerrit-Owner: Patryk Chodur <pch...@google.com>
          Gerrit-Reviewer: Andrew Rayskiy <green...@google.com>
          Gerrit-Reviewer: Mike Wasserman <m...@chromium.org>
          Gerrit-Reviewer: Nate Chapin <jap...@chromium.org>
          Gerrit-Reviewer: Olga Korokhina <koro...@google.com>
          Gerrit-Reviewer: Patryk Chodur <pch...@google.com>
          Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
          Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
          Gerrit-CC: Daniel Cheng <dch...@chromium.org>
          Gerrit-Attention: Patryk Chodur <pch...@google.com>
          Gerrit-Attention: Nate Chapin <jap...@chromium.org>
          Gerrit-Comment-Date: Fri, 05 Dec 2025 22:36:39 +0000
          Gerrit-HasComments: No
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Nate Chapin (Gerrit)

          unread,
          Dec 5, 2025, 6:19:01 PM (2 days ago) Dec 5
          to Patryk Chodur, Mike Wasserman, Olga Korokhina, Andrew Rayskiy, Code Review Nudger, Daniel Cheng, AyeAye, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, pwa-com...@google.com, blink-revi...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, creis...@chromium.org, gavinp...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org
          Attention needed from Patryk Chodur

          Nate Chapin voted and added 2 comments

          Votes added by Nate Chapin

          Code-Review+1

          2 comments

          File third_party/blink/renderer/modules/awc/additional_windowing_controls.cc
          Line 116, Patchset 20 (Latest): ScriptState::Scope scope(resolver->GetScriptState());
          Nate Chapin . unresolved

          This isn't needed, `Reject` puts a `ScriptState::Scope` on the stack.

          Line 117, Patchset 20 (Latest): resolver->Reject(V8ThrowDOMException::CreateOrEmpty(
          Nate Chapin . unresolved

          Shorthand: `resolver->RejectWithDOMException(DOMExceptionCode::kNotAllowedError, error_message));`

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Patryk Chodur
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          • requirement satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I212501e1b8f0750becdd0c9aa3a474d4bb687f5e
          Gerrit-Change-Number: 7041143
          Gerrit-PatchSet: 20
          Gerrit-Owner: Patryk Chodur <pch...@google.com>
          Gerrit-Reviewer: Andrew Rayskiy <green...@google.com>
          Gerrit-Reviewer: Mike Wasserman <m...@chromium.org>
          Gerrit-Reviewer: Nate Chapin <jap...@chromium.org>
          Gerrit-Reviewer: Olga Korokhina <koro...@google.com>
          Gerrit-Reviewer: Patryk Chodur <pch...@google.com>
          Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
          Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
          Gerrit-CC: Daniel Cheng <dch...@chromium.org>
          Gerrit-Attention: Patryk Chodur <pch...@google.com>
          Gerrit-Comment-Date: Fri, 05 Dec 2025 23:18:49 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Patryk Chodur (Gerrit)

          unread,
          Dec 6, 2025, 3:52:33 AM (yesterday) Dec 6
          to Nate Chapin, Mike Wasserman, Olga Korokhina, Andrew Rayskiy, Code Review Nudger, Daniel Cheng, AyeAye, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, pwa-com...@google.com, blink-revi...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, creis...@chromium.org, gavinp...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org

          Patryk Chodur voted and added 2 comments

          Votes added by Patryk Chodur

          Commit-Queue+1

          2 comments

          File third_party/blink/renderer/modules/awc/additional_windowing_controls.cc
          Line 116, Patchset 20: ScriptState::Scope scope(resolver->GetScriptState());
          Nate Chapin . resolved

          This isn't needed, `Reject` puts a `ScriptState::Scope` on the stack.

          Patryk Chodur

          I needed it for the `V8ThrowDOMException::CreateOrEmpty` ([this](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/bindings/script_state.h;l=166;drc=e187d025a32045c6249b739190382367dfc85985) `CHECK` failed), but with the `RejectWithDOMException` it works like charm!

          Line 117, Patchset 20: resolver->Reject(V8ThrowDOMException::CreateOrEmpty(
          Nate Chapin . resolved

          Shorthand: `resolver->RejectWithDOMException(DOMExceptionCode::kNotAllowedError, error_message));`

          Patryk Chodur

          Done. Thank you!

          Open in Gerrit

          Related details

          Attention set is empty
          Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement satisfiedCode-Owners
            • requirement satisfiedCode-Review
            • requirement satisfiedReview-Enforcement
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: I212501e1b8f0750becdd0c9aa3a474d4bb687f5e
            Gerrit-Change-Number: 7041143
            Gerrit-PatchSet: 22
            Gerrit-Owner: Patryk Chodur <pch...@google.com>
            Gerrit-Reviewer: Andrew Rayskiy <green...@google.com>
            Gerrit-Reviewer: Mike Wasserman <m...@chromium.org>
            Gerrit-Reviewer: Nate Chapin <jap...@chromium.org>
            Gerrit-Reviewer: Olga Korokhina <koro...@google.com>
            Gerrit-Reviewer: Patryk Chodur <pch...@google.com>
            Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
            Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
            Gerrit-CC: Daniel Cheng <dch...@chromium.org>
            Gerrit-Comment-Date: Sat, 06 Dec 2025 08:52:06 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: Yes
            Comment-In-Reply-To: Nate Chapin <jap...@chromium.org>
            satisfied_requirement
            open
            diffy

            Patryk Chodur (Gerrit)

            unread,
            Dec 6, 2025, 3:55:04 AM (yesterday) Dec 6
            to Nate Chapin, Mike Wasserman, Olga Korokhina, Andrew Rayskiy, Code Review Nudger, Daniel Cheng, AyeAye, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, pwa-com...@google.com, blink-revi...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, creis...@chromium.org, gavinp...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org

            Patryk Chodur voted Commit-Queue+2

            Commit-Queue+2
            Gerrit-Comment-Date: Sat, 06 Dec 2025 08:54:36 +0000
            Gerrit-HasComments: No
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            open
            diffy

            Patryk Chodur (Gerrit)

            unread,
            Dec 6, 2025, 9:19:29 AM (yesterday) Dec 6
            to Nate Chapin, Mike Wasserman, Olga Korokhina, Andrew Rayskiy, Code Review Nudger, Daniel Cheng, AyeAye, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, pwa-com...@google.com, blink-revi...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, creis...@chromium.org, gavinp...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org

            Patryk Chodur voted Commit-Queue+2

            Commit-Queue+2
            Open in Gerrit

            Related details

            Attention set is empty
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement satisfiedCode-Owners
            • requirement satisfiedCode-Review
            • requirement satisfiedReview-Enforcement
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: I212501e1b8f0750becdd0c9aa3a474d4bb687f5e
            Gerrit-Change-Number: 7041143
            Gerrit-PatchSet: 23
            Gerrit-Owner: Patryk Chodur <pch...@google.com>
            Gerrit-Reviewer: Andrew Rayskiy <green...@google.com>
            Gerrit-Reviewer: Mike Wasserman <m...@chromium.org>
            Gerrit-Reviewer: Nate Chapin <jap...@chromium.org>
            Gerrit-Reviewer: Olga Korokhina <koro...@google.com>
            Gerrit-Reviewer: Patryk Chodur <pch...@google.com>
            Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
            Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
            Gerrit-CC: Daniel Cheng <dch...@chromium.org>
            Gerrit-Comment-Date: Sat, 06 Dec 2025 14:19:00 +0000
            Gerrit-HasComments: No
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            open
            diffy

            Chromium LUCI CQ (Gerrit)

            unread,
            Dec 6, 2025, 9:22:24 AM (yesterday) Dec 6
            to Patryk Chodur, Nate Chapin, Mike Wasserman, Olga Korokhina, Andrew Rayskiy, Code Review Nudger, Daniel Cheng, AyeAye, AI Code Reviewer, chromium...@chromium.org, pwa-com...@google.com, blink-revi...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, creis...@chromium.org, gavinp...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org

            Chromium LUCI CQ submitted the change with unreviewed changes

            Unreviewed changes

            20 is the latest approved patch-set.
            The change was submitted with unreviewed changes in the following files:

            ```
            The name of the file: third_party/blink/renderer/modules/awc/additional_windowing_controls.cc
            Insertions: 4, Deletions: 8.

            The diff is too large to show. Please review the diff.
            ```

            Change information

            Commit message:
            AWC window.maximize, minimize and restore promises implemented

            This commit implements promises for window.maximize(), window.minimize()
            and window.restore() promises. Previously they were resolved just after
            the browser requested the change without waiting for it to happen. Now
            the promise will get resolved when an appropriate state change happens.

            If another promise is waiting for the state change, the current promise
            will be rejected. There's a plan to implement FIFO queue for these in
            the following CLs.
            Bug: 40946306
            Change-Id: I212501e1b8f0750becdd0c9aa3a474d4bb687f5e
            Include-Ci-Only-Tests: chromium.mac:Mac12 Tests|browser_tests
            Low-Coverage-Reason: COVERAGE_UNDERREPORTED
            Reviewed-by: Mike Wasserman <m...@chromium.org>
            Reviewed-by: Andrew Rayskiy <green...@google.com>
            Reviewed-by: Nate Chapin <jap...@chromium.org>
            Commit-Queue: Patryk Chodur <pch...@google.com>
            Reviewed-by: Olga Korokhina <koro...@google.com>
            Cr-Commit-Position: refs/heads/main@{#1555119}
            Files:
            • M chrome/browser/ui/views/web_apps/frame_toolbar/web_app_frame_toolbar_browsertest.cc
            • M third_party/blink/renderer/core/exported/web_view_impl.cc
            • M third_party/blink/renderer/core/exported/web_view_impl.h
            • M third_party/blink/renderer/core/frame/web_frame_widget_impl.cc
            • M third_party/blink/renderer/core/loader/empty_clients.h
            • M third_party/blink/renderer/core/page/chrome_client.h
            • M third_party/blink/renderer/core/page/chrome_client_impl.cc
            • M third_party/blink/renderer/core/page/chrome_client_impl.h
            • M third_party/blink/renderer/modules/awc/additional_windowing_controls.cc
            Change size: L
            Delta: 9 files changed, 367 insertions(+), 150 deletions(-)
            Branch: refs/heads/main
            Submit Requirements:
            • requirement satisfiedCode-Review: +1 by Nate Chapin, +1 by Mike Wasserman, +1 by Olga Korokhina, +1 by Andrew Rayskiy
            Open in Gerrit
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: merged
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: I212501e1b8f0750becdd0c9aa3a474d4bb687f5e
            Gerrit-Change-Number: 7041143
            Gerrit-PatchSet: 24
            Gerrit-Owner: Patryk Chodur <pch...@google.com>
            Gerrit-Reviewer: Andrew Rayskiy <green...@google.com>
            Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
            Gerrit-Reviewer: Mike Wasserman <m...@chromium.org>
            Gerrit-Reviewer: Nate Chapin <jap...@chromium.org>
            Gerrit-Reviewer: Olga Korokhina <koro...@google.com>
            Gerrit-Reviewer: Patryk Chodur <pch...@google.com>
            Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
            open
            diffy
            satisfied_requirement
            Reply all
            Reply to author
            Forward
            0 new messages