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

Unified Diff: content/renderer/service_worker/service_worker_script_context.cc

Issue 623663002: [ServiceWorker] pipe RequestContext and FrameType to ServiceWorker. [2/2 chromium] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: request_info.cc Created 6 years, 2 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/public/common/request_context_type.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/service_worker/service_worker_script_context.cc
diff --git a/content/renderer/service_worker/service_worker_script_context.cc b/content/renderer/service_worker/service_worker_script_context.cc
index 65fc5e7c5c46782a1d0a97fef686dbf4d96e399f..f6b1168b4f66b9651dc32a177684a88114058d44 100644
--- a/content/renderer/service_worker/service_worker_script_context.cc
+++ b/content/renderer/service_worker/service_worker_script_context.cc
@@ -45,6 +45,17 @@ blink::WebURLRequest::FetchCredentialsMode GetBlinkFetchCredentialsMode(
credentials_mode);
}
+blink::WebURLRequest::RequestContext GetBlinkRequestContext(
+ RequestContextType request_context_type) {
+ return static_cast<blink::WebURLRequest::RequestContext>(
+ request_context_type);
+}
+
+blink::WebURLRequest::FrameType GetBlinkFrameType(
+ RequestContextFrameType frame_type) {
+ return static_cast<blink::WebURLRequest::FrameType>(frame_type);
+}
+
} // namespace
ServiceWorkerScriptContext::ServiceWorkerScriptContext(
@@ -191,6 +202,9 @@ void ServiceWorkerScriptContext::OnFetchEvent(
webRequest.setMode(GetBlinkFetchRequestMode(request.mode));
webRequest.setCredentialsMode(
GetBlinkFetchCredentialsMode(request.credentials_mode));
+ webRequest.setRequestContext(
+ GetBlinkRequestContext(request.request_context_type));
+ webRequest.setFrameType(GetBlinkFrameType(request.frame_type));
webRequest.setIsReload(request.is_reload);
fetch_start_timings_[request_id] = base::TimeTicks::Now();
proxy_->dispatchFetchEvent(request_id, webRequest);
« no previous file with comments | « content/public/common/request_context_type.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698