• Antonio Gomes's avatar
    Migrate chrome/test/chromedriver/net/net_util.cc using SimpleURLLoader · c7e36b09
    Antonio Gomes authored
    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: default avatarMatt Menke <mmenke@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#601422}
    c7e36b09
BUILD.gn 12.7 KB