StringViews and generated code

872 views
Skip to first unread message

Dave Tapuska

unread,
Oct 10, 2024, 1:57:59 PM10/10/24
to chromium-mojo
Anyone thought about changing the bindings generator to using std::string_view and WTF::StringView instead of std::string and WTF::String?

I have one specific case where I have a const char* that I then have to promote to a WTF::String to pass into the bindings API. I haven't seen how many are like this. I thought I'd just ask if anyone explored it.

dave.

Daniel Cheng

unread,
Oct 10, 2024, 2:13:57 PM10/10/24
to Dave Tapuska, chromium-mojo
Can you give a concrete example? I know there are definitely mixed feelings about the Blink variants, but I'm having trouble following this specific request.

Daniel

--
You received this message because you are subscribed to the Google Groups "chromium-mojo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-moj...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-mojo/CAHgVhZWpdD0PcBM1BXZCa_yF9CJyAme14%2BoZKhZYRfaMHAd9ew%40mail.gmail.com.

Dave Tapuska

unread,
Oct 10, 2024, 2:17:30 PM10/10/24
to Daniel Cheng, chromium-mojo
It is really minor, but I figured I'd ask. Here is the code I had to write to materialize a blink::EnumerationBase into a String: https://chromium-review.googlesource.com/c/chromium/src/+/5919758/1/third_party/blink/renderer/core/frame/reporting_context.cc
Reply all
Reply to author
Forward
0 new messages