@@ -2109,68 +2109,6 @@ DART_EXPORT Dart_Handle Dart_HandleMessage() {
2109
2109
return Api::Success ();
2110
2110
}
2111
2111
2112
- DART_EXPORT Dart_Handle Dart_WaitForEvent (int64_t timeout_millis) {
2113
- if (!FLAG_enable_deprecated_wait_for) {
2114
- return Dart_NewUnhandledExceptionError (Dart_NewStringFromCString (
2115
- " Synchronous waiting using dart:cli waitFor "
2116
- " and C API Dart_WaitForEvent is deprecated and disabled by default. "
2117
- " This feature will be fully removed in Dart 3.4 release. "
2118
- " You can currently still enable it by passing "
2119
- " --enable_deprecated_wait_for "
2120
- " to the Dart VM. "
2121
- " See https://dartbug.com/52121." ));
2122
- }
2123
-
2124
- Thread* T = Thread::Current ();
2125
- Isolate* I = T->isolate ();
2126
- CHECK_API_SCOPE (T);
2127
- CHECK_CALLBACK_STATE (T);
2128
- API_TIMELINE_BEGIN_END (T);
2129
- TransitionNativeToVM transition (T);
2130
- if (I->message_notify_callback () != nullptr ) {
2131
- return Api::NewError (" waitForEventSync is not supported by this embedder" );
2132
- }
2133
- Object& result =
2134
- Object::Handle (Z, DartLibraryCalls::EnsureScheduleImmediate ());
2135
- if (result.IsError ()) {
2136
- return Api::NewHandle (T, result.ptr ());
2137
- }
2138
-
2139
- // Drain the microtask queue. Propagate any errors to the entry frame.
2140
- result = DartLibraryCalls::DrainMicrotaskQueue ();
2141
- if (result.IsError ()) {
2142
- // Persist the error across unwiding scopes before propagating.
2143
- const Error* error;
2144
- {
2145
- NoSafepointScope no_safepoint;
2146
- ErrorPtr raw_error = Error::Cast (result).ptr ();
2147
- T->UnwindScopes (T->top_exit_frame_info ());
2148
- error = &Error::Handle (T->zone (), raw_error);
2149
- }
2150
- Exceptions::PropagateToEntry (*error);
2151
- UNREACHABLE ();
2152
- return Api::NewError (" Unreachable" );
2153
- }
2154
-
2155
- // Block to wait for messages and then handle them. Propagate any errors to
2156
- // the entry frame.
2157
- if (I->message_handler ()->PauseAndHandleAllMessages (timeout_millis) !=
2158
- MessageHandler::kOK ) {
2159
- // Persist the error across unwiding scopes before propagating.
2160
- const Error* error;
2161
- {
2162
- NoSafepointScope no_safepoint;
2163
- ErrorPtr raw_error = T->StealStickyError ();
2164
- T->UnwindScopes (T->top_exit_frame_info ());
2165
- error = &Error::Handle (T->zone (), raw_error);
2166
- }
2167
- Exceptions::PropagateToEntry (*error);
2168
- UNREACHABLE ();
2169
- return Api::NewError (" Unreachable" );
2170
- }
2171
- return Api::Success ();
2172
- }
2173
-
2174
2112
DART_EXPORT bool Dart_HandleServiceMessages () {
2175
2113
#if defined(PRODUCT)
2176
2114
return true ;
0 commit comments