From 24546472718858f18a067df98cd5323a993fc52d Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Fri, 2 Sep 2022 16:26:59 -0400 Subject: [PATCH] [fuchsia] Avoid naming fuchsia::io::NodeInfo (flutter/engine#35891) The argument is unused and the type is being renamed in https://fxrev.dev/719447. --- .../platform/fuchsia/flutter/component_v1.cc | 51 +++++++++---------- .../platform/fuchsia/flutter/component_v2.cc | 6 +-- 2 files changed, 27 insertions(+), 30 deletions(-) diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/component_v1.cc b/engine/src/flutter/shell/platform/fuchsia/flutter/component_v1.cc index 7cef1f937c..b9a8674f65 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/component_v1.cc +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/component_v1.cc @@ -221,32 +221,31 @@ ComponentV1::ComponentV1( fuchsia::io::OpenFlags::RIGHT_WRITABLE, cloned_directory_ptr_.NewRequest()); - cloned_directory_ptr_.events().OnOpen = - [this](zx_status_t status, std::unique_ptr info) { - cloned_directory_ptr_.Unbind(); - if (status != ZX_OK) { - FML_LOG(ERROR) - << "could not bind out directory for flutter component(" - << debug_label_ << "): " << zx_status_get_string(status); - return; - } - const char* other_dirs[] = {"debug", "ctrl", "diagnostics"}; - // add other directories as RemoteDirs. - for (auto& dir_str : other_dirs) { - fuchsia::io::DirectoryHandle dir; - auto request = dir.NewRequest().TakeChannel(); - auto status = fdio_service_connect_at(directory_ptr_.channel().get(), - dir_str, request.release()); - if (status == ZX_OK) { - outgoing_dir_->AddEntry( - dir_str, std::make_unique(dir.TakeChannel())); - } else { - FML_LOG(ERROR) << "could not add out directory entry(" << dir_str - << ") for flutter component(" << debug_label_ - << "): " << zx_status_get_string(status); - } - } - }; + cloned_directory_ptr_.events().OnOpen = [this](zx_status_t status, + auto unused) { + cloned_directory_ptr_.Unbind(); + if (status != ZX_OK) { + FML_LOG(ERROR) << "could not bind out directory for flutter component(" + << debug_label_ << "): " << zx_status_get_string(status); + return; + } + const char* other_dirs[] = {"debug", "ctrl", "diagnostics"}; + // add other directories as RemoteDirs. + for (auto& dir_str : other_dirs) { + fuchsia::io::DirectoryHandle dir; + auto request = dir.NewRequest().TakeChannel(); + auto status = fdio_service_connect_at(directory_ptr_.channel().get(), + dir_str, request.release()); + if (status == ZX_OK) { + outgoing_dir_->AddEntry( + dir_str, std::make_unique(dir.TakeChannel())); + } else { + FML_LOG(ERROR) << "could not add out directory entry(" << dir_str + << ") for flutter component(" << debug_label_ + << "): " << zx_status_get_string(status); + } + } + }; cloned_directory_ptr_.set_error_handler( [this](zx_status_t status) { cloned_directory_ptr_.Unbind(); }); diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/component_v2.cc b/engine/src/flutter/shell/platform/fuchsia/flutter/component_v2.cc index 6bf1bc2a2c..09fce7e806 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/component_v2.cc +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/component_v2.cc @@ -278,10 +278,8 @@ ComponentV2::ComponentV2( other_dirs.push_back(dir); } - cloned_directory_ptr_.events() - .OnOpen = [this, other_dirs]( - zx_status_t status, - std::unique_ptr info) { + cloned_directory_ptr_.events().OnOpen = [this, other_dirs](zx_status_t status, + auto unused) { cloned_directory_ptr_.Unbind(); if (status != ZX_OK) { FML_LOG(ERROR) << "could not bind out directory for flutter component("