[OnionSoup] Move blink.mojom.FetchAPIResponse into blink/public/mojom/fetch/
This CL is the 2nd step of the plan below aiming to eliminate the native
struct content::ServiceWorkerResponse defined in
content/common/service_worker/service_worker_types.h.
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: (This CL)
Now we can just move blink.mojom.FetchAPIResponse into
blink/public/mojom/fetch/, which makes the next steps possible.
3rd step:
- 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: I9afad29a89887369c211cb46bce5bc98df16064f
Reviewed-on: https://chromium-review.googlesource.com/1149706
Commit-Queue: Han Leon <[email protected]>
Reviewed-by: Matt Falkenhagen <[email protected]>
Reviewed-by: Makoto Shimazu <[email protected]>
Reviewed-by: Yutaka Hirano <[email protected]>
Reviewed-by: Kinuko Yasuda <[email protected]>
Cr-Commit-Position: refs/heads/master@{#579273}
diff --git a/third_party/blink/public/BUILD.gn b/third_party/blink/public/BUILD.gn
index 8680612c..58287cc 100644
--- a/third_party/blink/public/BUILD.gn
+++ b/third_party/blink/public/BUILD.gn
@@ -704,7 +704,6 @@
"platform/modules/cache_storage/cache_storage.mojom",
"platform/modules/credentialmanager/credential_manager.mojom",
"platform/modules/fetch/fetch_api_request.mojom",
- "platform/modules/fetch/fetch_api_response.mojom",
"platform/modules/geolocation/geolocation_service.mojom",
"platform/modules/hyphenation/hyphenation.mojom",
"platform/modules/insecure_input/insecure_input_service.mojom",
diff --git a/third_party/blink/public/mojom/BUILD.gn b/third_party/blink/public/mojom/BUILD.gn
index 312a34a..f121b4d 100644
--- a/third_party/blink/public/mojom/BUILD.gn
+++ b/third_party/blink/public/mojom/BUILD.gn
@@ -22,6 +22,7 @@
"dom_storage/storage_area.mojom",
"dom_storage/storage_partition_service.mojom",
"feature_policy/feature_policy.mojom",
+ "fetch/fetch_api_response.mojom",
"file/file_utilities.mojom",
"frame/find_in_page.mojom",
"leak_detector/leak_detector.mojom",
diff --git a/third_party/blink/public/mojom/fetch/OWNERS b/third_party/blink/public/mojom/fetch/OWNERS
new file mode 100644
index 0000000..2eaf30a
--- /dev/null
+++ b/third_party/blink/public/mojom/fetch/OWNERS
@@ -0,0 +1,7 @@
+file://third_party/blink/renderer/core/fetch/OWNERS
+
+per-file *.mojom=set noparent
+per-file *.mojom=file://ipc/SECURITY_OWNERS
+
+# TEAM: [email protected]
+# COMPONENT: Blink>Network>FetchAPI
diff --git a/third_party/blink/public/mojom/fetch/README.md b/third_party/blink/public/mojom/fetch/README.md
new file mode 100644
index 0000000..1dfa89b
--- /dev/null
+++ b/third_party/blink/public/mojom/fetch/README.md
@@ -0,0 +1,2 @@
+Public mojom files that are referenced both from browser-side and renderer-side
+for [Fetch API](https://fetch.spec.whatwg.org/#fetch-api).
diff --git a/third_party/blink/public/platform/modules/fetch/fetch_api_response.mojom b/third_party/blink/public/mojom/fetch/fetch_api_response.mojom
similarity index 100%
rename from third_party/blink/public/platform/modules/fetch/fetch_api_response.mojom
rename to third_party/blink/public/mojom/fetch/fetch_api_response.mojom
diff --git a/third_party/blink/public/platform/modules/cache_storage/cache_storage.mojom b/third_party/blink/public/platform/modules/cache_storage/cache_storage.mojom
index 0cfadd65..67c1693 100644
--- a/third_party/blink/public/platform/modules/cache_storage/cache_storage.mojom
+++ b/third_party/blink/public/platform/modules/cache_storage/cache_storage.mojom
@@ -4,8 +4,8 @@
module blink.mojom;
+import "third_party/blink/public/mojom/fetch/fetch_api_response.mojom";
import "third_party/blink/public/platform/modules/fetch/fetch_api_request.mojom";
-import "third_party/blink/public/platform/modules/fetch/fetch_api_response.mojom";
import "mojo/public/mojom/base/string16.mojom";
// This enum is used in histograms, so do not change the ordering and always
diff --git a/third_party/blink/renderer/core/fetch/fetch_response_data.h b/third_party/blink/renderer/core/fetch/fetch_response_data.h
index 5810fcd..b32bb79 100644
--- a/third_party/blink/renderer/core/fetch/fetch_response_data.h
+++ b/third_party/blink/renderer/core/fetch/fetch_response_data.h
@@ -10,8 +10,8 @@
#include "base/macros.h"
#include "base/memory/scoped_refptr.h"
#include "services/network/public/mojom/fetch_api.mojom-blink.h"
+#include "third_party/blink/public/mojom/fetch/fetch_api_response.mojom-blink.h"
#include "third_party/blink/public/platform/modules/fetch/fetch_api_request.mojom-blink.h"
-#include "third_party/blink/public/platform/modules/fetch/fetch_api_response.mojom-blink.h"
#include "third_party/blink/public/platform/modules/service_worker/web_service_worker_request.h"
#include "third_party/blink/public/platform/web_cors.h"
#include "third_party/blink/renderer/core/core_export.h"
diff --git a/third_party/blink/renderer/core/fetch/response.h b/third_party/blink/renderer/core/fetch/response.h
index 33463f8..10caa9a 100644
--- a/third_party/blink/renderer/core/fetch/response.h
+++ b/third_party/blink/renderer/core/fetch/response.h
@@ -5,7 +5,7 @@
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_FETCH_RESPONSE_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_FETCH_RESPONSE_H_
-#include "third_party/blink/public/platform/modules/fetch/fetch_api_response.mojom-blink.h"
+#include "third_party/blink/public/mojom/fetch/fetch_api_response.mojom-blink.h"
#include "third_party/blink/renderer/bindings/core/v8/dictionary.h"
#include "third_party/blink/renderer/bindings/core/v8/script_value.h"
#include "third_party/blink/renderer/core/core_export.h"