PSA: Disallowing raw pointers on WTF::bind and blink::threadSafeBind

38 views
Skip to first unread message

Taiju Tsuiki

unread,
Jun 27, 2016, 12:18:17 AM6/27/16
to blink-dev, Hiroshige Hayashizaki
Hi, blink devs.

I'm about to land a CL to disallow raw pointers on WTF::bind and blink::threadSafeBind.
After the change landed, raw pointers hit a static_assert in wtf/Functional.h. All existing usage of raw pointers are already replaced.

If you see the error on a new code or an in-flight code, please wrap the raw pointers explicitly with either: Persistent, CrossThreadPersistent, WeakPersistent, CrossThreadWeakPersistent, RefPtr, unretained, or crossThreadUnretained.

--
立木 泰樹 (Taiju Tsuiki, tzik)
tz...@google.com

Kentaro Hara

unread,
Jun 27, 2016, 12:23:00 AM6/27/16
to Taiju Tsuiki, blink-dev, Hiroshige Hayashizaki
This is a great improvement.

Can we create an md file that explains pointer types used in WTF::bind?


--
Kentaro Hara, Tokyo, Japan

Kouhei Ueno

unread,
Jun 27, 2016, 12:26:47 AM6/27/16
to Kentaro Hara, Taiju Tsuiki, blink-dev, Hiroshige Hayashizaki
Thanks for the work! This really clarifies the confusing behaviors of bind variants.

The BlinkOn6 slides are great! Should we have a link to the slide as a comment?

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.



--
Kouhei Ueno

Kinuko Yasuda

unread,
Jun 27, 2016, 12:38:22 AM6/27/16
to Kouhei Ueno, Kentaro Hara, Taiju Tsuiki, blink-dev, Hiroshige Hayashizaki
Really nice improvement, and +1000 to have some easy-to-refer documentation, which could be just a copy-paste of the tables in the awesome BlinkOn6 slides.


Reply all
Reply to author
Forward
0 new messages