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

Unified Diff: content/child/web_url_loader_impl.cc

Issue 588153002: [ServiceWorker] Plumbing the request mode from the renderer to the ServiceWorker. [2/2 chromium] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix compile error 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 696d8e649ed78c81a15eb2096004b94f7f02e5e6..797ef698a6192ed558cc16c8eba9c30789a59ff7 100644
--- a/content/child/web_url_loader_impl.cc
+++ b/content/child/web_url_loader_impl.cc
@@ -22,6 +22,7 @@
#include "content/child/web_url_request_util.h"
#include "content/child/weburlresponse_extradata_impl.h"
#include "content/common/resource_request_body.h"
+#include "content/common/service_worker/service_worker_types.h"
#include "content/public/child/request_peer.h"
#include "net/base/data_url.h"
#include "net/base/filename_util.h"
@@ -199,6 +200,25 @@ int GetInfoFromDataURL(const GURL& url,
return net::OK;
}
+#define COMPILE_ASSERT_MATCHING_ENUMS(content_name, blink_name) \
+ COMPILE_ASSERT( \
+ static_cast<int>(content_name) == static_cast<int>(blink_name), \
+ mismatching_enums)
+
+COMPILE_ASSERT_MATCHING_ENUMS(FETCH_REQUEST_MODE_SAME_ORIGIN,
+ WebURLRequest::FetchRequestModeSameOrigin);
+COMPILE_ASSERT_MATCHING_ENUMS(FETCH_REQUEST_MODE_NO_CORS,
+ WebURLRequest::FetchRequestModeNoCORS);
+COMPILE_ASSERT_MATCHING_ENUMS(FETCH_REQUEST_MODE_CORS,
+ WebURLRequest::FetchRequestModeCORS);
+COMPILE_ASSERT_MATCHING_ENUMS(
+ FETCH_REQUEST_MODE_CORS_WITH_FORCED_PREFLIGHT,
+ WebURLRequest::FetchRequestModeCORSWithForcedPreflight);
+
+FetchRequestMode GetFetchRequestMode(const WebURLRequest& request) {
+ return static_cast<FetchRequestMode>(request.fetchRequestMode());
+}
+
} // namespace
// WebURLLoaderImpl::Context --------------------------------------------------
@@ -397,6 +417,7 @@ void WebURLLoaderImpl::Context::Start(const WebURLRequest& request,
request_info.download_to_file = request.downloadToFile();
request_info.has_user_gesture = request.hasUserGesture();
request_info.skip_service_worker = request.skipServiceWorker();
+ request_info.fetch_request_mode = GetFetchRequestMode(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