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

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

Issue 926753002: Improve DartLoader error handling. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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"
(...skipping 25 matching lines...) Expand all
36 36
37 void WaitForDependencies(const HashSet<DartDependency*>& dependencies, 37 void WaitForDependencies(const HashSet<DartDependency*>& dependencies,
38 const base::Closure& callback); 38 const base::Closure& callback);
39 39
40 void set_dependency_catcher(DartDependencyCatcher* dependency_catcher) { 40 void set_dependency_catcher(DartDependencyCatcher* dependency_catcher) {
41 DCHECK(!dependency_catcher_ || !dependency_catcher); 41 DCHECK(!dependency_catcher_ || !dependency_catcher);
42 dependency_catcher_ = dependency_catcher; 42 dependency_catcher_ = dependency_catcher;
43 } 43 }
44 44
45 DartState* dart_state() const { return dart_state_.get(); } 45 DartState* dart_state() const { return dart_state_.get(); }
46 bool saw_error() const { return saw_error_; }
46 47
47 private: 48 private:
48 class Job; 49 class Job;
49 class ImportJob; 50 class ImportJob;
50 class SourceJob; 51 class SourceJob;
51 class DependencyWatcher; 52 class DependencyWatcher;
52 class WatcherSignaler; 53 class WatcherSignaler;
53 54
54 Dart_Handle Import(Dart_Handle library, Dart_Handle url); 55 Dart_Handle Import(Dart_Handle library, Dart_Handle url);
55 Dart_Handle Source(Dart_Handle library, Dart_Handle url); 56 Dart_Handle Source(Dart_Handle library, Dart_Handle url);
56 void DidCompleteImportJob(ImportJob* job, const Vector<uint8_t>& buffer); 57 void DidCompleteImportJob(ImportJob* job, const Vector<uint8_t>& buffer);
57 void DidCompleteSourceJob(SourceJob* job, const Vector<uint8_t>& buffer); 58 void DidCompleteSourceJob(SourceJob* job, const Vector<uint8_t>& buffer);
59 void DidFailJob(Job* job);
58 60
59 base::WeakPtr<DartState> dart_state_; 61 base::WeakPtr<DartState> dart_state_;
60 HashMap<String, Job*> pending_libraries_; 62 HashMap<String, Job*> pending_libraries_;
61 HashSet<OwnPtr<Job>> jobs_; 63 HashSet<OwnPtr<Job>> jobs_;
62 HashSet<OwnPtr<DependencyWatcher>> dependency_watchers_; 64 HashSet<OwnPtr<DependencyWatcher>> dependency_watchers_;
63 DartDependencyCatcher* dependency_catcher_; 65 DartDependencyCatcher* dependency_catcher_;
66 bool saw_error_;
64 67
65 DISALLOW_COPY_AND_ASSIGN(DartLoader); 68 DISALLOW_COPY_AND_ASSIGN(DartLoader);
66 }; 69 };
67 70
68 } // namespace blink 71 } // namespace blink
69 72
70 #endif // SKY_ENGINE_CORE_SCRIPT_DART_LOADER_H_ 73 #endif // SKY_ENGINE_CORE_SCRIPT_DART_LOADER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698