| 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 1184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1195 | 1195 |
| 1196 DART_EXPORT bool Dart_Initialize( | 1196 DART_EXPORT bool Dart_Initialize( |
| 1197 Dart_IsolateCreateCallback create, | 1197 Dart_IsolateCreateCallback create, |
| 1198 Dart_IsolateInterruptCallback interrupt, | 1198 Dart_IsolateInterruptCallback interrupt, |
| 1199 Dart_IsolateUnhandledExceptionCallback unhandled, | 1199 Dart_IsolateUnhandledExceptionCallback unhandled, |
| 1200 Dart_IsolateShutdownCallback shutdown, | 1200 Dart_IsolateShutdownCallback shutdown, |
| 1201 Dart_FileOpenCallback file_open, | 1201 Dart_FileOpenCallback file_open, |
| 1202 Dart_FileReadCallback file_read, | 1202 Dart_FileReadCallback file_read, |
| 1203 Dart_FileWriteCallback file_write, | 1203 Dart_FileWriteCallback file_write, |
| 1204 Dart_FileCloseCallback file_close, | 1204 Dart_FileCloseCallback file_close, |
| 1205 Dart_EntropySource entropy_source, | 1205 Dart_EntropySource entropy_source) { |
| 1206 Dart_ServiceIsolateCreateCalback service_create) { | |
| 1207 const char* err_msg = Dart::InitOnce(create, interrupt, unhandled, shutdown, | 1206 const char* err_msg = Dart::InitOnce(create, interrupt, unhandled, shutdown, |
| 1208 file_open, file_read, file_write, | 1207 file_open, file_read, file_write, |
| 1209 file_close, entropy_source, | 1208 file_close, entropy_source); |
| 1210 service_create); | |
| 1211 if (err_msg != NULL) { | 1209 if (err_msg != NULL) { |
| 1212 OS::PrintErr("Dart_Initialize: %s\n", err_msg); | 1210 OS::PrintErr("Dart_Initialize: %s\n", err_msg); |
| 1213 return false; | 1211 return false; |
| 1214 } | 1212 } |
| 1215 return true; | 1213 return true; |
| 1216 } | 1214 } |
| 1217 | 1215 |
| 1218 | 1216 |
| 1219 DART_EXPORT bool Dart_Cleanup() { | 1217 DART_EXPORT bool Dart_Cleanup() { |
| 1220 CHECK_NO_ISOLATE(Isolate::Current()); | 1218 CHECK_NO_ISOLATE(Isolate::Current()); |
| (...skipping 4137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5358 NoGCScope no_gc; | 5356 NoGCScope no_gc; |
| 5359 RawObject* raw_obj = obj.raw(); | 5357 RawObject* raw_obj = obj.raw(); |
| 5360 isolate->heap()->SetPeer(raw_obj, peer); | 5358 isolate->heap()->SetPeer(raw_obj, peer); |
| 5361 } | 5359 } |
| 5362 return Api::Success(); | 5360 return Api::Success(); |
| 5363 } | 5361 } |
| 5364 | 5362 |
| 5365 | 5363 |
| 5366 // --- Service support --- | 5364 // --- Service support --- |
| 5367 | 5365 |
| 5368 DART_EXPORT Dart_Isolate Dart_GetServiceIsolate(void* callback_data) { | |
| 5369 return Api::CastIsolate(Service::GetServiceIsolate(callback_data)); | |
| 5370 } | |
| 5371 | |
| 5372 | |
| 5373 DART_EXPORT bool Dart_IsServiceRunning() { | |
| 5374 return Service::IsRunning(); | |
| 5375 } | |
| 5376 | |
| 5377 | |
| 5378 DART_EXPORT void Dart_RegisterIsolateServiceRequestCallback( | 5366 DART_EXPORT void Dart_RegisterIsolateServiceRequestCallback( |
| 5379 const char* name, | 5367 const char* name, |
| 5380 Dart_ServiceRequestCallback callback, | 5368 Dart_ServiceRequestCallback callback, |
| 5381 void* user_data) { | 5369 void* user_data) { |
| 5382 Service::RegisterIsolateEmbedderCallback(name, callback, user_data); | 5370 Service::RegisterIsolateEmbedderCallback(name, callback, user_data); |
| 5383 } | 5371 } |
| 5384 | 5372 |
| 5385 | 5373 |
| 5386 DART_EXPORT void Dart_RegisterRootServiceRequestCallback( | 5374 DART_EXPORT void Dart_RegisterRootServiceRequestCallback( |
| 5387 const char* name, | 5375 const char* name, |
| 5388 Dart_ServiceRequestCallback callback, | 5376 Dart_ServiceRequestCallback callback, |
| 5389 void* user_data) { | 5377 void* user_data) { |
| 5390 Service::RegisterRootEmbedderCallback(name, callback, user_data); | 5378 Service::RegisterRootEmbedderCallback(name, callback, user_data); |
| 5391 } | 5379 } |
| 5392 | 5380 |
| 5393 } // namespace dart | 5381 } // namespace dart |
| OLD | NEW |