Chromium Code Reviews| Index: third_party/WebKit/Source/modules/worklet/WorkletScriptLoader.h |
| diff --git a/third_party/WebKit/Source/modules/worklet/WorkletScriptLoader.h b/third_party/WebKit/Source/modules/worklet/WorkletScriptLoader.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8553ab7f18827631f4330786c87d26ca63b3d5a6 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/modules/worklet/WorkletScriptLoader.h |
| @@ -0,0 +1,44 @@ |
| +// Copyright 2016 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 WorkletScriptLoader_h |
| +#define WorkletScriptLoader_h |
| + |
| +#include "bindings/core/v8/ScriptPromiseResolver.h" |
| +#include "core/fetch/ResourceClient.h" |
| +#include "core/fetch/ResourceOwner.h" |
| +#include "core/fetch/ScriptResource.h" |
| + |
| +namespace blink { |
| + |
| +class ScriptPromiseResolver; |
|
yhirano
2016/08/01 10:56:28
Not needed as you are including the header file.
Gleb Lanbin
2016/08/01 19:49:51
Done.
|
| +class Worklet; |
| + |
| +class WorkletScriptLoader final : public GarbageCollectedFinalized<WorkletScriptLoader>, public ResourceOwner<ScriptResource, ScriptResourceClient> { |
| + USING_GARBAGE_COLLECTED_MIXIN(WorkletScriptLoader); |
| + WTF_MAKE_NONCOPYABLE(WorkletScriptLoader); |
| +public: |
| + static WorkletScriptLoader* create(ScriptPromiseResolver* scriptPromiseResolver, Worklet* worklet, ScriptResource* resource) |
| + { |
| + return new WorkletScriptLoader(scriptPromiseResolver, worklet, resource); |
| + } |
| + |
| + ~WorkletScriptLoader() override = default; |
| + |
| + DECLARE_TRACE(); |
| + |
| +private: |
| + WorkletScriptLoader(ScriptPromiseResolver*, Worklet* host, ScriptResource*); |
| + |
| + // ResourceClient |
| + void notifyFinished(Resource*) final; |
| + String debugName() const final { return "WorkletLoader"; } |
| + |
| + Member<ScriptPromiseResolver> m_resolver; |
| + Member<Worklet> m_host; |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // WorkletScriptLoader_h |