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/WorkerFetchContext.h" | 5 #include "core/loader/WorkerFetchContext.h" |
6 | 6 |
7 #include "core/frame/Deprecation.h" | 7 #include "core/frame/Deprecation.h" |
8 #include "core/frame/UseCounter.h" | 8 #include "core/frame/UseCounter.h" |
9 #include "core/loader/MixedContentChecker.h" | 9 #include "core/loader/MixedContentChecker.h" |
10 #include "core/timing/WorkerGlobalScopePerformance.h" | 10 #include "core/timing/WorkerGlobalScopePerformance.h" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 } | 151 } |
152 | 152 |
153 void WorkerFetchContext::CountDeprecation(UseCounter::Feature feature) const { | 153 void WorkerFetchContext::CountDeprecation(UseCounter::Feature feature) const { |
154 Deprecation::CountDeprecation(worker_global_scope_, feature); | 154 Deprecation::CountDeprecation(worker_global_scope_, feature); |
155 } | 155 } |
156 | 156 |
157 bool WorkerFetchContext::ShouldBlockFetchByMixedContentCheck( | 157 bool WorkerFetchContext::ShouldBlockFetchByMixedContentCheck( |
158 const ResourceRequest& resource_request, | 158 const ResourceRequest& resource_request, |
159 const KURL& url, | 159 const KURL& url, |
160 SecurityViolationReportingPolicy reporting_policy) const { | 160 SecurityViolationReportingPolicy reporting_policy) const { |
161 // TODO(horo): Implement this. | 161 // TODO(horo): We need more detailed check which is implemented in |
162 return false; | 162 // MixedContentChecker::ShouldBlockFetch(). |
| 163 return MixedContentChecker::IsMixedContent( |
| 164 worker_global_scope_->GetSecurityOrigin(), url); |
163 } | 165 } |
164 | 166 |
165 std::unique_ptr<WebURLLoader> WorkerFetchContext::CreateURLLoader() { | 167 std::unique_ptr<WebURLLoader> WorkerFetchContext::CreateURLLoader() { |
166 return web_context_->CreateURLLoader(); | 168 return web_context_->CreateURLLoader(); |
167 } | 169 } |
168 | 170 |
169 bool WorkerFetchContext::IsControlledByServiceWorker() const { | 171 bool WorkerFetchContext::IsControlledByServiceWorker() const { |
170 return web_context_->IsControlledByServiceWorker(); | 172 return web_context_->IsControlledByServiceWorker(); |
171 } | 173 } |
172 | 174 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 void ProvideWorkerFetchContextToWorker( | 250 void ProvideWorkerFetchContextToWorker( |
249 WorkerClients* clients, | 251 WorkerClients* clients, |
250 std::unique_ptr<WebWorkerFetchContext> web_context) { | 252 std::unique_ptr<WebWorkerFetchContext> web_context) { |
251 DCHECK(clients); | 253 DCHECK(clients); |
252 WorkerFetchContextHolder::ProvideTo( | 254 WorkerFetchContextHolder::ProvideTo( |
253 *clients, WorkerFetchContextHolder::SupplementName(), | 255 *clients, WorkerFetchContextHolder::SupplementName(), |
254 new WorkerFetchContextHolder(std::move(web_context))); | 256 new WorkerFetchContextHolder(std::move(web_context))); |
255 } | 257 } |
256 | 258 |
257 } // namespace blink | 259 } // namespace blink |
OLD | NEW |