commit | b616250114f1f5b45878afa71a41d7f2e3eddad3 | [log] [tgz] |
---|---|---|
author | Antonio Gomes <tonikitoo@igalia.com> | Thu Jun 28 20:21:55 2018 |
committer | Commit Bot <commit-bot@chromium.org> | Thu Jun 28 20:21:55 2018 |
tree | d5094ba5178d2723095c5f16240f7e187720d857 | |
parent | 7d24b26391b9f7e35a24213db8092e7304204be7 [diff] |
Reland "Migrate client_update::SendProtocolRequest to SimpleURLLoader" This is a reland of ccd4ec0882bbc5d235b49188ca6cc3ac43c6c9d5 Difference from the original CL is minor, but indeed the cause of failures on debug bots: - headers.AddHeadersFromString(request.all_headers); + for (auto it : request.headers) + headers.SetHeader(it.first, it.second); Basically, network::ResourceRequest::all_headers can contain lines that do not match the "key: value" syntax expected by net::HttpRequestHeaders. Hence, we iterate over network::ResourceRequest::headers instead. TBR=emaxx@chromium.org,sorin@chromium.org,rdevlin.cronin@chromium.org,droger@chromium.org,mmenke@chromium.org Original change's description: > Migrate client_update::SendProtocolRequest to SimpleURLLoader > > URLFetcher et al will stop working in the browser process with advent > of Network Service, and SimpleURLLoader is the replacement API > for most clients. CL migrates SendProtocolRequest to the new API. > > Major remarks: > > * URLRequestPostInterceptor is replaced by URLLoaderPostInterceptor although the public APIs > of the former is kept (are almost the same) in the later. This allows the extensive set of unit > tests to remain untouched. The replacement is needed because URLRequestPostInterceptor used > to intercept requests instantiated by URLFetcher, precisely the class we are moving away to use. > > * URLLoaderPostInterceptor operates in two modes: it supports working both with TestURLLoaderFactory > and EmbeddedTestServer. Two constructors are offered that control the 'mode' it operates on. > This is needed because of the nature of the tests: some tests manipulate the TestConfigurator > directly, hence the needed SharedURLLoaderFactory instance can be acquired directly from it, > eg PingManagerTest, UpdateCheckerTest and RequestSenderTest. > Some other tests, trigger the respective SimpleURLLoader machinery from upper layers, and then > have no access to TestConfigurator instances. In such cases, URLLoaderPostInterceptor operates > using EmbeddedTestServer in order to intercept URL loads. > > Note that this CL migrates components/update_client/utils.cc|h to SimpleURLLoader, but there > some other classes on the same directory that still use URLFetcher (eg UrlFetcherDownloader), > so we simply can not *yet* remove all the references to URLFetcher and URLRequestContextGetter. > It will be done in a follow up CL. > > BUG=773295,844973 > > Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet > Change-Id: I3d8be368818ba77b559907c0217995f8c6a95b04 > Reviewed-on: https://chromium-review.googlesource.com/1097337 > Commit-Queue: Antonio Gomes <tonikitoo@igalia.com> > Reviewed-by: Maksim Ivanov <emaxx@chromium.org> > Reviewed-by: Sorin Jianu <sorin@chromium.org> > Reviewed-by: Devlin <rdevlin.cronin@chromium.org> > Reviewed-by: David Roger <droger@chromium.org> > Reviewed-by: Matt Menke <mmenke@chromium.org> > Cr-Commit-Position: refs/heads/master@{#571097} Bug: 773295, 844973 Change-Id: I3a8252aecf687d08e41c0d09cb9bd245fe3f712b Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet Reviewed-on: https://chromium-review.googlesource.com/1118646 Reviewed-by: Matt Menke <mmenke@chromium.org> Commit-Queue: Antonio Gomes <tonikitoo@igalia.com> Cr-Commit-Position: refs/heads/master@{#571242}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .