Chromium Code Reviews| 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..59cc18d4bb5a481651478435eab435c851ecf873 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/core/loader/WorkerFetchContext.h |
| @@ -0,0 +1,43 @@ |
| +// 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>); |
| + |
| +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.
|
| + public: |
| + static WorkerFetchContext* Create(WorkerGlobalScope&); |
| + |
| + 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.
|
| + virtual ~WorkerFetchContext(); |
| + |
| + // FetchContext implementation: |
| + // TODO(horo): Implement more methods. |
| + WebURLLoader* CreateURLLoader() override; |
| + void PrepareRequest(ResourceRequest&, RedirectType) override; |
| + bool IsControlledByServiceWorker() const override; |
| + |
| + private: |
| + std::unique_ptr<WebWorkerFetchContext> web_context_; |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // WorkerFetchContext_h |