Namespace-qualifying things in WTF

35 views
Skip to first unread message

Daniel Cheng

unread,
Dec 5, 2016, 1:20:38 PM12/5/16
to platform-architecture-dev, Łukasz Anforowicz
Does anyone know why we historically don't namespace-qualify WTF things and just import them into the global namespace?

This is causing a fair number of potential conflicts as we work on the Blink renaming:
- base::Passed and WTF::passed
- base::MakeUnique and WTF::makeUnique
- base::WrapUnique and WTF::wrapUnique
- and more

Daniel

Nico Weber

unread,
Dec 5, 2016, 1:22:28 PM12/5/16
to Daniel Cheng, platform-architecture-dev, Łukasz Anforowicz

--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architecture-dev+unsub...@chromium.org.
To post to this group, send email to platform-architecture-dev@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CAF3XrKrRjw_mhygt-FgBWgWzOe7wArsM5G8wT8-HCM2q5cXLdA%40mail.gmail.com.

Daniel Cheng

unread,
Dec 5, 2016, 2:23:47 PM12/5/16
to Nico Weber, platform-architecture-dev, Łukasz Anforowicz
Would anyone object to removing the using WTF::x statements in various WTF headers so we consistently namespace qualify all things in WTF, rather than inconsistently requiring namespace qualification for only some things?

On Mon, Dec 5, 2016 at 10:22 AM Nico Weber <tha...@chromium.org> wrote:

On Mon, Dec 5, 2016 at 1:20 PM, Daniel Cheng <dch...@chromium.org> wrote:
Does anyone know why we historically don't namespace-qualify WTF things and just import them into the global namespace?

This is causing a fair number of potential conflicts as we work on the Blink renaming:
- base::Passed and WTF::passed
- base::MakeUnique and WTF::makeUnique
- base::WrapUnique and WTF::wrapUnique
- and more

Daniel

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

Kentaro Hara

unread,
Dec 5, 2016, 7:25:53 PM12/5/16
to Daniel Cheng, Nico Weber, platform-architecture-dev, Łukasz Anforowicz
Would anyone object to removing the using WTF::x statements in various WTF headers so we consistently namespace qualify all things in WTF, rather than inconsistently requiring namespace qualification for only some things?

+1 to removing the using statements.


On Tue, Dec 6, 2016 at 4:23 AM, Daniel Cheng <dch...@chromium.org> wrote:
Would anyone object to removing the using WTF::x statements in various WTF headers so we consistently namespace qualify all things in WTF, rather than inconsistently requiring namespace qualification for only some things?
On Mon, Dec 5, 2016 at 10:22 AM Nico Weber <tha...@chromium.org> wrote:

On Mon, Dec 5, 2016 at 1:20 PM, Daniel Cheng <dch...@chromium.org> wrote:
Does anyone know why we historically don't namespace-qualify WTF things and just import them into the global namespace?

This is causing a fair number of potential conflicts as we work on the Blink renaming:
- base::Passed and WTF::passed
- base::MakeUnique and WTF::makeUnique
- base::WrapUnique and WTF::wrapUnique
- and more

Daniel

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

--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architecture-dev+unsub...@chromium.org.
To post to this group, send email to platform-architecture-dev@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CAF3XrKqDJPeU%3Drac1xQEPD_OAZtab3mr%2B2b42xj2wSx6kC%3D%3DpQ%40mail.gmail.com.



--
Kentaro Hara, Tokyo, Japan

Elliott Sprehn

unread,
Dec 5, 2016, 7:41:32 PM12/5/16
to Kentaro Hara, Daniel Cheng, Nico Weber, platform-architecture-dev, Łukasz Anforowicz
I assume we're going to rename the namespace to lowercase "wtf::" at the same time?


On Mon, Dec 5, 2016 at 4:25 PM, Kentaro Hara <har...@chromium.org> wrote:
Would anyone object to removing the using WTF::x statements in various WTF headers so we consistently namespace qualify all things in WTF, rather than inconsistently requiring namespace qualification for only some things?

+1 to removing the using statements.

On Tue, Dec 6, 2016 at 4:23 AM, Daniel Cheng <dch...@chromium.org> wrote:
Would anyone object to removing the using WTF::x statements in various WTF headers so we consistently namespace qualify all things in WTF, rather than inconsistently requiring namespace qualification for only some things?
On Mon, Dec 5, 2016 at 10:22 AM Nico Weber <tha...@chromium.org> wrote:

On Mon, Dec 5, 2016 at 1:20 PM, Daniel Cheng <dch...@chromium.org> wrote:
Does anyone know why we historically don't namespace-qualify WTF things and just import them into the global namespace?

