[NullAway] Add @NullMarked to customtabs/ files [chromium/src : main]

0 views
Skip to first unread message

Aishwarya Rajesh (Gerrit)

unread,
Sep 3, 2025, 4:34:19 PM (4 days ago) Sep 3
to Andrew Grieve, Chromium LUCI CQ, chromium...@chromium.org, Peter Beverloo, dtraino...@chromium.org, lizeb+watch...@chromium.org, peilinwa...@google.com, roagarw...@chromium.org
Attention needed from Andrew Grieve

Aishwarya Rajesh added 1 comment

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Aishwarya Rajesh . resolved

PTAL, thanks!

Open in Gerrit

Related details

Attention is currently required from:
  • Andrew Grieve
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
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: Ie2cd0c4538180d8f1fadef34dc5f0141762433b1
Gerrit-Change-Number: 6912607
Gerrit-PatchSet: 1
Gerrit-Owner: Aishwarya Rajesh <aishw...@google.com>
Gerrit-Reviewer: Aishwarya Rajesh <aishw...@google.com>
Gerrit-Reviewer: Andrew Grieve <agr...@chromium.org>
Gerrit-CC: Peter Beverloo <pe...@chromium.org>
Gerrit-Attention: Andrew Grieve <agr...@chromium.org>
Gerrit-Comment-Date: Wed, 03 Sep 2025 20:34:09 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Andrew Grieve (Gerrit)

unread,
Sep 3, 2025, 9:28:34 PM (3 days ago) Sep 3
to Aishwarya Rajesh, Andrew Grieve, Chromium LUCI CQ, chromium...@chromium.org, Peter Beverloo, dtraino...@chromium.org, lizeb+watch...@chromium.org, peilinwa...@google.com, roagarw...@chromium.org
Attention needed from Aishwarya Rajesh

Andrew Grieve added 9 comments

Patchset-level comments
Andrew Grieve . resolved

tricky one!

File chrome/android/java/src/org/chromium/chrome/browser/TabbedModeTabDelegateFactory.java
Line 182, Patchset 1 (Latest): assumeNonNull(mTabModelSelectorSupplier.get()),
Andrew Grieve . unresolved

assertNonNull

