• Antonio Gomes's avatar
    Reland "Migrate chrome/test/chromedriver/net/net_util.cc using SimpleURLLoader" · 930cc098
    Antonio Gomes authored
    This is a reland of c7e36b09
    
    The difference between this CL and its original version
    (https://crrev.com/c/c1289849) is that dependencies are made
    more explicit in chrome/test/chromedriver/BUILD.gn.
    
    TBR=mmenke@chromium.org,johnchen@chromium.org (John +1'ed the original incarnation of this CL at [1]).
    
    Original change's description:
    > Migrate chrome/test/chromedriver/net/net_util.cc using SimpleURLLoader
    >
    > URLFetcher will stop working with advent of Network Service, and
    > SimpleURLLoader is the replacement API for most clients.
    > This CL migrates chromedriver and its respective unittests away from
    > URLFetcher.
    >
    > Note that because of the multithreaded nature of the code, the natural
    > approach was to simply call SharedURLLoaderFactory::Clone and pass
    > the "info" mojo handle accross threads, until the operational thread.
    > However, the structure holding this mojo handle is called/passed from
    >
    >   (i) an indirect chain of BindRepeating calls,
    >   (ii) various threads.
    >
    > Given that network::mojom::URLLoaderFactoryPtrInfo and
    > network::SharedURLLoaderFactoryInfo are both move-only object
    > (which does not comply with BingRepeating) and that raw
    > a network::SharedURLoaderLoader instance must operate on the same
    > thread it was created on, this CL comes up with a local thread-agnostic
    > "wrapper" to mojom::URLLoaderFactory, named WrapperURLLoaderFactory
    > (see chrome/test/chromedriver/server/http_handler.cc).
    > Its instance replaces URLRequestContextGetter instead across threads
    > and BindRepeating chains just fine.
    >
    > This CL is based on the original work of Sergio Villar (svillar@igalia.com)
    > on [1].
    >
    > TBR=johnchen@chromium.org (John +1'ed the original incarnation of this CL at [1]).
    >
    > [1] https://crrev.com/c/1221256
    >
    > Bug: 872887
    >
    > Change-Id: I21386edb04b25438ba3aa40dd5ecc1461342aecf
    > Reviewed-on: https://chromium-review.googlesource.com/c/1289849
    > Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
    > Reviewed-by: Matt Menke <mmenke@chromium.org>
    > Cr-Commit-Position: refs/heads/master@{#601422}
    
    Bug: 872887
    Change-Id: I645a34d28cfb92c15f2f2db409e0fe7cb7a5ac6b
    Reviewed-on: https://chromium-review.googlesource.com/c/1292933Reviewed-by: default avatarAntonio Gomes <tonikitoo@igalia.com>
    Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
    Cr-Commit-Position: refs/heads/master@{#601478}
    930cc098
devtools_http_client.cc 11.2 KB