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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 // TODO(horo): Implement this. | 109 // TODO(horo): Implement this. |
110 return nullptr; | 110 return nullptr; |
111 } | 111 } |
112 | 112 |
113 SubresourceFilter* WorkerFetchContext::GetSubresourceFilter() const { | 113 SubresourceFilter* WorkerFetchContext::GetSubresourceFilter() const { |
114 // TODO(horo): Implement this. | 114 // TODO(horo): Implement this. |
115 return nullptr; | 115 return nullptr; |
116 } | 116 } |
117 | 117 |
118 SecurityContext* WorkerFetchContext::GetParentSecurityContext() const { | 118 SecurityContext* WorkerFetchContext::GetParentSecurityContext() const { |
119 // TODO(horo): Implement this. | 119 // This method was introduced to check the parent frame's security context |
| 120 // while loading iframe document resources. So this method is not suitable for |
| 121 // workers. |
| 122 NOTREACHED(); |
120 return nullptr; | 123 return nullptr; |
121 } | 124 } |
122 | 125 |
123 bool WorkerFetchContext::ShouldBlockRequestByInspector( | 126 bool WorkerFetchContext::ShouldBlockRequestByInspector( |
124 const ResourceRequest& resource_request) const { | 127 const ResourceRequest& resource_request) const { |
125 // TODO(horo): Implement this. | 128 // TODO(horo): Implement this. |
126 return false; | 129 return false; |
127 } | 130 } |
128 | 131 |
129 void WorkerFetchContext::DispatchDidBlockRequest( | 132 void WorkerFetchContext::DispatchDidBlockRequest( |
130 const ResourceRequest& resource_request, | 133 const ResourceRequest& resource_request, |
131 const FetchInitiatorInfo& fetch_initiator_info, | 134 const FetchInitiatorInfo& fetch_initiator_info, |
132 ResourceRequestBlockedReason blocked_reason) const { | 135 ResourceRequestBlockedReason blocked_reason) const { |
133 // TODO(horo): Implement this. | 136 // TODO(horo): Implement this. |
134 } | 137 } |
135 | 138 |
136 void WorkerFetchContext::ReportLocalLoadFailed(const KURL&) const { | 139 void WorkerFetchContext::ReportLocalLoadFailed(const KURL&) const { |
137 // TODO(horo): Implement this. | 140 // Threre is no way to load local files from worker thread. |
| 141 NOTREACHED(); |
138 } | 142 } |
139 | 143 |
140 bool WorkerFetchContext::ShouldBypassMainWorldCSP() const { | 144 bool WorkerFetchContext::ShouldBypassMainWorldCSP() const { |
141 // TODO(horo): Implement this. | 145 // This method was introduced to bypass the page's CSP while running the |
| 146 // script from an isolated world (ex: Chrome extensions). But worker threads |
| 147 // doesn't have any isolated world. So we can just return false. |
142 return false; | 148 return false; |
143 } | 149 } |
144 | 150 |
145 bool WorkerFetchContext::IsSVGImageChromeClient() const { | 151 bool WorkerFetchContext::IsSVGImageChromeClient() const { |
146 return false; | 152 return false; |
147 } | 153 } |
148 | 154 |
149 void WorkerFetchContext::CountUsage(UseCounter::Feature feature) const { | 155 void WorkerFetchContext::CountUsage(UseCounter::Feature feature) const { |
150 UseCounter::Count(worker_global_scope_, feature); | 156 UseCounter::Count(worker_global_scope_, feature); |
151 } | 157 } |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 void ProvideWorkerFetchContextToWorker( | 256 void ProvideWorkerFetchContextToWorker( |
251 WorkerClients* clients, | 257 WorkerClients* clients, |
252 std::unique_ptr<WebWorkerFetchContext> web_context) { | 258 std::unique_ptr<WebWorkerFetchContext> web_context) { |
253 DCHECK(clients); | 259 DCHECK(clients); |
254 WorkerFetchContextHolder::ProvideTo( | 260 WorkerFetchContextHolder::ProvideTo( |
255 *clients, WorkerFetchContextHolder::SupplementName(), | 261 *clients, WorkerFetchContextHolder::SupplementName(), |
256 new WorkerFetchContextHolder(std::move(web_context))); | 262 new WorkerFetchContextHolder(std::move(web_context))); |
257 } | 263 } |
258 | 264 |
259 } // namespace blink | 265 } // namespace blink |
OLD | NEW |