This is causing a fair number of potential conflicts as we work on the Blink renaming:
- base::Passed and WTF::passed
- base::MakeUnique and WTF::makeUnique
- base::WrapUnique and WTF::wrapUnique
- and more

Daniel

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

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

To post to this group, send email to platform-architecture-dev@chromium.org.
--
Kentaro Hara, Tokyo, Japan

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

To post to this group, send email to platform-architecture-dev@chromium.org.

Daniel Cheng

unread,
Dec 5, 2016, 8:03:12 PM12/5/16
to Elliott Sprehn, Kentaro Hara, Nico Weber, platform-architecture-dev, Łukasz Anforowicz
On Mon, Dec 5, 2016 at 4:41 PM Elliott Sprehn <esp...@chromium.org> wrote:
I assume we're going to rename the namespace to lowercase "wtf::" at the same time?

Sure, if that's what wtf OWNERS would prefer: it would certainly be more consistent.

Daniel
 


On Mon, Dec 5, 2016 at 4:25 PM, Kentaro Hara <har...@chromium.org> wrote:
Would anyone object to removing the using WTF::x statements in various WTF headers so we consistently namespace qualify all things in WTF, rather than inconsistently requiring namespace qualification for only some things?

+1 to removing the using statements.

On Tue, Dec 6, 2016 at 4:23 AM, Daniel Cheng <dch...@chromium.org> wrote:
Would anyone object to removing the using WTF::x statements in various WTF headers so we consistently namespace qualify all things in WTF, rather than inconsistently requiring namespace qualification for only some things?
On Mon, Dec 5, 2016 at 10:22 AM Nico Weber <tha...@chromium.org> wrote:

On Mon, Dec 5, 2016 at 1:20 PM, Daniel Cheng <dch...@chromium.org> wrote:
Does anyone know why we historically don't namespace-qualify WTF things and just import them into the global namespace?

This is causing a fair number of potential conflicts as we work on the Blink renaming:
- base::Passed and WTF::passed
- base::MakeUnique and WTF::makeUnique
- base::WrapUnique and WTF::wrapUnique
- and more

Daniel

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

--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architect...@chromium.org.
To post to this group, send email to platform-arc...@chromium.org.
--
Kentaro Hara, Tokyo, Japan

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

Kentaro Hara

unread,
Dec 5, 2016, 8:08:03 PM12/5/16
to Daniel Cheng, Elliott Sprehn, Nico Weber, platform-architecture-dev, Łukasz Anforowicz
On Tue, Dec 6, 2016 at 10:03 AM, Daniel Cheng <dch...@chromium.org> wrote:
On Mon, Dec 5, 2016 at 4:41 PM Elliott Sprehn <esp...@chromium.org> wrote:
I assume we're going to rename the namespace to lowercase "wtf::" at the same time?

Sure, if that's what wtf OWNERS would prefer: it would certainly be more consistent.

+1

Also our plan is to merge wtf/ into platform/wtf/, keeping the wtf:: namespace. In long term, each platform/xxx/ will have a xxx:: namespace.


 

Daniel
 


On Mon, Dec 5, 2016 at 4:25 PM, Kentaro Hara <har...@chromium.org> wrote:
Would anyone object to removing the using WTF::x statements in various WTF headers so we consistently namespace qualify all things in WTF, rather than inconsistently requiring namespace qualification for only some things?

+1 to removing the using statements.

On Tue, Dec 6, 2016 at 4:23 AM, Daniel Cheng <dch...@chromium.org> wrote:
Would anyone object to removing the using WTF::x statements in various WTF headers so we consistently namespace qualify all things in WTF, rather than inconsistently requiring namespace qualification for only some things?
On Mon, Dec 5, 2016 at 10:22 AM Nico Weber <tha...@chromium.org> wrote:

On Mon, Dec 5, 2016 at 1:20 PM, Daniel Cheng <dch...@chromium.org> wrote:
Does anyone know why we historically don't namespace-qualify WTF things and just import them into the global namespace?

This is causing a fair number of potential conflicts as we work on the Blink renaming:
- base::Passed and WTF::passed
- base::MakeUnique and WTF::makeUnique
- base::WrapUnique and WTF::wrapUnique
- and more

Daniel

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

--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architecture-dev+unsub...@chromium.org.
To post to this group, send email to platform-architecture-dev@chromium.org.
--
Kentaro Hara, Tokyo, Japan

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

luk...@chromium.org

