Limit thread name appropriately
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Jan 2017 02:53:00 +0000 (02:53 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Jan 2017 02:53:00 +0000 (02:53 +0000)
commit5e56de0cd3eee8a21adec45bdf6fcd9e4c69f948
tree0e45bfb2ec4c929dd2702e50c0bd5e45c46d0207
parent6f9b70ed427f01767b126170f375265f5e02f3ce
Limit thread name appropriately
https://bugs.webkit.org/show_bug.cgi?id=166676

Reviewed by Sam Weinig.

Source/WTF:

In some platform, the max length of thread names are limited.
For example, the number of the max length is 32 in Windows and
16 in Linux. But the specified thread name is typically long
in WebKit like "com.apple.CoreIPC.ReceiveQueue"

We port the logic substring the thread name in
generic/WorkQueueGeneric.cpp to Threading. It retrieves the name
"ReceiveQueue" from "com.apple.CoreIPC.ReceiveQueue". And apply
the appropriate the thread name limit and use it on Linux and
Windows environment.

* wtf/Threading.cpp:
(WTF::normalizeThreadName):
(WTF::createThread):
* wtf/Threading.h:
* wtf/ThreadingPthreads.cpp:
(WTF::initializeCurrentThreadInternal):
* wtf/ThreadingWin.cpp:
(WTF::initializeCurrentThreadInternal):
* wtf/generic/WorkQueueGeneric.cpp:
(WorkQueue::platformInitialize):
* wtf/text/StringView.h:
(WTF::StringView::left):
(WTF::StringView::right):
(WTF::StringView::reverseFind):

Tools:

* TestWebKitAPI/Tests/WTF/StringView.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WTF/WTFString.cpp:
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210313 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WTF/ChangeLog
Source/WTF/wtf/Threading.cpp
Source/WTF/wtf/Threading.h
Source/WTF/wtf/ThreadingPthreads.cpp
Source/WTF/wtf/ThreadingWin.cpp
Source/WTF/wtf/generic/WorkQueueGeneric.cpp
Source/WTF/wtf/text/StringView.h
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WTF/StringView.cpp
Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp