| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "include/dart_api.h" | 5 #include "include/dart_api.h" |
| 6 #include "include/dart_mirrors_api.h" | 6 #include "include/dart_mirrors_api.h" |
| 7 #include "include/dart_native_api.h" | 7 #include "include/dart_native_api.h" |
| 8 | 8 |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 #include "vm/class_finalizer.h" | 10 #include "vm/class_finalizer.h" |
| (...skipping 1483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1494 } | 1494 } |
| 1495 | 1495 |
| 1496 | 1496 |
| 1497 DART_EXPORT bool Dart_IsolateMakeRunnable(Dart_Isolate isolate) { | 1497 DART_EXPORT bool Dart_IsolateMakeRunnable(Dart_Isolate isolate) { |
| 1498 CHECK_NO_ISOLATE(Isolate::Current()); | 1498 CHECK_NO_ISOLATE(Isolate::Current()); |
| 1499 if (isolate == NULL) { | 1499 if (isolate == NULL) { |
| 1500 FATAL1("%s expects argument 'isolate' to be non-null.", CURRENT_FUNC); | 1500 FATAL1("%s expects argument 'isolate' to be non-null.", CURRENT_FUNC); |
| 1501 } | 1501 } |
| 1502 // TODO(16615): Validate isolate parameter. | 1502 // TODO(16615): Validate isolate parameter. |
| 1503 Isolate* iso = reinterpret_cast<Isolate*>(isolate); | 1503 Isolate* iso = reinterpret_cast<Isolate*>(isolate); |
| 1504 if (iso->object_store()->root_library() == Library::null()) { |
| 1505 // The embedder should have called Dart_LoadScript by now. |
| 1506 return false; |
| 1507 } |
| 1504 return iso->MakeRunnable(); | 1508 return iso->MakeRunnable(); |
| 1505 } | 1509 } |
| 1506 | 1510 |
| 1507 | 1511 |
| 1508 // --- Messages and Ports --- | 1512 // --- Messages and Ports --- |
| 1509 | 1513 |
| 1510 DART_EXPORT void Dart_SetMessageNotifyCallback( | 1514 DART_EXPORT void Dart_SetMessageNotifyCallback( |
| 1511 Dart_MessageNotifyCallback message_notify_callback) { | 1515 Dart_MessageNotifyCallback message_notify_callback) { |
| 1512 Isolate* isolate = Isolate::Current(); | 1516 Isolate* isolate = Isolate::Current(); |
| 1513 CHECK_ISOLATE(isolate); | 1517 CHECK_ISOLATE(isolate); |
| (...skipping 4040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5554 | 5558 |
| 5555 | 5559 |
| 5556 DART_EXPORT void Dart_RegisterRootServiceRequestCallback( | 5560 DART_EXPORT void Dart_RegisterRootServiceRequestCallback( |
| 5557 const char* name, | 5561 const char* name, |
| 5558 Dart_ServiceRequestCallback callback, | 5562 Dart_ServiceRequestCallback callback, |
| 5559 void* user_data) { | 5563 void* user_data) { |
| 5560 Service::RegisterRootEmbedderCallback(name, callback, user_data); | 5564 Service::RegisterRootEmbedderCallback(name, callback, user_data); |
| 5561 } | 5565 } |
| 5562 | 5566 |
| 5563 } // namespace dart | 5567 } // namespace dart |
| OLD | NEW |