unread,
Dec 5, 2016, 8:15:35 PM12/5/16
to platform-architecture-dev, har...@chromium.org, dch...@chromium.org, tha...@chromium.org, luk...@chromium.org
On Monday, December 5, 2016 at 4:41:32 PM UTC-8, Elliott Sprehn wrote:
I assume we're going to rename the namespace to lowercase "wtf::" at the same time?

I am not sure what "the same time" means.  I like the idea to rename WTF namespace to wtf, but I think this renaming is independent (and should be landed in a separate CL) from changes that 1) add WTF:: namespace qualifier to some WTF function calls (like https://codereview.chromium.org/2547053003) and 2) from the work to enable renaming Blink entities to Chromium naming style (i.e. the work tracked in https://crbug.com/578344).


On Mon, Dec 5, 2016 at 4:25 PM, Kentaro Hara <har...@chromium.org> wrote:
Would anyone object to removing the using WTF::x statements in various WTF headers so we consistently namespace qualify all things in WTF, rather than inconsistently requiring namespace qualification for only some things?

+1 to removing the using statements.

On Tue, Dec 6, 2016 at 4:23 AM, Daniel Cheng <dch...@chromium.org> wrote:
Would anyone object to removing the using WTF::x statements in various WTF headers so we consistently namespace qualify all things in WTF, rather than inconsistently requiring namespace qualification for only some things?
On Mon, Dec 5, 2016 at 10:22 AM Nico Weber <tha...@chromium.org> wrote:

On Mon, Dec 5, 2016 at 1:20 PM, Daniel Cheng <dch...@chromium.org> wrote:
Does anyone know why we historically don't namespace-qualify WTF things and just import them into the global namespace?

This is causing a fair number of potential conflicts as we work on the Blink renaming:
- base::Passed and WTF::passed
- base::MakeUnique and WTF::makeUnique
- base::WrapUnique and WTF::wrapUnique
- and more

Daniel

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

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

To post to this group, send email to platform-architecture-dev@chromium.org.
--
Kentaro Hara, Tokyo, Japan

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

To post to this group, send email to platform-architecture-dev@chromium.org.

Elliott Sprehn

unread,
Dec 5, 2016, 8:18:45 PM12/5/16
to Łukasz Anforowicz, platform-architecture-dev, Kentaro Hara, dch...@chromium.org, Nico Weber
On Mon, Dec 5, 2016 at 5:15 PM, <luk...@chromium.org> wrote:
On Monday, December 5, 2016 at 4:41:32 PM UTC-8, Elliott Sprehn wrote:
I assume we're going to rename the namespace to lowercase "wtf::" at the same time?

I am not sure what "the same time" means.  I like the idea to rename WTF namespace to wtf, but I think this renaming is independent (and should be landed in a separate CL) from changes that 1) add WTF:: namespace qualifier to some WTF function calls (like https://codereview.chromium.org/2547053003) and 2) from the work to enable renaming Blink entities to Chromium naming style (i.e. the work tracked in https://crbug.com/578344).

I meant step 2. If we're going to rename every function in the codebase we should be able to rename WTF -> wtf at the same time. Touching essentially every file everywhere twice just to rename WTF -> wtf after the huge rename seems much worse.
 


On Mon, Dec 5, 2016 at 4:25 PM, Kentaro Hara <har...@chromium.org> wrote:
Would anyone object to removing the using WTF::x statements in various WTF headers so we consistently namespace qualify all things in WTF, rather than inconsistently requiring namespace qualification for only some things?

+1 to removing the using statements.

On Tue, Dec 6, 2016 at 4:23 AM, Daniel Cheng <dch...@chromium.org> wrote:
Would anyone object to removing the using WTF::x statements in various WTF headers so we consistently namespace qualify all things in WTF, rather than inconsistently requiring namespace qualification for only some things?
On Mon, Dec 5, 2016 at 10:22 AM Nico Weber <tha...@chromium.org> wrote:

On Mon, Dec 5, 2016 at 1:20 PM, Daniel Cheng <dch...@chromium.org> wrote:
Does anyone know why we historically don't namespace-qualify WTF things and just import them into the global namespace?

This is causing a fair number of potential conflicts as we work on the Blink renaming:
- base::Passed and WTF::passed
- base::MakeUnique and WTF::makeUnique
- base::WrapUnique and WTF::wrapUnique
- and more

Daniel

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

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

To post to this group, send email to platform-architecture-dev@chromium.org.
--
Kentaro Hara, Tokyo, Japan

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

To post to this group, send email to platform-architecture-dev@chromium.org.

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

dan...@chromium.org

unread,
Dec 5, 2016, 8:22:30 PM12/5/16
to Elliott Sprehn, Łukasz Anforowicz, platform-architecture-dev, Kentaro Hara, dch...@chromium.org, Nico Weber
On Mon, Dec 5, 2016 at 5:18 PM, Elliott Sprehn <esp...@chromium.org> wrote:

On Mon, Dec 5, 2016 at 5:15 PM, <luk...@chromium.org> wrote:
On Monday, December 5, 2016 at 4:41:32 PM UTC-8, Elliott Sprehn wrote:
I assume we're going to rename the namespace to lowercase "wtf::" at the same time?

I am not sure what "the same time" means.  I like the idea to rename WTF namespace to wtf, but I think this renaming is independent (and should be landed in a separate CL) from changes that 1) add WTF:: namespace qualifier to some WTF function calls (like https://codereview.chromium.org/2547053003) and 2) from the work to enable renaming Blink entities to Chromium naming style (i.e. the work tracked in https://crbug.com/578344).

I meant step 2. If we're going to rename every function in the codebase we should be able to rename WTF -> wtf at the same time. Touching essentially every file everywhere twice just to rename WTF -> wtf after the huge rename seems much worse.

While it can be done we should be very wary of continuing to increase the number of things that need to be done here lest we never complete the conversion. Our hyperblame tool allows us to do things in multiple CLs (this renaming of the world will already be done with multiple CLs AFAIK since we must reformat again after and this makes both steps clear), so there's no need to hyper optimize to make all possible naming fixes into a single step I think.
 
 

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

Elliott Sprehn

unread,
Dec 5, 2016, 8:25:34 PM12/5/16
to Dana Jansens, Łukasz Anforowicz, platform-architecture-dev, Kentaro Hara, dch...@chromium.org, Nico Weber
On Mon, Dec 5, 2016 at 5:22 PM, <dan...@chromium.org> wrote:
On Mon, Dec 5, 2016 at 5:18 PM, Elliott Sprehn <esp...@chromium.org> wrote:

On Mon, Dec 5, 2016 at 5:15 PM, <luk...@chromium.org> wrote:
On Monday, December 5, 2016 at 4:41:32 PM UTC-8, Elliott Sprehn wrote:
I assume we're going to rename the namespace to lowercase "wtf::" at the same time?

I am not sure what "the same time" means.  I like the idea to rename WTF namespace to wtf, but I think this renaming is independent (and should be landed in a separate CL) from changes that 1) add WTF:: namespace qualifier to some WTF function calls (like https://codereview.chromium.org/2547053003) and 2) from the work to enable renaming Blink entities to Chromium naming style (i.e. the work tracked in https://crbug.com/578344).

I meant step 2. If we're going to rename every function in the codebase we should be able to rename WTF -> wtf at the same time. Touching essentially every file everywhere twice just to rename WTF -> wtf after the huge rename seems much worse.

While it can be done we should be very wary of continuing to increase the number of things that need to be done here lest we never complete the conversion. Our hyperblame tool allows us to do things in multiple CLs (this renaming of the world will already be done with multiple CLs AFAIK since we must reformat again after and this makes both steps clear), so there's no need to hyper optimize to make all possible naming fixes into a single step I think.

Gitiles still doesn't support hyperblame. I had to jump over the previous reformat 5+ times today while trying to understand code for various things. :(

I guess back to the original discussion here, I would object to adding WTF:: to the beginning of everything because I think it makes the code much harder to read with it shouting WTF everywhere. I would prefer we rename to lowercase first, or have a plan to make that happen quickly.

Kentaro Hara

unread,
Dec 5, 2016, 8:28:41 PM12/5/16
to Elliott Sprehn, Dana Jansens, Łukasz Anforowicz, platform-architecture-dev, dch...@chromium.org, Nico Weber
Just to clarify: You don't like having a "WTF::" prefix here and there in the code base but are fine with having a "wtf::" prefix, right?


Elliott Sprehn

unread,
Dec 5, 2016, 8:34:03 PM12/5/16
to Kentaro Hara, Dana Jansens, Łukasz Anforowicz, platform-architecture-dev, dch...@chromium.org, Nico Weber
On Mon, Dec 5, 2016 at 5:28 PM, Kentaro Hara <har...@chromium.org> wrote:
Just to clarify: You don't like having a "WTF::" prefix here and there in the code base but are fine with having a "wtf::" prefix, right?

Yeah, WTF::String vs wtf::String. In general I'm worried in the quest for conformity here we're increasing the noise per line across the entire codebase.

For a number of functions this means we end up with "WTF" on lines all over the place.



To unsubscribe from this group and stop receiving emails from it, send an email to platform-architecture-dev+unsub...@chromium.org.

To post to this group, send email to platform-architecture-dev@chromium.org.
Reply all
Reply to author
Forward
0 new messages