[ios] Split TaskRequest responsibilities in multiple classes [chromium/src : main]

0 views
Skip to first unread message

Federica Germinario (Gerrit)

unread,
Feb 23, 2026, 8:15:29 AM (yesterday) Feb 23
to Sylvain Defresne, Chromium LUCI CQ, chromium...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
Attention needed from Sylvain Defresne

Federica Germinario added 1 comment

Patchset-level comments
File-level comment, Patchset 4 (Latest):
Federica Germinario . resolved

Hello, can you PTAL?

Open in Gerrit

Related details

Attention is currently required from:
  • Sylvain Defresne
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • 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: I216fde6a31444cfcee40ce91e48f732f1eb64440
Gerrit-Change-Number: 7594981
Gerrit-PatchSet: 4
Gerrit-Owner: Federica Germinario <fede...@google.com>
Gerrit-Reviewer: Federica Germinario <fede...@google.com>
Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
Gerrit-Attention: Sylvain Defresne <sdef...@chromium.org>
Gerrit-Comment-Date: Mon, 23 Feb 2026 13:15:17 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Sylvain Defresne (Gerrit)

unread,
Feb 23, 2026, 11:28:01 AM (yesterday) Feb 23
to Federica Germinario, Chromium LUCI CQ, chromium...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
Attention needed from Federica Germinario

Sylvain Defresne added 5 comments

File ios/chrome/app/task_request.h
Line 70, Patchset 5 (Latest):// Protected methods for subclasses.
Sylvain Defresne . unresolved

I think we can move this to `task_request_private.h`, which we allow to include from sub-classes and from `task_request.mm` but not from the rest of the codebase.

```
@interface TaskRequest ()

- (instancetype)initWithSceneState:(SceneState*)sceneState
isColdStart:(BOOL)isColdStart;
  • (SceneState*)sceneStateFromSessionID;

@end
```

Line 38, Patchset 5 (Latest): @protected
std::string _sceneSessionID;
__weak SceneState* _sceneState;
BOOL _isColdStart;
}
Sylvain Defresne . unresolved

I don't think this is necessary.

Looking at the implementation, this is never used from sub-classes. The sub-classes uses the `isColdStart` property, and the `sceneStateFromSessionID` methods instead of accessing those ivars directly.

Thus you should be able to move this back into the implementation files.

File ios/chrome/app/task_request.mm
Line 102, Patchset 5 (Latest):+ (instancetype)taskForTestingWithSceneID:(std::string_view)sceneID
Sylvain Defresne . unresolved

nit: move with the other factories (i.e. before the initializers)

Line 128, Patchset 5 (Latest): return nil;
Sylvain Defresne . unresolved

nit: `NOTREACHED()` since all sub-classes `CHECK(...)` that the pointer returned is not nil

File ios/chrome/app/task_request_shortcut_item.mm
Line 27, Patchset 5 (Latest): _shortcutHandler = [handler copy];
Sylvain Defresne . unresolved

nit: `-copy` is not required since we use ARC.

Open in Gerrit

Related details

