Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Unified Diff: third_party/WebKit/public/platform/modules/fetch/request.mojom

Issue 2762303002: Enable transmitting Fetch Requests over Mojo (Closed)
Patch Set: rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/public/platform/modules/fetch/request.mojom
diff --git a/third_party/WebKit/public/platform/modules/fetch/request.mojom b/third_party/WebKit/public/platform/modules/fetch/request.mojom
new file mode 100644
index 0000000000000000000000000000000000000000..c2d6deb4020bafb6b2b35d735f9db36c48846807
--- /dev/null
+++ b/third_party/WebKit/public/platform/modules/fetch/request.mojom
@@ -0,0 +1,105 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
yhirano 2017/03/27 05:58:19 Is it better to rename this file?
Peter Beverloo 2017/03/27 22:22:31 I don't mind too much. It defines a fair number of
yhirano 2017/03/28 12:52:18 sgtm
Peter Beverloo 2017/03/28 14:07:53 Done
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+module blink.mojom;
+
+import "third_party/WebKit/public/platform/referrer.mojom";
+import "url/mojo/url.mojom";
+
+// The mode associated with a request.
+// https://fetch.spec.whatwg.org/#concept-request-mode
+enum FetchRequestMode {
kinuko 2017/03/27 10:01:03 For the enums that are also used in WebURLRequest
Peter Beverloo 2017/03/27 22:22:30 Yeah, it'd be great to remove the duplication. The
+ SAME_ORIGIN,
+ NO_CORS,
+ CORS,
+ CORS_WITH_FORCED_PREFLIGHT,
+ NAVIGATE,
+};
+
+// Type of the context associated with a request.
+enum RequestContextType {
+ UNSPECIFIED,
+ AUDIO,
+ BEACON,
+ CSP_REPORT,
+ DOWNLOAD,
+ EMBED,
+ EVENT_SOURCE,
+ FAVICON,
+ FETCH,
+ FONT,
+ FORM,
+ FRAME,
+ HYPERLINK,
+ IFRAME,
+ IMAGE,
+ IMAGE_SET,
+ IMPORT,
+ INTERNAL,
+ LOCATION,
+ MANIFEST,
+ OBJECT,
+ PING,
+ PLUGIN,
+ PREFETCH,
+ SCRIPT,
+ SERVICE_WORKER,
+ SHARED_WORKER,
+ SUBRESOURCE,
+ STYLE,
+ TRACK,
+ VIDEO,
+ WORKER,
+ XML_HTTP_REQUEST,
+ XSLT,
+};
+
+// Frame type of the context associated with a request.
+enum RequestContextFrameType {
+ AUXILIARY,
+ NESTED,
+ NONE,
+ TOP_LEVEL,
+};
+
+// Credentials mode indicating which credentials should be included with a
+// request.
+enum FetchCredentialsMode {
+ OMIT,
+ SAME_ORIGIN,
+ INCLUDE,
+ PASSWORD,
+};
+
+// The redirect mode indicating how redirects should be handled.
+// https://fetch.spec.whatwg.org/#concept-request-redirect-mode
+enum FetchRedirectMode {
+ FOLLOW,
+ ERROR,
horo 2017/03/27 05:52:02 This ERROR cause compile error in MSVC. I think yo
Peter Beverloo 2017/03/27 22:22:31 Thanks for looking into the error! ERROR_MODE woul
+ MANUAL,
+};
+
+// Whether this is a regular fetch, or a foreign fetch request.
+enum ServiceWorkerFetchType {
+ FETCH,
+ FOREIGN_FETCH,
+};
+
+struct FetchAPIRequest {
+ FetchRequestMode mode;
+ bool is_main_resource_load;
+ RequestContextType request_context_type;
+ RequestContextFrameType frame_type;
+ url.mojom.Url url;
+ string method;
+ map<string, string> headers;
+ string? blob_uuid;
+ uint64 blob_size;
+ Referrer referrer;
+ FetchCredentialsMode credentials_mode;
+ FetchRedirectMode redirect_mode;
+ string? client_id;
+ bool is_reload;
+ ServiceWorkerFetchType fetch_type;
+};

Powered by Google App Engine
This is Rietveld 408576698