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

Side by Side Diff: third_party/WebKit/Source/core/loader/ThreadableLoadingContext.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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/loader/ThreadableLoadingContext.h" 5 #include "core/loader/ThreadableLoadingContext.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/dom/TaskRunnerHelper.h" 8 #include "core/dom/TaskRunnerHelper.h"
9 #include "core/loader/WorkerFetchContext.h" 9 #include "core/loader/WorkerFetchContext.h"
10 #include "core/workers/WorkerGlobalScope.h" 10 #include "core/workers/WorkerGlobalScope.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 } 94 }
95 95
96 bool IsSecureContext() const override { 96 bool IsSecureContext() const override {
97 DCHECK(IsContextThread()); 97 DCHECK(IsContextThread());
98 String error_message; 98 String error_message;
99 return worker_global_scope_->IsSecureContext(error_message); 99 return worker_global_scope_->IsSecureContext(error_message);
100 } 100 }
101 101
102 KURL FirstPartyForCookies() const override { 102 KURL FirstPartyForCookies() const override {
103 DCHECK(IsContextThread()); 103 DCHECK(IsContextThread());
104 // TODO(horo): Returns the FirstPartyForCookies of the parent frame for 104 return fetch_context_->FirstPartyForCookies();
105 // dedicated workers.
106 return worker_global_scope_->Url();
107 } 105 }
108 106
109 String UserAgent() const override { 107 String UserAgent() const override {
110 DCHECK(IsContextThread()); 108 DCHECK(IsContextThread());
111 return worker_global_scope_->UserAgent(); 109 return worker_global_scope_->UserAgent();
112 } 110 }
113 111
114 Document* GetLoadingDocument() override { return nullptr; } 112 Document* GetLoadingDocument() override { return nullptr; }
115 113
116 RefPtr<WebTaskRunner> GetTaskRunner(TaskType type) override { 114 RefPtr<WebTaskRunner> GetTaskRunner(TaskType type) override {
(...skipping 18 matching lines...) Expand all
135 ThreadableLoadingContext* ThreadableLoadingContext::Create(Document& document) { 133 ThreadableLoadingContext* ThreadableLoadingContext::Create(Document& document) {
136 return new DocumentThreadableLoadingContext(document); 134 return new DocumentThreadableLoadingContext(document);
137 } 135 }
138 136
139 ThreadableLoadingContext* ThreadableLoadingContext::Create( 137 ThreadableLoadingContext* ThreadableLoadingContext::Create(
140 WorkerGlobalScope& worker_global_scope) { 138 WorkerGlobalScope& worker_global_scope) {
141 return new WorkerThreadableLoadingContext(worker_global_scope); 139 return new WorkerThreadableLoadingContext(worker_global_scope);
142 } 140 }
143 141
144 } // namespace blink 142 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698