| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |