OLD | NEW |
(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 WorkletModuleScriptFetcher_h |
| 6 #define WorkletModuleScriptFetcher_h |
| 7 |
| 8 #include "core/loader/modulescript/ModuleScriptFetcher.h" |
| 9 |
| 10 #include "core/workers/WorkletModuleResponsesMap.h" |
| 11 #include "core/workers/WorkletModuleResponsesMapProxy.h" |
| 12 #include "platform/wtf/Optional.h" |
| 13 |
| 14 namespace blink { |
| 15 |
| 16 class WorkletModuleScriptFetcher final |
| 17 : public ModuleScriptFetcher, |
| 18 public WorkletModuleResponsesMap::Client { |
| 19 USING_GARBAGE_COLLECTED_MIXIN(WorkletModuleScriptFetcher); |
| 20 |
| 21 public: |
| 22 CORE_EXPORT WorkletModuleScriptFetcher(FetchParameters, |
| 23 ResourceFetcher*, |
| 24 Modulator*, |
| 25 WorkletModuleResponsesMapProxy*); |
| 26 |
| 27 // Implements WorkletModuleResponsesMap::Client. |
| 28 void OnRead(const ModuleScriptCreationParams&) override; |
| 29 void OnFetchNeeded() override; |
| 30 void OnFailed() override; |
| 31 |
| 32 DECLARE_TRACE(); |
| 33 |
| 34 private: |
| 35 void FetchInternal() override; |
| 36 |
| 37 void Finalize(WTF::Optional<ModuleScriptCreationParams>) override; |
| 38 |
| 39 Member<WorkletModuleResponsesMapProxy> module_responses_map_proxy_; |
| 40 bool was_fetched_via_network_ = false; |
| 41 }; |
| 42 |
| 43 } // namespace blink |
| 44 |
| 45 #endif // WorkletModuleScriptFetcher_h |
OLD | NEW |