| OLD | NEW |
| 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 #include "sky/engine/config.h" | 5 #include "sky/engine/config.h" |
| 6 #include "sky/engine/core/script/dart_controller.h" | 6 #include "sky/engine/core/script/dart_controller.h" |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 dart_state()->class_library().set_provider(builtin_sky_.get()); | 341 dart_state()->class_library().set_provider(builtin_sky_.get()); |
| 342 | 342 |
| 343 if (dart_state()->document()) | 343 if (dart_state()->document()) |
| 344 builtin_sky_->InstallWindow(dart_state()); | 344 builtin_sky_->InstallWindow(dart_state()); |
| 345 | 345 |
| 346 EnsureHandleWatcherStarted(); | 346 EnsureHandleWatcherStarted(); |
| 347 } | 347 } |
| 348 Dart_ExitIsolate(); | 348 Dart_ExitIsolate(); |
| 349 } | 349 } |
| 350 | 350 |
| 351 void DartController::InstallView(View* view) { |
| 352 DartIsolateScope isolate_scope(dart_state()->isolate()); |
| 353 DartApiScope dart_api_scope; |
| 354 |
| 355 builtin_sky_->InstallView(view); |
| 356 } |
| 357 |
| 351 void DartController::ClearForClose() { | 358 void DartController::ClearForClose() { |
| 352 // Don't use a DartIsolateScope here since we never exit the isolate. | 359 // Don't use a DartIsolateScope here since we never exit the isolate. |
| 353 Dart_EnterIsolate(dom_dart_state_->isolate()); | 360 Dart_EnterIsolate(dom_dart_state_->isolate()); |
| 354 Dart_ShutdownIsolate(); | 361 Dart_ShutdownIsolate(); |
| 355 dom_dart_state_.clear(); | 362 dom_dart_state_.clear(); |
| 356 } | 363 } |
| 357 | 364 |
| 358 void DartController::InitVM() { | 365 void DartController::InitVM() { |
| 359 int argc = 0; | 366 int argc = 0; |
| 360 const char** argv = nullptr; | 367 const char** argv = nullptr; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 374 nullptr, // Isolate interrupt callback. | 381 nullptr, // Isolate interrupt callback. |
| 375 UnhandledExceptionCallback, IsolateShutdownCallback, | 382 UnhandledExceptionCallback, IsolateShutdownCallback, |
| 376 // File IO callbacks. | 383 // File IO callbacks. |
| 377 nullptr, nullptr, nullptr, nullptr, nullptr)); | 384 nullptr, nullptr, nullptr, nullptr, nullptr)); |
| 378 // Wait for load port- ensures handle watcher and service isolates are | 385 // Wait for load port- ensures handle watcher and service isolates are |
| 379 // running. | 386 // running. |
| 380 Dart_ServiceWaitForLoadPort(); | 387 Dart_ServiceWaitForLoadPort(); |
| 381 } | 388 } |
| 382 | 389 |
| 383 } // namespace blink | 390 } // namespace blink |
| OLD | NEW |