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..4b492424c2c06c75532919d850e46ff45554a41d |
--- /dev/null |
+++ b/third_party/WebKit/Source/core/loader/WorkerFetchContext.h |
@@ -0,0 +1,45 @@ |
+// 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 "core/workers/WorkerClients.h" |
+#include "platform/loader/fetch/FetchContext.h" |
+#include "wtf/Forward.h" |
nhiroki
2017/04/14 04:09:24
wtf/Forward.h is deprecated. Can you replace this
horo
2017/04/14 07:22:45
Done.
|
+ |
+namespace blink { |
+ |
+class ExecutionContext; |
+class WorkerClients; |
+class WebURLLoader; |
+class WebWorkerFetchContext; |
+class WebWorkerFetchContextInfo; |
+ |
+CORE_EXPORT void ProvideWorkerFetchContextInfoToWorker( |
+ WorkerClients*, |
+ std::unique_ptr<WebWorkerFetchContextInfo>); |
+ |
+class WorkerFetchContext final : public FetchContext { |
+ public: |
+ static WorkerFetchContext* From(ExecutionContext&); |
+ |
+ explicit WorkerFetchContext(std::unique_ptr<WebWorkerFetchContext>); |
+ virtual ~WorkerFetchContext(); |
+ |
+ // FetchContext implementation: |
+ // TODO(horo): Implement more methods. |
+ void PrepareRequest(ResourceRequest&, RedirectType) override; |
+ WebURLLoader* CreateURLLoader() override; |
+ bool IsControlledByServiceWorker() const override; |
+ |
+ private: |
+ std::unique_ptr<WebWorkerFetchContext> context_; |
+}; |
+ |
+} // namespace blink |
+ |
+#endif // WorkerFetchContext_h |