| 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 23 matching lines...) Expand all Loading... |
| 34 #include "sky/engine/tonic/dart_error.h" | 34 #include "sky/engine/tonic/dart_error.h" |
| 35 #include "sky/engine/tonic/dart_gc_controller.h" | 35 #include "sky/engine/tonic/dart_gc_controller.h" |
| 36 #include "sky/engine/tonic/dart_invoke.h" | 36 #include "sky/engine/tonic/dart_invoke.h" |
| 37 #include "sky/engine/tonic/dart_isolate_scope.h" | 37 #include "sky/engine/tonic/dart_isolate_scope.h" |
| 38 #include "sky/engine/tonic/dart_state.h" | 38 #include "sky/engine/tonic/dart_state.h" |
| 39 #include "sky/engine/tonic/dart_wrappable.h" | 39 #include "sky/engine/tonic/dart_wrappable.h" |
| 40 #include "sky/engine/wtf/text/TextPosition.h" | 40 #include "sky/engine/wtf/text/TextPosition.h" |
| 41 | 41 |
| 42 namespace blink { | 42 namespace blink { |
| 43 | 43 |
| 44 #if ENABLE(ASSERT) | 44 #if ENABLE(DART_STRICT) |
| 45 static const char* kCheckedModeArgs[] = { | 45 static const char* kCheckedModeArgs[] = { |
| 46 "--enable_asserts", | 46 "--enable_asserts", |
| 47 "--enable_type_checks", | 47 "--enable_type_checks", |
| 48 "--error_on_bad_type", | 48 "--error_on_bad_type", |
| 49 "--error_on_bad_override", | 49 "--error_on_bad_override", |
| 50 }; | 50 }; |
| 51 #endif | 51 #endif |
| 52 | 52 |
| 53 extern const uint8_t* kDartVmIsolateSnapshotBuffer; | 53 extern const uint8_t* kDartVmIsolateSnapshotBuffer; |
| 54 extern const uint8_t* kDartIsolateSnapshotBuffer; | 54 extern const uint8_t* kDartIsolateSnapshotBuffer; |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 // Don't use a DartIsolateScope here since we never exit the isolate. | 362 // Don't use a DartIsolateScope here since we never exit the isolate. |
| 363 Dart_EnterIsolate(dom_dart_state_->isolate()); | 363 Dart_EnterIsolate(dom_dart_state_->isolate()); |
| 364 Dart_ShutdownIsolate(); | 364 Dart_ShutdownIsolate(); |
| 365 dom_dart_state_.clear(); | 365 dom_dart_state_.clear(); |
| 366 } | 366 } |
| 367 | 367 |
| 368 void DartController::InitVM() { | 368 void DartController::InitVM() { |
| 369 int argc = 0; | 369 int argc = 0; |
| 370 const char** argv = nullptr; | 370 const char** argv = nullptr; |
| 371 | 371 |
| 372 #if ENABLE(ASSERT) | 372 #if ENABLE(DART_STRICT) |
| 373 argc = arraysize(kCheckedModeArgs); | 373 argc = arraysize(kCheckedModeArgs); |
| 374 argv = kCheckedModeArgs; | 374 argv = kCheckedModeArgs; |
| 375 #endif | 375 #endif |
| 376 | 376 |
| 377 dart::bin::BootstrapDartIo(); | 377 dart::bin::BootstrapDartIo(); |
| 378 | 378 |
| 379 CHECK(Dart_SetVMFlags(argc, argv)); | 379 CHECK(Dart_SetVMFlags(argc, argv)); |
| 380 // This should be called before calling Dart_Initialize. | 380 // This should be called before calling Dart_Initialize. |
| 381 DartDebugger::InitDebugger(); | 381 DartDebugger::InitDebugger(); |
| 382 CHECK(Dart_Initialize(kDartVmIsolateSnapshotBuffer, | 382 CHECK(Dart_Initialize(kDartVmIsolateSnapshotBuffer, |
| 383 IsolateCreateCallback, | 383 IsolateCreateCallback, |
| 384 nullptr, // Isolate interrupt callback. | 384 nullptr, // Isolate interrupt callback. |
| 385 UnhandledExceptionCallback, IsolateShutdownCallback, | 385 UnhandledExceptionCallback, IsolateShutdownCallback, |
| 386 // File IO callbacks. | 386 // File IO callbacks. |
| 387 nullptr, nullptr, nullptr, nullptr, nullptr)); | 387 nullptr, nullptr, nullptr, nullptr, nullptr)); |
| 388 // Wait for load port- ensures handle watcher and service isolates are | 388 // Wait for load port- ensures handle watcher and service isolates are |
| 389 // running. | 389 // running. |
| 390 Dart_ServiceWaitForLoadPort(); | 390 Dart_ServiceWaitForLoadPort(); |
| 391 } | 391 } |
| 392 | 392 |
| 393 } // namespace blink | 393 } // namespace blink |
| OLD | NEW |