OLD | NEW |
1 // Copyright 2011, Google Inc. | 1 // Copyright 2011, Google Inc. |
2 // All rights reserved. | 2 // All rights reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 | 119 |
120 // Registers a request to be fetched later. | 120 // Registers a request to be fetched later. |
121 void addRequest(PassRefPtr<DartScriptInfo>); | 121 void addRequest(PassRefPtr<DartScriptInfo>); |
122 | 122 |
123 // Fetches all pending requests and invokes callback when done. | 123 // Fetches all pending requests and invokes callback when done. |
124 void processRequests(Dart_Isolate, const ScriptSourceCode&, PassRefPtr<Callb
ack>); | 124 void processRequests(Dart_Isolate, const ScriptSourceCode&, PassRefPtr<Callb
ack>); |
125 void processSingleRequest(Dart_Isolate, const String& url, PassRefPtr<Callba
ck>); | 125 void processSingleRequest(Dart_Isolate, const String& url, PassRefPtr<Callba
ck>); |
126 | 126 |
127 bool running() const { return m_state >= Running; } | 127 bool running() const { return m_state >= Running; } |
128 bool error() const { return m_state == Error; } | 128 bool error() const { return m_state == Error; } |
| 129 bool uninitialized() const { return m_state == Uninitialized; } |
129 | 130 |
| 131 const KURL& scriptUrl() { return m_scriptUrl; } |
130 private: | 132 private: |
131 enum State { | 133 enum State { |
132 // The application failed to load. | 134 // The application failed to load. |
133 Error = -1, | 135 Error = -1, |
134 | 136 |
135 // The isolate is not set. | 137 // The isolate is not set. |
136 Uninitialized = 0, | 138 Uninitialized = 0, |
137 | 139 |
138 // The isolate is initialized, but no user scripts have been requested o
r loaded. | 140 // The isolate is initialized, but no user scripts have been requested o
r loaded. |
139 Initialized, | 141 Initialized, |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 State m_state; | 219 State m_state; |
218 SnapshotMode m_snapshotMode; | 220 SnapshotMode m_snapshotMode; |
219 | 221 |
220 friend class DartService; | 222 friend class DartService; |
221 friend class ScriptLoadedCallback; | 223 friend class ScriptLoadedCallback; |
222 }; | 224 }; |
223 | 225 |
224 } | 226 } |
225 | 227 |
226 #endif // DartApplicationLoader_h | 228 #endif // DartApplicationLoader_h |
OLD | NEW |