Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Side by Side Diff: sky/engine/core/script/dart_loader.h

Issue 1130353009: Teach SkyView how to load the main script (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 class KURL;
22 23
23 // TODO(abarth): This class seems more complicated than it needs to be. Is 24 // TODO(abarth): This class seems more complicated than it needs to be. Is
24 // there some way of simplifying this system? For example, we have a bunch 25 // there some way of simplifying this system? For example, we have a bunch
25 // of inner classes that could potentially be factored out in some other way. 26 // of inner classes that could potentially be factored out in some other way.
26 class DartLoader { 27 class DartLoader {
27 public: 28 public:
28 explicit DartLoader(DartState* dart_state); 29 explicit DartLoader(DartState* dart_state);
29 ~DartLoader(); 30 ~DartLoader();
30 31
31 // TODO(dart): This can be called both on the main thread from application iso lates 32 // TODO(dart): This can be called both on the main thread from application iso lates
32 // or from the handle watcher isolate thread. 33 // or from the handle watcher isolate thread.
33 static Dart_Handle HandleLibraryTag(Dart_LibraryTag tag, 34 static Dart_Handle HandleLibraryTag(Dart_LibraryTag tag,
34 Dart_Handle library, 35 Dart_Handle library,
35 Dart_Handle url); 36 Dart_Handle url);
36 37
38 void LoadLibrary(const KURL& url);
39
37 void WaitForDependencies(const HashSet<DartDependency*>& dependencies, 40 void WaitForDependencies(const HashSet<DartDependency*>& dependencies,
38 const base::Closure& callback); 41 const base::Closure& callback);
39 42
40 void set_dependency_catcher(DartDependencyCatcher* dependency_catcher) { 43 void set_dependency_catcher(DartDependencyCatcher* dependency_catcher) {
41 DCHECK(!dependency_catcher_ || !dependency_catcher); 44 DCHECK(!dependency_catcher_ || !dependency_catcher);
42 dependency_catcher_ = dependency_catcher; 45 dependency_catcher_ = dependency_catcher;
43 } 46 }
44 47
45 DartState* dart_state() const { return dart_state_.get(); } 48 DartState* dart_state() const { return dart_state_.get(); }
46 49
(...skipping 15 matching lines...) Expand all
62 HashSet<OwnPtr<Job>> jobs_; 65 HashSet<OwnPtr<Job>> jobs_;
63 HashSet<OwnPtr<DependencyWatcher>> dependency_watchers_; 66 HashSet<OwnPtr<DependencyWatcher>> dependency_watchers_;
64 DartDependencyCatcher* dependency_catcher_; 67 DartDependencyCatcher* dependency_catcher_;
65 68
66 DISALLOW_COPY_AND_ASSIGN(DartLoader); 69 DISALLOW_COPY_AND_ASSIGN(DartLoader);
67 }; 70 };
68 71
69 } // namespace blink 72 } // namespace blink
70 73
71 #endif // SKY_ENGINE_CORE_SCRIPT_DART_LOADER_H_ 74 #endif // SKY_ENGINE_CORE_SCRIPT_DART_LOADER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698