| 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/callback.h" | 5 #include "base/callback.h" |
| 6 #include "base/files/file_util.h" | 6 #include "base/files/file_util.h" |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/sys_info.h" | 9 #include "base/sys_info.h" |
| 10 #include "crypto/random.h" | 10 #include "crypto/random.h" |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 DART_CHECK_VALID(isolate_lib); | 192 DART_CHECK_VALID(isolate_lib); |
| 193 Dart_Handle mojo_core_lib = | 193 Dart_Handle mojo_core_lib = |
| 194 Builtin::GetLibrary(Builtin::kMojoCoreLibrary); | 194 Builtin::GetLibrary(Builtin::kMojoCoreLibrary); |
| 195 DART_CHECK_VALID(mojo_core_lib); | 195 DART_CHECK_VALID(mojo_core_lib); |
| 196 | 196 |
| 197 // We need to ensure that all the scripts loaded so far are finalized | 197 // We need to ensure that all the scripts loaded so far are finalized |
| 198 // as we are about to invoke some Dart code below to setup closures. | 198 // as we are about to invoke some Dart code below to setup closures. |
| 199 Dart_Handle result = Dart_FinalizeLoading(false); | 199 Dart_Handle result = Dart_FinalizeLoading(false); |
| 200 DART_CHECK_VALID(result); | 200 DART_CHECK_VALID(result); |
| 201 | 201 |
| 202 // Import dart:_internal into mojo:builtin for setting up hooks. | 202 // Import dart:_internal into dart:mojo.builtin for setting up hooks. |
| 203 result = Dart_LibraryImportLibrary(builtin_lib, internal_lib, Dart_Null()); | 203 result = Dart_LibraryImportLibrary(builtin_lib, internal_lib, Dart_Null()); |
| 204 DART_CHECK_VALID(result); | 204 DART_CHECK_VALID(result); |
| 205 | 205 |
| 206 // Setup the internal library's 'internalPrint' function. | 206 // Setup the internal library's 'internalPrint' function. |
| 207 Dart_Handle print = Dart_Invoke(builtin_lib, | 207 Dart_Handle print = Dart_Invoke(builtin_lib, |
| 208 Dart_NewStringFromCString("_getPrintClosure"), | 208 Dart_NewStringFromCString("_getPrintClosure"), |
| 209 0, | 209 0, |
| 210 nullptr); | 210 nullptr); |
| 211 DART_CHECK_VALID(print); | 211 DART_CHECK_VALID(print); |
| 212 result = Dart_SetField(internal_lib, | 212 result = Dart_SetField(internal_lib, |
| (...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 | 727 |
| 728 Dart_ExitScope(); | 728 Dart_ExitScope(); |
| 729 Dart_ShutdownIsolate(); | 729 Dart_ShutdownIsolate(); |
| 730 Dart_Cleanup(); | 730 Dart_Cleanup(); |
| 731 root_isolate_ = nullptr; | 731 root_isolate_ = nullptr; |
| 732 initialized_ = false; | 732 initialized_ = false; |
| 733 } | 733 } |
| 734 | 734 |
| 735 } // namespace apps | 735 } // namespace apps |
| 736 } // namespace mojo | 736 } // namespace mojo |
| OLD | NEW |