DevTools/Android: Implement Browser.setWindowBounds [chromium/src : main]

0 views
Skip to first unread message

Alex Rudenko (Gerrit)

unread,
Jul 21, 2026, 3:58:45 AM (6 days ago) Jul 21
to Julio Piubello, Jack Thiesen, Alex N. Jose, Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, devtools...@chromium.org
Attention needed from Alex N. Jose, Jack Thiesen and Julio Piubello

Alex Rudenko added 5 comments

Patchset-level comments
File-level comment, Patchset 4 (Latest):
Alex Rudenko . resolved

Thanks, mostly LGTM. Please wait for a review from someone more familiar with Android implementation.

File chrome/browser/devtools/protocol/browser_handler_android.h
Line 78, Patchset 4 (Latest): ui::BaseWindow* FindWindowById(int window_id, bool* is_pending);
Alex Rudenko . unresolved

Consider updating the signature to return a `std::pair<ui::BaseWindow*, bool>` or a custom struct to avoid the output parameter.

File chrome/browser/devtools/protocol/browser_handler_android.cc
Line 118, Patchset 4 (Latest): ui::BaseWindow* window = FindWindowById(window_id, /*is_pending=*/nullptr);
Alex Rudenko . unresolved
This would simplify to:
```cpp
auto [window, is_pending] = FindWindowById(window_id);
```
Line 128, Patchset 4 (Latest): bool* is_pending) {
Alex Rudenko . unresolved

To avoid using an output parameter (`bool* is_pending`), you could change this method to return a `std::pair<ui::BaseWindow*, bool>` or a small struct. This aligns with the Google C++ Style Guide recommendation to prefer return values over output parameters, and allows the use of structured bindings at the call site.

For example:
```cpp
std::pair<ui::BaseWindow*, bool> BrowserHandlerAndroid::FindWindowById(int window_id) {
if (ui::BaseWindow* window = FindBrowserWindowById(window_id)) {
return {window, false};
}
  auto tracked_window = tracked_browser_windows_.find(window_id);
if (tracked_window != tracked_browser_windows_.end()) {
if (tracked_window->second) {
return {tracked_window->second->GetWindow(), true};
} else {
tracked_browser_windows_.erase(tracked_window);
}
}
return {nullptr, false};
}
```
Line 229, Patchset 4 (Latest): ui::BaseWindow* window = FindWindowById(window_id, &is_pending);
Alex Rudenko . unresolved

If you change `FindWindowById` to return a `std::pair` or struct, you can use structured bindings here:

```cpp
auto [window, is_pending] = FindWindowById(window_id);
```
Open in Gerrit

Related details

Attention is currently required from:
  • Alex N. Jose
  • Jack Thiesen
  • Julio Piubello
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: I5e6925952558d3ae50e2ade9ad01e30afa67b615
Gerrit-Change-Number: 8084624
Gerrit-PatchSet: 4
Gerrit-Owner: Julio Piubello <ju...@gitstart.com>
Gerrit-Reviewer: Alex N. Jose <ale...@chromium.org>
Gerrit-Reviewer: Alex Rudenko <alexr...@chromium.org>
Gerrit-Reviewer: Jack Thiesen <jthi...@chromium.org>
Gerrit-Reviewer: Julio Piubello <ju...@gitstart.com>
Gerrit-Attention: Jack Thiesen <jthi...@chromium.org>
Gerrit-Attention: Alex N. Jose <ale...@chromium.org>
Gerrit-Attention: Julio Piubello <ju...@gitstart.com>
Gerrit-Comment-Date: Tue, 21 Jul 2026 07:58:27 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Julio Piubello (Gerrit)

unread,
1:17 AM (3 hours ago) 1:17 AM
to Jack Thiesen, Alex Rudenko, Alex N. Jose, Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, devtools...@chromium.org
Attention needed from Alex N. Jose, Alex Rudenko and Jack Thiesen

Julio Piubello added 4 comments

File chrome/browser/devtools/protocol/browser_handler_android.h
Line 78, Patchset 4: ui::BaseWindow* FindWindowById(int window_id, bool* is_pending);
Alex Rudenko . unresolved

Consider updating the signature to return a `std::pair<ui::BaseWindow*, bool>` or a custom struct to avoid the output parameter.

Julio Piubello

done!

File chrome/browser/devtools/protocol/browser_handler_android.cc
Line 118, Patchset 4: ui::BaseWindow* window = FindWindowById(window_id, /*is_pending=*/nullptr);
Alex Rudenko . unresolved
This would simplify to:
```cpp
auto [window, is_pending] = FindWindowById(window_id);
```
Julio Piubello

done!

Line 128, Patchset 4: bool* is_pending) {
Alex Rudenko . unresolved

To avoid using an output parameter (`bool* is_pending`), you could change this method to return a `std::pair<ui::BaseWindow*, bool>` or a small struct. This aligns with the Google C++ Style Guide recommendation to prefer return values over output parameters, and allows the use of structured bindings at the call site.

For example:
```cpp
std::pair<ui::BaseWindow*, bool> BrowserHandlerAndroid::FindWindowById(int window_id) {
if (ui::BaseWindow* window = FindBrowserWindowById(window_id)) {
return {window, false};
}
  auto tracked_window = tracked_browser_windows_.find(window_id);
if (tracked_window != tracked_browser_windows_.end()) {
if (tracked_window->second) {
return {tracked_window->second->GetWindow(), true};
} else {
tracked_browser_windows_.erase(tracked_window);
}
}
return {nullptr, false};
}
```
Julio Piubello

ok! changed to a WindowLookupResult struct instead

Line 229, Patchset 4: ui::BaseWindow* window = FindWindowById(window_id, &is_pending);
Alex Rudenko . unresolved

If you change `FindWindowById` to return a `std::pair` or struct, you can use structured bindings here:

```cpp
auto [window, is_pending] = FindWindowById(window_id);
```
Julio Piubello

done! now uses structured binding

Open in Gerrit

Related details

Attention is currently required from:
  • Alex N. Jose
  • Alex Rudenko
  • Jack Thiesen
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: I5e6925952558d3ae50e2ade9ad01e30afa67b615
Gerrit-Change-Number: 8084624
Gerrit-PatchSet: 5
Gerrit-Owner: Julio Piubello <ju...@gitstart.com>
Gerrit-Reviewer: Alex N. Jose <ale...@chromium.org>
Gerrit-Reviewer: Alex Rudenko <alexr...@chromium.org>
Gerrit-Reviewer: Jack Thiesen <jthi...@chromium.org>
Gerrit-Reviewer: Julio Piubello <ju...@gitstart.com>
Gerrit-Attention: Jack Thiesen <jthi...@chromium.org>
Gerrit-Attention: Alex N. Jose <ale...@chromium.org>
Gerrit-Attention: Alex Rudenko <alexr...@chromium.org>
Gerrit-Comment-Date: Mon, 27 Jul 2026 05:17:03 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Alex Rudenko <alexr...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages