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 #include "core/loader/modulescript/ModuleTreeLinkerRegistry.h" |
| 6 |
| 7 #include "core/loader/modulescript/ModuleTreeLinker.h" |
| 8 #include "platform/weborigin/KURL.h" |
| 9 #include "platform/weborigin/KURLHash.h" |
| 10 |
| 11 namespace blink { |
| 12 |
| 13 DEFINE_TRACE(ModuleTreeLinkerRegistry) { |
| 14 visitor->trace(m_activeTreeLinkers); |
| 15 } |
| 16 |
| 17 ModuleTreeLinker* ModuleTreeLinkerRegistry::fetch( |
| 18 const ModuleScriptFetchRequest& request, |
| 19 const AncestorList& ancestorList, |
| 20 ModuleGraphLevel level, |
| 21 Modulator* modulator, |
| 22 ModuleTreeClient* client) { |
| 23 ModuleTreeLinker* fetcher = ModuleTreeLinker::fetch( |
| 24 request, ancestorList, level, modulator, this, client); |
| 25 DCHECK(fetcher->isFetching()); |
| 26 m_activeTreeLinkers.insert(fetcher); |
| 27 return fetcher; |
| 28 } |
| 29 |
| 30 void ModuleTreeLinkerRegistry::releaseFinishedFetcher( |
| 31 ModuleTreeLinker* fetcher) { |
| 32 DCHECK(fetcher->hasFinished()); |
| 33 |
| 34 auto it = m_activeTreeLinkers.find(fetcher); |
| 35 DCHECK_NE(it, m_activeTreeLinkers.end()); |
| 36 m_activeTreeLinkers.erase(it); |
| 37 } |
| 38 |
| 39 } // namespace blink |
OLD | NEW |