| 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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 builtin_sky_->InstallWindow(dart_state()); | 277 builtin_sky_->InstallWindow(dart_state()); |
| 278 | 278 |
| 279 document->frame()->loaderClient()->didCreateIsolate(isolate); | 279 document->frame()->loaderClient()->didCreateIsolate(isolate); |
| 280 | 280 |
| 281 EnsureHandleWatcherStarted(); | 281 EnsureHandleWatcherStarted(); |
| 282 } | 282 } |
| 283 Dart_ExitIsolate(); | 283 Dart_ExitIsolate(); |
| 284 } | 284 } |
| 285 | 285 |
| 286 void DartController::ClearForClose() { | 286 void DartController::ClearForClose() { |
| 287 DartIsolateScope scope(dom_dart_state_->isolate()); | 287 // Don't use a DartIsolateScope here since we never exit the isolate. |
| 288 Dart_EnterIsolate(dom_dart_state_->isolate()); |
| 288 Dart_ShutdownIsolate(); | 289 Dart_ShutdownIsolate(); |
| 289 dom_dart_state_.clear(); | 290 dom_dart_state_.clear(); |
| 290 } | 291 } |
| 291 | 292 |
| 292 void DartController::InitVM() { | 293 void DartController::InitVM() { |
| 293 int argc = 0; | 294 int argc = 0; |
| 294 const char** argv = nullptr; | 295 const char** argv = nullptr; |
| 295 | 296 |
| 296 #if ENABLE(ASSERT) | 297 #if ENABLE(ASSERT) |
| 297 argc = arraysize(kCheckedModeArgs); | 298 argc = arraysize(kCheckedModeArgs); |
| 298 argv = kCheckedModeArgs; | 299 argv = kCheckedModeArgs; |
| 299 #endif | 300 #endif |
| 300 | 301 |
| 301 CHECK(Dart_SetVMFlags(argc, argv)); | 302 CHECK(Dart_SetVMFlags(argc, argv)); |
| 302 CHECK(Dart_Initialize(IsolateCreateCallback, | 303 CHECK(Dart_Initialize(IsolateCreateCallback, |
| 303 nullptr, // Isolate interrupt callback. | 304 nullptr, // Isolate interrupt callback. |
| 304 UnhandledExceptionCallback, IsolateShutdownCallback, | 305 UnhandledExceptionCallback, IsolateShutdownCallback, |
| 305 // File IO callbacks. | 306 // File IO callbacks. |
| 306 nullptr, nullptr, nullptr, nullptr, nullptr)); | 307 nullptr, nullptr, nullptr, nullptr, nullptr)); |
| 307 } | 308 } |
| 308 | 309 |
| 309 } // namespace blink | 310 } // namespace blink |
| OLD | NEW |