| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/callback.h" | 6 #include "base/callback.h" |
| 7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/rand_util.h" | 10 #include "base/rand_util.h" |
| (...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 683 bool DartController::Initialize( | 683 bool DartController::Initialize( |
| 684 DartControllerServiceConnector* service_connector, | 684 DartControllerServiceConnector* service_connector, |
| 685 bool strict_compilation) { | 685 bool strict_compilation) { |
| 686 service_connector_ = service_connector; | 686 service_connector_ = service_connector; |
| 687 strict_compilation_ = strict_compilation; | 687 strict_compilation_ = strict_compilation; |
| 688 InitVmIfNeeded(generateEntropy, nullptr, 0); | 688 InitVmIfNeeded(generateEntropy, nullptr, 0); |
| 689 return true; | 689 return true; |
| 690 } | 690 } |
| 691 | 691 |
| 692 bool DartController::RunDartScript(const DartControllerConfig& config) { | 692 bool DartController::RunDartScript(const DartControllerConfig& config) { |
| 693 BlockForServiceIsolate(); | |
| 694 CHECK(service_isolate_running_); | |
| 695 const bool strict = strict_compilation_ || config.strict_compilation; | 693 const bool strict = strict_compilation_ || config.strict_compilation; |
| 696 Dart_Isolate isolate = CreateIsolateHelper(config.application_data, | 694 Dart_Isolate isolate = CreateIsolateHelper(config.application_data, |
| 697 strict, | 695 strict, |
| 698 config.callbacks, | 696 config.callbacks, |
| 699 config.script_uri, | 697 config.script_uri, |
| 700 config.package_root, | 698 config.package_root, |
| 701 config.error, | 699 config.error, |
| 702 config.use_network_loader); | 700 config.use_network_loader); |
| 703 if (isolate == nullptr) { | 701 if (isolate == nullptr) { |
| 704 return false; | 702 return false; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 720 } | 718 } |
| 721 BlockForServiceIsolateLocked(); | 719 BlockForServiceIsolateLocked(); |
| 722 StopHandleWatcherIsolate(); | 720 StopHandleWatcherIsolate(); |
| 723 Dart_Cleanup(); | 721 Dart_Cleanup(); |
| 724 service_isolate_running_ = false; | 722 service_isolate_running_ = false; |
| 725 initialized_ = false; | 723 initialized_ = false; |
| 726 } | 724 } |
| 727 | 725 |
| 728 } // namespace apps | 726 } // namespace apps |
| 729 } // namespace mojo | 727 } // namespace mojo |
| OLD | NEW |