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 class WorkerFetchContext final : public FetchContext { | |
nhiroki
2017/04/18 07:56:41
Can you add a class-level comment?
horo
2017/04/18 12:53:34
Done.
| |
25 public: | |
26 static WorkerFetchContext* Create(WorkerGlobalScope&); | |
27 | |
28 explicit WorkerFetchContext(std::unique_ptr<WebWorkerFetchContext>); | |
nhiroki
2017/04/18 07:56:41
Exposing both a creation function and the ctor loo
horo
2017/04/18 12:53:34
Done.
| |
29 virtual ~WorkerFetchContext(); | |
30 | |
31 // FetchContext implementation: | |
32 // TODO(horo): Implement more methods. | |
33 WebURLLoader* CreateURLLoader() override; | |
34 void PrepareRequest(ResourceRequest&, RedirectType) override; | |
35 bool IsControlledByServiceWorker() const override; | |
36 | |
37 private: | |
38 std::unique_ptr<WebWorkerFetchContext> web_context_; | |
39 }; | |
40 | |
41 } // namespace blink | |
42 | |
43 #endif // WorkerFetchContext_h | |
OLD | NEW |