Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(427)

Side by Side Diff: third_party/WebKit/Source/core/loader/WorkerFetchContext.h

Issue 2804843005: Implement the infrastructure of creating WorkerFetchContext in worker global scope. (Closed)
Patch Set: s/WebScheduler.h/web_scheduler.h/ Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 std::unique_ptr<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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698