ash: Remove VpnService crosapi [chromium/src : main]

0 views
Skip to first unread message

Georg Neis (Gerrit)

unread,
Aug 12, 2025, 11:37:09 PMAug 12
to chromium...@chromium.org, Chromium LUCI CQ, AyeAye, ffred...@chromium.org, oshima...@chromium.org, extension...@chromium.org, tluk+...@chromium.org, chromium-a...@chromium.org

Georg Neis voted and added 2 comments

Votes added by Georg Neis

Commit-Queue+1

2 comments

Patchset-level comments
File-level comment, Patchset 2 (Latest):
Georg Neis . resolved

Patchset 1 contains code moves only. Hopefully this helps a little bit.

File chrome/browser/chromeos/extensions/vpn_provider/vpn_service.cc
Line 205, Patchset 1: if (pepper_vpn_proxy_observer_) {
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: Ic8458904b9fd1e11b4e6400bf2244b0a76fa14e2
Gerrit-Change-Number: 6844415
Gerrit-PatchSet: 2
Gerrit-Owner: Georg Neis <ne...@chromium.org>
Gerrit-Reviewer: Georg Neis <ne...@chromium.org>
Gerrit-Comment-Date: Wed, 13 Aug 2025 03:36:34 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Georg Neis (Gerrit)

unread,
Aug 12, 2025, 11:37:29 PMAug 12
to Hidehiko Abe, chromium...@chromium.org, Chromium LUCI CQ, AyeAye, ffred...@chromium.org, oshima...@chromium.org, extension...@chromium.org, tluk+...@chromium.org, chromium-a...@chromium.org
Attention needed from Hidehiko Abe

Georg Neis added 1 comment

Patchset-level comments
Georg Neis . unresolved

Patchset 1 contains code moves only. Hopefully this helps a little bit.

Georg Neis

Unresolving for visibility.

Open in Gerrit

Related details

Attention is currently required from:
  • Hidehiko Abe
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: Ic8458904b9fd1e11b4e6400bf2244b0a76fa14e2
Gerrit-Change-Number: 6844415
Gerrit-PatchSet: 2
Gerrit-Owner: Georg Neis <ne...@chromium.org>
Gerrit-Reviewer: Georg Neis <ne...@chromium.org>
Gerrit-Reviewer: Hidehiko Abe <hide...@chromium.org>
Gerrit-Attention: Hidehiko Abe <hide...@chromium.org>
Gerrit-Comment-Date: Wed, 13 Aug 2025 03:37:04 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Georg Neis <ne...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Hidehiko Abe (Gerrit)

unread,
Sep 16, 2025, 7:49:42 AMSep 16
to Georg Neis, Code Review Nudger, chromium...@chromium.org, Chromium LUCI CQ, AyeAye, ffred...@chromium.org, oshima...@chromium.org, extension...@chromium.org, tluk+...@chromium.org, chromium-a...@chromium.org
Attention needed from Georg Neis

Hidehiko Abe added 1 comment

Patchset-level comments
Hidehiko Abe . unresolved

Sorry for miscommunication and delayed reply.

Looking at the code in more precise, I still am feeling difficult to say straightforward LG in this CL, and risk of breakage looks non trivial, because even corresponding code pairs look having some minor tweaks after moving the code, and also the size is still huge (1500+LoC edits).

Suggestion:
Can we break down into smaller pieces?
First step can be:
SetParameters, SendPacket, NotifyConnectionStateChanged. They look similar patterns, and has only small dependency in VpnServiceAsh in crosapi, which is active_configuration_. You can temporarily expose the pointer by adding a public method to crosapi::VpnServiceAsh for migration purpose.

Next step can be moving observer method implementation. Some of internal methods may need to be exposed temporarily as back doors, but I think that'd be fine as long as they are explicitly stated so. Or, if you concern more, base::PassKey should help limiting callers.

Open in Gerrit

Related details

Attention is currently required from:
  • Georg Neis
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: Ic8458904b9fd1e11b4e6400bf2244b0a76fa14e2
Gerrit-Change-Number: 6844415
Gerrit-PatchSet: 2
Gerrit-Owner: Georg Neis <ne...@chromium.org>
Gerrit-Reviewer: Georg Neis <ne...@chromium.org>
Gerrit-Reviewer: Hidehiko Abe <hide...@chromium.org>
Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
Gerrit-Attention: Georg Neis <ne...@chromium.org>
Gerrit-Comment-Date: Tue, 16 Sep 2025 11:49:16 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Georg Neis (Gerrit)

unread,
Oct 22, 2025, 10:42:04 PM (8 days ago) Oct 22
to Code Review Nudger, Hidehiko Abe, chromium...@chromium.org, Chromium LUCI CQ, AyeAye, ffred...@chromium.org, oshima...@chromium.org, extension...@chromium.org, tluk+...@chromium.org, chromium-a...@chromium.org
Attention needed from Hidehiko Abe

Georg Neis added 1 comment

Patchset-level comments
Hidehiko Abe . unresolved

Sorry for miscommunication and delayed reply.

Looking at the code in more precise, I still am feeling difficult to say straightforward LG in this CL, and risk of breakage looks non trivial, because even corresponding code pairs look having some minor tweaks after moving the code, and also the size is still huge (1500+LoC edits).

Suggestion:
Can we break down into smaller pieces?
First step can be:
SetParameters, SendPacket, NotifyConnectionStateChanged. They look similar patterns, and has only small dependency in VpnServiceAsh in crosapi, which is active_configuration_. You can temporarily expose the pointer by adding a public method to crosapi::VpnServiceAsh for migration purpose.

Next step can be moving observer method implementation. Some of internal methods may need to be exposed temporarily as back doors, but I think that'd be fine as long as they are explicitly stated so. Or, if you concern more, base::PassKey should help limiting callers.

Georg Neis

I don't see what you see regarding "Next step ...".
Let's take VpnServiceForExtensionAsh::OnConfigurationRemoved (ash::NetworkConfigurationObserver) as example. To move this we also need to move configurations and thus basically everything. Moving it without moving configurations would require artificial changes such as exposing DispatchConfigRemovedEvent and DestroyConfigurationInternal and making them take the service path as parameter instead of what they currently take. And then we would still have to do the hard work later.

Open in Gerrit

Related details

Attention is currently required from:
  • Hidehiko Abe
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: Ic8458904b9fd1e11b4e6400bf2244b0a76fa14e2
    Gerrit-Change-Number: 6844415
    Gerrit-PatchSet: 2
    Gerrit-Owner: Georg Neis <ne...@chromium.org>
    Gerrit-Reviewer: Georg Neis <ne...@chromium.org>
    Gerrit-Reviewer: Hidehiko Abe <hide...@chromium.org>
    Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
    Gerrit-Attention: Hidehiko Abe <hide...@chromium.org>
    Gerrit-Comment-Date: Thu, 23 Oct 2025 02:41:31 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Hidehiko Abe <hide...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Hidehiko Abe (Gerrit)

    unread,
    Oct 23, 2025, 6:50:39 AM (7 days ago) Oct 23
    to Georg Neis, Code Review Nudger, chromium...@chromium.org, Chromium LUCI CQ, AyeAye, ffred...@chromium.org, oshima...@chromium.org, extension...@chromium.org, tluk+...@chromium.org, chromium-a...@chromium.org
    Attention needed from Georg Neis

    Hidehiko Abe added 1 comment

    Patchset-level comments
    Hidehiko Abe . unresolved

    Sorry for miscommunication and delayed reply.

    Looking at the code in more precise, I still am feeling difficult to say straightforward LG in this CL, and risk of breakage looks non trivial, because even corresponding code pairs look having some minor tweaks after moving the code, and also the size is still huge (1500+LoC edits).

    Suggestion:
    Can we break down into smaller pieces?
    First step can be:
    SetParameters, SendPacket, NotifyConnectionStateChanged. They look similar patterns, and has only small dependency in VpnServiceAsh in crosapi, which is active_configuration_. You can temporarily expose the pointer by adding a public method to crosapi::VpnServiceAsh for migration purpose.

    Next step can be moving observer method implementation. Some of internal methods may need to be exposed temporarily as back doors, but I think that'd be fine as long as they are explicitly stated so. Or, if you concern more, base::PassKey should help limiting callers.

    Georg Neis

    I don't see what you see regarding "Next step ...".
    Let's take VpnServiceForExtensionAsh::OnConfigurationRemoved (ash::NetworkConfigurationObserver) as example. To move this we also need to move configurations and thus basically everything. Moving it without moving configurations would require artificial changes such as exposing DispatchConfigRemovedEvent and DestroyConfigurationInternal and making them take the service path as parameter instead of what they currently take. And then we would still have to do the hard work later.

    Hidehiko Abe
    You can break down the operation to smaller ones step by step.
    ```
    void VpnServiceForExtensionAsh::OnConfigurationRemoved(
    const std::string& service_path,
    const std::string& guid) {
    VpnConfiguration* configuration =
    base::FindPtrOrNull(service_path_to_configuration_map_, service_path);
    if (!configuration) {
    // Ignore removal of a configuration unknown to VPN service, which means
    // the configuration was created internally by the platform or already
    // removed by the extension.
    return;
    }
      DispatchConfigRemovedEvent(configuration->configuration_name());
    DestroyConfigurationInternal(configuration);
    }
    ```

    So, VpnServiceForExtensionAsh can provide a few thin new APIs like returning configuration name from service_path and destroying some specific configure (equivalent to DestroyConfigurationInternal conceptually, but interface can be somewhat tweakable).

    So, with keeping the implementation, observer can be moved to VpnService.

    ```
    void VpnService::OnConfigurationRemoved(const std::string& service_path,
    const std::string&) {
    auto configration_name = GetVpnServiceForExtension(...)->FindConfigurationName(service_path);
    if (!configuration_name) {
    return;
    }
    SendOnConfigRemovedToExtension(...);
    GetVpnServiceForExtension(...)->DestroyConfiguration(...);
    }
    ```

    So, configuration map can be kep in the old class still, but "sending message part" can be moved out from the class.

    The drawback is, as commented above, it breaks some of the encapsulation of VpnServiceForExtensionAsh, but IMHO, it should be fine as long as we can control callers, because anyways we're breaking the class and merge it into the new code in ash.

    Thoughts?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Georg Neis
    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: Ic8458904b9fd1e11b4e6400bf2244b0a76fa14e2
    Gerrit-Change-Number: 6844415
    Gerrit-PatchSet: 2
    Gerrit-Owner: Georg Neis <ne...@chromium.org>
    Gerrit-Reviewer: Georg Neis <ne...@chromium.org>
    Gerrit-Reviewer: Hidehiko Abe <hide...@chromium.org>
    Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
    Gerrit-Attention: Georg Neis <ne...@chromium.org>
    Gerrit-Comment-Date: Thu, 23 Oct 2025 10:50:02 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Georg Neis <ne...@chromium.org>
    Comment-In-Reply-To: Hidehiko Abe <hide...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Georg Neis (Gerrit)

    unread,
    Oct 27, 2025, 10:53:55 PM (3 days ago) Oct 27
    to Code Review Nudger, Hidehiko Abe, chromium...@chromium.org, Chromium LUCI CQ, AyeAye, ffred...@chromium.org, oshima...@chromium.org, extension...@chromium.org, tluk+...@chromium.org, chromium-a...@chromium.org
    Attention needed from Hidehiko Abe

    Georg Neis added 1 comment

    Patchset-level comments
    Georg Neis

    That's one drawback, but I mentioned more:

    Moving it without moving configurations would require artificial changes such as exposing DispatchConfigRemovedEvent and DestroyConfigurationInternal and making them take the service path as parameter instead of what they currently take. And then we would still have to do the hard work later.

    Changing the parameter types of the functions is an artificial change only needed for the sake of making these intermediate CLs and something we would most likely want to do undo again later. Moreover, we still have to move the configurations anyways.

    I understand you want to have small CLs but in this case I don't think it's the right approach as it creates a lot of overhead.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Hidehiko Abe
    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: Ic8458904b9fd1e11b4e6400bf2244b0a76fa14e2
    Gerrit-Change-Number: 6844415
    Gerrit-PatchSet: 2
    Gerrit-Owner: Georg Neis <ne...@chromium.org>
    Gerrit-Reviewer: Georg Neis <ne...@chromium.org>
    Gerrit-Reviewer: Hidehiko Abe <hide...@chromium.org>
    Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
    Gerrit-Attention: Hidehiko Abe <hide...@chromium.org>
    Gerrit-Comment-Date: Tue, 28 Oct 2025 02:53:19 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Hidehiko Abe (Gerrit)

    unread,
    Oct 28, 2025, 4:45:18 AM (2 days ago) Oct 28
    to Georg Neis, Code Review Nudger, chromium...@chromium.org, Chromium LUCI CQ, AyeAye, ffred...@chromium.org, oshima...@chromium.org, extension...@chromium.org, tluk+...@chromium.org, chromium-a...@chromium.org
    Attention needed from Georg Neis

    Hidehiko Abe added 1 comment

    Patchset-level comments
    Hidehiko Abe

    so per offlien chat, you want to use `friend` in order to split this (still) large CL into smaller pieces and migrate one by one.
    I'm ok with the approach, too.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Georg Neis
    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: Ic8458904b9fd1e11b4e6400bf2244b0a76fa14e2
    Gerrit-Change-Number: 6844415
    Gerrit-PatchSet: 2
    Gerrit-Owner: Georg Neis <ne...@chromium.org>
    Gerrit-Reviewer: Georg Neis <ne...@chromium.org>
    Gerrit-Reviewer: Hidehiko Abe <hide...@chromium.org>
    Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
    Gerrit-Attention: Georg Neis <ne...@chromium.org>
    Gerrit-Comment-Date: Tue, 28 Oct 2025 08:44:55 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages