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

Unified Diff: third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp

Issue 2891453005: Pipe the FirstPartyForCookies to WorkerFetchContext for off-main-thread-fetch (Closed)
Patch Set: Created 3 years, 7 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/Source/core/loader/WorkerFetchContext.cpp
diff --git a/third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp b/third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp
index d4830069f643e0b183069986e0f4e13af1dbf27d..88ca53d3ee9b4aabb764221ccd813511105b09bc 100644
--- a/third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp
+++ b/third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp
@@ -92,6 +92,10 @@ ResourceFetcher* WorkerFetchContext::GetResourceFetcher() {
return resource_fetcher_;
}
+KURL WorkerFetchContext::FirstPartyForCookies() const {
+ return web_context_->FirstPartyForCookies();
+}
+
ContentSettingsClient* WorkerFetchContext::GetContentSettingsClient() const {
// TODO(horo): Implement this.
return nullptr;
@@ -185,6 +189,23 @@ void WorkerFetchContext::AddAdditionalRequestHeaders(ResourceRequest& request,
request.SetHTTPHeaderField("Save-Data", "on");
}
+void WorkerFetchContext::PopulateResourceRequest(
+ const KURL& url,
+ Resource::Type type,
+ const ClientHintsPreferences& hints_preferences,
+ const FetchParameters::ResourceWidth& resource_width,
+ const ResourceLoaderOptions& options,
+ SecurityViolationReportingPolicy reporting_policy,
+ ResourceRequest& request) {
falken 2017/05/17 08:55:31 out_request
horo 2017/05/17 09:44:03 Done.
+ SetFirstPartyCookieAndRequestorOrigin(request);
+}
+
+void WorkerFetchContext::SetFirstPartyCookieAndRequestorOrigin(
+ ResourceRequest& request) {
+ if (request.FirstPartyForCookies().IsNull())
+ request.SetFirstPartyForCookies(FirstPartyForCookies());
+}
+
DEFINE_TRACE(WorkerFetchContext) {
visitor->Trace(worker_global_scope_);
visitor->Trace(resource_fetcher_);

Powered by Google App Engine
This is Rietveld 408576698