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

Unified Diff: Source/bindings/dart/DartApplicationLoader.cpp

Issue 503903003: Cherry-pick "Fix for issue 20605, set the application loader state back to running when all the def… (Closed) Base URL: svn://svn.chromium.org/blink/branches/dart/2062
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/dart/DartApplicationLoader.cpp
diff --git a/Source/bindings/dart/DartApplicationLoader.cpp b/Source/bindings/dart/DartApplicationLoader.cpp
index 18e6d0f7e0e4a1039a01394d9ba129710e4e8a61..f63b87d28d84c80c872b331af14eaf59b375613c 100644
--- a/Source/bindings/dart/DartApplicationLoader.cpp
+++ b/Source/bindings/dart/DartApplicationLoader.cpp
@@ -267,23 +267,29 @@ void DartApplicationLoader::load(PassRefPtr<DartErrorEventDispatcher> errorEvent
DartIsolateScope isolateScope(m_isolate);
DartApiScope dartApiScope;
+ bool completeFutures = false;
- // Indicate to the VM that all outstanding load requests are done. This
- // call will finalize all the classes loaded so far and complete all
- // deferred library load futures.
+ // Finalize classes and complete futures if there are any deferred loads.
+ if (!m_mainInvoked) {
+ RELEASE_ASSERT(m_state == Ready);
+ } else {
+ // We have already invoked the entry point on the main script URL at
+ // this point we will start running dart code again.
+ RELEASE_ASSERT(m_state == DeferredReady);
+ m_state = Running;
+ completeFutures = true;
+ }
{
V8Scope v8scope(DartDOMData::current());
- Dart_Handle result = Dart_FinalizeLoading(true);
+ Dart_Handle result = Dart_FinalizeLoading(completeFutures);
if (Dart_IsError(result)) {
reportDartError(result);
return;
}
}
-
// Invoke the entry point on the main script URL if it has not yet been
// invoked.
if (!m_mainInvoked) {
- RELEASE_ASSERT(m_state == Ready);
// Call the entry point on the main script URL.
callEntryPoint();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698