Skip to content

Roll pigeon dependency to unblock flutter framework deps roll #4383

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jul 7, 2023
3 changes: 2 additions & 1 deletion packages/url_launcher/url_launcher_windows/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## NEXT
## 3.0.7

* Updates pigeon dependency for url_launcher_windows to "^10.1.2".
* Updates minimum supported SDK version to Flutter 3.3/Dart 2.18.

## 3.0.6
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Autogenerated from Pigeon (v5.0.1), do not edit directly.
// Autogenerated from Pigeon (v10.1.2), do not edit directly.
// See also: https://pub.dev/packages/pigeon
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import

import 'dart:async';
import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List;

Expand Down
4 changes: 2 additions & 2 deletions packages/url_launcher/url_launcher_windows/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: url_launcher_windows
description: Windows implementation of the url_launcher plugin.
repository: https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher_windows
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+url_launcher%22
version: 3.0.6
version: 3.0.7

environment:
sdk: ">=2.18.0 <4.0.0"
Expand All @@ -24,5 +24,5 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
pigeon: ^5.0.1
pigeon: ^10.1.2
test: ^1.16.3
64 changes: 33 additions & 31 deletions packages/url_launcher/url_launcher_windows/windows/messages.g.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Autogenerated from Pigeon (v5.0.1), do not edit directly.
// Autogenerated from Pigeon (v10.1.2), do not edit directly.
// See also: https://pub.dev/packages/pigeon

#undef _HAS_EXCEPTIONS
Expand All @@ -18,6 +18,11 @@
#include <string>

