• Vaclav Brozek's avatar
    Turn IOSFormParser into a static function · 8478a8f1
    Vaclav Brozek authored
    IOSFormParser is a class used on iOS to turn a HTML description of
    password forms into an internal PasswordForm structure. The class has
    no data members and the only method, Parse(), is thus effectively
    static.
    
    It was created as a class for two reasons: (1) to allow mocking, and
    (2) to enable holding some server-supplied state.
    
    I chatted with dvadym@ and we agreed that once this actually needs
    being mocked, we can assess the concrete needs, and perhaps change
    some alternative (e.g., providing a fake result for testing) to mocking
    which would still require adding a virtual interface and other
    boilerplate. Holding the server-supplied state might also likely
    end up in PasswordFormManager.
    
    Because it is confusing to create IOSFormParser instances in the
    current code and the two concerns above seem addressed, this CL
    turns IOSFormParser into a single static function, ParseFormData(),
    following the existing pattern found in
    components/password_manager/core/browser/import/csv_reader.h.
    
    Bug: 827945
    Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
    Change-Id: Idbbd5087f301bb07974364f7b8bd324ed42a0fa5
    Reviewed-on: https://chromium-review.googlesource.com/990333
    Commit-Queue: Vaclav Brozek <vabr@chromium.org>
    Reviewed-by: default avatarVadym Doroshenko <dvadym@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#548740}
    8478a8f1
password_controller.mm 33.5 KB