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

Unified Diff: sky/engine/core/script/dart_controller.cc

Issue 1131673011: Teach SkyView code path to print hello, world (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: again 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/engine/core/script/dart_controller.h ('k') | sky/engine/core/script/dom_dart_state.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/script/dart_controller.cc
diff --git a/sky/engine/core/script/dart_controller.cc b/sky/engine/core/script/dart_controller.cc
index b0b1639438d308ad14b950e83a1418d6fab395e8..f927ebb6ed355d120a412ba1193f99f2f3bc90cf 100644
--- a/sky/engine/core/script/dart_controller.cc
+++ b/sky/engine/core/script/dart_controller.cc
@@ -111,6 +111,9 @@ void DartController::DidLoadMainLibrary(KURL url) {
DCHECK(Dart_CurrentIsolate() == dart_state()->isolate());
DartApiScope dart_api_scope;
+ if (LogIfError(Dart_FinalizeLoading(true)))
+ return;
+
Dart_Handle library = Dart_LookupLibrary(
StringToDart(dart_state(), url.string()));
CHECK(!LogIfError(library));
@@ -308,13 +311,13 @@ static void MessageNotifyCallback(Dart_Isolate dest_isolate) {
base::Bind(&CallHandleMessage, DartState::From(dest_isolate)->GetWeakPtr()));
}
-void DartController::CreateIsolateFor(Document* document) {
- DCHECK(document);
+void DartController::CreateIsolateFor(PassOwnPtr<DOMDartState> state,
+ const KURL& url) {
CHECK(kDartIsolateSnapshotBuffer);
char* error = nullptr;
- dom_dart_state_ = adoptPtr(new DOMDartState(document));
+ dom_dart_state_ = state;
Dart_Isolate isolate = Dart_CreateIsolate(
- document->url().string().utf8().data(), "main", kDartIsolateSnapshotBuffer,
+ url.string().utf8().data(), "main", kDartIsolateSnapshotBuffer,
static_cast<DartState*>(dom_dart_state_.get()), &error);
Dart_SetMessageNotifyCallback(MessageNotifyCallback);
CHECK(isolate) << error;
@@ -336,9 +339,9 @@ void DartController::CreateIsolateFor(Document* document) {
builtin_sky_ = adoptPtr(new BuiltinSky(dart_state()));
dart_state()->class_library().set_provider(builtin_sky_.get());
- builtin_sky_->InstallWindow(dart_state());
- document->frame()->loaderClient()->didCreateIsolate(isolate);
+ if (dart_state()->document())
+ builtin_sky_->InstallWindow(dart_state());
EnsureHandleWatcherStarted();
}
« no previous file with comments | « sky/engine/core/script/dart_controller.h ('k') | sky/engine/core/script/dom_dart_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698