@@ -201,8 +201,9 @@ void PlatformConfiguration::DidCreateIsolate() {
201201void PlatformConfiguration::UpdateLocales (
202202 const std::vector<std::string>& locales) {
203203 std::shared_ptr<tonic::DartState> dart_state = library_.dart_state ().lock ();
204- if (!dart_state)
204+ if (!dart_state) {
205205 return ;
206+ }
206207 tonic::DartState::Scope scope (dart_state);
207208 tonic::LogIfError (tonic::DartInvokeField (
208209 library_.value (), " _updateLocales" ,
@@ -213,8 +214,9 @@ void PlatformConfiguration::UpdateLocales(
213214
214215void PlatformConfiguration::UpdateUserSettingsData (const std::string& data) {
215216 std::shared_ptr<tonic::DartState> dart_state = library_.dart_state ().lock ();
216- if (!dart_state)
217+ if (!dart_state) {
217218 return ;
219+ }
218220 tonic::DartState::Scope scope (dart_state);
219221
220222 tonic::LogIfError (tonic::DartInvokeField (library_.value (),
@@ -226,8 +228,9 @@ void PlatformConfiguration::UpdateUserSettingsData(const std::string& data) {
226228
227229void PlatformConfiguration::UpdateLifecycleState (const std::string& data) {
228230 std::shared_ptr<tonic::DartState> dart_state = library_.dart_state ().lock ();
229- if (!dart_state)
231+ if (!dart_state) {
230232 return ;
233+ }
231234 tonic::DartState::Scope scope (dart_state);
232235 tonic::LogIfError (tonic::DartInvokeField (library_.value (),
233236 " _updateLifecycleState" ,
@@ -238,8 +241,9 @@ void PlatformConfiguration::UpdateLifecycleState(const std::string& data) {
238241
239242void PlatformConfiguration::UpdateSemanticsEnabled (bool enabled) {
240243 std::shared_ptr<tonic::DartState> dart_state = library_.dart_state ().lock ();
241- if (!dart_state)
244+ if (!dart_state) {
242245 return ;
246+ }
243247 tonic::DartState::Scope scope (dart_state);
244248 UIDartState::ThrowIfUIOperationsProhibited ();
245249
@@ -249,8 +253,9 @@ void PlatformConfiguration::UpdateSemanticsEnabled(bool enabled) {
249253
250254void PlatformConfiguration::UpdateAccessibilityFeatures (int32_t values) {
251255 std::shared_ptr<tonic::DartState> dart_state = library_.dart_state ().lock ();
252- if (!dart_state)
256+ if (!dart_state) {
253257 return ;
258+ }
254259 tonic::DartState::Scope scope (dart_state);
255260
256261 tonic::LogIfError (tonic::DartInvokeField (library_.value (),
@@ -293,14 +298,16 @@ void PlatformConfiguration::DispatchSemanticsAction(int32_t id,
293298 SemanticsAction action,
294299 std::vector<uint8_t > args) {
295300 std::shared_ptr<tonic::DartState> dart_state = library_.dart_state ().lock ();
296- if (!dart_state)
301+ if (!dart_state) {
297302 return ;
303+ }
298304 tonic::DartState::Scope scope (dart_state);
299305
300306 Dart_Handle args_handle = (args.empty ()) ? Dart_Null () : ToByteData (args);
301307
302- if (Dart_IsError (args_handle))
308+ if (Dart_IsError (args_handle)) {
303309 return ;
310+ }
304311
305312 tonic::LogIfError (tonic::DartInvokeField (
306313 library_.value (), " _dispatchSemanticsAction" ,
@@ -310,8 +317,9 @@ void PlatformConfiguration::DispatchSemanticsAction(int32_t id,
310317
311318void PlatformConfiguration::BeginFrame (fml::TimePoint frameTime) {
312319 std::shared_ptr<tonic::DartState> dart_state = library_.dart_state ().lock ();
313- if (!dart_state)
320+ if (!dart_state) {
314321 return ;
322+ }
315323 tonic::DartState::Scope scope (dart_state);
316324
317325 int64_t microseconds = (frameTime - fml::TimePoint ()).ToMicroseconds ();
@@ -328,8 +336,9 @@ void PlatformConfiguration::BeginFrame(fml::TimePoint frameTime) {
328336
329337void PlatformConfiguration::ReportTimings (std::vector<int64_t > timings) {
330338 std::shared_ptr<tonic::DartState> dart_state = library_.dart_state ().lock ();
331- if (!dart_state)
339+ if (!dart_state) {
332340 return ;
341+ }
333342 tonic::DartState::Scope scope (dart_state);
334343
335344 Dart_Handle data_handle =
@@ -353,11 +362,13 @@ void PlatformConfiguration::ReportTimings(std::vector<int64_t> timings) {
353362
354363void PlatformConfiguration::CompletePlatformMessageEmptyResponse (
355364 int response_id) {
356- if (!response_id)
365+ if (!response_id) {
357366 return ;
367+ }
358368 auto it = pending_responses_.find (response_id);
359- if (it == pending_responses_.end ())
369+ if (it == pending_responses_.end ()) {
360370 return ;
371+ }
361372 auto response = std::move (it->second );
362373 pending_responses_.erase (it);
363374 response->CompleteEmpty ();
@@ -366,11 +377,13 @@ void PlatformConfiguration::CompletePlatformMessageEmptyResponse(
366377void PlatformConfiguration::CompletePlatformMessageResponse (
367378 int response_id,
368379 std::vector<uint8_t > data) {
369- if (!response_id)
380+ if (!response_id) {
370381 return ;
382+ }
371383 auto it = pending_responses_.find (response_id);
372- if (it == pending_responses_.end ())
384+ if (it == pending_responses_.end ()) {
373385 return ;
386+ }
374387 auto response = std::move (it->second );
375388 pending_responses_.erase (it);
376389 response->Complete (std::make_unique<fml::DataMapping>(std::move (data)));
0 commit comments