commit | 1a87e03023a72417bd06f216aa1efa1fb8454001 | [log] [tgz] |
---|---|---|
author | Han Leon <leon.han@intel.com> | Mon Aug 06 12:06:59 2018 |
committer | Commit Bot <commit-bot@chromium.org> | Mon Aug 06 12:06:59 2018 |
tree | a80c5d59519fd73dafea9f0605ecb5bf5e5071d4 | |
parent | 632f6b70acb4754d8fd6fc674b15cad43cf43078 [diff] |
[OnionSoup] Use blink.mojom.FetchAPIResponse for FetchEvent#respondWith This CL is the 3rd step of the plan below aiming to eliminate the native struct content::ServiceWorkerResponse defined in content/common/service_worker/service_worker_types.h. Note: Actually after this CL we can remove the Mojo method content.mojom.ServiceWorkerFetchResponseCallback.OnResponseBlob by using OnResponse instead, but to avoid a too big CL I'd like to do that with a follow-up CL. 1st step: https://chromium-review.googlesource.com/c/chromium/src/+/1134731 - Remove the typemapping of blink.mojom.FetchAPIResponse. The mojom struct blink.mojom.FetchAPIResponse describes a Response in terms of the concept from the Fetch spec, currently it's defined under blink/public/platform/modules/fetch/ and is used only by Cache Storage API implementation (by both Browser and Renderer code), as this struct meets the 2 conditions below, it should be fine to go into blink/public/mojom/: - it is expected to be used by both Browser and Renderer code. - it is expected to be passed over Mojo between Browser and Renderer (Blink). But, currently for Chromium Mojo binding variant it is typemapped to content::ServiceWorkerResponse being used in content/browser/cache_storage/, this blocks it being moved to blink/public/mojom/. So we need to remove this typemapping first, this removal also helps reduce 1 user of content::ServiceWorkerResponse. 2nd step: https://chromium-review.googlesource.com/c/chromium/src/+/1149706 Now we can just move blink.mojom.FetchAPIResponse into blink/public/mojom/fetch/, which makes the next steps possible. 3rd step: (this CL) - Use blink.mojom.FetchAPIResponse to represent the response a service worker provides to FetchEvent#respondWith. Specifically, use this mojom struct to replace the existing [Native] mojom struct content.mojom.ServiceWorkerResponse in content/common/service_worker/service_worker_fetch_response_callback.mojom. Thus we can reduce another 1 user of content::ServiceWorkerResponse. More importantly, this makes it possible for us to move service_worker_fetch_response_callback.mojom into blink/public/mojom/service_worker/ in future. 4th step: - Use blink.mojom.FetchAPIResponse to represent responses to background fetches. Specifically, use this mojom struct to replace the existing [Native] mojom struct content.mojom.ServiceWorkerResponse defined in content/common/service_worker/service_worker.mojom. Thus we can reduce the last 1 user of content::ServiceWorkerResponse. 5th step: - Remove content::ServiceWorkerResponse and do any left cleanup. BUG=789854 Change-Id: I8c5740abf5e78d1d9b6e716ad692e33addb80e56 Reviewed-on: https://chromium-review.googlesource.com/1155999 Reviewed-by: Kinuko Yasuda <kinuko@chromium.org> Reviewed-by: Matt Falkenhagen <falken@chromium.org> Reviewed-by: Makoto Shimazu <shimazu@chromium.org> Commit-Queue: Han Leon <leon.han@intel.com> Cr-Commit-Position: refs/heads/master@{#580850}
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 .