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_DART_LOADER_H_ | 5 #ifndef SKY_ENGINE_CORE_SCRIPT_DART_LOADER_H_ |
6 #define SKY_ENGINE_CORE_SCRIPT_DART_LOADER_H_ | 6 #define SKY_ENGINE_CORE_SCRIPT_DART_LOADER_H_ |
7 | 7 |
8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
11 #include "dart/runtime/include/dart_api.h" | 11 #include "dart/runtime/include/dart_api.h" |
12 #include "sky/engine/wtf/HashMap.h" | 12 #include "sky/engine/wtf/HashMap.h" |
13 #include "sky/engine/wtf/HashSet.h" | 13 #include "sky/engine/wtf/HashSet.h" |
14 #include "sky/engine/wtf/OwnPtr.h" | 14 #include "sky/engine/wtf/OwnPtr.h" |
15 #include "sky/engine/wtf/Vector.h" | 15 #include "sky/engine/wtf/Vector.h" |
16 #include "sky/engine/wtf/text/WTFString.h" | 16 #include "sky/engine/wtf/text/WTFString.h" |
17 | 17 |
18 namespace blink { | 18 namespace blink { |
19 class DartState; | 19 class DartState; |
20 class DartDependency; | 20 class DartDependency; |
21 class DartDependencyCatcher; | 21 class DartDependencyCatcher; |
22 | 22 |
23 class DartLoader { | 23 class DartLoader { |
24 public: | 24 public: |
25 explicit DartLoader(DartState* dart_state); | 25 explicit DartLoader(DartState* dart_state); |
26 ~DartLoader(); | 26 ~DartLoader(); |
27 | 27 |
28 Dart_Handle HandleLibraryTag(Dart_LibraryTag tag, | 28 // TODO(dart): This can be called both on the main thread from application iso
lates |
29 Dart_Handle library, | 29 // or from the handle watcher isolate thread. |
30 Dart_Handle url); | 30 static Dart_Handle HandleLibraryTag(Dart_LibraryTag tag, |
| 31 Dart_Handle library, |
| 32 Dart_Handle url); |
31 | 33 |
32 void WaitForDependencies(const HashSet<DartDependency*>& dependencies, | 34 void WaitForDependencies(const HashSet<DartDependency*>& dependencies, |
33 const base::Closure& callback); | 35 const base::Closure& callback); |
34 | 36 |
35 void set_dependency_catcher(DartDependencyCatcher* dependency_catcher) { | 37 void set_dependency_catcher(DartDependencyCatcher* dependency_catcher) { |
36 DCHECK(!dependency_catcher_ || !dependency_catcher); | 38 DCHECK(!dependency_catcher_ || !dependency_catcher); |
37 dependency_catcher_ = dependency_catcher; | 39 dependency_catcher_ = dependency_catcher; |
38 } | 40 } |
39 | 41 |
40 DartState* dart_state() const { return dart_state_.get(); } | 42 DartState* dart_state() const { return dart_state_.get(); } |
(...skipping 15 matching lines...) Expand all Loading... |
56 HashSet<OwnPtr<Job>> jobs_; | 58 HashSet<OwnPtr<Job>> jobs_; |
57 HashSet<OwnPtr<DependencyWatcher>> dependency_watchers_; | 59 HashSet<OwnPtr<DependencyWatcher>> dependency_watchers_; |
58 DartDependencyCatcher* dependency_catcher_; | 60 DartDependencyCatcher* dependency_catcher_; |
59 | 61 |
60 DISALLOW_COPY_AND_ASSIGN(DartLoader); | 62 DISALLOW_COPY_AND_ASSIGN(DartLoader); |
61 }; | 63 }; |
62 | 64 |
63 } // namespace blink | 65 } // namespace blink |
64 | 66 |
65 #endif // SKY_ENGINE_CORE_SCRIPT_DART_LOADER_H_ | 67 #endif // SKY_ENGINE_CORE_SCRIPT_DART_LOADER_H_ |
OLD | NEW |