Chromium Code Reviews| 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 "lib/stacktrace.h" | 10 #include "lib/stacktrace.h" |
| (...skipping 1358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1369 DART_EXPORT bool Dart_ShouldPauseOnStart() { | 1369 DART_EXPORT bool Dart_ShouldPauseOnStart() { |
| 1370 Isolate* isolate = Isolate::Current(); | 1370 Isolate* isolate = Isolate::Current(); |
| 1371 CHECK_ISOLATE(isolate); | 1371 CHECK_ISOLATE(isolate); |
| 1372 return isolate->message_handler()->should_pause_on_start(); | 1372 return isolate->message_handler()->should_pause_on_start(); |
| 1373 } | 1373 } |
| 1374 | 1374 |
| 1375 | 1375 |
| 1376 DART_EXPORT void Dart_SetShouldPauseOnStart(bool should_pause) { | 1376 DART_EXPORT void Dart_SetShouldPauseOnStart(bool should_pause) { |
| 1377 Isolate* isolate = Isolate::Current(); | 1377 Isolate* isolate = Isolate::Current(); |
| 1378 CHECK_ISOLATE(isolate); | 1378 CHECK_ISOLATE(isolate); |
| 1379 if (isolate->is_runnable()) { | |
| 1380 FATAL1("%s expects the current isolate to not be runnable yet.", | |
| 1381 CURRENT_FUNC); | |
| 1382 } | |
| 1379 return isolate->message_handler()->set_should_pause_on_start(should_pause); | 1383 return isolate->message_handler()->set_should_pause_on_start(should_pause); |
| 1380 } | 1384 } |
| 1381 | 1385 |
| 1382 | 1386 |
| 1383 DART_EXPORT bool Dart_IsPausedOnStart() { | 1387 DART_EXPORT bool Dart_IsPausedOnStart() { |
| 1384 Isolate* isolate = Isolate::Current(); | 1388 Isolate* isolate = Isolate::Current(); |
| 1385 CHECK_ISOLATE(isolate); | 1389 CHECK_ISOLATE(isolate); |
| 1386 return isolate->message_handler()->is_paused_on_start(); | 1390 return isolate->message_handler()->is_paused_on_start(); |
| 1387 } | 1391 } |
| 1388 | 1392 |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 1399 DART_EXPORT bool Dart_ShouldPauseOnExit() { | 1403 DART_EXPORT bool Dart_ShouldPauseOnExit() { |
| 1400 Isolate* isolate = Isolate::Current(); | 1404 Isolate* isolate = Isolate::Current(); |
| 1401 CHECK_ISOLATE(isolate); | 1405 CHECK_ISOLATE(isolate); |
| 1402 return isolate->message_handler()->should_pause_on_exit(); | 1406 return isolate->message_handler()->should_pause_on_exit(); |
| 1403 } | 1407 } |
| 1404 | 1408 |
| 1405 | 1409 |
| 1406 DART_EXPORT void Dart_SetShouldPauseOnExit(bool should_pause) { | 1410 DART_EXPORT void Dart_SetShouldPauseOnExit(bool should_pause) { |
| 1407 Isolate* isolate = Isolate::Current(); | 1411 Isolate* isolate = Isolate::Current(); |
| 1408 CHECK_ISOLATE(isolate); | 1412 CHECK_ISOLATE(isolate); |
| 1413 if (isolate->is_runnable()) { | |
| 1414 FATAL1("%s expects the current isolate to not be runnable yet.", | |
| 1415 CURRENT_FUNC); | |
|
turnidge
2016/02/04 17:13:38
I could see allowing this to be set late.
Cutch
2016/02/04 17:26:58
Done and comment updated.
| |
| 1416 } | |
| 1409 return isolate->message_handler()->set_should_pause_on_exit(should_pause); | 1417 return isolate->message_handler()->set_should_pause_on_exit(should_pause); |
| 1410 } | 1418 } |
| 1411 | 1419 |
| 1412 | 1420 |
| 1413 DART_EXPORT bool Dart_IsPausedOnExit() { | 1421 DART_EXPORT bool Dart_IsPausedOnExit() { |
| 1414 Isolate* isolate = Isolate::Current(); | 1422 Isolate* isolate = Isolate::Current(); |
| 1415 CHECK_ISOLATE(isolate); | 1423 CHECK_ISOLATE(isolate); |
| 1416 return isolate->message_handler()->is_paused_on_exit(); | 1424 return isolate->message_handler()->is_paused_on_exit(); |
| 1417 } | 1425 } |
| 1418 | 1426 |
| (...skipping 4681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6100 return Api::Success(); | 6108 return Api::Success(); |
| 6101 } | 6109 } |
| 6102 #endif // DART_PRECOMPILER | 6110 #endif // DART_PRECOMPILER |
| 6103 | 6111 |
| 6104 | 6112 |
| 6105 DART_EXPORT bool Dart_IsRunningPrecompiledCode() { | 6113 DART_EXPORT bool Dart_IsRunningPrecompiledCode() { |
| 6106 return Dart::IsRunningPrecompiledCode(); | 6114 return Dart::IsRunningPrecompiledCode(); |
| 6107 } | 6115 } |
| 6108 | 6116 |
| 6109 } // namespace dart | 6117 } // namespace dart |
| OLD | NEW |