base/numerics in Blink

16 views
Skip to first unread message

Ken Russell

unread,
Jun 21, 2018, 10:03:10 PM6/21/18
to blink-dev
Can we please add an exception to Blink's include rules to allow inclusion of headers in base/numerics/ and use of those symbols?

Platform code like LayoutUnit already uses base::saturated_cast, which is the conversion routine I want to be able to call to fix an undefined behavior bug. It's painful to not be able to call it directly from code outside the platform/ directories.

Thanks,

-Ken

Kentaro Hara

unread,
Jun 21, 2018, 10:08:06 PM6/21/18
to Kenneth Russell, Adithya Srinivasan, blink-dev
+1. This makes a lot of sense.

FWIW adithyas@ is now removing platform/wtf/checked_numeric.h in favor of base/numerics/ :)



--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAMYvS2fjYqEvy3CPgJYvLkC_aHo7Rz2e%3D1QWNi%3D0a%3DKA3cwM%3DQ%40mail.gmail.com.


--
Kentaro Hara, Tokyo, Japan

Ken Russell

unread,
Jun 21, 2018, 10:25:52 PM6/21/18
to Kentaro Hara, adit...@chromium.org, blink-dev
Fantastic. Thanks.

FYI to others, https://chromium-review.googlesource.com/1109267 up for review adding access to this header in Blink.

-Ken

Kentaro Hara

unread,
Jun 21, 2018, 10:44:26 PM6/21/18
to Kenneth Russell, Adithya Srinivasan, blink-dev
BTW if you want to allow more //base/ types in Blink, feel free to let platform-architecture-dev@ know. We're happy to support :) We're aiming at unifying as many types between Chromium and Blink as possible (except a couple of types that really need to be optimized for Blink; e.g., Vector, HashTable, String).
Reply all
Reply to author
Forward
0 new messages