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

Unified Diff: content/child/web_url_loader_impl.cc

Issue 615493003: [ServiceWorker] Plumbing the request credentials mode to the ServiceWorker. [2/2 chromium] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 3 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
« no previous file with comments | « content/child/resource_dispatcher.cc ('k') | content/common/resource_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/web_url_loader_impl.cc
diff --git a/content/child/web_url_loader_impl.cc b/content/child/web_url_loader_impl.cc
index a9f1bc6242f2a89da622ab52025179932f38afd1..4757a827bba4bbbca4830bcfe53e42386aa6dcd1 100644
--- a/content/child/web_url_loader_impl.cc
+++ b/content/child/web_url_loader_impl.cc
@@ -219,6 +219,17 @@ FetchRequestMode GetFetchRequestMode(const WebURLRequest& request) {
return static_cast<FetchRequestMode>(request.fetchRequestMode());
}
+COMPILE_ASSERT_MATCHING_ENUMS(FETCH_CREDENTIALS_MODE_OMIT,
+ WebURLRequest::FetchCredentialsModeOmit);
+COMPILE_ASSERT_MATCHING_ENUMS(FETCH_CREDENTIALS_MODE_SAME_ORIGIN,
+ WebURLRequest::FetchCredentialsModeSameOrigin);
+COMPILE_ASSERT_MATCHING_ENUMS(FETCH_CREDENTIALS_MODE_INCLUDE,
+ WebURLRequest::FetchCredentialsModeInclude);
+
+FetchCredentialsMode GetFetchCredentialsMode(const WebURLRequest& request) {
+ return static_cast<FetchCredentialsMode>(request.fetchCredentialsMode());
+}
+
} // namespace
// WebURLLoaderImpl::Context --------------------------------------------------
@@ -397,6 +408,9 @@ void WebURLLoaderImpl::Context::Start(const WebURLRequest& request,
// TODO(brettw) this should take parameter encoding into account when
// creating the GURLs.
+ // TODO(horo): Check credentials flag is unset when credentials mode is omit.
+ // Check credentials flag is set when credentials mode is include.
+
RequestInfo request_info;
request_info.method = method;
request_info.url = url;
@@ -418,6 +432,7 @@ void WebURLLoaderImpl::Context::Start(const WebURLRequest& request,
request_info.has_user_gesture = request.hasUserGesture();
request_info.skip_service_worker = request.skipServiceWorker();
request_info.fetch_request_mode = GetFetchRequestMode(request);
+ request_info.fetch_credentials_mode = GetFetchCredentialsMode(request);
request_info.extra_data = request.extraData();
referrer_policy_ = request.referrerPolicy();
request_info.referrer_policy = request.referrerPolicy();
« no previous file with comments | « content/child/resource_dispatcher.cc ('k') | content/common/resource_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698