Attention is currently required from:
  • Federica Germinario
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: I216fde6a31444cfcee40ce91e48f732f1eb64440
    Gerrit-Change-Number: 7594981
    Gerrit-PatchSet: 5
    Gerrit-Owner: Federica Germinario <fede...@google.com>
    Gerrit-Reviewer: Federica Germinario <fede...@google.com>
    Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
    Gerrit-Attention: Federica Germinario <fede...@google.com>
    Gerrit-Comment-Date: Mon, 23 Feb 2026 16:27:43 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Federica Germinario (Gerrit)

    unread,
    8:17 AM (8 hours ago) 8:17 AM
    to Sylvain Defresne, Chromium LUCI CQ, chromium...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
    Attention needed from Sylvain Defresne

    Federica Germinario added 5 comments

    File ios/chrome/app/task_request.h
    Line 70, Patchset 5:// Protected methods for subclasses.
    Sylvain Defresne . resolved

    I think we can move this to `task_request_private.h`, which we allow to include from sub-classes and from `task_request.mm` but not from the rest of the codebase.

    ```
    @interface TaskRequest ()

    - (instancetype)initWithSceneState:(SceneState*)sceneState
    isColdStart:(BOOL)isColdStart;
    • (SceneState*)sceneStateFromSessionID;

    @end
    ```

    Federica Germinario

    Done


    std::string _sceneSessionID;
    __weak SceneState* _sceneState;
    BOOL _isColdStart;
    }
    Sylvain Defresne . resolved

    I don't think this is necessary.

    Looking at the implementation, this is never used from sub-classes. The sub-classes uses the `isColdStart` property, and the `sceneStateFromSessionID` methods instead of accessing those ivars directly.

    Thus you should be able to move this back into the implementation files.

    Federica Germinario

    Done

    File ios/chrome/app/task_request.mm
    Line 102, Patchset 5:+ (instancetype)taskForTestingWithSceneID:(std::string_view)sceneID
    Sylvain Defresne . resolved

    nit: move with the other factories (i.e. before the initializers)

    Federica Germinario

    Done

    Line 128, Patchset 5: return nil;
    Sylvain Defresne . resolved

    nit: `NOTREACHED()` since all sub-classes `CHECK(...)` that the pointer returned is not nil

    Federica Germinario

    Done

    File ios/chrome/app/task_request_shortcut_item.mm
    Line 27, Patchset 5: _shortcutHandler = [handler copy];
    Sylvain Defresne . resolved

    nit: `-copy` is not required since we use ARC.

    Federica Germinario

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Sylvain Defresne
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • 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: I216fde6a31444cfcee40ce91e48f732f1eb64440
      Gerrit-Change-Number: 7594981
      Gerrit-PatchSet: 7
      Gerrit-Owner: Federica Germinario <fede...@google.com>
      Gerrit-Reviewer: Federica Germinario <fede...@google.com>
      Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
      Gerrit-Attention: Sylvain Defresne <sdef...@chromium.org>
      Gerrit-Comment-Date: Tue, 24 Feb 2026 13:16:53 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Sylvain Defresne <sdef...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Sylvain Defresne (Gerrit)

      unread,
      11:49 AM (5 hours ago) 11:49 AM
      to Federica Germinario, Chromium LUCI CQ, chromium...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
      Attention needed from Federica Germinario

      Sylvain Defresne voted and added 1 comment

      Votes added by Sylvain Defresne

      Code-Review+1

      1 comment

      Patchset-level comments
      File-level comment, Patchset 7 (Latest):
      Sylvain Defresne . resolved

      lgtm

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Federica Germinario
      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: I216fde6a31444cfcee40ce91e48f732f1eb64440
      Gerrit-Change-Number: 7594981
      Gerrit-PatchSet: 7
      Gerrit-Owner: Federica Germinario <fede...@google.com>
      Gerrit-Reviewer: Federica Germinario <fede...@google.com>
      Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
      Gerrit-Attention: Federica Germinario <fede...@google.com>
      Gerrit-Comment-Date: Tue, 24 Feb 2026 16:49:23 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      open
      diffy

      Federica Germinario (Gerrit)

      unread,
      11:50 AM (5 hours ago) 11:50 AM
      to Sylvain Defresne, Chromium LUCI CQ, chromium...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org

      Federica Germinario voted and added 1 comment

      Votes added by Federica Germinario

      Commit-Queue+2

      1 comment

      Patchset-level comments
      Federica Germinario . resolved

      Thanks!

      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: I216fde6a31444cfcee40ce91e48f732f1eb64440
      Gerrit-Change-Number: 7594981
      Gerrit-PatchSet: 7
      Gerrit-Owner: Federica Germinario <fede...@google.com>
      Gerrit-Reviewer: Federica Germinario <fede...@google.com>
      Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
      Gerrit-Comment-Date: Tue, 24 Feb 2026 16:50:02 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      open
      diffy

      Chromium LUCI CQ (Gerrit)

      unread,
      12:56 PM (4 hours ago) 12:56 PM
      to Federica Germinario, Sylvain Defresne, chromium...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org

      Chromium LUCI CQ submitted the change

      Change information

      Commit message:
      [ios] Split TaskRequest responsibilities in multiple classes

      Add:
      - TaskRequestForShortcutItem
      - TaskRequestForURLContext
      - TaskRequestForUserActivity
      classes to handle specific intent types, to avoid having all logic in
      one single class.
      Bug: 462018636
      Change-Id: I216fde6a31444cfcee40ce91e48f732f1eb64440
      Reviewed-by: Sylvain Defresne <sdef...@chromium.org>
      Commit-Queue: Federica Germinario <fede...@google.com>
      Cr-Commit-Position: refs/heads/main@{#1589505}
      Files:
      Change size: L
      Delta: 11 files changed, 386 insertions(+), 220 deletions(-)
      Branch: refs/heads/main
      Submit Requirements:
      • requirement satisfiedCode-Review: +1 by Sylvain Defresne
      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: I216fde6a31444cfcee40ce91e48f732f1eb64440
      Gerrit-Change-Number: 7594981
      Gerrit-PatchSet: 8
      Gerrit-Owner: Federica Germinario <fede...@google.com>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: Federica Germinario <fede...@google.com>
      Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
      open
      diffy
      satisfied_requirement
      Reply all
      Reply to author
      Forward
      0 new messages