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

Unified 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, 8 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/loader/WorkerFetchContext.h
diff --git a/third_party/WebKit/Source/core/loader/WorkerFetchContext.h b/third_party/WebKit/Source/core/loader/WorkerFetchContext.h
new file mode 100644
index 0000000000000000000000000000000000000000..4a9870669dd5d2d3f19c0519ebd7e701ab7f4fcb
--- /dev/null
+++ b/third_party/WebKit/Source/core/loader/WorkerFetchContext.h
@@ -0,0 +1,47 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef WorkerFetchContext_h
+#define WorkerFetchContext_h
+
+#include <memory>
+#include "core/CoreExport.h"
+#include "platform/loader/fetch/FetchContext.h"
+#include "platform/wtf/Forward.h"
+
+namespace blink {
+
+class WorkerClients;
+class WebURLLoader;
+class WebWorkerFetchContext;
+class WorkerGlobalScope;
+
+CORE_EXPORT void ProvideWorkerFetchContextToWorker(
+ WorkerClients*,
+ std::unique_ptr<WebWorkerFetchContext>);
+
+// The WorkerFetchContext is a FetchContext for workers (dedicated, shared and
+// service workers). This class is used only when off-main-thread-fetch is
+// enabled, and is still under development.
+// TODO(horo): Implement all methods of FetchContext. crbug.com/443374
+class WorkerFetchContext final : public FetchContext {
+ public:
+ static WorkerFetchContext* Create(WorkerGlobalScope&);
+ virtual ~WorkerFetchContext();
+
+ // FetchContext implementation:
+ // TODO(horo): Implement more methods.
+ std::unique_ptr<WebURLLoader> CreateURLLoader() override;
+ void PrepareRequest(ResourceRequest&, RedirectType) override;
+ bool IsControlledByServiceWorker() const override;
+
+ private:
+ explicit WorkerFetchContext(std::unique_ptr<WebWorkerFetchContext>);
+
+ std::unique_ptr<WebWorkerFetchContext> web_context_;
+};
+
+} // namespace blink
+
+#endif // WorkerFetchContext_h

Powered by Google App Engine
This is Rietveld 408576698