Proposal: Remove "WTF" namespace

49 views
Skip to first unread message

TAMURA, Kent

unread,
Jun 3, 2025, 9:05:20 PMJun 3
to Nico Weber, Michael Lippautz, Kentaro Hara, platform-architecture-dev
Hi WTF owners and platform-architeture-dev@,

I am proposing the removal of the "WTF" namespace and its merger into the "blink" namespace.

Here are the reasons for this proposal:

  • There is no significant advantage to distinguishing between the blink and WTF namespaces.
    Historically, the WTF namespace was created in WebKit to house common code between the JSC and WebCore namespaces.  That is not the case in Chromium.
  • According to the Google C++ style guide, namespace names should be lowercase, so "WTF" would need to be changed regardless.
  • Many WTF symbols are brought into the global namespace by using WTF::Foo in header files, which pollutes the global namespace. While this practice should stop, adding the WTF:: prefix to all call sites in Blink would be a significant effort. By merging WTF into the blink namespace, we can mitigate the impact on existing code.

Are there any comments on this proposal?


A relevant thread: https://groups.google.com/a/chromium.org/g/platform-architecture-dev/c/DU2xiGoTHOE/m/4AV1wmoYCwAJ



--
TAMURA Kent
Software Engineer, Google


Kentaro Hara

unread,
Jun 3, 2025, 9:10:06 PMJun 3
to TAMURA, Kent, Nico Weber, Michael Lippautz, platform-architecture-dev
LGTM.

(I have a question about the importance of the work but that's a separate question to be resolved in your team. Technically, no objection :-)


--
Kentaro Hara, Tokyo

Michael Lippautz

unread,
Jun 4, 2025, 2:45:30 AMJun 4
to Kentaro Hara, TAMURA, Kent, Nico Weber, Michael Lippautz, platform-architecture-dev
lgtm

Are you intending to keep the folder name there? One could argue that this could be e.g.platform/base. (Not suggesting that this needs to be done now though.)

Nico Weber

unread,
Jun 4, 2025, 8:24:21 AMJun 4
to Michael Lippautz, Kentaro Hara, TAMURA, Kent, platform-architecture-dev
lgtm

TAMURA, Kent

unread,
Jun 5, 2025, 9:40:48 PMJun 5
to Nico Weber, Michael Lippautz, Kentaro Hara, platform-architecture-dev
Thanks for the feedback.
Since there are no objections, I'll assume we have an agreement to remove the WTF namespace. The tracking bug for this task is crbug.com/422768753.


On Wed, Jun 4, 2025 at 9:24 PM Nico Weber <tha...@chromium.org> wrote:
lgtm

On Wed, Jun 4, 2025, 2:45 AM Michael Lippautz <mlip...@chromium.org> wrote:
lgtm

Are you intending to keep the folder name there? One could argue that this could be e.g.platform/base. (Not suggesting that this needs to be done now though.)

For now, I am not planning to change the platform/wtf/ directory name. This task will only affect the namespace within the code.

 

On Wed, Jun 4, 2025 at 3:10 AM Kentaro Hara <har...@chromium.org> wrote:
LGTM.

(I have a question about the importance of the work but that's a separate question to be resolved in your team. Technically, no objection :-)

I don't believe we need to formally assign anyone to this task, as the workload isn't large and it can be done incrementally. It should be manageable to work on this during downtime, such as while waiting for code reviews on main projects, or as a 20% time project.

 



On Wed, Jun 4, 2025 at 10:05 AM TAMURA, Kent <tk...@chromium.org> wrote:
Hi WTF owners and platform-architeture-dev@,

I am proposing the removal of the "WTF" namespace and its merger into the "blink" namespace.

Here are the reasons for this proposal:

  • There is no significant advantage to distinguishing between the blink and WTF namespaces.
    Historically, the WTF namespace was created in WebKit to house common code between the JSC and WebCore namespaces.  That is not the case in Chromium.
  • According to the Google C++ style guide, namespace names should be lowercase, so "WTF" would need to be changed regardless.
  • Many WTF symbols are brought into the global namespace by using WTF::Foo in header files, which pollutes the global namespace. While this practice should stop, adding the WTF:: prefix to all call sites in Blink would be a significant effort. By merging WTF into the blink namespace, we can mitigate the impact on existing code.

Are there any comments on this proposal?


A relevant thread: https://groups.google.com/a/chromium.org/g/platform-architecture-dev/c/DU2xiGoTHOE/m/4AV1wmoYCwAJ



--
TAMURA Kent
Software Engineer, Google




--
Kentaro Hara, Tokyo

Daniel Cheng

unread,
Jul 26, 2025, 1:04:13 AMJul 26
to TAMURA, Kent, Nico Weber, Michael Lippautz, Kentaro Hara, platform-architecture-dev
Btw, is anyone updating the Blink GC plugin? It has some hardcoded references to WTF:: types; we'll need to update those right?


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 view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CAGH7WqE1N_zDzbkDLOtmr-4KvGhUimJWHfTKYo%3DP4MLp2kFoMw%40mail.gmail.com.

Michael Lippautz

unread,
Jul 26, 2025, 4:49:47 AMJul 26
to Daniel Cheng, Omer Katz, TAMURA, Kent, Nico Weber, Michael Lippautz, Kentaro Hara, platform-architecture-dev
On Sat, Jul 26, 2025 at 7:04 AM Daniel Cheng <dch...@chromium.org> wrote:
Btw, is anyone updating the Blink GC plugin? It has some hardcoded references to WTF:: types; we'll need to update those right?



For GC-related stuff, yes, @Omer Katz 

Omer Katz (chromium.org)

unread,
Jul 26, 2025, 4:51:45 AMJul 26
to Michael Lippautz, Daniel Cheng, TAMURA, Kent, Nico Weber, Kentaro Hara, platform-architecture-dev
Kent is already handling that in crrev.com/c/6786468.
Reply all
Reply to author
Forward
0 new messages