OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef WorkerFetchContext_h |
| 6 #define WorkerFetchContext_h |
| 7 |
| 8 #include <memory> |
| 9 #include "core/CoreExport.h" |
| 10 #include "platform/loader/fetch/FetchContext.h" |
| 11 #include "platform/wtf/Forward.h" |
| 12 |
| 13 namespace blink { |
| 14 |
| 15 class WorkerClients; |
| 16 class WebURLLoader; |
| 17 class WebWorkerFetchContext; |
| 18 class WorkerGlobalScope; |
| 19 |
| 20 CORE_EXPORT void ProvideWorkerFetchContextToWorker( |
| 21 WorkerClients*, |
| 22 std::unique_ptr<WebWorkerFetchContext>); |
| 23 |
| 24 // The WorkerFetchContext is a FetchContext for workers (dedicated, shared and |
| 25 // service workers). This class is used only when off-main-thread-fetch is |
| 26 // enabled, and is still under development. |
| 27 // TODO(horo): Implement all methods of FetchContext. crbug.com/443374 |
| 28 class WorkerFetchContext final : public FetchContext { |
| 29 public: |
| 30 static WorkerFetchContext* Create(WorkerGlobalScope&); |
| 31 virtual ~WorkerFetchContext(); |
| 32 |
| 33 // FetchContext implementation: |
| 34 // TODO(horo): Implement more methods. |
| 35 WebURLLoader* CreateURLLoader() override; |
| 36 void PrepareRequest(ResourceRequest&, RedirectType) override; |
| 37 bool IsControlledByServiceWorker() const override; |
| 38 |
| 39 private: |
| 40 explicit WorkerFetchContext(std::unique_ptr<WebWorkerFetchContext>); |
| 41 |
| 42 std::unique_ptr<WebWorkerFetchContext> web_context_; |
| 43 }; |
| 44 |
| 45 } // namespace blink |
| 46 |
| 47 #endif // WorkerFetchContext_h |
OLD | NEW |