| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef SKY_ENGINE_CORE_SCRIPT_DEPENDENCY_CATCHER_H_ | 5 #ifndef SKY_ENGINE_TONIC_DART_DEPENDENCY_CATCHER_H_ |
| 6 #define SKY_ENGINE_CORE_SCRIPT_DEPENDENCY_CATCHER_H_ | 6 #define SKY_ENGINE_TONIC_DART_DEPENDENCY_CATCHER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "sky/engine/wtf/HashSet.h" | 9 #include "sky/engine/wtf/HashSet.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 class DartLoader; | 12 class DartLibraryLoader; |
| 13 | 13 |
| 14 // A base class to represent a dependency. | 14 // A base class to represent a dependency. |
| 15 class DartDependency { | 15 class DartDependency {}; |
| 16 }; | |
| 17 | 16 |
| 18 // To catch the dependencies for a library, put a DartDependencyCatcher on the | 17 // To catch the dependencies for a library, put a DartDependencyCatcher on the |
| 19 // stack during the call to Dart_LoadLibrary. | 18 // stack during the call to Dart_LoadLibrary. |
| 20 class DartDependencyCatcher { | 19 class DartDependencyCatcher { |
| 21 public: | 20 public: |
| 22 explicit DartDependencyCatcher(DartLoader& loader); | 21 explicit DartDependencyCatcher(DartLibraryLoader& loader); |
| 23 ~DartDependencyCatcher(); | 22 ~DartDependencyCatcher(); |
| 24 | 23 |
| 25 void AddDependency(DartDependency* dependency); | 24 void AddDependency(DartDependency* dependency); |
| 26 const HashSet<DartDependency*>& dependencies() const { return dependencies_; } | 25 const HashSet<DartDependency*>& dependencies() const { return dependencies_; } |
| 27 | 26 |
| 28 private: | 27 private: |
| 29 DartLoader& loader_; | 28 DartLibraryLoader& loader_; |
| 30 HashSet<DartDependency*> dependencies_; | 29 HashSet<DartDependency*> dependencies_; |
| 31 | 30 |
| 32 DISALLOW_COPY_AND_ASSIGN(DartDependencyCatcher); | 31 DISALLOW_COPY_AND_ASSIGN(DartDependencyCatcher); |
| 33 }; | 32 }; |
| 34 | 33 |
| 35 } // namespace blink | 34 } // namespace blink |
| 36 | 35 |
| 37 #endif // SKY_ENGINE_CORE_SCRIPT_DEPENDENCY_CATCHER_H_ | 36 #endif // SKY_ENGINE_TONIC_DART_DEPENDENCY_CATCHER_H_ |
| OLD | NEW |