commit | 75cdb263f3b7d0949d6a5dc19894c172a600ea69 | [log] [tgz] |
---|---|---|
author | Antonio Gomes <tonikitoo@igalia.com> | Fri Aug 17 13:51:23 2018 |
committer | Commit Bot <commit-bot@chromium.org> | Fri Aug 17 13:51:23 2018 |
tree | 9e79fc94738c02912e0cf20da5df84e20956b4ca | |
parent | 514383a2188ae3b4f2fdc7f466abfa3ebb9880af [diff] |
Migrate WebRtcEventLogUploaderImpl to SimpleURLLoader URLFetcher will stop working with advent of Network Service, and SimpleURLLoader is the replacement API for most clients. This CL migrates WebRtcEventLogUploaderImpl et al away from URLFetcher. Note that this CL slightly changes the flow of the WebRtcEventLogUploader code. Previously, an URLRequestContextGetter instance was acquired on UI thread, passed to the IO-capable task runner, used there, and ultimately deleted either on the UI thread or on the IO-capable task runner thread, depending on the termination circumstance (eg BrowserProcessImpl shutdown or upload completion, respectively). However, URLLoaderFactory and SimpleURLLoader have stricter threading restrictions than URLFetcher and URLRequestContextGetter. For instance, a SharedURLLoaderFactory instance needs to be created, used and deleted on the same thread. Given this scenario, a natural approach to tackle this migration would be the use of CrossThreadSharedURLLoaderFactory{Info} classes. However, as mentioned earlier, the fact that WebRtcEventLogUploader instances are constructed the aforementioned IO-capable task runner thread and the deletion thread varies, make the use of CrossThreadSharedURLLoaderFactory{Info} less straightforward. This CL makes use of the thread agnostic network::mojom::URLLoaderFactoryPtrInfo class instead: from the IO-capable task runner it posts a message to the UI thread to bind a network::mojom::URLLoaderFactory object. As per the mojo documentation [1]: "Once the LoggerPtr is bound we can immediately begin calling Logger interface methods on it, which will immediately write messages into the pipe. These messages will stay queued on the receiving end of the pipe until someone binds to it and starts reading them." [1] https://chromium.googlesource.com/chromium/src/+/master/mojo/public/cpp/bindings/README.md#Binding-an-Interface-Request BUG=773295,873187 Change-Id: Ic29222ea63e90dcb26f3124bdea1c627570dc04d Reviewed-on: https://chromium-review.googlesource.com/1171622 Commit-Queue: Antonio Gomes <tonikitoo@igalia.com> Reviewed-by: Elad Alon <eladalon@chromium.org> Reviewed-by: Matt Menke <mmenke@chromium.org> Cr-Commit-Position: refs/heads/master@{#584048}
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 .