namespace url_launcher_windows {
using flutter::BasicMessageChannel;
using flutter::CustomEncodableValue;
using flutter::EncodableList;
using flutter::EncodableMap;
using flutter::EncodableValue;

/// The codec used by UrlLauncherApi.
const flutter::StandardMessageCodec& UrlLauncherApi::GetCodec() {
Expand All @@ -30,16 +35,15 @@ const flutter::StandardMessageCodec& UrlLauncherApi::GetCodec() {
void UrlLauncherApi::SetUp(flutter::BinaryMessenger* binary_messenger,
UrlLauncherApi* api) {
{
auto channel =
std::make_unique<flutter::BasicMessageChannel<flutter::EncodableValue>>(
binary_messenger, "dev.flutter.pigeon.UrlLauncherApi.canLaunchUrl",
&GetCodec());
auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger, "dev.flutter.pigeon.UrlLauncherApi.canLaunchUrl",
&GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
[api](const flutter::EncodableValue& message,
const flutter::MessageReply<flutter::EncodableValue>& reply) {
[api](const EncodableValue& message,
const flutter::MessageReply<EncodableValue>& reply) {
try {
const auto& args = std::get<flutter::EncodableList>(message);
const auto& args = std::get<EncodableList>(message);
const auto& encodable_url_arg = args.at(0);
if (encodable_url_arg.IsNull()) {
reply(WrapError("url_arg unexpectedly null."));
Expand All @@ -51,10 +55,9 @@ void UrlLauncherApi::SetUp(flutter::BinaryMessenger* binary_messenger,
reply(WrapError(output.error()));
return;
}
flutter::EncodableList wrapped;
wrapped.push_back(
flutter::EncodableValue(std::move(output).TakeValue()));
reply(flutter::EncodableValue(std::move(wrapped)));
EncodableList wrapped;
wrapped.push_back(EncodableValue(std::move(output).TakeValue()));
reply(EncodableValue(std::move(wrapped)));
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
}
Expand All @@ -64,16 +67,15 @@ void UrlLauncherApi::SetUp(flutter::BinaryMessenger* binary_messenger,
}
}
{
auto channel =
std::make_unique<flutter::BasicMessageChannel<flutter::EncodableValue>>(
binary_messenger, "dev.flutter.pigeon.UrlLauncherApi.launchUrl",
&GetCodec());
auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger, "dev.flutter.pigeon.UrlLauncherApi.launchUrl",
&GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
[api](const flutter::EncodableValue& message,
const flutter::MessageReply<flutter::EncodableValue>& reply) {
[api](const EncodableValue& message,
const flutter::MessageReply<EncodableValue>& reply) {
try {
const auto& args = std::get<flutter::EncodableList>(message);
const auto& args = std::get<EncodableList>(message);
const auto& encodable_url_arg = args.at(0);
if (encodable_url_arg.IsNull()) {
reply(WrapError("url_arg unexpectedly null."));
Expand All @@ -85,9 +87,9 @@ void UrlLauncherApi::SetUp(flutter::BinaryMessenger* binary_messenger,
reply(WrapError(output.value()));
return;
}
flutter::EncodableList wrapped;
wrapped.push_back(flutter::EncodableValue());
reply(flutter::EncodableValue(std::move(wrapped)));
EncodableList wrapped;
wrapped.push_back(EncodableValue());
reply(EncodableValue(std::move(wrapped)));
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
}
Expand All @@ -98,16 +100,16 @@ void UrlLauncherApi::SetUp(flutter::BinaryMessenger* binary_messenger,
}
}

flutter::EncodableValue UrlLauncherApi::WrapError(
std::string_view error_message) {
return flutter::EncodableValue(flutter::EncodableList{
flutter::EncodableValue(std::string(error_message)),
flutter::EncodableValue("Error"), flutter::EncodableValue()});
EncodableValue UrlLauncherApi::WrapError(std::string_view error_message) {
return EncodableValue(
EncodableList{EncodableValue(std::string(error_message)),
EncodableValue("Error"), EncodableValue()});
}
flutter::EncodableValue UrlLauncherApi::WrapError(const FlutterError& error) {
return flutter::EncodableValue(flutter::EncodableList{
flutter::EncodableValue(error.message()),
flutter::EncodableValue(error.code()), error.details()});

EncodableValue UrlLauncherApi::WrapError(const FlutterError& error) {
return EncodableValue(EncodableList{EncodableValue(error.code()),
EncodableValue(error.message()),
error.details()});
}

} // namespace url_launcher_windows
20 changes: 9 additions & 11 deletions packages/url_launcher/url_launcher_windows/windows/messages.g.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Autogenerated from Pigeon (v5.0.1), do not edit directly.
// Autogenerated from Pigeon (v10.1.2), do not edit directly.
// See also: https://pub.dev/packages/pigeon

#ifndef PIGEON_H_
#define PIGEON_H_
#ifndef PIGEON_MESSAGES_G_H_
#define PIGEON_MESSAGES_G_H_
#include <flutter/basic_message_channel.h>
#include <flutter/binary_messenger.h>
#include <flutter/encodable_value.h>
Expand Down Expand Up @@ -41,10 +41,10 @@ class FlutterError {
template <class T>
class ErrorOr {
public:
ErrorOr(const T& rhs) { new (&v_) T(rhs); }
ErrorOr(const T&& rhs) { v_ = std::move(rhs); }
ErrorOr(const FlutterError& rhs) { new (&v_) FlutterError(rhs); }
ErrorOr(const FlutterError&& rhs) { v_ = std::move(rhs); }
ErrorOr(const T& rhs) : v_(rhs) {}
ErrorOr(const T&& rhs) : v_(std::move(rhs)) {}
ErrorOr(const FlutterError& rhs) : v_(rhs) {}
ErrorOr(const FlutterError&& rhs) : v_(std::move(rhs)) {}

bool has_error() const { return std::holds_alternative<FlutterError>(v_); }
const T& value() const { return std::get<T>(v_); };
Expand All @@ -64,7 +64,7 @@ class UrlLauncherApi {
public:
UrlLauncherApi(const UrlLauncherApi&) = delete;
UrlLauncherApi& operator=(const UrlLauncherApi&) = delete;
virtual ~UrlLauncherApi(){};
virtual ~UrlLauncherApi() {}
virtual ErrorOr<bool> CanLaunchUrl(const std::string& url) = 0;
virtual std::optional<FlutterError> LaunchUrl(const std::string& url) = 0;

Expand All @@ -80,7 +80,5 @@ class UrlLauncherApi {
protected:
UrlLauncherApi() = default;
};

} // namespace url_launcher_windows

#endif // PIGEON_H_
#endif // PIGEON_MESSAGES_G_H_