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 |
| 9 namespace blink { |
| 10 |
| 11 DEFINE_TRACE(ModuleTreeLinkerRegistry) { |
| 12 visitor->trace(m_activeTreeLinkers); |
| 13 } |
| 14 |
| 15 ModuleTreeLinker* ModuleTreeLinkerRegistry::fetch(const KURL& url, |
| 16 const KURL& baseURL, |
| 17 Modulator* modulator, |
| 18 ModuleTreeClient* client) { |
| 19 ModuleTreeLinker* fetcher = |
| 20 ModuleTreeLinker::fetch(url, baseURL, modulator, this, client); |
| 21 DCHECK(fetcher->isFetching()); |
| 22 m_activeTreeLinkers.add(fetcher); |
| 23 return fetcher; |
| 24 } |
| 25 |
| 26 void ModuleTreeLinkerRegistry::releaseFinishedFetcher( |
| 27 ModuleTreeLinker* fetcher) { |
| 28 DCHECK(fetcher->hasFinished()); |
| 29 |
| 30 auto it = m_activeTreeLinkers.find(fetcher); |
| 31 DCHECK_NE(it, m_activeTreeLinkers.end()); |
| 32 m_activeTreeLinkers.remove(it); |
| 33 } |
| 34 |
| 35 } // namespace blink |
OLD | NEW |