Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Apply internal cl for C++20 prep #37266

Merged
merged 2 commits into from
Nov 3, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions lib/ui/painting/image.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ namespace flutter {
typedef CanvasImage Image;

// Since _Image is a private class, we can't use IMPLEMENT_WRAPPERTYPEINFO
static const tonic::DartWrapperInfo kDartWrapperInfoUIImage = {
"ui",
"_Image",
};
static const tonic::DartWrapperInfo kDartWrapperInfoUIImage("ui", "_Image");
const tonic::DartWrapperInfo& Image::dart_wrapper_info_ =
kDartWrapperInfoUIImage;

Expand Down
11 changes: 4 additions & 7 deletions third_party/tonic/dart_wrappable.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,10 @@ class DartWrappable {
private: \
static const tonic::DartWrapperInfo& dart_wrapper_info_

#define IMPLEMENT_WRAPPERTYPEINFO(LibraryName, ClassName) \
static const tonic::DartWrapperInfo \
kDartWrapperInfo_##LibraryName_##ClassName = { \
#LibraryName, \
#ClassName, \
}; \
const tonic::DartWrapperInfo& ClassName::dart_wrapper_info_ = \
#define IMPLEMENT_WRAPPERTYPEINFO(LibraryName, ClassName) \
static const tonic::DartWrapperInfo \
kDartWrapperInfo_##LibraryName_##ClassName(#LibraryName, #ClassName); \
const tonic::DartWrapperInfo& ClassName::dart_wrapper_info_ = \
kDartWrapperInfo_##LibraryName_##ClassName;

struct DartConverterWrappable {
Expand Down
3 changes: 3 additions & 0 deletions third_party/tonic/dart_wrapper_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ struct DartWrapperInfo {
const char* library_name;
const char* interface_name;

DartWrapperInfo(const char* library_name, const char* interface_name)
: library_name(library_name), interface_name(interface_name) {}

private:
DartWrapperInfo(const DartWrapperInfo&) = delete;
DartWrapperInfo& operator=(const DartWrapperInfo&) = delete;
Expand Down