From e75747c9074f8bd43135bedfa7e9092940c62fbc Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Mon, 5 Feb 2018 16:11:51 -0800 Subject: [PATCH] Update PlatformViewAndroid for the new definition of SemanticsNodeUpdates (flutter/engine#4636) --- .../shell/platform/android/platform_view_android.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/engine/src/flutter/shell/platform/android/platform_view_android.cc b/engine/src/flutter/shell/platform/android/platform_view_android.cc index 4b91caa0a6..9a7bc18c04 100644 --- a/engine/src/flutter/shell/platform/android/platform_view_android.cc +++ b/engine/src/flutter/shell/platform/android/platform_view_android.cc @@ -471,9 +471,9 @@ void PlatformViewAndroid::UpdateSemantics( return; size_t num_bytes = 0; - for (const blink::SemanticsNode& node : update) { + for (const auto& value : update) { num_bytes += kBytesPerNode; - num_bytes += node.children.size() * kBytesPerChild; + num_bytes += value.second.children.size() * kBytesPerChild; } std::vector buffer(num_bytes); @@ -482,10 +482,11 @@ void PlatformViewAndroid::UpdateSemantics( std::vector strings; size_t position = 0; - for (const blink::SemanticsNode& node : update) { + for (const auto& value : update) { // If you edit this code, make sure you update kBytesPerNode // and/or kBytesPerChild above to match the number of values you are // sending. + const blink::SemanticsNode& node = value.second; buffer_int32[position++] = node.id; buffer_int32[position++] = node.flags; buffer_int32[position++] = node.actions;