File chrome/android/java/src/org/chromium/chrome/browser/app/tab_activity_glue/ActivityTabWebContentsDelegateAndroid.java
Line 410, Patchset 1 (Latest): if (mChromeActivityNativeDelegate != null
Andrew Grieve . unresolved

nit: probably fine to just assume here. Looks like probably mActivity != null implies mChromeActivityNativeDelegate != null.

File chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabBottomBarDelegate.java
Line 171, Patchset 1 (Latest): assumeNonNull(mBottomBarContentView).removeOnLayoutChangeListener(this);
Andrew Grieve . unresolved

nit: I think you can mark this `@MonotonicNonNull` instead.

Line 369, Patchset 1 (Latest): assumeNonNull(mBottomBarView);
Andrew Grieve . unresolved

nit: a bit better to do:

```
CustomTabBottomBarView bottomBarView = mBottomBarView;
if (bottomBarView == null) return;
bottomBarView
.animate()
.alpha(0)
.setInterpolator(
Interpolators.FAST_OUT_SLOW_IN_INTERPOLATOR)
.setDuration(SLIDE_ANIMATION_DURATION_MS)
.withEndAction(
() -> bottomBarView.setVisibility(View.GONE))
.start();
```
File chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabDelegateFactory.java
Line 449, Patchset 1 (Latest): return new CustomTabDelegateFactory(
Andrew Grieve . unresolved

I suspect this API is a mistake since most APIs in this class assume these are all non-null. Probably worth using `null` where this is currently used rather than marking all fields as nullable.

If you want to skip this scope expansion for now, maybe just mark this as `@SuppressWarnings("NullAway") // TODO: Remove this method.`

Hopefully will mean you can remove most changes to ActivityTabWebContentsDelegateAndroid and where ShareDelegate{Supplier} was marked @Nullable.

File chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIncognitoManager.java
Line 69, Patchset 1 (Latest): if (mProfileProviderSupplier.get().hasOffTheRecordProfile()) {
Andrew Grieve . unresolved

nit: better to do:

```
Profile otrProfile = mProfileProviderSupplier.get().getOffTheRecordProfile(/* createIfNeeded= */ false);
if (otrProfile != null) {
ProfileManager.destroyWhenAppropriate(otrProfile);
}
```
Line 79, Patchset 1 (Latest): public @Nullable Profile getProfile() {
Andrew Grieve . unresolved

Should not be nullable since `createIfNeeded=true`.

Maybe worth creating a `getOrCreateOffTheRecordProfile()` in `ProfileProvider` so that each call site doesn't need to add an assert.

File chrome/browser/browser_controls/android/java/src/org/chromium/chrome/browser/browser_controls/BrowserControlsMarginSupplier.java
Line 25, Patchset 1 (Latest): @Nullable BrowserControlsStateProvider browserControlsStateProvider) {
Andrew Grieve . unresolved

Why nullable? Seems the class assumed it wouldn't be, so likely should fix at the call site.

Open in Gerrit

Related details

Attention is currently required from:
  • Aishwarya Rajesh
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: Ie2cd0c4538180d8f1fadef34dc5f0141762433b1
    Gerrit-Change-Number: 6912607
    Gerrit-PatchSet: 1
    Gerrit-Owner: Aishwarya Rajesh <aishw...@google.com>
    Gerrit-Reviewer: Aishwarya Rajesh <aishw...@google.com>
    Gerrit-Reviewer: Andrew Grieve <agr...@chromium.org>
    Gerrit-CC: Peter Beverloo <pe...@chromium.org>
    Gerrit-Attention: Aishwarya Rajesh <aishw...@google.com>
    Gerrit-Comment-Date: Thu, 04 Sep 2025 01:28:21 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Aishwarya Rajesh (Gerrit)

    unread,
    Sep 4, 2025, 5:19:58 PM (2 days ago) Sep 4
    to Andrew Grieve, Chromium LUCI CQ, chromium...@chromium.org, Peter Beverloo, dtraino...@chromium.org, lizeb+watch...@chromium.org, peilinwa...@google.com, roagarw...@chromium.org
    Attention needed from Andrew Grieve

    Aishwarya Rajesh added 8 comments

    File chrome/android/java/src/org/chromium/chrome/browser/TabbedModeTabDelegateFactory.java
    Line 182, Patchset 1: assumeNonNull(mTabModelSelectorSupplier.get()),
    Andrew Grieve . resolved

    assertNonNull

    Aishwarya Rajesh

    Obsolete with changes in latest PS per suggestion from other comment.

    File chrome/android/java/src/org/chromium/chrome/browser/app/tab_activity_glue/ActivityTabWebContentsDelegateAndroid.java
    Line 410, Patchset 1: if (mChromeActivityNativeDelegate != null
    Andrew Grieve . resolved

    nit: probably fine to just assume here. Looks like probably mActivity != null implies mChromeActivityNativeDelegate != null.

    Aishwarya Rajesh

    Obsolete with changes in latest PS per suggestion from other comment.

    File chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabBottomBarDelegate.java
    Line 171, Patchset 1: assumeNonNull(mBottomBarContentView).removeOnLayoutChangeListener(this);
    Andrew Grieve . resolved

    nit: I think you can mark this `@MonotonicNonNull` instead.

    Aishwarya Rajesh

    That's true - updated.

    Line 369, Patchset 1: assumeNonNull(mBottomBarView);
    Andrew Grieve . resolved

    nit: a bit better to do:

    ```
    CustomTabBottomBarView bottomBarView = mBottomBarView;
    if (bottomBarView == null) return;
    bottomBarView
    .animate()
    .alpha(0)
    .setInterpolator(
    Interpolators.FAST_OUT_SLOW_IN_INTERPOLATOR)
    .setDuration(SLIDE_ANIMATION_DURATION_MS)
    .withEndAction(
    () -> bottomBarView.setVisibility(View.GONE))
    .start();
    ```
    Aishwarya Rajesh

    Done

    File chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabDelegateFactory.java
    Line 449, Patchset 1: return new CustomTabDelegateFactory(
    Andrew Grieve . resolved

    I suspect this API is a mistake since most APIs in this class assume these are all non-null. Probably worth using `null` where this is currently used rather than marking all fields as nullable.

    If you want to skip this scope expansion for now, maybe just mark this as `@SuppressWarnings("NullAway") // TODO: Remove this method.`

    Hopefully will mean you can remove most changes to ActivityTabWebContentsDelegateAndroid and where ShareDelegate{Supplier} was marked @Nullable.

    Aishwarya Rajesh

    That's a great callout, thanks. :)

    Updated the 3 callsites of this method to refrain from doing `setDelegateFactory(#createEmpty())` since this is currently defined to be `@Nullable` anyway.

    Removed this method in the latest PS, so this simplifies / reverts a whole bunch of nullability changes in the existing PS like you mentioned.

    File chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIncognitoManager.java
    Line 69, Patchset 1: if (mProfileProviderSupplier.get().hasOffTheRecordProfile()) {
    Andrew Grieve . resolved

    nit: better to do:

    ```
    Profile otrProfile = mProfileProviderSupplier.get().getOffTheRecordProfile(/* createIfNeeded= */ false);
    if (otrProfile != null) {
    ProfileManager.destroyWhenAppropriate(otrProfile);
    }
    ```
    Aishwarya Rajesh

    Done

    Line 79, Patchset 1: public @Nullable Profile getProfile() {
    Andrew Grieve . resolved

    Should not be nullable since `createIfNeeded=true`.

    Maybe worth creating a `getOrCreateOffTheRecordProfile()` in `ProfileProvider` so that each call site doesn't need to add an assert.

    Aishwarya Rajesh

    I gathered that this method currently does not have any usage - so removed it instead.

    File chrome/browser/browser_controls/android/java/src/org/chromium/chrome/browser/browser_controls/BrowserControlsMarginSupplier.java
    Line 25, Patchset 1: @Nullable BrowserControlsStateProvider browserControlsStateProvider) {
    Andrew Grieve . resolved

    Why nullable? Seems the class assumed it wouldn't be, so likely should fix at the call site.

    Aishwarya Rajesh

    Reverted nullability update in calling class, so this is now not relevant.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Andrew Grieve
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    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: Ie2cd0c4538180d8f1fadef34dc5f0141762433b1
    Gerrit-Change-Number: 6912607
    Gerrit-PatchSet: 3
    Gerrit-Owner: Aishwarya Rajesh <aishw...@google.com>
    Gerrit-Reviewer: Aishwarya Rajesh <aishw...@google.com>
    Gerrit-Reviewer: Andrew Grieve <agr...@chromium.org>
    Gerrit-CC: Peter Beverloo <pe...@chromium.org>
    Gerrit-Attention: Andrew Grieve <agr...@chromium.org>
    Gerrit-Comment-Date: Thu, 04 Sep 2025 21:19:46 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Andrew Grieve <agr...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Aishwarya Rajesh (Gerrit)

    unread,
    Sep 4, 2025, 5:22:24 PM (2 days ago) Sep 4
    to Andrew Grieve, Chromium LUCI CQ, chromium...@chromium.org, Peter Beverloo, dtraino...@chromium.org, lizeb+watch...@chromium.org, peilinwa...@google.com, roagarw...@chromium.org
    Attention needed from Andrew Grieve

    Aishwarya Rajesh voted Commit-Queue+0

    Commit-Queue+0
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Andrew Grieve
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    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: Ie2cd0c4538180d8f1fadef34dc5f0141762433b1
    Gerrit-Change-Number: 6912607
    Gerrit-PatchSet: 3
    Gerrit-Owner: Aishwarya Rajesh <aishw...@google.com>
    Gerrit-Reviewer: Aishwarya Rajesh <aishw...@google.com>
    Gerrit-Reviewer: Andrew Grieve <agr...@chromium.org>
    Gerrit-CC: Peter Beverloo <pe...@chromium.org>
    Gerrit-Attention: Andrew Grieve <agr...@chromium.org>
    Gerrit-Comment-Date: Thu, 04 Sep 2025 21:22:13 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Aishwarya Rajesh (Gerrit)

    unread,
    Sep 4, 2025, 7:53:32 PM (2 days ago) Sep 4
    to AyeAye, Andrew Grieve, Chromium LUCI CQ, chromium...@chromium.org, Peter Beverloo, jinsukk...@chromium.org, dtraino...@chromium.org, lizeb+watch...@chromium.org, peilinwa...@google.com, roagarw...@chromium.org
    Attention needed from Andrew Grieve

    Aishwarya Rajesh added 1 comment

    File chrome/android/java/src/org/chromium/chrome/browser/tab/TabBuilder.java
    Line 200, Patchset 5 (Parent): assert mDelegateFactory != null;
    Aishwarya Rajesh . unresolved

    It is apparently problematic if we pass a `null` `mDelegateFactory` to `#initialize()` although `mDelegateFactory` [here](https://source.chromium.org/chromium/chromium/src/+/main:chrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.java;l=1264;drc=ee9e4b7dbb33a548fa1cc97e734e4bda272b5c3f) is technically `@Nullable` - this change [breaks](https://chromium-review.googlesource.com/c/chromium/src/+/6912607?checksPatchset=5&tab=checks) a few tests and it is unclear to me if it is safe to continue passing a `null` `CustomTabDelegateFactory` and update the failing test fixtures instead.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Andrew Grieve
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      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: Ie2cd0c4538180d8f1fadef34dc5f0141762433b1
      Gerrit-Change-Number: 6912607
      Gerrit-PatchSet: 5
      Gerrit-Owner: Aishwarya Rajesh <aishw...@google.com>
      Gerrit-Reviewer: Aishwarya Rajesh <aishw...@google.com>
      Gerrit-Reviewer: Andrew Grieve <agr...@chromium.org>
      Gerrit-CC: Peter Beverloo <pe...@chromium.org>
      Gerrit-Attention: Andrew Grieve <agr...@chromium.org>
      Gerrit-Comment-Date: Thu, 04 Sep 2025 23:53:23 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Aishwarya Rajesh (Gerrit)

      unread,
      Sep 4, 2025, 8:09:00 PM (2 days ago) Sep 4
      to AyeAye, Andrew Grieve, Chromium LUCI CQ, chromium...@chromium.org, Peter Beverloo, jinsukk...@chromium.org, dtraino...@chromium.org, lizeb+watch...@chromium.org, peilinwa...@google.com, roagarw...@chromium.org
      Attention needed from Aishwarya Rajesh and Andrew Grieve

      Aishwarya Rajesh voted and added 1 comment

      Votes added by Aishwarya Rajesh

      Commit-Queue+1

      1 comment

      File chrome/android/java/src/org/chromium/chrome/browser/tab/TabBuilder.java
      Line 200, Patchset 5 (Parent): assert mDelegateFactory != null;
      Aishwarya Rajesh . unresolved

      It is apparently problematic if we pass a `null` `mDelegateFactory` to `#initialize()` although `mDelegateFactory` [here](https://source.chromium.org/chromium/chromium/src/+/main:chrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.java;l=1264;drc=ee9e4b7dbb33a548fa1cc97e734e4bda272b5c3f) is technically `@Nullable` - this change [breaks](https://chromium-review.googlesource.com/c/chromium/src/+/6912607?checksPatchset=5&tab=checks) a few tests and it is unclear to me if it is safe to continue passing a `null` `CustomTabDelegateFactory` and update the failing test fixtures instead.

      Aishwarya Rajesh

      Okay, I just realized there are ~300 test failures, so this method probably requires a non-null `delegateFactory` after all. The fallback on `null` value, `TabImpl#getDelegateFactory()` on line 193, also returns a `@Nullable` value so if we don't provide a non-null, "empty" `delegateFactory`, we're going to break some implementations.

      I'll probably revert the recent changes and add the `createEmpty()` method back, unless you have a better idea, please LMK. :)

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Aishwarya Rajesh
      • Andrew Grieve
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      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: Ie2cd0c4538180d8f1fadef34dc5f0141762433b1
      Gerrit-Change-Number: 6912607
      Gerrit-PatchSet: 5
      Gerrit-Owner: Aishwarya Rajesh <aishw...@google.com>
      Gerrit-Reviewer: Aishwarya Rajesh <aishw...@google.com>
      Gerrit-Reviewer: Andrew Grieve <agr...@chromium.org>
      Gerrit-CC: Peter Beverloo <pe...@chromium.org>
      Gerrit-Attention: Aishwarya Rajesh <aishw...@google.com>
      Gerrit-Attention: Andrew Grieve <agr...@chromium.org>
      Gerrit-Comment-Date: Fri, 05 Sep 2025 00:08:49 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Aishwarya Rajesh <aishw...@google.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Aishwarya Rajesh (Gerrit)

      unread,
      Sep 4, 2025, 8:23:29 PM (2 days ago) Sep 4
      to AyeAye, Andrew Grieve, Chromium LUCI CQ, chromium...@chromium.org, Peter Beverloo, jinsukk...@chromium.org, dtraino...@chromium.org, lizeb+watch...@chromium.org, peilinwa...@google.com, roagarw...@chromium.org

      Aishwarya Rajesh voted Commit-Queue+0

      Commit-Queue+0
      Open in Gerrit

      Related details

      Attention set is empty
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      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: Ie2cd0c4538180d8f1fadef34dc5f0141762433b1
      Gerrit-Change-Number: 6912607
      Gerrit-PatchSet: 5
      Gerrit-Owner: Aishwarya Rajesh <aishw...@google.com>
      Gerrit-Reviewer: Aishwarya Rajesh <aishw...@google.com>
      Gerrit-Reviewer: Andrew Grieve <agr...@chromium.org>
      Gerrit-CC: Peter Beverloo <pe...@chromium.org>
      Gerrit-Comment-Date: Fri, 05 Sep 2025 00:23:20 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Andrew Grieve (Gerrit)

      unread,
      Sep 4, 2025, 9:07:57 PM (2 days ago) Sep 4
      to Aishwarya Rajesh, AyeAye, Andrew Grieve, Chromium LUCI CQ, chromium...@chromium.org, Peter Beverloo, jinsukk...@chromium.org, dtraino...@chromium.org, lizeb+watch...@chromium.org, peilinwa...@google.com, roagarw...@chromium.org
      Attention needed from Aishwarya Rajesh

      Andrew Grieve added 1 comment

      File chrome/android/java/src/org/chromium/chrome/browser/tab/TabBuilder.java
      Line 200, Patchset 5 (Parent): assert mDelegateFactory != null;
      Aishwarya Rajesh . unresolved

      It is apparently problematic if we pass a `null` `mDelegateFactory` to `#initialize()` although `mDelegateFactory` [here](https://source.chromium.org/chromium/chromium/src/+/main:chrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.java;l=1264;drc=ee9e4b7dbb33a548fa1cc97e734e4bda272b5c3f) is technically `@Nullable` - this change [breaks](https://chromium-review.googlesource.com/c/chromium/src/+/6912607?checksPatchset=5&tab=checks) a few tests and it is unclear to me if it is safe to continue passing a `null` `CustomTabDelegateFactory` and update the failing test fixtures instead.

      Aishwarya Rajesh

      Okay, I just realized there are ~300 test failures, so this method probably requires a non-null `delegateFactory` after all. The fallback on `null` value, `TabImpl#getDelegateFactory()` on line 193, also returns a `@Nullable` value so if we don't provide a non-null, "empty" `delegateFactory`, we're going to break some implementations.

      I'll probably revert the recent changes and add the `createEmpty()` method back, unless you have a better idea, please LMK. :)

      Andrew Grieve

      Reverting back sgtm since it seems like it's involved. Maybe instead of adding back all the @Nullables though, just mark `createEmpty()` with `@SuppressWarnings("NullAway")` and add a TODO to have callers use null instead.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Aishwarya Rajesh
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      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: Ie2cd0c4538180d8f1fadef34dc5f0141762433b1
      Gerrit-Change-Number: 6912607
      Gerrit-PatchSet: 5
      Gerrit-Owner: Aishwarya Rajesh <aishw...@google.com>
      Gerrit-Reviewer: Aishwarya Rajesh <aishw...@google.com>
      Gerrit-Reviewer: Andrew Grieve <agr...@chromium.org>
      Gerrit-CC: Peter Beverloo <pe...@chromium.org>
      Gerrit-Attention: Aishwarya Rajesh <aishw...@google.com>
      Gerrit-Comment-Date: Fri, 05 Sep 2025 01:07:52 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Aishwarya Rajesh <aishw...@google.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Aishwarya Rajesh (Gerrit)

      unread,
      Sep 5, 2025, 2:50:13 PM (2 days ago) Sep 5
      to AyeAye, Andrew Grieve, Chromium LUCI CQ, chromium...@chromium.org, Peter Beverloo, jinsukk...@chromium.org, dtraino...@chromium.org, lizeb+watch...@chromium.org, peilinwa...@google.com, roagarw...@chromium.org
      Attention needed from Andrew Grieve

      Aishwarya Rajesh added 1 comment

      File chrome/android/java/src/org/chromium/chrome/browser/tab/TabBuilder.java
      Line 200, Patchset 5 (Parent): assert mDelegateFactory != null;
      Aishwarya Rajesh . resolved

      It is apparently problematic if we pass a `null` `mDelegateFactory` to `#initialize()` although `mDelegateFactory` [here](https://source.chromium.org/chromium/chromium/src/+/main:chrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.java;l=1264;drc=ee9e4b7dbb33a548fa1cc97e734e4bda272b5c3f) is technically `@Nullable` - this change [breaks](https://chromium-review.googlesource.com/c/chromium/src/+/6912607?checksPatchset=5&tab=checks) a few tests and it is unclear to me if it is safe to continue passing a `null` `CustomTabDelegateFactory` and update the failing test fixtures instead.

      Aishwarya Rajesh

      Okay, I just realized there are ~300 test failures, so this method probably requires a non-null `delegateFactory` after all. The fallback on `null` value, `TabImpl#getDelegateFactory()` on line 193, also returns a `@Nullable` value so if we don't provide a non-null, "empty" `delegateFactory`, we're going to break some implementations.

      I'll probably revert the recent changes and add the `createEmpty()` method back, unless you have a better idea, please LMK. :)

      Andrew Grieve

      Reverting back sgtm since it seems like it's involved. Maybe instead of adding back all the @Nullables though, just mark `createEmpty()` with `@SuppressWarnings("NullAway")` and add a TODO to have callers use null instead.

      Aishwarya Rajesh

      SG - done!

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Andrew Grieve
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      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: Ie2cd0c4538180d8f1fadef34dc5f0141762433b1
      Gerrit-Change-Number: 6912607
      Gerrit-PatchSet: 7
      Gerrit-Owner: Aishwarya Rajesh <aishw...@google.com>
      Gerrit-Reviewer: Aishwarya Rajesh <aishw...@google.com>
      Gerrit-Reviewer: Andrew Grieve <agr...@chromium.org>
      Gerrit-CC: Peter Beverloo <pe...@chromium.org>
      Gerrit-Attention: Andrew Grieve <agr...@chromium.org>
      Gerrit-Comment-Date: Fri, 05 Sep 2025 18:50:02 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Aishwarya Rajesh <aishw...@google.com>
      Comment-In-Reply-To: Andrew Grieve <agr...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Andrew Grieve (Gerrit)

      unread,
      Sep 5, 2025, 3:03:01 PM (2 days ago) Sep 5
      to Aishwarya Rajesh, Andrew Grieve, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Peter Beverloo, jinsukk...@chromium.org, dtraino...@chromium.org, lizeb+watch...@chromium.org, peilinwa...@google.com, roagarw...@chromium.org
      Attention needed from Aishwarya Rajesh

      Andrew Grieve voted and added 5 comments

      Votes added by Andrew Grieve

      Code-Review+1

      5 comments

      Patchset-level comments
      File-level comment, Patchset 7 (Latest):
      Andrew Grieve . resolved

      a few nits. Thanks for working through this! Still not a very null-friendly class!

      File chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabDelegateFactory.java
      Line 174, Patchset 7 (Latest): assert mIntentDataProvider != null && mIntentDataProvider.isAuthTab();
      Andrew Grieve . unresolved

      nit: use 2 asserts so that if it fails we know what happened.

      Line 180, Patchset 7 (Latest): if (mIntentDataProvider == null || mIntentDataProvider.isAuthTab()) return;
      Andrew Grieve . unresolved

      nit: `assumeNonNull()`. Don't want to fail silently if it's a bug to call this without a provider.

      Line 260, Patchset 7 (Latest): if (mActivity == null) return;
      Andrew Grieve . unresolved

      nit: probably an assert would be better than not doing what we promise to do.

      Line 614, Patchset 7 (Latest): if (intentDataProvider != null && intentDataProvider.hasTargetNetwork()) {
      Andrew Grieve . unresolved

      nit: assumeNonNull()

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Aishwarya Rajesh
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      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: Ie2cd0c4538180d8f1fadef34dc5f0141762433b1
      Gerrit-Change-Number: 6912607
      Gerrit-PatchSet: 7
      Gerrit-Owner: Aishwarya Rajesh <aishw...@google.com>
      Gerrit-Reviewer: Aishwarya Rajesh <aishw...@google.com>
      Gerrit-Reviewer: Andrew Grieve <agr...@chromium.org>
      Gerrit-CC: Peter Beverloo <pe...@chromium.org>
      Gerrit-Attention: Aishwarya Rajesh <aishw...@google.com>
      Gerrit-Comment-Date: Fri, 05 Sep 2025 19:02:55 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Aishwarya Rajesh (Gerrit)

      unread,
      Sep 5, 2025, 3:15:33 PM (2 days ago) Sep 5
      to Andrew Grieve, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Peter Beverloo, jinsukk...@chromium.org, dtraino...@chromium.org, lizeb+watch...@chromium.org, peilinwa...@google.com, roagarw...@chromium.org

      Aishwarya Rajesh added 4 comments

      File chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabDelegateFactory.java
      Line 174, Patchset 7: assert mIntentDataProvider != null && mIntentDataProvider.isAuthTab();
      Andrew Grieve . resolved

      nit: use 2 asserts so that if it fails we know what happened.

      Aishwarya Rajesh

      Done

      Line 180, Patchset 7: if (mIntentDataProvider == null || mIntentDataProvider.isAuthTab()) return;
      Andrew Grieve . resolved

      nit: `assumeNonNull()`. Don't want to fail silently if it's a bug to call this without a provider.

      Aishwarya Rajesh

      Done

      Line 260, Patchset 7: if (mActivity == null) return;
      Andrew Grieve . resolved

      nit: probably an assert would be better than not doing what we promise to do.

      Aishwarya Rajesh

      Done

      Line 614, Patchset 7: if (intentDataProvider != null && intentDataProvider.hasTargetNetwork()) {
      Andrew Grieve . resolved

      nit: assumeNonNull()

      Aishwarya Rajesh

      I realized this has just one caller that is already doing `assumeNonNull()` so this input should be non-null already, removed `@Nullable` on the input. :)

      Open in Gerrit

      Related details

      Attention set is empty
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      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: Ie2cd0c4538180d8f1fadef34dc5f0141762433b1
      Gerrit-Change-Number: 6912607
      Gerrit-PatchSet: 9
      Gerrit-Owner: Aishwarya Rajesh <aishw...@google.com>
      Gerrit-Reviewer: Aishwarya Rajesh <aishw...@google.com>
      Gerrit-Reviewer: Andrew Grieve <agr...@chromium.org>
      Gerrit-CC: Peter Beverloo <pe...@chromium.org>
      Gerrit-Comment-Date: Fri, 05 Sep 2025 19:15:05 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Andrew Grieve <agr...@chromium.org>
      satisfied_requirement
      open
      diffy

      Aishwarya Rajesh (Gerrit)

      unread,
      Sep 5, 2025, 3:16:53 PM (2 days ago) Sep 5
      to Andrew Grieve, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Peter Beverloo, jinsukk...@chromium.org, dtraino...@chromium.org, lizeb+watch...@chromium.org, peilinwa...@google.com, roagarw...@chromium.org

      Aishwarya Rajesh 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
      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: Ie2cd0c4538180d8f1fadef34dc5f0141762433b1
      Gerrit-Change-Number: 6912607
      Gerrit-PatchSet: 9
      Gerrit-Owner: Aishwarya Rajesh <aishw...@google.com>
      Gerrit-Reviewer: Aishwarya Rajesh <aishw...@google.com>
      Gerrit-Reviewer: Andrew Grieve <agr...@chromium.org>
      Gerrit-CC: Peter Beverloo <pe...@chromium.org>
      Gerrit-Comment-Date: Fri, 05 Sep 2025 19:15:09 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      open
      diffy

      Chromium LUCI CQ (Gerrit)

      unread,
      Sep 5, 2025, 4:31:54 PM (2 days ago) Sep 5
      to Aishwarya Rajesh, Andrew Grieve, AyeAye, chromium...@chromium.org, Peter Beverloo, jinsukk...@chromium.org, dtraino...@chromium.org, lizeb+watch...@chromium.org, peilinwa...@google.com, roagarw...@chromium.org

      Chromium LUCI CQ submitted the change with unreviewed changes

      Unreviewed changes

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

      ```
      The name of the file: chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabDelegateFactory.java
      Insertions: 6, Deletions: 6.

      @@ -171,13 +171,14 @@

      @Override
      public void returnAsActivityResult(GURL url) {
      - assert mIntentDataProvider != null && mIntentDataProvider.isAuthTab();
      + assert mIntentDataProvider != null;
      + assert mIntentDataProvider.isAuthTab();
      mAuthTabVerifier.returnAsActivityResult(url);
      }

      @Override
      public void maybeRecordExternalNavigationSchemeHistogram(GURL url) {
      - if (mIntentDataProvider == null || mIntentDataProvider.isAuthTab()) return;
      + if (assumeNonNull(mIntentDataProvider).isAuthTab()) return;

      // Only record for Custom Tabs that we think are launched for auth purposes.
      Uri urlToLoad = Uri.parse(mIntentDataProvider.getUrlToLoad());
      @@ -257,7 +258,7 @@

      @Override
      protected void bringActivityToForeground() {
      - if (mActivity == null) return;
      + assert mActivity != null;
      ((ActivityManager) mActivity.getSystemService(Context.ACTIVITY_SERVICE))
      .moveTaskToFront(mActivity.getTaskId(), 0);
      }
      @@ -609,9 +610,8 @@
      }

      private static @ChromeContextMenuPopulator.ContextMenuMode int getContextMenuMode(
      - @Nullable BrowserServicesIntentDataProvider intentDataProvider,
      - @ActivityType int activityType) {
      - if (intentDataProvider != null && intentDataProvider.hasTargetNetwork()) {
      + BrowserServicesIntentDataProvider intentDataProvider, @ActivityType int activityType) {
      + if (intentDataProvider.hasTargetNetwork()) {
      return ChromeContextMenuPopulator.ContextMenuMode.NETWORK_BOUND_TAB;
      }
      return isWebappOrWebApk(activityType)
      ```

      Change information

      Commit message:
      [NullAway] Add @NullMarked to customtabs/ files
      Bug: 389129271
      Change-Id: Ie2cd0c4538180d8f1fadef34dc5f0141762433b1
      Reviewed-by: Andrew Grieve <agr...@chromium.org>
      Commit-Queue: Aishwarya Rajesh <aishw...@google.com>
      Cr-Commit-Position: refs/heads/main@{#1511844}
      Files:
      • M chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomButtonParamsImpl.java
      • M chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuHelper.java
      • M chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java
      • M chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabBottomBarDelegate.java
      • M chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabColorProviderImpl.java
      • M chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabCompositorContentInitializer.java
      • M chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabDelegateFactory.java
      • M chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabDownloadObserver.java
      • M chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIncognitoManager.java
      • M chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePageFactory.java
      • M chrome/browser/android/browserservices/intents/java/src/org/chromium/chrome/browser/browserservices/intents/CustomButtonParams.java
      Change size: M
      Delta: 11 files changed, 77 insertions(+), 53 deletions(-)
      Branch: refs/heads/main
      Submit Requirements:
      • requirement satisfiedCode-Review: +1 by Andrew Grieve
      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: Ie2cd0c4538180d8f1fadef34dc5f0141762433b1
      Gerrit-Change-Number: 6912607
      Gerrit-PatchSet: 10
      Gerrit-Owner: Aishwarya Rajesh <aishw...@google.com>
      Gerrit-Reviewer: Aishwarya Rajesh <aishw...@google.com>
      Gerrit-Reviewer: Andrew Grieve <agr...@chromium.org>
      open
      diffy
      satisfied_requirement
      Reply all
      Reply to author
      Forward
      0 new messages