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

Commit 2e3bc80

Browse files
authored
Apply internal cl for C++20 prep (#37266)
1 parent 2cbe38b commit 2e3bc80

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

lib/ui/painting/image.cc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@ namespace flutter {
1818
typedef CanvasImage Image;
1919

2020
// Since _Image is a private class, we can't use IMPLEMENT_WRAPPERTYPEINFO
21-
static const tonic::DartWrapperInfo kDartWrapperInfoUIImage = {
22-
"ui",
23-
"_Image",
24-
};
21+
static const tonic::DartWrapperInfo kDartWrapperInfoUIImage("ui", "_Image");
2522
const tonic::DartWrapperInfo& Image::dart_wrapper_info_ =
2623
kDartWrapperInfoUIImage;
2724

third_party/tonic/dart_wrappable.h

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,10 @@ class DartWrappable {
7575
private: \
7676
static const tonic::DartWrapperInfo& dart_wrapper_info_
7777

78-
#define IMPLEMENT_WRAPPERTYPEINFO(LibraryName, ClassName) \
79-
static const tonic::DartWrapperInfo \
80-
kDartWrapperInfo_##LibraryName_##ClassName = { \
81-
#LibraryName, \
82-
#ClassName, \
83-
}; \
84-
const tonic::DartWrapperInfo& ClassName::dart_wrapper_info_ = \
78+
#define IMPLEMENT_WRAPPERTYPEINFO(LibraryName, ClassName) \
79+
static const tonic::DartWrapperInfo \
80+
kDartWrapperInfo_##LibraryName_##ClassName(#LibraryName, #ClassName); \
81+
const tonic::DartWrapperInfo& ClassName::dart_wrapper_info_ = \
8582
kDartWrapperInfo_##LibraryName_##ClassName;
8683

8784
struct DartConverterWrappable {

third_party/tonic/dart_wrapper_info.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ struct DartWrapperInfo {
1616
const char* library_name;
1717
const char* interface_name;
1818

19+
DartWrapperInfo(const char* library_name, const char* interface_name)
20+
: library_name(library_name), interface_name(interface_name) {}
21+
1922
private:
2023
DartWrapperInfo(const DartWrapperInfo&) = delete;
2124
DartWrapperInfo& operator=(const DartWrapperInfo&) = delete;

0 commit comments

Comments
 (0)