[JSC] Less contended MetaAllocator
[WebKit-https.git] / Source / WTF / ChangeLog
1 2019-08-14  Yusuke Suzuki  <ysuzuki@apple.com>
2
3         [JSC] Less contended MetaAllocator
4         https://bugs.webkit.org/show_bug.cgi?id=200278
5
6         Reviewed by Mark Lam.
7
8         * wtf/MetaAllocator.cpp:
9         (WTF::MetaAllocator::incrementPageOccupancy):
10         (WTF::MetaAllocator::decrementPageOccupancy):
11         * wtf/MetaAllocator.h:
12
13 2019-08-14  Samuel Groß  <saelo@google.com>
14
15         [JSCOnly] JSCOnly port doesn't build on macOS
16         https://bugs.webkit.org/show_bug.cgi?id=200667
17
18         spi/darwin/ProcessMemoryFootprint.h is required by jsc.cpp so we add it to the WTF_PUBLIC_HEADERS.
19
20         Reviewed by Alex Christensen.
21
22         * wtf/PlatformJSCOnly.cmake:
23         * wtf/PlatformMac.cmake:
24
25 2019-08-13  Sam Weinig  <weinig@apple.com>
26
27         Rename StringBuilder::append(UChar32) to StringBuilder::appendCharacter(UChar32) to avoid accidental change in behavior when replacing append with flexibleAppend
28         https://bugs.webkit.org/show_bug.cgi?id=200675
29
30         Reviewed by Darin Adler.
31
32         When we switch StringBuilder::append(...) to be based on the StringConcatenate/makeString flexibleAppend 
33         implementation, if we don't change anything, the behavior of StringBuilder::append(UChar32) will go from 
34         appending a character to appending a stringified number.
35
36         To work around this, we can rename StringBuilder::append(UChar32) to StringBuilder::appendCharacter(UChar32) 
37         and update all the call sites.
38
39         * wtf/text/StringBuilder.h:
40         (WTF::StringBuilder::appendCharacter):
41         Renamed StringBuilder::append(UChar32) to StringBuilder::appendCharacter(UChar32).
42
43         * wtf/FileSystem.cpp:
44         (WTF::FileSystemImpl::decodeFromFilename):
45         Update for new name.
46
47 2019-08-13  Yusuke Suzuki  <ysuzuki@apple.com>
48
49         Unreviewed, build fix for Windows
50         https://bugs.webkit.org/show_bug.cgi?id=200611
51
52         * wtf/win/GDIObject.h:
53
54 2019-08-12  Takashi Komori  <Takashi.Komori@sony.com>
55
56         [WTF] Thread::removeFromThreadGroup leaks weak pointers.
57         https://bugs.webkit.org/show_bug.cgi?id=199857
58
59         Reviewed by Yusuke Suzuki.
60
61         Fix leaking of ThreadGroup's weak pointers.
62
63         Tests: WTF.ThreadGroupRemove API tests
64
65         * wtf/Threading.cpp:
66         (WTF::Thread::didExit):
67         (WTF::Thread::addToThreadGroup):
68         (WTF::Thread::removeFromThreadGroup):
69         (WTF::Thread::numberOfThreadGroups):
70         * wtf/Threading.h:
71
72 2019-08-12  Sam Weinig  <weinig@apple.com>
73
74         Replace multiparameter overloads of append() in StringBuilder as a first step toward standardizinging on the flexibleAppend() implementation
75         https://bugs.webkit.org/show_bug.cgi?id=200614
76
77         Reviewed by Darin Adler.
78
79         Renames StringBuilder::append(const LChar*, unsigned), StringBuilder::append(const UChar*, unsigned) and 
80         StringBuilder::append(const char*, unsigned) to StringBuilder::appendCharacters(...).
81         
82         Renames StringBuilder::append(const String& string, unsigned offset, unsigned length) to 
83         StringBuilder::appendSubstring(...).
84
85         * wtf/HexNumber.h:
86         (WTF::appendUnsignedAsHexFixedSize):
87         Add overload that explicitly takes a StringBuilder to work around rename from append to appendCharacters.
88
89         * wtf/text/StringBuilder.cpp:
90         (WTF::StringBuilder::appendCharacters):
91         (WTF::StringBuilder::append):
92         * wtf/text/StringBuilder.h:
93         (WTF::StringBuilder::appendCharacters):
94         (WTF::StringBuilder::append):
95         (WTF::StringBuilder::appendSubstring):
96         (WTF::StringBuilder::appendLiteral):
97         (WTF::IntegerToStringConversionTrait<StringBuilder>::flush):
98         Update for renames.
99
100 2019-08-12  Yusuke Suzuki  <ysuzuki@apple.com>
101
102         [WTF][JSC] Make JSC and WTF aggressively-fast-malloced
103         https://bugs.webkit.org/show_bug.cgi?id=200611
104
105         Reviewed by Saam Barati.
106
107         WTF has many data structures, in particular, containers. And these containers can be allocated like `std::make_unique<Container>()`.
108         Without WTF_MAKE_FAST_ALLOCATED, this container itself is allocated from the system malloc. This patch attaches WTF_MAKE_FAST_ALLOCATED
109         more aggressively not to allocate them from the system malloc. And we add some `final` to containers and classes that would be never inherited.
110
111         * wtf/Assertions.cpp:
112         * wtf/Atomics.h:
113         * wtf/AutodrainedPool.h:
114         * wtf/Bag.h:
115         (WTF::Bag::Bag): Deleted.
116         (WTF::Bag::~Bag): Deleted.
117         (WTF::Bag::clear): Deleted.
118         (WTF::Bag::add): Deleted.
119         (WTF::Bag::iterator::iterator): Deleted.
120         (WTF::Bag::iterator::operator! const): Deleted.
121         (WTF::Bag::iterator::operator* const): Deleted.
122         (WTF::Bag::iterator::operator++): Deleted.
123         (WTF::Bag::iterator::operator== const): Deleted.
124         (WTF::Bag::iterator::operator!= const): Deleted.
125         (WTF::Bag::begin): Deleted.
126         (WTF::Bag::begin const): Deleted.
127         (WTF::Bag::end const): Deleted.
128         (WTF::Bag::isEmpty const): Deleted.
129         (WTF::Bag::unwrappedHead const): Deleted.
130         * wtf/BitVector.h:
131         (WTF::BitVector::BitVector): Deleted.
132         (WTF::BitVector::~BitVector): Deleted.
133         (WTF::BitVector::operator=): Deleted.
134         (WTF::BitVector::size const): Deleted.
135         (WTF::BitVector::ensureSize): Deleted.
136         (WTF::BitVector::quickGet const): Deleted.
137         (WTF::BitVector::quickSet): Deleted.
138         (WTF::BitVector::quickClear): Deleted.
139         (WTF::BitVector::get const): Deleted.
140         (WTF::BitVector::contains const): Deleted.
141         (WTF::BitVector::set): Deleted.
142         (WTF::BitVector::add): Deleted.
143         (WTF::BitVector::ensureSizeAndSet): Deleted.
144         (WTF::BitVector::clear): Deleted.
145         (WTF::BitVector::remove): Deleted.
146         (WTF::BitVector::merge): Deleted.
147         (WTF::BitVector::filter): Deleted.
148         (WTF::BitVector::exclude): Deleted.
149         (WTF::BitVector::bitCount const): Deleted.
150         (WTF::BitVector::isEmpty const): Deleted.
151         (WTF::BitVector::findBit const): Deleted.
152         (WTF::BitVector::isEmptyValue const): Deleted.
153         (WTF::BitVector::isDeletedValue const): Deleted.
154         (WTF::BitVector::isEmptyOrDeletedValue const): Deleted.
155         (WTF::BitVector::operator== const): Deleted.
156         (WTF::BitVector::hash const): Deleted.
157         (WTF::BitVector::iterator::iterator): Deleted.
158         (WTF::BitVector::iterator::operator* const): Deleted.
159         (WTF::BitVector::iterator::operator++): Deleted.
160         (WTF::BitVector::iterator::isAtEnd const): Deleted.
161         (WTF::BitVector::iterator::operator== const): Deleted.
162         (WTF::BitVector::iterator::operator!= const): Deleted.
163         (WTF::BitVector::begin const): Deleted.
164         (WTF::BitVector::end const): Deleted.
165         (WTF::BitVector::bitsInPointer): Deleted.
166         (WTF::BitVector::maxInlineBits): Deleted.
167         (WTF::BitVector::byteCount): Deleted.
168         (WTF::BitVector::makeInlineBits): Deleted.
169         (WTF::BitVector::cleanseInlineBits): Deleted.
170         (WTF::BitVector::bitCount): Deleted.
171         (WTF::BitVector::findBitFast const): Deleted.
172         (WTF::BitVector::findBitSimple const): Deleted.
173         (WTF::BitVector::OutOfLineBits::numBits const): Deleted.
174         (WTF::BitVector::OutOfLineBits::numWords const): Deleted.
175         (WTF::BitVector::OutOfLineBits::bits): Deleted.
176         (WTF::BitVector::OutOfLineBits::bits const): Deleted.
177         (WTF::BitVector::OutOfLineBits::OutOfLineBits): Deleted.
178         (WTF::BitVector::isInline const): Deleted.
179         (WTF::BitVector::outOfLineBits const): Deleted.
180         (WTF::BitVector::outOfLineBits): Deleted.
181         (WTF::BitVector::bits): Deleted.
182         (WTF::BitVector::bits const): Deleted.
183         * wtf/Bitmap.h:
184         (WTF::Bitmap::size): Deleted.
185         (WTF::Bitmap::iterator::iterator): Deleted.
186         (WTF::Bitmap::iterator::operator* const): Deleted.
187         (WTF::Bitmap::iterator::operator++): Deleted.
188         (WTF::Bitmap::iterator::operator== const): Deleted.
189         (WTF::Bitmap::iterator::operator!= const): Deleted.
190         (WTF::Bitmap::begin const): Deleted.
191         (WTF::Bitmap::end const): Deleted.
192         * wtf/Box.h:
193         * wtf/BumpPointerAllocator.h:
194         * wtf/CPUTime.h:
195         * wtf/CheckedBoolean.h:
196         * wtf/CommaPrinter.h:
197         (WTF::CommaPrinter::CommaPrinter): Deleted.
198         (WTF::CommaPrinter::dump const): Deleted.
199         (WTF::CommaPrinter::didPrint const): Deleted.
200         * wtf/CompactPointerTuple.h:
201         (WTF::CompactPointerTuple::encodeType): Deleted.
202         (WTF::CompactPointerTuple::decodeType): Deleted.
203         (WTF::CompactPointerTuple::CompactPointerTuple): Deleted.
204         (WTF::CompactPointerTuple::pointer const): Deleted.
205         (WTF::CompactPointerTuple::setPointer): Deleted.
206         (WTF::CompactPointerTuple::type const): Deleted.
207         (WTF::CompactPointerTuple::setType): Deleted.
208         * wtf/CompilationThread.h:
209         (WTF::CompilationScope::CompilationScope): Deleted.
210         (WTF::CompilationScope::~CompilationScope): Deleted.
211         (WTF::CompilationScope::leaveEarly): Deleted.
212         * wtf/CompletionHandler.h:
213         (WTF::CompletionHandler<Out):
214         (WTF::Detail::CallableWrapper<CompletionHandler<Out):
215         (WTF::CompletionHandlerCallingScope::CompletionHandlerCallingScope): Deleted.
216         (WTF::CompletionHandlerCallingScope::~CompletionHandlerCallingScope): Deleted.
217         (WTF::CompletionHandlerCallingScope::CompletionHandler<void): Deleted.
218         * wtf/ConcurrentBuffer.h:
219         (WTF::ConcurrentBuffer::ConcurrentBuffer): Deleted.
220         (WTF::ConcurrentBuffer::~ConcurrentBuffer): Deleted.
221         (WTF::ConcurrentBuffer::growExact): Deleted.
222         (WTF::ConcurrentBuffer::grow): Deleted.
223         (WTF::ConcurrentBuffer::array const): Deleted.
224         (WTF::ConcurrentBuffer::operator[]): Deleted.
225         (WTF::ConcurrentBuffer::operator[] const): Deleted.
226         (WTF::ConcurrentBuffer::createArray): Deleted.
227         * wtf/ConcurrentPtrHashSet.h:
228         (WTF::ConcurrentPtrHashSet::contains): Deleted.
229         (WTF::ConcurrentPtrHashSet::add): Deleted.
230         (WTF::ConcurrentPtrHashSet::size const): Deleted.
231         (WTF::ConcurrentPtrHashSet::Table::maxLoad const): Deleted.
232         (WTF::ConcurrentPtrHashSet::hash): Deleted.
233         (WTF::ConcurrentPtrHashSet::cast): Deleted.
234         (WTF::ConcurrentPtrHashSet::containsImpl const): Deleted.
235         (WTF::ConcurrentPtrHashSet::addImpl): Deleted.
236         * wtf/ConcurrentVector.h:
237         (WTF::ConcurrentVector::~ConcurrentVector): Deleted.
238         (WTF::ConcurrentVector::size const): Deleted.
239         (WTF::ConcurrentVector::isEmpty const): Deleted.
240         (WTF::ConcurrentVector::at): Deleted.
241         (WTF::ConcurrentVector::at const): Deleted.
242         (WTF::ConcurrentVector::operator[]): Deleted.
243         (WTF::ConcurrentVector::operator[] const): Deleted.
244         (WTF::ConcurrentVector::first): Deleted.
245         (WTF::ConcurrentVector::first const): Deleted.
246         (WTF::ConcurrentVector::last): Deleted.
247         (WTF::ConcurrentVector::last const): Deleted.
248         (WTF::ConcurrentVector::takeLast): Deleted.
249         (WTF::ConcurrentVector::append): Deleted.
250         (WTF::ConcurrentVector::alloc): Deleted.
251         (WTF::ConcurrentVector::removeLast): Deleted.
252         (WTF::ConcurrentVector::grow): Deleted.
253         (WTF::ConcurrentVector::begin): Deleted.
254         (WTF::ConcurrentVector::end): Deleted.
255         (WTF::ConcurrentVector::segmentExistsFor): Deleted.
256         (WTF::ConcurrentVector::segmentFor): Deleted.
257         (WTF::ConcurrentVector::subscriptFor): Deleted.
258         (WTF::ConcurrentVector::ensureSegmentsFor): Deleted.
259         (WTF::ConcurrentVector::ensureSegment): Deleted.
260         (WTF::ConcurrentVector::allocateSegment): Deleted.
261         * wtf/Condition.h:
262         (WTF::Condition::waitUntil): Deleted.
263         (WTF::Condition::waitFor): Deleted.
264         (WTF::Condition::wait): Deleted.
265         (WTF::Condition::notifyOne): Deleted.
266         (WTF::Condition::notifyAll): Deleted.
267         * wtf/CountingLock.h:
268         (WTF::CountingLock::LockHooks::lockHook): Deleted.
269         (WTF::CountingLock::LockHooks::unlockHook): Deleted.
270         (WTF::CountingLock::LockHooks::parkHook): Deleted.
271         (WTF::CountingLock::LockHooks::handoffHook): Deleted.
272         (WTF::CountingLock::tryLock): Deleted.
273         (WTF::CountingLock::lock): Deleted.
274         (WTF::CountingLock::unlock): Deleted.
275         (WTF::CountingLock::isHeld const): Deleted.
276         (WTF::CountingLock::isLocked const): Deleted.
277         (WTF::CountingLock::Count::operator bool const): Deleted.
278         (WTF::CountingLock::Count::operator== const): Deleted.
279         (WTF::CountingLock::Count::operator!= const): Deleted.
280         (WTF::CountingLock::tryOptimisticRead): Deleted.
281         (WTF::CountingLock::validate): Deleted.
282         (WTF::CountingLock::doOptimizedRead): Deleted.
283         (WTF::CountingLock::tryOptimisticFencelessRead): Deleted.
284         (WTF::CountingLock::fencelessValidate): Deleted.
285         (WTF::CountingLock::doOptimizedFencelessRead): Deleted.
286         (WTF::CountingLock::getCount): Deleted.
287         * wtf/CrossThreadQueue.h:
288         * wtf/CrossThreadTask.h:
289         * wtf/CryptographicallyRandomNumber.cpp:
290         * wtf/DataMutex.h:
291         * wtf/DateMath.h:
292         * wtf/Deque.h:
293         (WTF::Deque::size const): Deleted.
294         (WTF::Deque::isEmpty const): Deleted.
295         (WTF::Deque::begin): Deleted.
296         (WTF::Deque::end): Deleted.
297         (WTF::Deque::begin const): Deleted.
298         (WTF::Deque::end const): Deleted.
299         (WTF::Deque::rbegin): Deleted.
300         (WTF::Deque::rend): Deleted.
301         (WTF::Deque::rbegin const): Deleted.
302         (WTF::Deque::rend const): Deleted.
303         (WTF::Deque::first): Deleted.
304         (WTF::Deque::first const): Deleted.
305         (WTF::Deque::last): Deleted.
306         (WTF::Deque::last const): Deleted.
307         (WTF::Deque::append): Deleted.
308         * wtf/Dominators.h:
309         * wtf/DoublyLinkedList.h:
310         * wtf/Expected.h:
311         * wtf/FastBitVector.h:
312         * wtf/FileMetadata.h:
313         * wtf/FileSystem.h:
314         * wtf/GraphNodeWorklist.h:
315         * wtf/GregorianDateTime.h:
316         (WTF::GregorianDateTime::GregorianDateTime): Deleted.
317         (WTF::GregorianDateTime::year const): Deleted.
318         (WTF::GregorianDateTime::month const): Deleted.
319         (WTF::GregorianDateTime::yearDay const): Deleted.
320         (WTF::GregorianDateTime::monthDay const): Deleted.
321         (WTF::GregorianDateTime::weekDay const): Deleted.
322         (WTF::GregorianDateTime::hour const): Deleted.
323         (WTF::GregorianDateTime::minute const): Deleted.
324         (WTF::GregorianDateTime::second const): Deleted.
325         (WTF::GregorianDateTime::utcOffset const): Deleted.
326         (WTF::GregorianDateTime::isDST const): Deleted.
327         (WTF::GregorianDateTime::setYear): Deleted.
328         (WTF::GregorianDateTime::setMonth): Deleted.
329         (WTF::GregorianDateTime::setYearDay): Deleted.
330         (WTF::GregorianDateTime::setMonthDay): Deleted.
331         (WTF::GregorianDateTime::setWeekDay): Deleted.
332         (WTF::GregorianDateTime::setHour): Deleted.
333         (WTF::GregorianDateTime::setMinute): Deleted.
334         (WTF::GregorianDateTime::setSecond): Deleted.
335         (WTF::GregorianDateTime::setUtcOffset): Deleted.
336         (WTF::GregorianDateTime::setIsDST): Deleted.
337         (WTF::GregorianDateTime::operator tm const): Deleted.
338         (WTF::GregorianDateTime::copyFrom): Deleted.
339         * wtf/HashTable.h:
340         * wtf/Hasher.h:
341         * wtf/HexNumber.h:
342         * wtf/Indenter.h:
343         * wtf/IndexMap.h:
344         * wtf/IndexSet.h:
345         * wtf/IndexSparseSet.h:
346         * wtf/IndexedContainerIterator.h:
347         * wtf/Insertion.h:
348         * wtf/IteratorAdaptors.h:
349         * wtf/IteratorRange.h:
350         * wtf/KeyValuePair.h:
351         * wtf/ListHashSet.h:
352         (WTF::ListHashSet::begin): Deleted.
353         (WTF::ListHashSet::end): Deleted.
354         (WTF::ListHashSet::begin const): Deleted.
355         (WTF::ListHashSet::end const): Deleted.
356         (WTF::ListHashSet::random): Deleted.
357         (WTF::ListHashSet::random const): Deleted.
358         (WTF::ListHashSet::rbegin): Deleted.
359         (WTF::ListHashSet::rend): Deleted.
360         (WTF::ListHashSet::rbegin const): Deleted.
361         (WTF::ListHashSet::rend const): Deleted.
362         * wtf/Liveness.h:
363         * wtf/LocklessBag.h:
364         (WTF::LocklessBag::LocklessBag): Deleted.
365         (WTF::LocklessBag::add): Deleted.
366         (WTF::LocklessBag::iterate): Deleted.
367         (WTF::LocklessBag::consumeAll): Deleted.
368         (WTF::LocklessBag::consumeAllWithNode): Deleted.
369         (WTF::LocklessBag::~LocklessBag): Deleted.
370         * wtf/LoggingHashID.h:
371         * wtf/MD5.h:
372         * wtf/MachSendRight.h:
373         * wtf/MainThreadData.h:
374         * wtf/Markable.h:
375         * wtf/MediaTime.h:
376         * wtf/MemoryPressureHandler.h:
377         * wtf/MessageQueue.h:
378         (WTF::MessageQueue::MessageQueue): Deleted.
379         * wtf/MetaAllocator.h:
380         * wtf/MonotonicTime.h:
381         (WTF::MonotonicTime::MonotonicTime): Deleted.
382         (WTF::MonotonicTime::fromRawSeconds): Deleted.
383         (WTF::MonotonicTime::infinity): Deleted.
384         (WTF::MonotonicTime::nan): Deleted.
385         (WTF::MonotonicTime::secondsSinceEpoch const): Deleted.
386         (WTF::MonotonicTime::approximateMonotonicTime const): Deleted.
387         (WTF::MonotonicTime::operator bool const): Deleted.
388         (WTF::MonotonicTime::operator+ const): Deleted.
389         (WTF::MonotonicTime::operator- const): Deleted.
390         (WTF::MonotonicTime::operator% const): Deleted.
391         (WTF::MonotonicTime::operator+=): Deleted.
392         (WTF::MonotonicTime::operator-=): Deleted.
393         (WTF::MonotonicTime::operator== const): Deleted.
394         (WTF::MonotonicTime::operator!= const): Deleted.
395         (WTF::MonotonicTime::operator< const): Deleted.
396         (WTF::MonotonicTime::operator> const): Deleted.
397         (WTF::MonotonicTime::operator<= const): Deleted.
398         (WTF::MonotonicTime::operator>= const): Deleted.
399         (WTF::MonotonicTime::isolatedCopy const): Deleted.
400         (WTF::MonotonicTime::encode const): Deleted.
401         (WTF::MonotonicTime::decode): Deleted.
402         * wtf/NaturalLoops.h:
403         * wtf/NoLock.h:
404         * wtf/OSAllocator.h:
405         * wtf/OptionSet.h:
406         * wtf/Optional.h:
407         * wtf/OrderMaker.h:
408         * wtf/Packed.h:
409         (WTF::alignof):
410         * wtf/PackedIntVector.h:
411         (WTF::PackedIntVector::PackedIntVector): Deleted.
412         (WTF::PackedIntVector::operator=): Deleted.
413         (WTF::PackedIntVector::size const): Deleted.
414         (WTF::PackedIntVector::ensureSize): Deleted.
415         (WTF::PackedIntVector::resize): Deleted.
416         (WTF::PackedIntVector::clearAll): Deleted.
417         (WTF::PackedIntVector::get const): Deleted.
418         (WTF::PackedIntVector::set): Deleted.
419         (WTF::PackedIntVector::mask): Deleted.
420         * wtf/PageBlock.h:
421         * wtf/ParallelJobsOpenMP.h:
422         * wtf/ParkingLot.h:
423         * wtf/PriorityQueue.h:
424         (WTF::PriorityQueue::size const): Deleted.
425         (WTF::PriorityQueue::isEmpty const): Deleted.
426         (WTF::PriorityQueue::enqueue): Deleted.
427         (WTF::PriorityQueue::peek const): Deleted.
428         (WTF::PriorityQueue::dequeue): Deleted.
429         (WTF::PriorityQueue::decreaseKey): Deleted.
430         (WTF::PriorityQueue::increaseKey): Deleted.
431         (WTF::PriorityQueue::begin const): Deleted.
432         (WTF::PriorityQueue::end const): Deleted.
433         (WTF::PriorityQueue::isValidHeap const): Deleted.
434         (WTF::PriorityQueue::parentOf): Deleted.
435         (WTF::PriorityQueue::leftChildOf): Deleted.
436         (WTF::PriorityQueue::rightChildOf): Deleted.
437         (WTF::PriorityQueue::siftUp): Deleted.
438         (WTF::PriorityQueue::siftDown): Deleted.
439         * wtf/RandomDevice.h:
440         * wtf/Range.h:
441         * wtf/RangeSet.h:
442         (WTF::RangeSet::RangeSet): Deleted.
443         (WTF::RangeSet::~RangeSet): Deleted.
444         (WTF::RangeSet::add): Deleted.
445         (WTF::RangeSet::contains const): Deleted.
446         (WTF::RangeSet::overlaps const): Deleted.
447         (WTF::RangeSet::clear): Deleted.
448         (WTF::RangeSet::dump const): Deleted.
449         (WTF::RangeSet::dumpRaw const): Deleted.
450         (WTF::RangeSet::begin const): Deleted.
451         (WTF::RangeSet::end const): Deleted.
452         (WTF::RangeSet::addAll): Deleted.
453         (WTF::RangeSet::compact): Deleted.
454         (WTF::RangeSet::overlapsNonEmpty): Deleted.
455         (WTF::RangeSet::subsumesNonEmpty): Deleted.
456         (WTF::RangeSet::findRange const): Deleted.
457         * wtf/RecursableLambda.h:
458         * wtf/RedBlackTree.h:
459         (WTF::RedBlackTree::Node::successor const): Deleted.
460         (WTF::RedBlackTree::Node::predecessor const): Deleted.
461         (WTF::RedBlackTree::Node::successor): Deleted.
462         (WTF::RedBlackTree::Node::predecessor): Deleted.
463         (WTF::RedBlackTree::Node::reset): Deleted.
464         (WTF::RedBlackTree::Node::parent const): Deleted.
465         (WTF::RedBlackTree::Node::setParent): Deleted.
466         (WTF::RedBlackTree::Node::left const): Deleted.
467         (WTF::RedBlackTree::Node::setLeft): Deleted.
468         (WTF::RedBlackTree::Node::right const): Deleted.
469         (WTF::RedBlackTree::Node::setRight): Deleted.
470         (WTF::RedBlackTree::Node::color const): Deleted.
471         (WTF::RedBlackTree::Node::setColor): Deleted.
472         (WTF::RedBlackTree::RedBlackTree): Deleted.
473         (WTF::RedBlackTree::insert): Deleted.
474         (WTF::RedBlackTree::remove): Deleted.
475         (WTF::RedBlackTree::findExact const): Deleted.
476         (WTF::RedBlackTree::findLeastGreaterThanOrEqual const): Deleted.
477         (WTF::RedBlackTree::findGreatestLessThanOrEqual const): Deleted.
478         (WTF::RedBlackTree::first const): Deleted.
479         (WTF::RedBlackTree::last const): Deleted.
480         (WTF::RedBlackTree::size): Deleted.
481         (WTF::RedBlackTree::isEmpty): Deleted.
482         (WTF::RedBlackTree::treeMinimum): Deleted.
483         (WTF::RedBlackTree::treeMaximum): Deleted.
484         (WTF::RedBlackTree::treeInsert): Deleted.
485         (WTF::RedBlackTree::leftRotate): Deleted.
486         (WTF::RedBlackTree::rightRotate): Deleted.
487         (WTF::RedBlackTree::removeFixup): Deleted.
488         * wtf/ResourceUsage.h:
489         * wtf/RunLoop.cpp:
490         * wtf/RunLoopTimer.h:
491         * wtf/SHA1.h:
492         * wtf/Seconds.h:
493         (WTF::Seconds::Seconds): Deleted.
494         (WTF::Seconds::value const): Deleted.
495         (WTF::Seconds::minutes const): Deleted.
496         (WTF::Seconds::seconds const): Deleted.
497         (WTF::Seconds::milliseconds const): Deleted.
498         (WTF::Seconds::microseconds const): Deleted.
499         (WTF::Seconds::nanoseconds const): Deleted.
500         (WTF::Seconds::minutesAs const): Deleted.
501         (WTF::Seconds::secondsAs const): Deleted.
502         (WTF::Seconds::millisecondsAs const): Deleted.
503         (WTF::Seconds::microsecondsAs const): Deleted.
504         (WTF::Seconds::nanosecondsAs const): Deleted.
505         (WTF::Seconds::fromMinutes): Deleted.
506         (WTF::Seconds::fromHours): Deleted.
507         (WTF::Seconds::fromMilliseconds): Deleted.
508         (WTF::Seconds::fromMicroseconds): Deleted.
509         (WTF::Seconds::fromNanoseconds): Deleted.
510         (WTF::Seconds::infinity): Deleted.
511         (WTF::Seconds::nan): Deleted.
512         (WTF::Seconds::operator bool const): Deleted.
513         (WTF::Seconds::operator+ const): Deleted.
514         (WTF::Seconds::operator- const): Deleted.
515         (WTF::Seconds::operator* const): Deleted.
516         (WTF::Seconds::operator/ const): Deleted.
517         (WTF::Seconds::operator% const): Deleted.
518         (WTF::Seconds::operator+=): Deleted.
519         (WTF::Seconds::operator-=): Deleted.
520         (WTF::Seconds::operator*=): Deleted.
521         (WTF::Seconds::operator/=): Deleted.
522         (WTF::Seconds::operator%=): Deleted.
523         (WTF::Seconds::operator== const): Deleted.
524         (WTF::Seconds::operator!= const): Deleted.
525         (WTF::Seconds::operator< const): Deleted.
526         (WTF::Seconds::operator> const): Deleted.
527         (WTF::Seconds::operator<= const): Deleted.
528         (WTF::Seconds::operator>= const): Deleted.
529         (WTF::Seconds::isolatedCopy const): Deleted.
530         (WTF::Seconds::encode const): Deleted.
531         (WTF::Seconds::decode): Deleted.
532         * wtf/SegmentedVector.h:
533         (WTF::SegmentedVector::~SegmentedVector): Deleted.
534         (WTF::SegmentedVector::size const): Deleted.
535         (WTF::SegmentedVector::isEmpty const): Deleted.
536         (WTF::SegmentedVector::at): Deleted.
537         (WTF::SegmentedVector::at const): Deleted.
538         (WTF::SegmentedVector::operator[]): Deleted.
539         (WTF::SegmentedVector::operator[] const): Deleted.
540         (WTF::SegmentedVector::first): Deleted.
541         (WTF::SegmentedVector::first const): Deleted.
542         (WTF::SegmentedVector::last): Deleted.
543         (WTF::SegmentedVector::last const): Deleted.
544         (WTF::SegmentedVector::takeLast): Deleted.
545         (WTF::SegmentedVector::append): Deleted.
546         (WTF::SegmentedVector::alloc): Deleted.
547         (WTF::SegmentedVector::removeLast): Deleted.
548         (WTF::SegmentedVector::grow): Deleted.
549         (WTF::SegmentedVector::clear): Deleted.
550         (WTF::SegmentedVector::begin): Deleted.
551         (WTF::SegmentedVector::end): Deleted.
552         (WTF::SegmentedVector::shrinkToFit): Deleted.
553         (WTF::SegmentedVector::deleteAllSegments): Deleted.
554         (WTF::SegmentedVector::segmentExistsFor): Deleted.
555         (WTF::SegmentedVector::segmentFor): Deleted.
556         (WTF::SegmentedVector::subscriptFor): Deleted.
557         (WTF::SegmentedVector::ensureSegmentsFor): Deleted.
558         (WTF::SegmentedVector::ensureSegment): Deleted.
559         (WTF::SegmentedVector::allocateSegment): Deleted.
560         * wtf/SetForScope.h:
561         * wtf/SingleRootGraph.h:
562         * wtf/SinglyLinkedList.h:
563         * wtf/SmallPtrSet.h:
564         * wtf/SpanningTree.h:
565         * wtf/Spectrum.h:
566         * wtf/StackBounds.h:
567         * wtf/StackShot.h:
568         * wtf/StackShotProfiler.h:
569         * wtf/StackStats.h:
570         * wtf/StackTrace.h:
571         * wtf/StreamBuffer.h:
572         * wtf/SynchronizedFixedQueue.h:
573         (WTF::SynchronizedFixedQueue::create): Deleted.
574         (WTF::SynchronizedFixedQueue::open): Deleted.
575         (WTF::SynchronizedFixedQueue::close): Deleted.
576         (WTF::SynchronizedFixedQueue::isOpen): Deleted.
577         (WTF::SynchronizedFixedQueue::enqueue): Deleted.
578         (WTF::SynchronizedFixedQueue::dequeue): Deleted.
579         (WTF::SynchronizedFixedQueue::SynchronizedFixedQueue): Deleted.
580         * wtf/SystemTracing.h:
581         * wtf/ThreadGroup.h:
582         (WTF::ThreadGroup::create): Deleted.
583         (WTF::ThreadGroup::threads const): Deleted.
584         (WTF::ThreadGroup::getLock): Deleted.
585         (WTF::ThreadGroup::weakFromThis): Deleted.
586         * wtf/ThreadSpecific.h:
587         * wtf/ThreadingPrimitives.h:
588         (WTF::Mutex::impl): Deleted.
589         * wtf/TimeWithDynamicClockType.h:
590         (WTF::TimeWithDynamicClockType::TimeWithDynamicClockType): Deleted.
591         (WTF::TimeWithDynamicClockType::fromRawSeconds): Deleted.
592         (WTF::TimeWithDynamicClockType::secondsSinceEpoch const): Deleted.
593         (WTF::TimeWithDynamicClockType::clockType const): Deleted.
594         (WTF::TimeWithDynamicClockType::withSameClockAndRawSeconds const): Deleted.
595         (WTF::TimeWithDynamicClockType::operator bool const): Deleted.
596         (WTF::TimeWithDynamicClockType::operator+ const): Deleted.
597         (WTF::TimeWithDynamicClockType::operator- const): Deleted.
598         (WTF::TimeWithDynamicClockType::operator+=): Deleted.
599         (WTF::TimeWithDynamicClockType::operator-=): Deleted.
600         (WTF::TimeWithDynamicClockType::operator== const): Deleted.
601         (WTF::TimeWithDynamicClockType::operator!= const): Deleted.
602         * wtf/TimingScope.h:
603         * wtf/TinyLRUCache.h:
604         * wtf/TinyPtrSet.h:
605         * wtf/URLParser.cpp:
606         * wtf/URLParser.h:
607         * wtf/Unexpected.h:
608         * wtf/Variant.h:
609         * wtf/WTFSemaphore.h:
610         (WTF::Semaphore::Semaphore): Deleted.
611         (WTF::Semaphore::signal): Deleted.
612         (WTF::Semaphore::waitUntil): Deleted.
613         (WTF::Semaphore::waitFor): Deleted.
614         (WTF::Semaphore::wait): Deleted.
615         * wtf/WallTime.h:
616         (WTF::WallTime::WallTime): Deleted.
617         (WTF::WallTime::fromRawSeconds): Deleted.
618         (WTF::WallTime::infinity): Deleted.
619         (WTF::WallTime::nan): Deleted.
620         (WTF::WallTime::secondsSinceEpoch const): Deleted.
621         (WTF::WallTime::approximateWallTime const): Deleted.
622         (WTF::WallTime::operator bool const): Deleted.
623         (WTF::WallTime::operator+ const): Deleted.
624         (WTF::WallTime::operator- const): Deleted.
625         (WTF::WallTime::operator+=): Deleted.
626         (WTF::WallTime::operator-=): Deleted.
627         (WTF::WallTime::operator== const): Deleted.
628         (WTF::WallTime::operator!= const): Deleted.
629         (WTF::WallTime::operator< const): Deleted.
630         (WTF::WallTime::operator> const): Deleted.
631         (WTF::WallTime::operator<= const): Deleted.
632         (WTF::WallTime::operator>= const): Deleted.
633         (WTF::WallTime::isolatedCopy const): Deleted.
634         * wtf/WeakHashSet.h:
635         (WTF::WeakHashSet::WeakHashSetConstIterator::WeakHashSetConstIterator): Deleted.
636         (WTF::WeakHashSet::WeakHashSetConstIterator::get const): Deleted.
637         (WTF::WeakHashSet::WeakHashSetConstIterator::operator* const): Deleted.
638         (WTF::WeakHashSet::WeakHashSetConstIterator::operator-> const): Deleted.
639         (WTF::WeakHashSet::WeakHashSetConstIterator::operator++): Deleted.
640         (WTF::WeakHashSet::WeakHashSetConstIterator::skipEmptyBuckets): Deleted.
641         (WTF::WeakHashSet::WeakHashSetConstIterator::operator== const): Deleted.
642         (WTF::WeakHashSet::WeakHashSetConstIterator::operator!= const): Deleted.
643         (WTF::WeakHashSet::WeakHashSet): Deleted.
644         (WTF::WeakHashSet::begin const): Deleted.
645         (WTF::WeakHashSet::end const): Deleted.
646         (WTF::WeakHashSet::add): Deleted.
647         (WTF::WeakHashSet::remove): Deleted.
648         (WTF::WeakHashSet::contains const): Deleted.
649         (WTF::WeakHashSet::capacity const): Deleted.
650         (WTF::WeakHashSet::computesEmpty const): Deleted.
651         (WTF::WeakHashSet::hasNullReferences const): Deleted.
652         (WTF::WeakHashSet::computeSize const): Deleted.
653         (WTF::WeakHashSet::checkConsistency const): Deleted.
654         * wtf/WeakRandom.h:
655         (WTF::WeakRandom::WeakRandom): Deleted.
656         (WTF::WeakRandom::setSeed): Deleted.
657         (WTF::WeakRandom::seed const): Deleted.
658         (WTF::WeakRandom::get): Deleted.
659         (WTF::WeakRandom::getUint32): Deleted.
660         (WTF::WeakRandom::lowOffset): Deleted.
661         (WTF::WeakRandom::highOffset): Deleted.
662         (WTF::WeakRandom::nextState): Deleted.
663         (WTF::WeakRandom::generate): Deleted.
664         (WTF::WeakRandom::advance): Deleted.
665         * wtf/WordLock.h:
666         (WTF::WordLock::lock): Deleted.
667         (WTF::WordLock::unlock): Deleted.
668         (WTF::WordLock::isHeld const): Deleted.
669         (WTF::WordLock::isLocked const): Deleted.
670         (WTF::WordLock::isFullyReset const): Deleted.
671         * wtf/generic/MainThreadGeneric.cpp:
672         * wtf/glib/GMutexLocker.h:
673         * wtf/linux/CurrentProcessMemoryStatus.h:
674         * wtf/posix/ThreadingPOSIX.cpp:
675         (WTF::Semaphore::Semaphore): Deleted.
676         (WTF::Semaphore::~Semaphore): Deleted.
677         (WTF::Semaphore::wait): Deleted.
678         (WTF::Semaphore::post): Deleted.
679         * wtf/text/ASCIILiteral.h:
680         (WTF::ASCIILiteral::operator const char* const): Deleted.
681         (WTF::ASCIILiteral::fromLiteralUnsafe): Deleted.
682         (WTF::ASCIILiteral::null): Deleted.
683         (WTF::ASCIILiteral::characters const): Deleted.
684         (WTF::ASCIILiteral::ASCIILiteral): Deleted.
685         * wtf/text/AtomString.h:
686         (WTF::AtomString::operator=): Deleted.
687         (WTF::AtomString::isHashTableDeletedValue const): Deleted.
688         (WTF::AtomString::existingHash const): Deleted.
689         (WTF::AtomString::operator const String& const): Deleted.
690         (WTF::AtomString::string const): Deleted.
691         (WTF::AtomString::impl const): Deleted.
692         (WTF::AtomString::is8Bit const): Deleted.
693         (WTF::AtomString::characters8 const): Deleted.
694         (WTF::AtomString::characters16 const): Deleted.
695         (WTF::AtomString::length const): Deleted.
696         (WTF::AtomString::operator[] const): Deleted.
697         (WTF::AtomString::contains const): Deleted.
698         (WTF::AtomString::containsIgnoringASCIICase const): Deleted.
699         (WTF::AtomString::find const): Deleted.
700         (WTF::AtomString::findIgnoringASCIICase const): Deleted.
701         (WTF::AtomString::startsWith const): Deleted.
702         (WTF::AtomString::startsWithIgnoringASCIICase const): Deleted.
703         (WTF::AtomString::endsWith const): Deleted.
704         (WTF::AtomString::endsWithIgnoringASCIICase const): Deleted.
705         (WTF::AtomString::toInt const): Deleted.
706         (WTF::AtomString::toDouble const): Deleted.
707         (WTF::AtomString::toFloat const): Deleted.
708         (WTF::AtomString::percentage const): Deleted.
709         (WTF::AtomString::isNull const): Deleted.
710         (WTF::AtomString::isEmpty const): Deleted.
711         (WTF::AtomString::operator NSString * const): Deleted.
712         * wtf/text/AtomStringImpl.h:
713         (WTF::AtomStringImpl::lookUp): Deleted.
714         (WTF::AtomStringImpl::add): Deleted.
715         (WTF::AtomStringImpl::addWithStringTableProvider): Deleted.
716         * wtf/text/CString.h:
717         (WTF::CStringBuffer::data): Deleted.
718         (WTF::CStringBuffer::length const): Deleted.
719         (WTF::CStringBuffer::CStringBuffer): Deleted.
720         (WTF::CStringBuffer::mutableData): Deleted.
721         (WTF::CString::CString): Deleted.
722         (WTF::CString::data const): Deleted.
723         (WTF::CString::length const): Deleted.
724         (WTF::CString::isNull const): Deleted.
725         (WTF::CString::buffer const): Deleted.
726         (WTF::CString::isHashTableDeletedValue const): Deleted.
727         * wtf/text/ExternalStringImpl.h:
728         (WTF::ExternalStringImpl::freeExternalBuffer): Deleted.
729         * wtf/text/LineBreakIteratorPoolICU.h:
730         * wtf/text/NullTextBreakIterator.h:
731         * wtf/text/OrdinalNumber.h:
732         * wtf/text/StringBuffer.h:
733         * wtf/text/StringBuilder.h:
734         * wtf/text/StringConcatenateNumbers.h:
735         * wtf/text/StringHasher.h:
736         * wtf/text/StringImpl.h:
737         * wtf/text/StringView.cpp:
738         * wtf/text/StringView.h:
739         (WTF::StringView::left const): Deleted.
740         (WTF::StringView::right const): Deleted.
741         (WTF::StringView::underlyingStringIsValid const): Deleted.
742         (WTF::StringView::setUnderlyingString): Deleted.
743         * wtf/text/SymbolImpl.h:
744         (WTF::SymbolImpl::StaticSymbolImpl::StaticSymbolImpl): Deleted.
745         (WTF::SymbolImpl::StaticSymbolImpl::operator SymbolImpl&): Deleted.
746         (WTF::PrivateSymbolImpl::PrivateSymbolImpl): Deleted.
747         (WTF::RegisteredSymbolImpl::symbolRegistry const): Deleted.
748         (WTF::RegisteredSymbolImpl::clearSymbolRegistry): Deleted.
749         (WTF::RegisteredSymbolImpl::RegisteredSymbolImpl): Deleted.
750         * wtf/text/SymbolRegistry.h:
751         * wtf/text/TextBreakIterator.h:
752         * wtf/text/TextPosition.h:
753         * wtf/text/TextStream.h:
754         * wtf/text/WTFString.h:
755         (WTF::String::swap): Deleted.
756         (WTF::String::adopt): Deleted.
757         (WTF::String::isNull const): Deleted.
758         (WTF::String::isEmpty const): Deleted.
759         (WTF::String::impl const): Deleted.
760         (WTF::String::releaseImpl): Deleted.
761         (WTF::String::length const): Deleted.
762         (WTF::String::characters8 const): Deleted.
763         (WTF::String::characters16 const): Deleted.
764         (WTF::String::is8Bit const): Deleted.
765         (WTF::String::sizeInBytes const): Deleted.
766         (WTF::String::operator[] const): Deleted.
767         (WTF::String::find const): Deleted.
768         (WTF::String::findIgnoringASCIICase const): Deleted.
769         (WTF::String::reverseFind const): Deleted.
770         (WTF::String::contains const): Deleted.
771         (WTF::String::containsIgnoringASCIICase const): Deleted.
772         (WTF::String::startsWith const): Deleted.
773         (WTF::String::startsWithIgnoringASCIICase const): Deleted.
774         (WTF::String::hasInfixStartingAt const): Deleted.
775         (WTF::String::endsWith const): Deleted.
776         (WTF::String::endsWithIgnoringASCIICase const): Deleted.
777         (WTF::String::hasInfixEndingAt const): Deleted.
778         (WTF::String::append): Deleted.
779         (WTF::String::left const): Deleted.
780         (WTF::String::right const): Deleted.
781         (WTF::String::createUninitialized): Deleted.
782         (WTF::String::fromUTF8WithLatin1Fallback): Deleted.
783         (WTF::String::isAllASCII const): Deleted.
784         (WTF::String::isAllLatin1 const): Deleted.
785         (WTF::String::isSpecialCharacter const): Deleted.
786         (WTF::String::isHashTableDeletedValue const): Deleted.
787         (WTF::String::hash const): Deleted.
788         (WTF::String::existingHash const): Deleted.
789         * wtf/text/cf/TextBreakIteratorCF.h:
790         * wtf/text/icu/TextBreakIteratorICU.h:
791         * wtf/text/icu/UTextProviderLatin1.h:
792         * wtf/threads/BinarySemaphore.h:
793         (WTF::BinarySemaphore::waitFor): Deleted.
794         (WTF::BinarySemaphore::wait): Deleted.
795         * wtf/unicode/Collator.h:
796         * wtf/win/GDIObject.h:
797         * wtf/win/PathWalker.h:
798         * wtf/win/Win32Handle.h:
799
800 2019-08-12  Chris Dumez  <cdumez@apple.com>
801
802         Unreviewed, fix post landing review comments for r248533 from Darin.
803
804         * wtf/RefCounted.h:
805         (WTF::RefCountedBase::ref const):
806         (WTF::RefCountedBase::applyRefDerefThreadingCheck const):
807         (WTF::RefCountedBase::derefBase const):
808         (WTF::RefCountedBase::areThreadingCheckedEnabled const): Deleted.
809
810 2019-08-12  Chris Dumez  <cdumez@apple.com>
811
812         Add threading assertions to RefCounted
813         https://bugs.webkit.org/show_bug.cgi?id=200507
814
815         Reviewed by Ryosuke Niwa.
816
817         Add threading assertions to RefCounted to try and catch unsafe concurrent ref'ing / derefing of
818         RefCounted objects from several threads. If you hit these new assertions, it likely means you either
819         need to:
820         1. Have your class subclass ThreadSafeRefCounted instead of RefCounted
821         or
822         2. Make sure your objects always gets ref'd / deref'd from the same thread.
823
824         These assertions already found several thread safety bugs in our code base, which I fixed via
825         dependency bugs.
826
827         These assertions are currently enabled in WebKit (UIProcess, child processes and
828         WebKitLegacy), they do not apply other JavascriptCore API clients.
829
830         * WTF.xcodeproj/project.pbxproj:
831         * wtf/CMakeLists.txt:
832         * wtf/RefCounted.cpp: Added.
833         * wtf/RefCounted.h:
834         (WTF::RefCountedBase::ref const):
835         (WTF::RefCountedBase::disableThreadingChecks):
836         (WTF::RefCountedBase::enableThreadingChecksGlobally):
837         (WTF::RefCountedBase::RefCountedBase):
838         (WTF::RefCountedBase::areThreadingCheckedEnabled const):
839         (WTF::RefCountedBase::derefBase const):
840         * wtf/SizeLimits.cpp:
841
842 2019-08-12  Chris Dumez  <cdumez@apple.com>
843
844         Unreviewed, rolling out r248525.
845
846         Revert new threading assertions while I work on fixing the
847         issues they exposed
848
849         Reverted changeset:
850
851         "Add threading assertions to RefCounted"
852         https://bugs.webkit.org/show_bug.cgi?id=200507
853         https://trac.webkit.org/changeset/248525
854
855 2019-08-11  Chris Dumez  <cdumez@apple.com>
856
857         Add threading assertions to RefCounted
858         https://bugs.webkit.org/show_bug.cgi?id=200507
859
860         Reviewed by Ryosuke Niwa.
861
862         Add threading assertions to RefCounted to try and catch unsafe concurrent ref'ing / derefing of
863         RefCounted objects from several threads. If you hit these new assertions, it likely means you either
864         need to:
865         1. Have your class subclass ThreadSafeRefCounted instead of RefCounted
866         or
867         2. Make sure your objects always gets ref'd / deref'd from the same thread.
868
869         These assertions already found several thread safety bugs in our code base, which I fixed via
870         dependency bugs.
871
872         These assertions are currently enabled in WebKit (UIProcess, child processes and
873         WebKitLegacy), they do not apply other JavascriptCore API clients.
874
875         * WTF.xcodeproj/project.pbxproj:
876         * wtf/CMakeLists.txt:
877         * wtf/RefCounted.cpp: Added.
878         * wtf/RefCounted.h:
879         (WTF::RefCountedBase::ref const):
880         (WTF::RefCountedBase::disableThreadingChecks):
881         (WTF::RefCountedBase::enableThreadingChecksGlobally):
882         (WTF::RefCountedBase::RefCountedBase):
883         (WTF::RefCountedBase::areThreadingCheckedEnabled const):
884         (WTF::RefCountedBase::derefBase const):
885         * wtf/SizeLimits.cpp:
886
887 2019-08-09  Saam Barati  <sbarati@apple.com>
888
889         [WHLSL] Devirtualize the AST
890         https://bugs.webkit.org/show_bug.cgi?id=200522
891
892         Reviewed by Robin Morisset.
893
894         Make RefCounted use std::default_delete instead of explicitly calling delete.
895         This allows uses of RefCounted to define their own custom deleter.
896
897         * wtf/RefCounted.h:
898         (WTF::RefCounted::deref const):
899         * wtf/UniqueRef.h:
900         (WTF::UniqueRef::UniqueRef):
901
902 2019-08-08  Chris Dumez  <cdumez@apple.com>
903
904         Fix thread safety issue in AudioSampleDataSource() constructor
905         https://bugs.webkit.org/show_bug.cgi?id=200547
906
907         Reviewed by Alex Christensen.
908
909         Make Logger ThreadSafeRefCounted as it is ref'd / deref'd from various
910         threads (including the main thread and the WebKitWebRTCAudioModule thread).
911
912         * wtf/Logger.h:
913
914 2019-08-08  Michael Saboff  <msaboff@apple.com>
915
916         OpenSource MemoryFootprint API for JSC command line tool
917         https://bugs.webkit.org/show_bug.cgi?id=200541
918
919         Reviewed by Saam Barati.
920
921         OpenSource version of WebKitAdditions/MemoryFootprint.h.
922
923         * WTF.xcodeproj/project.pbxproj:
924         * wtf/spi/darwin/ProcessMemoryFootprint.h: Added.
925         (ProcessMemoryFootprint::now):
926         (ProcessMemoryFootprint::resetPeak):
927
928 2019-08-08  Per Arne Vollan  <pvollan@apple.com>
929
930         [Mac] Use the PID of the WebContent process when issuing local file read sandbox extensions
931         https://bugs.webkit.org/show_bug.cgi?id=200543
932         <rdar://problem/49394015>
933
934         Reviewed by Brent Fulgham.
935
936         Add new SPI.
937
938         * wtf/Platform.h:
939         * wtf/spi/darwin/SandboxSPI.h:
940
941 2019-08-07  Chris Dumez  <cdumez@apple.com>
942
943         Tighten WeakPtr threading assertions for GC threads
944         https://bugs.webkit.org/show_bug.cgi?id=200451
945
946         Reviewed by Youenn Fablet.
947
948         Make sure our GC threads do not dereference WeakPtr for main thread
949         objects by tightening our threading assertions in WeakPtr. They are
950         still allowed to call WeakPtr::get() for now though.
951
952         * wtf/WeakPtr.h:
953         (WTF::WeakPtrImpl::get):
954         (WTF::WeakPtrImpl::wasConstructedOnMainThread const):
955         (WTF::WeakPtr::get const):
956         (WTF::WeakPtr::operator-> const):
957         (WTF::WeakPtr::operator* const):
958
959 2019-08-06  Jiewen Tan  <jiewen_tan@apple.com>
960
961         Unreviewed, a build fix after r248308
962
963         Use kSecUseDataProtectionKeychain for iOS 13 and macOS Catalina or newer.
964
965         * wtf/Platform.h:
966
967 2019-08-06  Chris Dumez  <cdumez@apple.com>
968
969         Fix inefficiency in HTTPHeaderMap::set(CFStringRef, const String&)
970         https://bugs.webkit.org/show_bug.cgi?id=200475
971
972         Reviewed by Darin Adler.
973
974         Add convenience constuctor to StringView which takes in a const char*
975         and an unsigned length, similarly to what we already have for String.
976
977         * wtf/URL.cpp:
978         (WTF::URL::protocolIs const):
979         (WTF::protocolIsInternal):
980         * wtf/text/StringView.h:
981         (WTF::StringView::StringView):
982         (WTF::StringView::empty):
983
984 2019-08-06  Jiewen Tan  <jiewen_tan@apple.com>
985
986         [WebAuthN] Enable LocalAuthenticator for macOS
987         https://bugs.webkit.org/show_bug.cgi?id=182772
988         <rdar://problem/43347920>
989
990         Reviewed by Brent Fulgham.
991
992         * wtf/Platform.h:
993         Adds HAVE_DEVICE_IDENTITY.
994         * wtf/spi/cocoa/SecuritySPI.h:
995         Adds a SPI for telling macOS keychain to use the modern one.
996
997 2019-08-06  Claudio Saavedra  <csaavedra@igalia.com>
998
999         FileSystem: silent build warning
1000
1001         Unreviewed compilation warning fix.
1002
1003         Remove unused parameter in empty method
1004         * wtf/FileSystem.cpp:
1005         (WTF::FileSystemImpl::createTemporaryZipArchive):
1006
1007 2019-08-05  Youenn Fablet  <youenn@apple.com>
1008
1009         Make Logger::log thread safe so that it can be used from background threads
1010         https://bugs.webkit.org/show_bug.cgi?id=200448
1011
1012         Reviewed by Eric Carlson.
1013
1014         Add a lock to ensure calling log is thread-safe.
1015
1016         * wtf/Logger.h:
1017         (WTF::Logger::addObserver):
1018         (WTF::Logger::removeObserver):
1019         (WTF::Logger::log):
1020         (WTF::Logger::observerLock):
1021
1022 2019-08-05  Takashi Komori  <Takashi.Komori@sony.com>
1023
1024         [Curl] implement CertificateInfo::summaryInfo
1025         https://bugs.webkit.org/show_bug.cgi?id=191498
1026
1027         Reviewed by Alex Christensen.
1028
1029         Fixed function template for encoding vector.
1030
1031         * wtf/persistence/PersistentCoders.h:
1032
1033 2019-08-02  Mark Lam  <mark.lam@apple.com>
1034
1035         [ARM64E] Harden the diversity of the DOMJIT::Signature::unsafeFunction pointer.
1036         https://bugs.webkit.org/show_bug.cgi?id=200292
1037         <rdar://problem/53706881>
1038
1039         Reviewed by Geoffrey Garen.
1040
1041         * wtf/PtrTag.h:
1042         - Introducing WTF_VTBL_FUNCPTR_PTRAUTH and WTF_VTBL_FUNCPTR_PTRAUTH_STR macros for
1043           defining vtbl function pointer style pointer signing modifier.
1044
1045 2019-08-02  Eric Carlson  <eric.carlson@apple.com>
1046
1047         uniqueLogIdentifier() should generate a 64-bit identifier
1048         https://bugs.webkit.org/show_bug.cgi?id=200403
1049         <rdar://problem/53878447>
1050
1051         Reviewed by Youenn Fablet.
1052
1053         * wtf/LoggerHelper.h:
1054         (WTF::LoggerHelper::childLogIdentifier const): Use uint64_t masks.
1055         (WTF::LoggerHelper::uniqueLogIdentifier): cryptographicallyRandomNumber returns a
1056         uint32_t so use two to generate a 64-bit identifier.
1057
1058 2019-08-02  Alex Christensen  <achristensen@webkit.org>
1059
1060         Fix an internal build after r248139
1061         https://bugs.webkit.org/show_bug.cgi?id=200102
1062
1063         * wtf/cocoa/FileSystemCocoa.mm:
1064         Some internal builds couldn't find BOM framework headers.
1065         No problem.  They're not needed.  Just remove references to them.
1066
1067 2019-08-01  Alex Christensen  <achristensen@webkit.org>
1068
1069         Move FormData zip file generation to NetworkProcess and enable it for all WebKit clients for uploading directories
1070         https://bugs.webkit.org/show_bug.cgi?id=200102
1071         <rdar://problem/53275114>
1072
1073         Reviewed by Darin Adler.
1074
1075         Move code from BlobDataFileReference::generateReplacementFile to FileSystem::createZipArchive.
1076
1077         * wtf/FileSystem.cpp:
1078         (WTF::FileSystemImpl::createZipArchive):
1079         * wtf/FileSystem.h:
1080         * wtf/cocoa/FileSystemCocoa.mm:
1081         (WTF::FileSystemImpl::createZipArchive):
1082
1083 2019-08-01  Per Arne Vollan  <pvollan@apple.com>
1084
1085         Initialize memory pressure flag in MemoryPressureHandler
1086         https://bugs.webkit.org/show_bug.cgi?id=200353
1087
1088         Reviewed by Geoffrey Garen.
1089
1090         The flag 'm_underMemoryPressure' in MemoryPressureHandler should be initialized to 'false'.
1091
1092         * wtf/MemoryPressureHandler.h:
1093
1094 2019-08-01  Chris Dumez  <cdumez@apple.com>
1095
1096         Add threading assertion to WeakPtr's operator->()
1097         https://bugs.webkit.org/show_bug.cgi?id=199922
1098
1099         Reviewed by Ryosuke Niwa.
1100
1101         Add threading assertion to WeakPtr's operator->() to make sure that the WeakPtr
1102         always gets dereferenced on the same thread it was constructed on.
1103
1104         * wtf/WeakPtr.h:
1105         (WTF::WeakPtrImpl::get):
1106         (WTF::WeakPtrImpl::WeakPtrImpl):
1107
1108 2019-07-31  Youenn Fablet  <youenn@apple.com>
1109
1110         Use CTFontCreateForCharactersWithLanguageAndOption if available instead of CTFontCreateForCharactersWithLanguage
1111         https://bugs.webkit.org/show_bug.cgi?id=200241
1112
1113         Reviewed by Myles C. Maxfield.
1114
1115         * wtf/Platform.h: Add macro to enable/disable new SPI.
1116
1117 2019-07-31  Keith Rollin  <krollin@apple.com>
1118
1119         Fix 64-bit vs 32-bit mismatch in PersistentCoders.h
1120         https://bugs.webkit.org/show_bug.cgi?id=200288
1121         <rdar://problem/53734203>
1122
1123         Reviewed by Chris Dumez.
1124
1125         hashMapSize is declared as a uint64_t. It is passed to
1126         HashMapType::reserveInitialCapacity, which takes an unsigned int. This
1127         is a 32-bit value on 32-bit platforms, leading to a compile time
1128         error. Fix his by casting hashMapSize to the expected type.
1129
1130         * wtf/persistence/PersistentCoders.h:
1131
1132 2019-07-31  Keith Rollin  <krollin@apple.com>
1133
1134         Fix 64-bit vs 32-bit mismatch in LogArgument
1135         https://bugs.webkit.org/show_bug.cgi?id=200286
1136         <rdar://problem/53733671>
1137
1138         Reviewed by Darin Adler.
1139
1140         LogArgument is a utility for converting scalars into strings. It has a
1141         number of versions of a toString() method that is specialized for each
1142         type and converts the value to a string in a manner appropriate for
1143         that type. However, the versions of toString() for "long long" and
1144         "unsigned long long" are actually declared to take an "long" or
1145         "unsigned long" as a parameter. This difference leads to a 64-bit vs
1146         32-bit build error on 32-bit systems. Fix this by specifying
1147         correct/matching types.
1148
1149         * wtf/Logger.h:
1150         (WTF::LogArgument::toString):
1151
1152 2019-07-30  Myles C. Maxfield  <mmaxfield@apple.com>
1153
1154         REGRESSION(r241288): Text on Yahoo Japan mobile looks too bold
1155         https://bugs.webkit.org/show_bug.cgi?id=200065
1156         <rdar://problem/50912757>
1157
1158         Reviewed by Simon Fraser.
1159
1160         * wtf/Platform.h:
1161
1162 2019-07-30  Michael Catanzaro  <mcatanzaro@igalia.com>
1163
1164         Fix CRASH_WITH_INFO() so that it doesn't complain about unused parameters on non Clang / MSVC compilers.
1165         https://bugs.webkit.org/show_bug.cgi?id=200243
1166
1167         Reviewed by Mark Lam.
1168
1169         For GCC, we'll implement WTFCrashWithInfo as a function rather than a macro. To use
1170         ##__VA_ARGS we would need to enable GNU extensions, and don't want to do that. The proper
1171         solution, format __VA_OPT__(,) __VA_ARGS__, requires C++20. So just use an inline function
1172         for now as a workaround.
1173
1174         * wtf/Assertions.h:
1175         (CRASH_WITH_INFO):
1176         (CRASH_WITH_SECURITY_IMPLICATION_AND_INFO):
1177
1178 2019-07-25  Dean Jackson  <dino@apple.com>
1179
1180         Add helper for ignoring deprecated implementation warnings
1181         https://bugs.webkit.org/show_bug.cgi?id=200135
1182
1183         Reviewed by Wenson Hsieh.
1184
1185         Add ALLOW_DEPRECATED_IMPLEMENTATIONS_BEGIN/END macro which
1186         is IGNORE_WARNINGS_BEGIN("deprecated-implementations")
1187
1188         * wtf/Compiler.h:
1189
1190 2019-07-24  Yusuke Suzuki  <ysuzuki@apple.com>
1191
1192         [bmalloc] Add IsoHeap test to ensure that IsoHeap pages are not allocating too large VA
1193         https://bugs.webkit.org/show_bug.cgi?id=200103
1194
1195         Reviewed by Mark Lam.
1196
1197         We move VMTag page investigation code from PAL to WTF to use it in TestWTF.
1198         And we also accumulate allocated VA size in `reserved` field of `TagInfo`.
1199
1200         * WTF.xcodeproj/project.pbxproj:
1201         * wtf/CMakeLists.txt:
1202         * wtf/PlatformMac.cmake:
1203         * wtf/ResourceUsage.h: Added.
1204         * wtf/cocoa/MemoryPressureHandlerCocoa.mm:
1205         * wtf/cocoa/ResourceUsageCocoa.cpp: Added.
1206         (WTF::vmPageSize):
1207         (WTF::logFootprintComparison):
1208         (WTF::displayNameForVMTag):
1209         (WTF::pagesPerVMTag):
1210         * wtf/spi/cocoa/MachVMSPI.h: Added.
1211
1212 2019-07-23  Keith Miller  <keith_miller@apple.com>
1213
1214         Add cheat sheet comment for HashMap/Set iterator/AddResult
1215         https://bugs.webkit.org/show_bug.cgi?id=200061
1216
1217         Reviewed by Saam Barati.
1218
1219         * wtf/HashMap.h:
1220         * wtf/HashSet.h:
1221
1222 2019-07-23  Keith Rollin  <krollin@apple.com>
1223
1224         Remove rest of NavigatorContentUtils support
1225         https://bugs.webkit.org/show_bug.cgi?id=200052
1226         <rdar://problem/53467357>
1227
1228         Reviewed by Alex Christensen.
1229
1230         Bug 196070 removes most of the support for the never-used
1231         NavigatorContentUtils facility. However, there were still a couple of
1232         left-over references after that change. This patch sweeps those up.
1233
1234         * wtf/FeatureDefines.h:
1235
1236 2019-07-23  Keith Rollin  <krollin@apple.com>
1237
1238         Enable HAVE_APP_LINKS_WITH_ISENABLED for entire iOS family
1239         https://bugs.webkit.org/show_bug.cgi?id=200040
1240         <rdar://problem/53457670>
1241
1242         Reviewed by Tim Horton.
1243
1244         This feature was enabled for just iOS, but should be enabled for tvOS
1245         and watchOS, too.
1246
1247         * wtf/Platform.h:
1248
1249 2019-07-23  Alicia Boya García  <aboya@igalia.com>
1250
1251         [WTF] Add DataMutex and MainThreadData wrappers
1252         https://bugs.webkit.org/show_bug.cgi?id=199831
1253
1254         Reviewed by Alex Christensen.
1255
1256         This patch adds two new wrapper classes:
1257
1258         DataMutex<T> stores an instance of T in a private member along with a
1259         mutex. In order to use its fields, users need to instantiate a
1260         DataMutex<T>::LockedWrapper instance in the stack. This class uses
1261         RAII to lock and unlock the mutex in construction and destruction
1262         respectively, and by using the arrow operator lets the user access T's
1263         members.
1264
1265         This way, DataMutex<T> prevents most instances of accidental access to
1266         data fields that should only be read and modified in an atomic matter.
1267
1268         Still, both the Lock and the LockHolder are exposed once the user has
1269         taken the lock so that special cases such as waiting for a condition
1270         variable or performing an early unlock are doable.
1271
1272         MainThreadData<T> is another wrapper class, in this case for data
1273         fields that should only be accessed from the main thread. In this
1274         case, it works similar to a smart pointer, except that (1) there is no
1275         actual memory indirection, T is stored directly inside
1276         MainThreadData<T> and (2) attempts to use the -> or * operator have an
1277         isMainThread() assertion.
1278
1279         Together, these two wrapper classes make it easier to write
1280         multi-threaded code in a safer, more self-documented way by letting
1281         the author group data into structures that have certain access safety
1282         requirements.
1283
1284         These structures were originally part of the new GStreamer
1285         WebKitMediaSrc rework patch: https://bugs.webkit.org/show_bug.cgi?id=199719
1286
1287         * wtf/CMakeLists.txt:
1288         * wtf/DataMutex.h: Added.
1289         (WTF::DataMutex::DataMutex):
1290         (WTF::DataMutex::LockedWrapper::LockedWrapper):
1291         (WTF::DataMutex::LockedWrapper::operator->):
1292         (WTF::DataMutex::LockedWrapper::operator*):
1293         (WTF::DataMutex::LockedWrapper::mutex):
1294         (WTF::DataMutex::LockedWrapper::lockHolder):
1295         * wtf/MainThreadData.h: Added.
1296         (WTF::MainThreadData::MainThreadData):
1297         (WTF::MainThreadData::operator->):
1298         (WTF::MainThreadData::operator*):
1299
1300 2019-07-22  Yusuke Suzuki  <ysuzuki@apple.com>
1301
1302         [bmalloc] Each IsoPage gets 1MB VA because VMHeap::tryAllocateLargeChunk rounds up
1303         https://bugs.webkit.org/show_bug.cgi?id=200024
1304
1305         Reviewed by Saam Barati.
1306
1307         Start using a VM tag for IsoHeap instead of CLoop Stack.
1308
1309         * wtf/OSAllocator.h:
1310         * wtf/VMTags.h:
1311
1312 2019-07-20  Chris Dumez  <cdumez@apple.com>
1313
1314         Speed up HashTable decoding by reserving capacity and avoiding rehashing
1315         https://bugs.webkit.org/show_bug.cgi?id=199982
1316
1317         Reviewed by Saam Barati.
1318
1319         Introduce reserveInitialCapacity() on HashMap to reserve capacity on a
1320         HashMap and cut down on rehashing cost when possible.
1321
1322         * wtf/HashMap.h:
1323         * wtf/HashTable.h:
1324         (WTF::HashTable::reserveInitialCapacity):
1325
1326         * wtf/persistence/PersistentCoders.h:
1327         Use HashMap::reserveInitialCapacity() in the HashMap persistent decoder for
1328         performance.
1329
1330 2019-07-20  Alexander Mikhaylenko  <exalm7659@gmail.com>
1331
1332         REGRESSION(r246033/r246496): [GTK] Kinetic scrolling doesn't work
1333         https://bugs.webkit.org/show_bug.cgi?id=199322
1334
1335         Reviewed by Michael Catanzaro.
1336
1337         Introduce ENABLE_KINETIC_SCROLLING to explicitly always have kinetic scrolling on GTK.
1338
1339         * wtf/Platform.h:
1340
1341 2019-07-18  Youenn Fablet  <youenn@apple.com>
1342
1343         Make sure to set kCTFontFallbackOptionAttribute to kCTFontFallbackOptionSystem for system fonts
1344         https://bugs.webkit.org/show_bug.cgi?id=199769
1345         <rdar://problem/49390297>
1346
1347         Reviewed by Myles C. Maxfield.
1348
1349         * wtf/Platform.h:
1350
1351 2019-07-17  Christopher Reid  <chris.reid@sony.com>
1352
1353         Bytecode cache should use FileSystem
1354         https://bugs.webkit.org/show_bug.cgi?id=199759
1355
1356         Reviewed by Yusuke Suzuki.
1357
1358         * wtf/FileSystem.cpp:
1359         * wtf/FileSystem.h:
1360         Add support for creating MappedFileData from a preexisting file handle
1361         for use with locked files. Also support creating MappedFileData
1362         with either private or shared mappings.
1363
1364         * wtf/UUID.cpp:
1365         Avoid ASSERT with returning a LazyNeverDestroyed object that hasn't been created.
1366
1367         * wtf/glib/FileSystemGlib.cpp:
1368         * wtf/win/FileSystemWin.cpp:
1369         Add truncateFile implementations.
1370
1371 2019-07-17  Sam Weinig  <weinig@apple.com>
1372
1373         Add StringBuilder member function which allows makeString() style variadic argument construction
1374         https://bugs.webkit.org/show_bug.cgi?id=198997
1375
1376         Reviewed by Darin Adler.
1377
1378         Adds new StringBuilder::flexibleAppend(...) member function which allows passing one or more 
1379         string-adaptable (in the sense that there is StringTypeAdapter specialization for the 
1380         type) parameters. This re-ususes the variadic template infrastructure in StringConcatenate.h
1381         that is used for makeString(...) allowing for improvements in one to benefit the other.
1382
1383         The advantage of StringBuilder::flexibleAppend(...) over calling StringBuilder::append(...)
1384         multiple times (beyond the code sharing with makeString(...) is that it can avoid unnecessary
1385         additional re-allocations when the StringBuilder needs to expand it's capacity. It does this
1386         by computing the complete required length for all the passed arguments and then ensuring enough
1387         capacity is available. It also reduces the allocation overhead versus the anti-pattern of
1388         builder.append(makeString(...)).
1389
1390         Ideally, this member function should eventually just be called StringBuilder::append(...), but
1391         the current overload set for StringBuilder::append(...) makes this complicated due to overloads
1392         that take two arguments such as StringBuilder::append(const UChar*, unsigned). Going forward, we
1393         should rename or remove those overloads and move to a standard interface. 
1394
1395         * wtf/posix/FileSystemPOSIX.cpp:
1396         (WTF::FileSystemImpl::pathByAppendingComponents):
1397         Adopt StringBuilder::flexibleAppend, using to combine the append of '/' and component.
1398
1399         * wtf/text/StringBuilder.cpp:
1400         (WTF::StringBuilder::appendUninitialized):
1401         (WTF::StringBuilder::appendUninitializedWithoutOverflowCheck):
1402         Extract the part of appendUnitialized that doesn't do the overflow check
1403         into it's own member function to allow callers that have already done the
1404         overflow check to bypass it.
1405
1406         (WTF::StringBuilder::appendUninitializedWithoutOverflowCheckForUChar):
1407         (WTF::StringBuilder::appendUninitializedWithoutOverflowCheckForLChar):
1408         Added to allow template member function flexibleAppendFromAdapters to call
1409         appendUninitializedWithoutOverflowCheck without moving it to the header.
1410         
1411         * wtf/text/StringBuilder.h:
1412         (WTF::StringBuilder::flexibleAppendFromAdapters):
1413         (WTF::StringBuilder::flexibleAppend):
1414         Modeled on tryMakeStringFromAdapters in StringConcatenate.h, these
1415         eagerly compute the required length, expand the buffer and then use
1416         the existing string type adaptor accumulation functions used by makeString. 
1417
1418         * wtf/text/StringConcatenate.h:
1419         (WTF::stringTypeAdapterAccumulator):
1420         (WTF::tryMakeStringFromAdapters):
1421         (WTF::makeStringAccumulator): Deleted.
1422         Renames makeStringAccumulator to stringTypeAdapterAccumulator now that it is used
1423         by more than just makeString.
1424
1425 2019-07-17  Commit Queue  <commit-queue@webkit.org>
1426
1427         Unreviewed, rolling out r247505.
1428         https://bugs.webkit.org/show_bug.cgi?id=199871
1429
1430         "Caused failed ASSERT in stress test" (Requested by creid on
1431         #webkit).
1432
1433         Reverted changeset:
1434
1435         "Bytecode cache should use FileSystem"
1436         https://bugs.webkit.org/show_bug.cgi?id=199759
1437         https://trac.webkit.org/changeset/247505
1438
1439 2019-07-16  Christopher Reid  <chris.reid@sony.com>
1440
1441         Bytecode cache should use FileSystem
1442         https://bugs.webkit.org/show_bug.cgi?id=199759
1443
1444         Reviewed by Yusuke Suzuki.
1445
1446         * wtf/FileSystem.cpp:
1447         * wtf/FileSystem.h:
1448         Add support for creating MappedFileData from a preexisting file handle
1449         for use with locked files. Also support creating MappedFileData
1450         with either private or shared mappings.
1451
1452         * wtf/UUID.cpp:
1453         Avoid ASSERT with returning a LazyNeverDestroyed object that hasn't been created.
1454
1455         * wtf/glib/FileSystemGlib.cpp:
1456         * wtf/win/FileSystemWin.cpp:
1457         Add truncateFile implementations.
1458
1459 2019-07-16  Myles C. Maxfield  <mmaxfield@apple.com>
1460
1461         New York font erroneously gets synthetic bold
1462         https://bugs.webkit.org/show_bug.cgi?id=199653
1463
1464         Unreviewed MacCatalyst build fix.
1465
1466         * wtf/Platform.h:
1467
1468 2019-07-16  Michael Catanzaro  <mcatanzaro@igalia.com>
1469
1470         [WPE][GTK] Improvements and fixes in FileSystemGlib.cpp
1471         https://bugs.webkit.org/show_bug.cgi?id=199800
1472
1473         Reviewed by Carlos Garcia Campos.
1474
1475         Use nullptr.
1476
1477         Fix a GFileInfo leak in getFileSize.
1478
1479         Use GRefPtr to clarify ownership of the GFileIOStream in openFile.
1480
1481         * wtf/glib/FileSystemGlib.cpp:
1482         (WTF::FileSystemImpl::getFileSize):
1483         (WTF::FileSystemImpl::getVolumeFreeSpace):
1484         (WTF::FileSystemImpl::openTemporaryFile):
1485         (WTF::FileSystemImpl::openFile):
1486         (WTF::FileSystemImpl::seekFile):
1487         (WTF::FileSystemImpl::writeToFile):
1488         (WTF::FileSystemImpl::readFromFile):
1489
1490 2019-07-15  Myles C. Maxfield  <mmaxfield@apple.com>
1491
1492         New York font erroneously gets synthetic bold
1493         https://bugs.webkit.org/show_bug.cgi?id=199653
1494
1495         Unreviewed watchOS build fix.
1496
1497         * wtf/Platform.h:
1498
1499 2019-07-15  Commit Queue  <commit-queue@webkit.org>
1500
1501         Unreviewed, rolling out r247462.
1502         https://bugs.webkit.org/show_bug.cgi?id=199816
1503
1504         completely messed up the patch (Requested by litherum on
1505         #webkit).
1506
1507         Reverted changeset:
1508
1509         "New York font erroneously gets synthetic bold"
1510         https://bugs.webkit.org/show_bug.cgi?id=199653
1511         https://trac.webkit.org/changeset/247462
1512
1513 2019-07-11  Myles C. Maxfield  <mmaxfield@apple.com>
1514
1515         New York font erroneously gets synthetic bold
1516         https://bugs.webkit.org/show_bug.cgi?id=199653
1517         <rdar://problem/51692592>
1518
1519         Reviewed by Simon Fraser.
1520
1521         * wtf/Platform.h:
1522
1523 2019-07-15  Brady Eidson  <beidson@apple.com>
1524
1525         Make WKURLSchemeTask thread safe.
1526         <rdar://problem/50471863> and https://bugs.webkit.org/show_bug.cgi?id=199764
1527
1528         Reviewed by Alex Christensen.
1529
1530         * wtf/MainThread.cpp:
1531         (WTF::callOnMainAndWait):
1532         (WTF::callOnMainRunLoopAndWait):
1533         (WTF::callOnMainThreadAndWait):
1534         * wtf/MainThread.h:
1535
1536 2019-07-15  Dean Jackson  <dino@apple.com>
1537
1538         MacCatalyst asserts when command key is raised
1539         https://bugs.webkit.org/show_bug.cgi?id=199805
1540         <rdar://problem/53120393>
1541
1542         Reviewed by Tim Horton.
1543
1544         Add USE_UIKIT_KEYBOARD_ADDITIONS for iOS 13+ and macCatalyst.
1545
1546         * wtf/FeatureDefines.h:
1547
1548 2019-07-14  Chris Dumez  <cdumez@apple.com>
1549
1550         Add threading assertion to WeakPtrFactory::createWeakPtr()
1551         https://bugs.webkit.org/show_bug.cgi?id=199639
1552
1553         Reviewed by Ryosuke Niwa.
1554
1555         Add threading assertion to WeakPtrFactory::createWeakPtr() to make sure it
1556         is called on the same thread where the WeakPtrFactory wad constructed.
1557
1558         * wtf/WeakPtr.h:
1559         (WTF::WeakPtrFactory::WeakPtrFactory):
1560         (WTF::WeakPtrFactory::createWeakPtr const):
1561
1562 2019-07-14  Dean Jackson  <dino@apple.com>
1563
1564         WebGL not supported on WKWebView on UIKit for Mac
1565         https://bugs.webkit.org/show_bug.cgi?id=199785
1566         <rdar://problem/52911449>
1567
1568         Reviewed by Antoine Quint.
1569
1570         MacCatalyst has Apple Graphics Control, although
1571         this area is very messy, see <rdar://53062794>.
1572
1573         * wtf/Platform.h:
1574
1575 2019-07-11  Myles C. Maxfield  <mmaxfield@apple.com>
1576
1577         New York font erroneously gets synthetic bold
1578         https://bugs.webkit.org/show_bug.cgi?id=199653
1579         <rdar://problem/51692592>
1580
1581         Reviewed by Simon Fraser.
1582
1583         * wtf/Platform.h:
1584
1585 2019-07-11  Pablo Saavedra  <psaavedra@igalia.com>
1586
1587         [WPE][GTK] Build failure with ENABLE_ACCESSIBILITY=OFF
1588         https://bugs.webkit.org/show_bug.cgi?id=199625
1589
1590         Added ENABLE(ACCESSIBILITY) and replaced HAVE(ACCESSIBILITY)
1591         with ENABLE(ACCESSIBILITY) in the code.
1592
1593         Additionally, the TestRunner code generator now honors the
1594         Conditional IDL format.
1595
1596         Reviewed by Konstantin Tokarev.
1597
1598         * wtf/FeatureDefines.h:
1599         * wtf/Platform.h:
1600
1601 2019-07-10  Ryan Haddad  <ryanhaddad@apple.com>
1602
1603         Unreviewed, rolling out r247286.
1604
1605         Caused TestWTF.WTF.StringOperators to fail on debug bots
1606
1607         Reverted changeset:
1608
1609         "Add StringBuilder member function which allows makeString()
1610         style variadic argument construction"
1611         https://bugs.webkit.org/show_bug.cgi?id=198997
1612         https://trac.webkit.org/changeset/247286
1613
1614 2019-07-09  Michael Catanzaro  <mcatanzaro@igalia.com>
1615
1616         [WPE][GTK] GUniqueOutPtr::release should return a raw pointer
1617         https://bugs.webkit.org/show_bug.cgi?id=199579
1618
1619         Reviewed by Carlos Garcia Campos.
1620
1621         GUniqueOutPtr::release should release to a raw pointer, rather than a GUniquePtr. If a
1622         GUniquePtr is desired, it's trivial to construct one from the raw pointer, but all existing
1623         callsites under Source/ would rather have a raw pointer. Currently they have to call
1624         release().release() to get the raw pointer, which is annoying.
1625
1626         * wtf/glib/GUniquePtr.h:
1627         (WTF::GUniqueOutPtr::release):
1628
1629 2019-07-09  Sam Weinig  <weinig@apple.com>
1630
1631         Add StringBuilder member function which allows makeString() style variadic argument construction
1632         https://bugs.webkit.org/show_bug.cgi?id=198997
1633
1634         Reviewed by Darin Adler.
1635
1636         Adds new StringBuilder::flexibleAppend(...) member function which allows passing one or more 
1637         string-adaptable (in the sense that there is StringTypeAdapter specialization for the 
1638         type) parameters. This re-ususes the variadic template infrastructure in StringConcatenate.h
1639         that is used for makeString(...) allowing for improvements in one to benefit the other.
1640
1641         The advantage of StringBuilder::flexibleAppend(...) over calling StringBuilder::append(...)
1642         multiple times (beyond the code sharing with makeString(...) is that it can avoid unnecessary
1643         additional re-allocations when the StringBuilder needs to expand it's capacity. It does this
1644         by computing the complete required length for all the passed arguments and then ensuring enough
1645         capacity is available. It also reduces the allocation overhead versus the anti-pattern of
1646         builder.append(makeString(...)).
1647
1648         Ideally, this member function should eventually just be called StringBuilder::append(...), but
1649         the current overload set for StringBuilder::append(...) makes this complicated due to overloads
1650         that take two arguments such as StringBuilder::append(const UChar*, unsigned). Going forward, we
1651         should rename or remove those overloads and move to a standard interface. 
1652
1653         * wtf/posix/FileSystemPOSIX.cpp:
1654         (WTF::FileSystemImpl::pathByAppendingComponents):
1655         Adopt StringBuilder::flexibleAppend, using to combine the append of '/' and component.
1656
1657         * wtf/text/StringBuilder.cpp:
1658         (WTF::StringBuilder::appendUninitialized):
1659         (WTF::StringBuilder::appendUninitializedWithoutOverflowCheck):
1660         Extract the part of appendUnitialized that doesn't do the overflow check
1661         into it's own member function to allow callers that have already done the
1662         overflow check to bypass it.
1663
1664         (WTF::StringBuilder::appendUninitializedWithoutOverflowCheckForUChar):
1665         (WTF::StringBuilder::appendUninitializedWithoutOverflowCheckForLChar):
1666         Added to allow template member function flexibleAppendFromAdapters to call
1667         appendUninitializedWithoutOverflowCheck without moving it to the header.
1668         
1669         * wtf/text/StringBuilder.h:
1670         (WTF::StringBuilder::flexibleAppendFromAdapters):
1671         (WTF::StringBuilder::flexibleAppend):
1672         Modeled on tryMakeStringFromAdapters in StringConcatenate.h, these
1673         eagerly compute the required length, expand the buffer and then use
1674         the existing string type adaptor accumulation functions used by makeString. 
1675
1676         * wtf/text/StringConcatenate.h:
1677         (WTF::stringTypeAdapterAccumulator):
1678         (WTF::tryMakeStringFromAdapters):
1679         (WTF::makeStringAccumulator): Deleted.
1680         Renames makeStringAccumulator to stringTypeAdapterAccumulator now that it is used
1681         by more than just makeString.
1682
1683 2019-07-09  Alex Christensen  <achristensen@webkit.org>
1684
1685         When parsing an IPv4 address, wait until after deciding it is indeed an IPv4 address before reporting syntax violations
1686         https://bugs.webkit.org/show_bug.cgi?id=199628
1687
1688         Reviewed by Brady Eidson.
1689
1690         Otherwise, we sometimes report syntax violations on things that are not IPv4 addresses and don't have syntax violations.
1691         I added a unit test with one such URL that used to cause an assertion.
1692
1693         * wtf/URLParser.cpp:
1694         (WTF::URLParser::parseIPv4Host):
1695
1696 2019-07-09  Alex Christensen  <achristensen@webkit.org>
1697
1698         Remove invalid assertion in URLParser::domainToASCII
1699         https://bugs.webkit.org/show_bug.cgi?id=199624
1700
1701         Reviewed by Brady Eidson.
1702
1703         When a non-ASCII domain's punycode encoding is longer than 63 characters,
1704         the URL is supposed to fail to parse, according to https://www.unicode.org/reports/tr46/#ToASCII
1705         We and all other browsers do this.  When uidna_nameToASCII tries to punycode encode such a domain,
1706         it can return a number larger than 63.  In this case, processingDetails.errors is UIDNA_ERROR_LABEL_TOO_LONG
1707         and we fail to parse as desired and uidna_nameToASCII did not write out of bounds, so it was just the assertion
1708         that was wrong.  I added some unit tests that would have hit the assertion and verify that we fail at the correct length.
1709
1710         * wtf/URLParser.cpp:
1711         (WTF::URLParser::domainToASCII):
1712
1713 2019-07-09  Alex Christensen  <achristensen@webkit.org>
1714
1715         URLParser should reserialize IPv6 addresses that end with a colon
1716         https://bugs.webkit.org/show_bug.cgi?id=199627
1717
1718         Reviewed by Brady Eidson.
1719
1720         When an IPv6 address ends in a colon, the colon should be removed which means the
1721         serialized output is different than the input, which the URLParser calls a syntax violation.
1722         This matches the URL specification, and I added a unit test that used to assert.
1723
1724         * wtf/URLParser.cpp:
1725         (WTF::URLParser::parseIPv6Host):
1726
1727 2019-07-08  Chris Dumez  <cdumez@apple.com>
1728
1729         Use WeakHashSet for WebUserContentControllerProxy::m_processes
1730         https://bugs.webkit.org/show_bug.cgi?id=199591
1731         <rdar://problem/52798721>
1732
1733         Reviewed by Youenn Fablet.
1734
1735         Update WeakHashSet::add() to return an AddResult type, similarly to our other containers.
1736
1737         * wtf/WeakHashSet.h:
1738         (WTF::WeakHashSet::add):
1739
1740 2019-07-08  Christopher Reid  <chris.reid@sony.com>
1741
1742         Implement MappedFileData for Windows
1743         https://bugs.webkit.org/show_bug.cgi?id=198269
1744
1745         Reviewed by Darin Adler.
1746
1747         Original patch by Fujii Hironori.
1748
1749         Add Windows implementations for MappedFileData constructor and destructor.
1750
1751         * wtf/FileSystem.cpp:
1752         * wtf/FileSystem.h:
1753         * wtf/win/FileSystemWin.cpp:
1754
1755 2019-07-08  Chris Dumez  <cdumez@apple.com>
1756
1757         Add threading assertion to WTF::CompletionHandler
1758         https://bugs.webkit.org/show_bug.cgi?id=199516
1759
1760         Reviewed by Alex Christensen.
1761
1762         Add threading assertion to WTF::CompletionHandler to try and catch common cases
1763         of unsafe usage (completion handler constructed on one thread but called on
1764         another).
1765
1766         * wtf/CompletionHandler.h:
1767         (WTF::CompletionHandler<Out):
1768
1769 2019-07-08  Antoine Quint  <graouts@apple.com>
1770
1771         [Pointer Events] Enable only on the most recent version of the supported iOS family
1772         https://bugs.webkit.org/show_bug.cgi?id=199562
1773         <rdar://problem/52766511>
1774
1775         Reviewed by Dean Jackson.
1776
1777         We really don't need HAVE_UI_WEB_TOUCH_EVENTS_GESTURE_RECOGNIZER_WITH_ACTIVE_TOUCHES_BY_ID since the UIKit SPI
1778         that was added in iOS 13 that it's checking for is really required for all parts of the implementation of Pointer
1779         Events, including dispatch of the "pointercancel" event and support for the "touch-action" CSS property.
1780
1781         * wtf/Platform.h:
1782
1783 2019-07-05  Ryan Haddad  <ryanhaddad@apple.com>
1784
1785         Unreviewed, rolling out r247115.
1786
1787         Breaks lldbWebKitTester (and by extension, test-webkitpy)
1788
1789         Reverted changeset:
1790
1791         "[WHLSL] Standard library is too big to directly include in
1792         WebCore"
1793         https://bugs.webkit.org/show_bug.cgi?id=198186
1794         https://trac.webkit.org/changeset/247115
1795
1796 2019-07-03  Jonathan Bedard  <jbedard@apple.com>
1797
1798         [Catalina] Enable WebKit build
1799         https://bugs.webkit.org/show_bug.cgi?id=199209
1800
1801         Reviewed by Darin Adler.
1802
1803         * wtf/spi/cocoa/SecuritySPI.h: Declare SecTrustedApplicationCreateFromPath(...).
1804
1805 2019-07-03  Keith Miller  <keith_miller@apple.com>
1806
1807         PACCage should first cage leaving PAC bits intact then authenticate
1808         https://bugs.webkit.org/show_bug.cgi?id=199372
1809
1810         Reviewed by Saam Barati.
1811
1812         * wtf/CagedPtr.h:
1813         (WTF::CagedPtr::get const):
1814         (WTF::CagedPtr::getMayBeNull const):
1815         (WTF::CagedPtr::mergePointers):
1816
1817 2019-07-03  Ryan Haddad  <ryanhaddad@apple.com>
1818
1819         Unreviewed, rolling out r246616.
1820
1821         Caused http/tests/inspector/network/har/har-page.html to fail
1822         on Catalina.
1823
1824         Reverted changeset:
1825
1826         "Web Inspector: Network: replace CFNetwork SPI with new API
1827         where able"
1828         https://bugs.webkit.org/show_bug.cgi?id=198762
1829         https://trac.webkit.org/changeset/246616
1830
1831 2019-07-02  Commit Queue  <commit-queue@webkit.org>
1832
1833         Unreviewed, rolling out r247041.
1834         https://bugs.webkit.org/show_bug.cgi?id=199425
1835
1836         broke some iOS arm64e tests (Requested by keith_miller on
1837         #webkit).
1838
1839         Reverted changeset:
1840
1841         "PACCage should first cage leaving PAC bits intact then
1842         authenticate"
1843         https://bugs.webkit.org/show_bug.cgi?id=199372
1844         https://trac.webkit.org/changeset/247041
1845
1846 2019-07-02  Chris Dumez  <cdumez@apple.com>
1847
1848         ThreadSafeRefCounted<DestructionThread::Main> is not safe to use in the UIProcess
1849         https://bugs.webkit.org/show_bug.cgi?id=199420
1850         <rdar://problem/52289717>
1851
1852         Reviewed by Ryosuke Niwa.
1853
1854         * wtf/MainThread.cpp:
1855         (WTF::isMainRunLoop):
1856         (WTF::callOnMainRunLoop):
1857         * wtf/MainThread.h:
1858         Add some function to MainThread.h to be used by ThreadSafeRefCounted to interact with the
1859         main RunLoop. This is used to avoid a circular dependency between RunLoop (which is
1860         ThreadSafeRefCounted) and ThreadSafeReCounted.
1861
1862         * wtf/ThreadSafeRefCounted.h:
1863         (WTF::ThreadSafeRefCounted::deref const):
1864         Add a new DestructionThread::MainRunLoop enum value to be used by classes that need to
1865         be destroyed on the main RunLoop rather than the main thread (which may be different
1866         when WK1 is invoved)
1867
1868 2019-07-02  Robin Morisset  <rmorisset@apple.com>
1869
1870         [WHLSL] the initializer in VariableDeclaration should be a std::unique_ptr, not Optional<UniqueRef<..>>
1871         https://bugs.webkit.org/show_bug.cgi?id=199389
1872
1873         Reviewed by Sam Weinig.
1874
1875         * wtf/UniqueRef.h:
1876         (WTF::UniqueRef::moveToUniquePtr): Added.
1877
1878 2019-07-02  Keith Miller  <keith_miller@apple.com>
1879
1880         PACCage should first cage leaving PAC bits intact then authenticate
1881         https://bugs.webkit.org/show_bug.cgi?id=199372
1882
1883         Reviewed by Saam Barati.
1884
1885         * wtf/CagedPtr.h:
1886         (WTF::CagedPtr::get const):
1887         (WTF::CagedPtr::getMayBeNull const):
1888         (WTF::CagedPtr::mergePointers):
1889
1890 2019-07-01  Philippe Normand  <pnormand@igalia.com>
1891
1892         [GStreamer] Cannot play Bert's Bytes radio stream from http://radio.dos.nl/
1893         https://bugs.webkit.org/show_bug.cgi?id=198376
1894
1895         Reviewed by Xabier Rodriguez-Calvar.
1896
1897         * wtf/glib/GLibUtilities.h:
1898         (enumToString): Utility function to get a string representation of of a GLib enum.
1899
1900 2019-06-22  Darin Adler  <darin@apple.com>
1901
1902         Streamline some string code, focusing on functions that were using substringSharingImpl
1903         https://bugs.webkit.org/show_bug.cgi?id=198898
1904
1905         Reviewed by Daniel Bates.
1906
1907         * wtf/URLHelpers.cpp:
1908         (WTF::URLHelpers::applyHostNameFunctionToURLString): Change code using
1909         substringSharingImpl so it could call String::find to call StringView::contains
1910         instead. Also rewrote lambdas to be simpler and likely more efficient.
1911         Rewrote another case using substringSharingImpl so it could call String::find
1912         to call StringView::find instead.
1913
1914         * wtf/text/StringView.cpp:
1915         (WTF::StringView::startsWith const): Added.
1916
1917         * wtf/text/StringView.h: Tweaked style a bit, and added an overload of
1918         StringView::contains that takes a CodeUnitMatchFunction and an overload
1919         of startsWith that cakes a UChar.
1920
1921 2019-06-28  Konstantin Tokarev  <annulen@yandex.ru>
1922
1923         Remove traces of ENABLE_ICONDATABASE remaining after its removal in 219733
1924         https://bugs.webkit.org/show_bug.cgi?id=199317
1925
1926         Reviewed by Michael Catanzaro.
1927
1928         While IconDatabase and all code using it was removed,
1929         ENABLE_ICONDATABASE still exists as build option and C++ macro.
1930
1931         * wtf/FeatureDefines.h:
1932
1933 2019-06-27  Konstantin Tokarev  <annulen@yandex.ru>
1934
1935         Avoid using WTF::Function for passing local function pointers and closures in URLHelpers.cpp
1936         https://bugs.webkit.org/show_bug.cgi?id=199271
1937
1938         Reviewed by Yusuke Suzuki.
1939
1940         WTF::Function allocates memory on heap, which is totally redundant in this
1941         case.
1942
1943         * wtf/URLHelpers.cpp:
1944         (WTF::URLHelpers::isSecondLevelDomainNameAllowedByTLDRules):
1945
1946 2019-06-27  Timothy Hatcher  <timothy@apple.com>
1947
1948         Move WebKitLegacy off of a couple AppKit ivars.
1949         https://bugs.webkit.org/show_bug.cgi?id=199279
1950         rdar://problem/34983438
1951
1952         Reviewed by Tim Horton.
1953
1954         * wtf/Platform.h: Added HAVE_SUBVIEWS_IVAR_SPI.
1955
1956 2019-06-27  Beth Dakin  <bdakin@apple.com>
1957
1958         Upstream use of MACCATALYST
1959         https://bugs.webkit.org/show_bug.cgi?id=199245
1960         rdar://problem/51687723
1961
1962         Reviewed by Tim Horton.
1963
1964         * Configurations/SDKVariant.xcconfig:
1965         * wtf/FeatureDefines.h:
1966         * wtf/Platform.h:
1967
1968 2019-06-27  Don Olmstead  <don.olmstead@sony.com>
1969
1970         [FTW] Build JavaScriptCore
1971         https://bugs.webkit.org/show_bug.cgi?id=199254
1972
1973         Reviewed by Brent Fulgham.
1974
1975         * wtf/PlatformFTW.cmake: Added.
1976
1977 2019-06-27  Fujii Hironori  <Hironori.Fujii@sony.com>
1978
1979         [CMake] Bump cmake_minimum_required version to 3.10
1980         https://bugs.webkit.org/show_bug.cgi?id=199181
1981
1982         Reviewed by Don Olmstead.
1983
1984         * CMakeLists.txt:
1985
1986 2019-06-26  Konstantin Tokarev  <annulen@yandex.ru>
1987
1988         Remove unneeded #include <wtf/glib/GRefPtr.h>
1989         https://bugs.webkit.org/show_bug.cgi?id=199228
1990
1991         Reviewed by Michael Catanzaro.
1992
1993         * wtf/MemoryPressureHandler.h:
1994
1995 2019-06-26  Myles C. Maxfield  <mmaxfield@apple.com>
1996
1997         REGRESSION: ( r246394 ) webgpu/whlsl-buffer-fragment.html and webgpu/whlsl-buffer-vertex.html are failing
1998         https://bugs.webkit.org/show_bug.cgi?id=199012
1999
2000         Reviewed by Saam Barati.
2001
2002         * wtf/Platform.h:
2003
2004 2019-06-25  Keith Miller  <keith_miller@apple.com>
2005
2006         CagedPtr doesn't merge PAC bits back into the resulting caged pointer.
2007         https://bugs.webkit.org/show_bug.cgi?id=199214
2008
2009         Reviewed by Yusuke Suzuki.
2010
2011         The current code means that caging will just strip the any failed
2012         authentication bits. Adding this code doesn't appear to be a
2013         regression on iPhone Xs.
2014
2015         * wtf/CagedPtr.h:
2016         (WTF::CagedPtr::get const):
2017         (WTF::CagedPtr::getMayBeNull const):
2018         (WTF::CagedPtr::getUnsafe const):
2019         (WTF::CagedPtr::mergePointers):
2020
2021 2019-06-25  Sam Weinig  <weinig@apple.com>
2022
2023         Experiment with simple structured bindings use
2024         https://bugs.webkit.org/show_bug.cgi?id=198905
2025
2026         Reviewed by Darin Adler.
2027
2028         * wtf/URLHelpers.cpp:
2029         (WTF::URLHelpers::mapHostNames):
2030         Simplify code using c++ structured bindings (https://en.cppreference.com/w/cpp/language/structured_binding)
2031         to see if all the platforms will work with it.
2032
2033 2019-06-25  Adam Barth  <abarth@webkit.org>
2034
2035         [fuchsia] Update to newer zx_clock_get syscall
2036         https://bugs.webkit.org/show_bug.cgi?id=199191
2037
2038         Reviewed by Sam Weinig.
2039
2040         Fuchsia has changed the zx_clock_get syscall to return the clock value
2041         via an out parameter rather than via its return value. This change
2042         makes zx_clock_get consistent with all the other syscalls.
2043
2044         This patch updates our use of zx_clock_get to use the new syscall. The
2045         old syscall is no longer supported by Fuchsia.
2046
2047         * wtf/fuchsia/CPUTimeFuchsia.cpp:
2048         (WTF::CPUTime::get): Switch to using the out parameter.
2049         (WTF::CPUTime::forCurrentThread): Switch to using the out parameter.
2050
2051 2019-06-25  Michael Catanzaro  <mcatanzaro@igalia.com>
2052
2053         Fully rename WebKitGTK+ -> WebKitGTK everywhere
2054         https://bugs.webkit.org/show_bug.cgi?id=199159
2055
2056         Reviewed by Carlos Garcia Campos.
2057
2058         * wtf/URLParser.cpp:
2059         (WTF::URLParser::internationalDomainNameTranscoder):
2060
2061 2019-06-25  Michael Catanzaro  <mcatanzaro@igalia.com>
2062
2063         Require GCC 7
2064         https://bugs.webkit.org/show_bug.cgi?id=198914
2065
2066         Reviewed by Darin Adler.
2067
2068         Remove now-stale GCC version check.
2069
2070         * wtf/Compiler.h:
2071
2072 2019-06-23  Simon Fraser  <simon.fraser@apple.com>
2073
2074         Add OverflowScrollProxyNodes to the scrolling tree
2075         https://bugs.webkit.org/show_bug.cgi?id=199132
2076
2077         Reviewed by Antti Koivisto.
2078         
2079         Setting indent is useful if you want to make a new stream with the indent of an
2080         existing stream.
2081
2082         * wtf/text/TextStream.h:
2083         (WTF::TextStream::setIndent):
2084
2085 2019-06-20  Fujii Hironori  <Hironori.Fujii@sony.com>
2086
2087         Try to use C++14 std::enable_if_t in CheckedArithmetic.h again
2088         https://bugs.webkit.org/show_bug.cgi?id=199099
2089
2090         Reviewed by Ross Kirsling.
2091
2092         r242235 changed CheckedArithmetic to not use C++14. Let's try
2093         C++14 again.
2094
2095         * wtf/CheckedArithmetic.h: Use C++14 std::make_unsigned_t and std::enable_if_t.
2096
2097 2019-06-18  Darin Adler  <darin@apple.com>
2098
2099         Tidy up the remaining bits of the AtomicString to AtomString rename
2100         https://bugs.webkit.org/show_bug.cgi?id=198990
2101
2102         Reviewed by Michael Catanzaro.
2103
2104         * wtf/text/AtomString.cpp: Fix a comment.
2105         * wtf/text/AtomString.h: Tweak formatting a bit. Use nullptr instead of 0.
2106         Removed "using AtomicString = AtomString".
2107         * wtf/text/AtomStringImpl.cpp:
2108         (WTF::CStringTranslator::translate): Use setIsAtom instead of setIsAtomic.
2109         (WTF::UCharBufferTranslator::translate): Ditto.
2110         (WTF::HashAndUTF8CharactersTranslator::translate): Ditto.
2111         (WTF::SubstringTranslator::translate): Ditto.
2112         (WTF::LCharBufferTranslator::translate): Ditto.
2113         (WTF::BufferFromStaticDataTranslator::translate): Ditto.
2114         (WTF::AtomStringImpl::addSlowCase): Ditto.
2115         (WTF::AtomStringImpl::lookUpSlowCase): Updated assertion message.
2116
2117         * wtf/text/AtomStringImpl.h: Tweaked the implementation of add.
2118         Updated comments to say AtomString.
2119
2120         * wtf/text/AtomStringTable.cpp:
2121         (WTF::AtomStringTable::~AtomStringTable): Use setIsAtom.
2122
2123         * wtf/text/StringImpl.h: Updated name of StringAtomic and
2124         s_hashFlagStringKindIsAtom. Renamed to flagIsAtom and setIsAtom.
2125
2126         * wtf/text/WTFString.cpp:
2127         (WTF::String::isSafeToSendToAnotherThread const): Updated comment.
2128
2129 2019-06-20  Carlos Garcia Campos  <cgarcia@igalia.com>
2130
2131         [GTK] Remove support for GTK2 plugins
2132         https://bugs.webkit.org/show_bug.cgi?id=199065
2133
2134         Reviewed by Sergio Villar Senin.
2135
2136         * wtf/Platform.h:
2137         * wtf/glib/GTypedefs.h:
2138
2139 2019-06-19  Yusuke Suzuki  <ysuzuki@apple.com>
2140
2141         [bmalloc] IsoHeap's initialization is racy with IsoHeap::isInitialized
2142         https://bugs.webkit.org/show_bug.cgi?id=199053
2143
2144         Reviewed by Saam Barati.
2145
2146         Add constexpr static functions to generate pseudo random numbers from __LINE__.
2147
2148         * wtf/WeakRandom.h:
2149         (WTF::WeakRandom::nextState):
2150         (WTF::WeakRandom::generate):
2151         (WTF::WeakRandom::advance):
2152
2153 2019-06-19  Fujii Hironori  <Hironori.Fujii@sony.com>
2154
2155         Add WTF::crossThreadCopy(T&&) to utilize String::isolatedCopy() &&
2156         https://bugs.webkit.org/show_bug.cgi?id=198957
2157
2158         Reviewed by Alex Christensen.
2159
2160         &&-qualified String::isolatedCopy() has a optimization path which
2161         does just WTFMove if it isSafeToSendToAnotherThread which means
2162         the object hasOneRef.
2163
2164         However, WTF::crossThreadCopy was using only &-qualified
2165         isolatedCopy. To use the optimization, added
2166         WTF::crossThreadCopy(T&&) overloading.
2167
2168         * wtf/CrossThreadCopier.h:
2169         (WTF::crossThreadCopy): Added a overload of (T&&).
2170         * wtf/CrossThreadTask.h:
2171         (WTF::createCrossThreadTask): Removed explicit template arguments of crossThreadCopy.
2172
2173 2019-06-19  Devin Rousso  <drousso@apple.com>
2174
2175         Web Inspector: Network: replace CFNetwork SPI with new API where able
2176         https://bugs.webkit.org/show_bug.cgi?id=198762
2177
2178         Reviewed by Timothy Hatcher.
2179
2180         * wtf/Platform.h:
2181
2182 2019-06-19  Alex Christensen  <achristensen@webkit.org>
2183
2184         Add a unit test for client certificate authentication
2185         https://bugs.webkit.org/show_bug.cgi?id=197800
2186
2187         Reviewed by Youenn Fablet.
2188
2189         * wtf/spi/cocoa/SecuritySPI.h:
2190         Move declarations from ArgumentCodersCF.cpp so they can be shared.
2191
2192 2019-06-19  Adrian Perez de Castro  <aperez@igalia.com>
2193
2194         [WPE][GTK] Fix build with unified sources disabled
2195         https://bugs.webkit.org/show_bug.cgi?id=198752
2196
2197         Reviewed by Michael Catanzaro.
2198
2199         * wtf/text/StringBuilder.h: Add missing include of StringConcatenateNumbers.h
2200
2201 2019-06-19  Zan Dobersek  <zdobersek@igalia.com>
2202
2203         USE_ANGLE macro can be evaluated without being defined
2204         https://bugs.webkit.org/show_bug.cgi?id=198991
2205
2206         Reviewed by Carlos Garcia Campos.
2207
2208         * wtf/Platform.h: On platforms not yet defining USE_ANGLE, the
2209         incompatibility check with some other flags leads to the macro being
2210         evaluated even when it was not defined, producing compiler warnings.
2211         To avoid this, the macro should be defined to 0 before the check in
2212         case it was not defined already.
2213
2214 2019-06-18  Dean Jackson  <dino@apple.com>
2215
2216         UIContextMenuInteraction implementation for WKContentView
2217         https://bugs.webkit.org/show_bug.cgi?id=198986
2218         <rdar://problem/51875189>
2219
2220         Reviewed by Andy Estes.
2221
2222         Add USE_UICONTEXTMENU for iOS 13+.
2223
2224         * wtf/Platform.h:
2225
2226 2019-06-18  Kenneth Russell  <kbr@chromium.org>
2227
2228         Add preliminary ANGLE backend to WebCore
2229         https://bugs.webkit.org/show_bug.cgi?id=197755
2230
2231         Reviewed by Dean Jackson.
2232
2233         Add a USE_ANGLE definition to wtf/Platform.h (currently disabled)
2234         which, when enabled, uses ANGLE instead of the OpenGL or OpenGL ES
2235         backend.
2236
2237         * wtf/Platform.h:
2238
2239 2019-06-17  Jiewen Tan  <jiewen_tan@apple.com>
2240
2241         Move SOAuthorization from WebKitAdditions to WebKit
2242         https://bugs.webkit.org/show_bug.cgi?id=198874
2243         <rdar://problem/47573431>
2244
2245         Reviewed by Brent Fulgham.
2246
2247         * wtf/Platform.h:
2248         Adds a feature flag to detect AppSSO framework.
2249
2250 2019-06-17  Ryan Haddad  <ryanhaddad@apple.com>
2251
2252         Unreviewed, rolling out r246501.
2253
2254         Breaks Apple internal builds.
2255
2256         Reverted changeset:
2257
2258         "Support using ANGLE as the backend for the WebGL
2259         implementation"
2260         https://bugs.webkit.org/show_bug.cgi?id=197755
2261         https://trac.webkit.org/changeset/246501
2262
2263 2019-06-17  Kenneth Russell  <kbr@chromium.org>
2264
2265         Support using ANGLE as the backend for the WebGL implementation
2266         https://bugs.webkit.org/show_bug.cgi?id=197755
2267
2268         Reviewed by Dean Jackson.
2269
2270         Add a USE_ANGLE definition to wtf/Platform.h (currently disabled)
2271         which, when enabled, uses ANGLE instead of the OpenGL or OpenGL ES
2272         backend.
2273
2274         * wtf/Platform.h:
2275
2276 2019-06-16  Darin Adler  <darin@apple.com>
2277
2278         Rename AtomicString to AtomString
2279         https://bugs.webkit.org/show_bug.cgi?id=195276
2280
2281         Reviewed by Michael Catanzaro.
2282
2283         * many files: Let do-webcore-rename do the renaming.
2284
2285         * wtf/text/AtomString.h: After renaming, added AtomicString as a synonym for
2286         now; helps smooth things over with a tiny bit of Apple internal software so
2287         we don't have to do this all at once. Can remove it soon.
2288
2289 2019-06-16  Eric Carlson  <eric.carlson@apple.com>
2290
2291         [MediaStream] Avoid roundoff error when setting AVCapture min/max frame rate
2292         https://bugs.webkit.org/show_bug.cgi?id=198875
2293         <rdar://problem/51768374>
2294
2295         Reviewed by Youenn Fablet.
2296
2297         * wtf/MediaTime.h:
2298         (WTF::LogArgument<MediaTime>::toString):
2299         (WTF::LogArgument<MediaTimeRange>::toString):
2300
2301 2019-06-12  Antoine Quint  <graouts@apple.com>
2302
2303         Show the web page URL when sharing an AR model
2304         https://bugs.webkit.org/show_bug.cgi?id=198812
2305         <rdar://problem/48689498>
2306
2307         Reviewed by Dean Jackson.
2308
2309         * wtf/Platform.h:
2310
2311 2019-06-12  Youenn Fablet  <youenn@apple.com>
2312
2313         Use NSURLSession for WebSocket
2314         https://bugs.webkit.org/show_bug.cgi?id=198568
2315
2316         Reviewed by Geoffrey Garen.
2317
2318         * wtf/Platform.h:
2319         Introduce compile flag for WebSocket NSURLSession
2320
2321 2019-06-12  Commit Queue  <commit-queue@webkit.org>
2322
2323         Unreviewed, rolling out r246322.
2324         https://bugs.webkit.org/show_bug.cgi?id=198796
2325
2326         "It's a huge page load regression on iOS" (Requested by
2327         saamyjoon on #webkit).
2328
2329         Reverted changeset:
2330
2331         "Roll out PAC cage"
2332         https://bugs.webkit.org/show_bug.cgi?id=198726
2333         https://trac.webkit.org/changeset/246322
2334
2335 2019-06-10  Simon Fraser  <simon.fraser@apple.com>
2336
2337         Add logging for UI-side compositing hit-testing
2338         https://bugs.webkit.org/show_bug.cgi?id=198739
2339
2340         Reviewed by Antti Koivisto.
2341
2342         Make it possible to output an Objective-C object to TextStream, which will
2343         log its -description.
2344
2345         Also add a template for OptionSet<> printing.
2346
2347         * WTF.xcodeproj/project.pbxproj:
2348         * wtf/text/TextStream.h:
2349         (WTF::operator<<):
2350         * wtf/text/cocoa/TextStreamCocoa.mm: Added.
2351         (WTF::TextStream::operator<<):
2352
2353 2019-06-11  Saam Barati  <sbarati@apple.com>
2354
2355         Roll out PAC cage
2356         https://bugs.webkit.org/show_bug.cgi?id=198726
2357
2358         Reviewed by Keith Miller.
2359
2360         * WTF.xcodeproj/project.pbxproj:
2361         * wtf/CMakeLists.txt:
2362         * wtf/CagedPtr.h:
2363         (WTF::CagedPtr::CagedPtr):
2364         (WTF::CagedPtr::get const):
2365         (WTF::CagedPtr::getMayBeNull const):
2366         (WTF::CagedPtr::operator=):
2367         (WTF::CagedPtr::operator== const):
2368         (WTF::CagedPtr::operator!= const):
2369         (WTF::CagedPtr::operator bool const):
2370         (WTF::CagedPtr::operator* const):
2371         (WTF::CagedPtr::operator-> const):
2372         (WTF::CagedPtr::operator[] const):
2373         (WTF::CagedPtr::getUnsafe const): Deleted.
2374         (WTF::CagedPtr::at const): Deleted.
2375         (WTF::CagedPtr::recage): Deleted.
2376         * wtf/CagedUniquePtr.h:
2377         (WTF::CagedUniquePtr::CagedUniquePtr):
2378         (WTF::CagedUniquePtr::create):
2379         (WTF::CagedUniquePtr::operator=):
2380         (WTF::CagedUniquePtr::~CagedUniquePtr):
2381         (WTF::CagedUniquePtr::destroy):
2382         * wtf/Gigacage.h:
2383         (Gigacage::caged):
2384         (Gigacage::cagedMayBeNull): Deleted.
2385         * wtf/PtrTag.h:
2386         (WTF::tagArrayPtr): Deleted.
2387         (WTF::untagArrayPtr): Deleted.
2388         (WTF::removeArrayPtrTag): Deleted.
2389         (WTF::retagArrayPtr): Deleted.
2390         * wtf/TaggedArrayStoragePtr.h:
2391         (WTF::TaggedArrayStoragePtr::TaggedArrayStoragePtr): Deleted.
2392         (WTF::TaggedArrayStoragePtr::get const): Deleted.
2393         (WTF::TaggedArrayStoragePtr::getUnsafe const): Deleted.
2394         (WTF::TaggedArrayStoragePtr::resize): Deleted.
2395         (WTF::TaggedArrayStoragePtr::operator bool const): Deleted.
2396
2397 2019-06-10  Andy Estes  <aestes@apple.com>
2398
2399         [iOS] Use PDFKit SPI for taking snapshots when the hosting app is not entitled for global capture
2400         https://bugs.webkit.org/show_bug.cgi?id=198731
2401         <rdar://problem/46215174>
2402
2403         Reviewed by Tim Horton.
2404
2405         * wtf/FeatureDefines.h:
2406
2407 2019-06-10  Sam Weinig  <weinig@apple.com>
2408
2409         Remove Dashboard support
2410         https://bugs.webkit.org/show_bug.cgi?id=198615
2411
2412         Reviewed by Ryosuke Niwa.
2413
2414         * wtf/FeatureDefines.h:
2415
2416 2019-06-10  Timothy Hatcher  <timothy@apple.com>
2417
2418         Integrate dark mode support for iOS.
2419         https://bugs.webkit.org/show_bug.cgi?id=198687
2420         rdar://problem/51545643
2421
2422         Reviewed by Tim Horton.
2423
2424         * wtf/Platform.h:
2425
2426 2019-06-08  Andy Estes  <aestes@apple.com>
2427
2428         [Apple Pay] If we have a bound interface identifier, set it on new PKPaymentRequests
2429         https://bugs.webkit.org/show_bug.cgi?id=198690
2430         <rdar://problem/48041803>
2431
2432         Reviewed by Tim Horton.
2433
2434         * wtf/FeatureDefines.h: Defined HAVE_PASSKIT_BOUND_INTERFACE_IDENTIFIER, and cleaned up some
2435         other PassKit HAVEs.
2436
2437 2019-06-06  Caio Lima  <ticaiolima@gmail.com>
2438
2439         [JSCOnly] JSCOnly port is not building on macOS
2440         https://bugs.webkit.org/show_bug.cgi?id=198563
2441
2442         Reviewed by Don Olmstead.
2443
2444         We are adding `<mach/vm_types.h>` to fix build issues when compiling
2445         JSCOnly port on macOS.
2446
2447         * wtf/WTFAssertions.cpp:
2448
2449 2019-06-03  Commit Queue  <commit-queue@webkit.org>
2450
2451         Unreviewed, rolling out r246022.
2452         https://bugs.webkit.org/show_bug.cgi?id=198486
2453
2454         Causing Internal build failures and JSC test failures
2455         (Requested by ShawnRoberts on #webkit).
2456
2457         Reverted changeset:
2458
2459         "Reenable Gigacage on ARM64."
2460         https://bugs.webkit.org/show_bug.cgi?id=198453
2461         https://trac.webkit.org/changeset/246022
2462
2463 2019-06-03  Darin Adler  <darin@apple.com>
2464
2465         Finish cleanup of String::number for floating point
2466         https://bugs.webkit.org/show_bug.cgi?id=198471
2467
2468         Reviewed by Yusuke Suzuki.
2469
2470         * wtf/JSONValues.cpp:
2471         (WTF::JSONImpl::Value::writeJSON const): Use appendNumber instead of
2472         appendECMAScriptNumber, since that's now the default.
2473
2474         * wtf/text/StringBuilder.cpp:
2475         (WTF::StringBuilder::appendNumber): Renamed from appendShortestFormNumber.
2476         * wtf/text/StringBuilder.h: Removed appendShortestFormNumber and
2477         appendECMAScriptNumber, replacing both with overload of appendNumber.
2478
2479         * wtf/text/WTFString.cpp:
2480         (WTF::String::number): Renamed from numberToStringShortest.
2481         * wtf/text/WTFString.h: Removed numberToStringShortest and
2482         numberToStringECMAScript, replacing both with overload of number.
2483
2484 2019-06-02  Keith Miller  <keith_miller@apple.com>
2485
2486         Reenable Gigacage on ARM64.
2487         https://bugs.webkit.org/show_bug.cgi?id=198453
2488
2489         Reviewed by Filip Pizlo.
2490
2491         * wtf/CagedPtr.h:
2492         (WTF::CagedPtr::authenticatingLoad):
2493         (WTF::CagedPtr::get const):
2494         (WTF::CagedPtr::getMayBeNull const):
2495
2496 2019-05-31  Alex Christensen  <achristensen@webkit.org>
2497
2498         URLParser::parseIPv6Host should properly parse 0's around compression
2499         https://bugs.webkit.org/show_bug.cgi?id=198424
2500
2501         Reviewed by Tim Horton.
2502
2503         * wtf/URLParser.cpp:
2504         (WTF::URLParser::parseIPv6Host):
2505
2506 2019-05-31  Alex Christensen  <achristensen@webkit.org>
2507
2508         URLParser::parseHostAndPort should not allow non-port characters after an ipv6 host
2509         https://bugs.webkit.org/show_bug.cgi?id=198428
2510         <rdar://problem/51209196>
2511
2512         Reviewed by Tim Horton.
2513
2514         This matches Chrome and Firefox.
2515
2516         * wtf/URLParser.cpp:
2517         (WTF::URLParser::parseHostAndPort):
2518
2519 2019-05-31  Tim Horton  <timothy_horton@apple.com>
2520
2521         Optionally respect device management restrictions when loading from the network
2522         https://bugs.webkit.org/show_bug.cgi?id=198318
2523         <rdar://problem/44263806>
2524
2525         Reviewed by Alex Christensen.
2526
2527         * wtf/Platform.h:
2528         Add a HAVE flag for DeviceManagement.framework.
2529         It does exist in the simulator, but does not function; pretend it doesn't exist.
2530
2531 2019-05-31  Geoffrey Garen  <ggaren@apple.com>
2532
2533         Some WeakPtr cleanup
2534         https://bugs.webkit.org/show_bug.cgi?id=198390
2535
2536         Reviewed by Chris Dumez.
2537
2538         * wtf/WeakHashSet.h:
2539         (WTF::HashTraits<Ref<WeakPtrImpl>>::isReleasedWeakValue):
2540         (WTF::WeakHashSet::WeakHashSetConstIterator::WeakHashSetConstIterator):
2541         Updated for rename to WeakPtrImpl.
2542
2543         (WTF::WeakHashSet::WeakHashSetConstIterator::get const): Updated for new
2544         get() interface. Also, switched to iterator operator* to help clarify
2545         the double dereference here.
2546
2547         (WTF::WeakHashSet::add):
2548         (WTF::WeakHashSet::remove):
2549         (WTF::WeakHashSet::contains const):
2550         (WTF::WeakHashSet::computeSize const):
2551         (WTF::HashTraits<Ref<WeakReference>>::isReleasedWeakValue): Deleted.
2552         Updated for rename to WeakPtrImpl.
2553
2554         * wtf/WeakPtr.h:
2555         (WTF::WeakPtrImpl::create):
2556         (WTF::WeakPtrImpl::~WeakPtrImpl): Renamed WeakReference to WeakPtrImpl.
2557         Now we don't need a comment explaining that this class is the backing
2558         implementation of WeakPtr.
2559
2560         (WTF::WeakPtrImpl::get): Return the pointer type we stored, rather than
2561         the pointer type requested by our client. It's a little too surprising
2562         for a field to store one pointer type and load another.
2563
2564         (WTF::WeakPtrImpl::WeakPtrImpl): Fixed a theoretical type safety bug.
2565         Make sure to store T::WeakValueType* instead of T*, since they might
2566         not be the same pointer value. (In practice, T and T::WeakValueType*
2567         are always the same type in this constructor because WeakPtrFactory
2568         makes them so, but it's best not to depend on implementation details
2569         across classes.)
2570
2571         (WTF::WeakPtr::get const): Updated for new get() interface.
2572
2573         (WTF::WeakPtr::operator bool const):
2574         (WTF::WeakPtr::operator=):
2575         (WTF::WeakPtr::clear):
2576         (WTF::WeakPtr::WeakPtr): Updated for WeakPtrImpl rename.
2577
2578         (WTF::WeakPtrFactory::~WeakPtrFactory): Updated for WeakPtrImpl rename.
2579
2580         (WTF::WeakPtrFactory::createWeakPtr const): ASSERT that the passed-in
2581         pointer is equal to the stored pointer. As a space optimization, we
2582         require our client to remind us what we point to each time a weak
2583         pointer is created -- but nothing guarantees that our client will do
2584         this correctly.
2585
2586         (WTF::WeakPtrFactory::revokeAll): Updated for WeakPtrImpl rename.
2587
2588         (WTF::CanMakeWeakPtr::weakPtrFactory const):
2589         (WTF::CanMakeWeakPtr::weakPtrFactory): Use idiomatic accessor naming.
2590
2591         (WTF::weak_ptr_impl_cast): Fixed a theoretical type safety bug.
2592         Previously, if Base and Derived both inherited CanMakeWeakPtr, and
2593         you casted WeakPtr<Base> to WeakPtr<Derived> (or vice versa), and
2594         casting Base <-> Derived required pointer fixup, the previous
2595         compile-time check would accept the cast, even though the stored pointer
2596         would be wrong.
2597
2598         (WTF::WeakPtr<T>::WeakPtr):
2599         (WTF::=):
2600         (WTF::makeWeakPtr):
2601         (WTF::WeakReference::create): Deleted.
2602         (WTF::WeakReference::~WeakReference): Deleted.
2603         (WTF::WeakReference::get const): Deleted.
2604         (WTF::WeakReference::operator bool const): Deleted.
2605         (WTF::WeakReference::clear): Deleted.
2606         (WTF::WeakReference::WeakReference): Deleted.
2607         (WTF::weak_reference_cast): Deleted. Updated for rename to WeakPtrImpl.
2608
2609         Don't export WeakPtrImpl because it's an implmenetation detail and
2610         it shouldn't be easy to use outside WTF.
2611
2612 2019-05-31  Don Olmstead  <don.olmstead@sony.com>
2613
2614         [CMake] Add WebKit::WTF target
2615         https://bugs.webkit.org/show_bug.cgi?id=198400
2616
2617         Reviewed by Konstantin Tokarev.
2618
2619         Create the WebKit::WTF target and use that to propagate headers. Use
2620         WEBKIT_COPY_FILES instead of WEBKIT_MAKE_FORWARDING_HEADERS.
2621
2622         * wtf/CMakeLists.txt:
2623
2624 2019-05-30  Saam Barati  <sbarati@apple.com>
2625
2626         [WHLSL] Enforce variable lifetimes
2627         https://bugs.webkit.org/show_bug.cgi?id=195794
2628         <rdar://problem/50746293>
2629
2630         Reviewed by Myles C. Maxfield.
2631
2632         * wtf/PrintStream.h:
2633
2634 2019-05-30  Keith Rollin  <krollin@apple.com>
2635
2636         Fix yet more deprecated uses of -[UIApplication interfaceOrientation]
2637         https://bugs.webkit.org/show_bug.cgi?id=198381
2638         <rdar://problem/51265846>
2639
2640         Reviewed by Wenson Hsieh.
2641
2642         r245267, r245272, and r245874 fixed many instances of this issue; this
2643         change fixes the issue for tvOS.
2644
2645         * wtf/FeatureDefines.h:
2646
2647 2019-05-29  David Kilzer  <ddkilzer@apple.com>
2648
2649         Clean up a few #include statements in WTF
2650         <https://webkit.org/b/198351>
2651
2652         Reviewed by Alex Christensen.
2653
2654         * benchmarks/HashSetDFGReplay.cpp:
2655         - Add missing "config.h" include.
2656         * wtf/ParallelJobsGeneric.cpp:
2657         - Replace include of ParallelJobs.h with
2658           ParallelJobsGeneric.h.
2659         * wtf/StackBounds.cpp:
2660         - Fix include ordering of StackBounds.h.
2661
2662 2019-05-29  Keith Rollin  <krollin@apple.com>
2663
2664         Followup to r245267 and r245272: fix even more deprecated uses of -[UIApplication interfaceOrientation]
2665         https://bugs.webkit.org/show_bug.cgi?id=198348
2666         <rdar://problem/51234077>
2667
2668         Reviewed by Wenson Hsieh.
2669
2670         r245267 and r245272 fixed many instances of this issue; this change
2671         fixes the issue for watchOS.
2672
2673         * wtf/FeatureDefines.h:
2674
2675 2019-05-29  David Kilzer  <ddkilzer@apple.com>
2676
2677         IndexedDatabase Server thread in com.apple.WebKit.Networking process leaks objects into an autoreleasePool that's never cleared
2678         <https://webkit.org/b/198346>
2679         <rdar://problem/50895658>
2680
2681         Reviewed by Brent Fulgham.
2682
2683         * wtf/CrossThreadTaskHandler.cpp:
2684         (WTF::CrossThreadTaskHandler::CrossThreadTaskHandler):
2685         - Add optional second argument to enable use of an
2686           AutodrainedPool when running the runloop.
2687         (WTF::CrossThreadTaskHandler::taskRunLoop):
2688         - Create an AutodrainedPool if requested when
2689           CrossThreadTaskHandler was created.
2690         * wtf/CrossThreadTaskHandler.h:
2691         (WTF::CrossThreadTaskHandler::AutodrainedPoolForRunLoop):
2692         - Add enum class for enabling an AutodrainedPool for
2693           CrossThreadTaskHandler::taskRunLoop().
2694         (WTF::CrossThreadTaskHandler::CrossThreadTaskHandler):
2695         - Add optional second argument to enable use of an
2696           AutodrainedPool when running the runloop.
2697
2698 2019-05-29  Geoffrey Garen  <ggaren@apple.com>
2699
2700         WeakPtr breaks vtables when upcasting to base classes
2701         https://bugs.webkit.org/show_bug.cgi?id=188799
2702
2703         Reviewed by Youenn Fablet.
2704
2705         This patch switches from reinterpret_cast to static_cast when loading
2706         from WeakReference storage.
2707
2708         We know which type to cast *to* because it's specified by the type of
2709         the calling WeakPtr.
2710
2711         We know which type to cast *from* because it's specified by a typedef
2712         in CanMakeWeakPtr.
2713
2714         (Our convention is that we store a pointer to the class that derives
2715         from CanMakeWeakPtr. We cast from that pointer to derived pointers when
2716         we get(). This means that #include of the derived type header is now
2717         required in order to get() the pointer.)
2718
2719         * wtf/WeakHashSet.h:
2720         (WTF::HashTraits<Ref<WeakReference>>::isReleasedWeakValue): Definition
2721         is now eagerly required because WeakReference is not a template anymore.
2722
2723         (WTF::WeakHashSet::WeakHashSetConstIterator::get const):
2724         (WTF::WeakHashSet::WeakHashSetConstIterator::skipEmptyBuckets):
2725         (WTF::WeakHashSet::remove):
2726         (WTF::WeakHashSet::contains const):
2727         (WTF::WeakHashSet::computesEmpty const):
2728         (WTF::WeakHashSet::hasNullReferences const):
2729         (WTF::WeakHashSet::computeSize const):
2730         (WTF::HashTraits<Ref<WeakReference<T>>>::isReleasedWeakValue): Deleted.
2731         Updated for new WeakReference get() API.
2732
2733         * wtf/WeakPtr.h: Use a macro for TestAPI support. We can't use template
2734         specialization because WeakReference is not a class template anymore.
2735         (Or maybe we could have kept it working with a dummy template argument?
2736         Felt weird, so I switched.)
2737
2738         (WTF::WeakReference::create):
2739         (WTF::WeakReference::~WeakReference):
2740         (WTF::WeakReference::get const):
2741         (WTF::WeakReference::operator bool const):
2742         (WTF::WeakReference::WeakReference): WeakReference is just a void* now.
2743         It's the caller's responsibility, when creating and getting, to use
2744         a consistent storage type. We ensure a canonical storage type using a
2745         typedef inside CanMakeWeakPtr.
2746
2747         (WTF::WeakPtr::WeakPtr):
2748         (WTF::WeakPtr::get const):
2749         (WTF::WeakPtr::operator bool const):
2750         (WTF::WeakPtr::operator-> const):
2751         (WTF::WeakPtr::operator* const): Adopted new WeakReference API.
2752
2753         (WTF::WeakPtrFactory::createWeakPtr const): No need for reinterpret_cast.
2754
2755         (WTF::weak_reference_cast): This isn't required for correctness, but it's
2756         nice to show a complier error at WeakPtr construction sites when you know
2757         that the types won't work. Otherwise, you get compiler errors at
2758         dereference sites, which are slightly more mysterious ways of saying that
2759         you constructed your WeakPtr incorrectly.
2760
2761         (WTF::WeakPtr<T>::WeakPtr):
2762         (WTF::=):
2763         (WTF::makeWeakPtr):
2764         (WTF::weak_reference_upcast): Deleted.
2765         (WTF::weak_reference_downcast): Deleted.
2766
2767 2019-05-29  Ryan Haddad  <ryanhaddad@apple.com>
2768
2769         Unreviewed, rolling out r245857.
2770
2771         Breaks internal builds.
2772
2773         Reverted changeset:
2774
2775         "WeakPtr breaks vtables when upcasting to base classes"
2776         https://bugs.webkit.org/show_bug.cgi?id=188799
2777         https://trac.webkit.org/changeset/245857
2778
2779 2019-05-28  Geoffrey Garen  <ggaren@apple.com>
2780
2781         WeakPtr breaks vtables when upcasting to base classes
2782         https://bugs.webkit.org/show_bug.cgi?id=188799
2783
2784         Reviewed by Youenn Fablet.
2785
2786         This patch switches from reinterpret_cast to static_cast when loading
2787         from WeakReference storage.
2788
2789         We know which type to cast *to* because it's specified by the type of
2790         the calling WeakPtr.
2791
2792         We know which type to cast *from* because it's specified by a typedef
2793         in CanMakeWeakPtr.
2794
2795         (Our convention is that we store a pointer to the class that derives
2796         from CanMakeWeakPtr. We cast from that pointer to derived pointers when
2797         we get(). This means that #include of the derived type header is now
2798         required in order to get() the pointer.)
2799
2800         * wtf/WeakHashSet.h:
2801         (WTF::HashTraits<Ref<WeakReference>>::isReleasedWeakValue): Definition
2802         is now eagerly required because WeakReference is not a template anymore.
2803
2804         (WTF::WeakHashSet::WeakHashSetConstIterator::get const):
2805         (WTF::WeakHashSet::WeakHashSetConstIterator::skipEmptyBuckets):
2806         (WTF::WeakHashSet::remove):
2807         (WTF::WeakHashSet::contains const):
2808         (WTF::WeakHashSet::computesEmpty const):
2809         (WTF::WeakHashSet::hasNullReferences const):
2810         (WTF::WeakHashSet::computeSize const):
2811         (WTF::HashTraits<Ref<WeakReference<T>>>::isReleasedWeakValue): Deleted.
2812         Updated for new WeakReference get() API.
2813
2814         * wtf/WeakPtr.h: Use a macro for TestAPI support. We can't use template
2815         specialization because WeakReference is not a class template anymore.
2816         (Or maybe we could have kept it working with a dummy template argument?
2817         Felt weird, so I switched.)
2818
2819         (WTF::WeakReference::create):
2820         (WTF::WeakReference::~WeakReference):
2821         (WTF::WeakReference::get const):
2822         (WTF::WeakReference::operator bool const):
2823         (WTF::WeakReference::WeakReference): WeakReference is just a void* now.
2824         It's the caller's responsibility, when creating and getting, to use
2825         a consistent storage type. We ensure a canonical storage type using a
2826         typedef inside CanMakeWeakPtr.
2827
2828         (WTF::WeakPtr::WeakPtr):
2829         (WTF::WeakPtr::get const):
2830         (WTF::WeakPtr::operator bool const):
2831         (WTF::WeakPtr::operator-> const):
2832         (WTF::WeakPtr::operator* const): Adopted new WeakReference API.
2833
2834         (WTF::WeakPtrFactory::createWeakPtr const): No need for reinterpret_cast.
2835
2836         (WTF::weak_reference_cast): This isn't required for correctness, but it's
2837         nice to show a complier error at WeakPtr construction sites when you know
2838         that the types won't work. Otherwise, you get compiler errors at
2839         dereference sites, which are slightly more mysterious ways of saying that
2840         you constructed your WeakPtr incorrectly.
2841
2842         (WTF::WeakPtr<T>::WeakPtr):
2843         (WTF::=):
2844         (WTF::makeWeakPtr):
2845         (WTF::weak_reference_upcast): Deleted.
2846         (WTF::weak_reference_downcast): Deleted.
2847
2848 2019-05-27  Chris Dumez  <cdumez@apple.com>
2849
2850         Use a strongly-typed identifier for pages
2851         https://bugs.webkit.org/show_bug.cgi?id=198206
2852
2853         Reviewed by Youenn Fablet.
2854
2855         * wtf/ObjectIdentifier.h:
2856         (WTF::operator<<):
2857
2858 2019-05-23  Don Olmstead  <don.olmstead@sony.com>
2859
2860         [CMake] Use target oriented design for bmalloc
2861         https://bugs.webkit.org/show_bug.cgi?id=198046
2862
2863         Reviewed by Konstantin Tokarev.
2864
2865         Use WebKit::bmalloc target.
2866
2867         * wtf/CMakeLists.txt:
2868
2869 2019-05-23  Ross Kirsling  <ross.kirsling@sony.com>
2870
2871         [PlayStation] Implement platformUserPreferredLanguages.
2872         https://bugs.webkit.org/show_bug.cgi?id=198149
2873
2874         Reviewed by Fujii Hironori.
2875
2876         * wtf/PlatformPlayStation.cmake:
2877         * wtf/playstation/LanguagePlayStation.cpp: Added.
2878         (WTF::platformUserPreferredLanguages):
2879
2880 2019-05-22  Myles C. Maxfield  <mmaxfield@apple.com>
2881
2882         font-optical-sizing applies the wrong variation value
2883         https://bugs.webkit.org/show_bug.cgi?id=197528
2884         <rdar://problem/50152854>
2885
2886         Reviewed by Antti Koivisto.
2887
2888         * wtf/Platform.h:
2889
2890 2019-05-22  Ryan Haddad  <ryanhaddad@apple.com>
2891
2892         Unreviewed, rolling out r245598.
2893
2894         Breaks watchOS build.
2895
2896         Reverted changeset:
2897
2898         "font-optical-sizing applies the wrong variation value"
2899         https://bugs.webkit.org/show_bug.cgi?id=197528
2900         https://trac.webkit.org/changeset/245598
2901
2902 2019-05-21  Ross Kirsling  <ross.kirsling@sony.com>
2903
2904         [PlayStation] Don't call fcntl.
2905         https://bugs.webkit.org/show_bug.cgi?id=197961
2906
2907         Reviewed by Fujii Hironori.
2908
2909         * wtf/PlatformGTK.cmake:
2910         * wtf/PlatformJSCOnly.cmake:
2911         * wtf/PlatformPlayStation.cmake:
2912         * wtf/PlatformWPE.cmake:
2913         * wtf/UniStdExtras.h:
2914         * wtf/playstation/UniStdExtrasPlayStation.cpp: Added.
2915         (WTF::setCloseOnExec):
2916         (WTF::dupCloseOnExec):
2917         (WTF::setNonBlock):
2918         * wtf/unix/UniStdExtrasUnix.cpp: Renamed from Source/WTF/wtf/UniStdExtras.cpp.
2919         (WTF::setNonBlock):
2920         Move UniStdExtras to unix/, add a PlayStation version that doesn't use fcntl, add an abstraction for O_NONBLOCK.
2921
2922 2019-05-20  Tadeu Zagallo  <tzagallo@apple.com>
2923
2924         Only cache bytecode for API clients in data vaults
2925         https://bugs.webkit.org/show_bug.cgi?id=197898
2926
2927         Reviewed by Keith Miller.
2928
2929         Add SPI to check if a filesystem path is restricted as a data vault.
2930
2931         * WTF.xcodeproj/project.pbxproj:
2932         * wtf/spi/darwin/DataVaultSPI.h: Added.
2933
2934 2019-05-20  Carlos Garcia Campos  <cgarcia@igalia.com>
2935
2936         [GLIB] Repeating timer is not stopped when stop is called from the callback
2937         https://bugs.webkit.org/show_bug.cgi?id=197986
2938
2939         Reviewed by Michael Catanzaro.
2940
2941         In case of repeating timers we always update the ready time to fire interval after the user callback is called.
2942
2943         * wtf/glib/RunLoopGLib.cpp:
2944         (WTF::RunLoop::TimerBase::stop): Reset m_fireInterval and m_isRepeating.
2945
2946 2019-05-19  Darin Adler  <darin@apple.com>
2947
2948         Change String::number to use "shortest" instead of "fixed precision 6 digits"
2949         https://bugs.webkit.org/show_bug.cgi?id=178319
2950
2951         Reviewed by Sam Weinig.
2952
2953         * wtf/text/StringBuilder.h: Delete appendNumber for floating point and
2954         appendECMAScriptNumber for single-precision.
2955
2956         * wtf/text/WTFString.h: Delete String::number for floating point and
2957         numberToStringECMAScript for single-precision.
2958
2959 2019-05-18  Tadeu Zagallo  <tzagallo@apple.com>
2960
2961         Add extra information to dumpJITMemory
2962         https://bugs.webkit.org/show_bug.cgi?id=197998
2963
2964         Reviewed by Saam Barati.
2965
2966         Add a new trace point code for JSC::dumpJITMemory
2967
2968         * wtf/SystemTracing.h:
2969
2970 2019-05-17  Don Olmstead  <don.olmstead@sony.com>
2971
2972         [CMake] Use builtin FindICU
2973         https://bugs.webkit.org/show_bug.cgi?id=197934
2974
2975         Reviewed by Michael Catanzaro.
2976
2977         Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES. Use ICU:: targets which end
2978         up propagating to all consumers of WTF.
2979
2980         * wtf/CMakeLists.txt:
2981         * wtf/PlatformPlayStation.cmake:
2982
2983 2019-05-17  Commit Queue  <commit-queue@webkit.org>
2984
2985         Unreviewed, rolling out r245418.
2986         https://bugs.webkit.org/show_bug.cgi?id=197989
2987
2988         New API test causing crashes on Mojave testers (Requested by
2989         ShawnRoberts on #webkit).
2990
2991         Reverted changeset:
2992
2993         "Add a unit test for client certificate authentication"
2994         https://bugs.webkit.org/show_bug.cgi?id=197800
2995         https://trac.webkit.org/changeset/245418
2996
2997 2019-05-16  Keith Miller  <keith_miller@apple.com>
2998
2999         Wasm should cage the memory base pointers in structs
3000         https://bugs.webkit.org/show_bug.cgi?id=197620
3001
3002         Reviewed by Saam Barati.
3003
3004         Rename reauthenticate to recage.
3005
3006         * wtf/CagedPtr.h:
3007         (WTF::CagedPtr::recage):
3008         (WTF::CagedPtr::reauthenticate): Deleted.
3009
3010 2019-05-16  Alex Christensen  <achristensen@webkit.org>
3011
3012         Add a unit test for client certificate authentication
3013         https://bugs.webkit.org/show_bug.cgi?id=197800
3014
3015         Reviewed by Youenn Fablet.
3016
3017         * wtf/spi/cocoa/SecuritySPI.h:
3018         Move declarations from ArgumentCodersCF.cpp so they can be shared.
3019
3020 2019-05-16  Eike Rathke  <erack@redhat.com>
3021
3022         Fix memcpy() call for big endian
3023         https://bugs.webkit.org/show_bug.cgi?id=197945
3024
3025         Reviewed by Michael Catanzaro.
3026
3027         * wtf/Packed.h:
3028         (WTF::alignof):
3029
3030 2019-05-15  Ross Kirsling  <ross.kirsling@sony.com>
3031
3032         [PlayStation] WTFCrash should preserve register state.
3033         https://bugs.webkit.org/show_bug.cgi?id=197932
3034
3035         Reviewed by Don Olmstead.
3036
3037         * wtf/Assertions.cpp:
3038         * wtf/Assertions.h:
3039         Let r196397 apply to PlayStation port as well.
3040
3041 2019-05-15  Simon Fraser  <simon.fraser@apple.com>
3042
3043         Make LOG_WITH_STREAM more efficient
3044         https://bugs.webkit.org/show_bug.cgi?id=197905
3045
3046         Reviewed by Alex Christensen.
3047
3048         Add a streamable repeat() class that can be used to output a series of characters.
3049         This is useful for indenting output.
3050
3051         * wtf/text/TextStream.h:
3052         (WTF::TextStream::repeat::repeat):
3053         (WTF::TextStream::operator<<):
3054
3055 2019-05-15  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
3056
3057         compilation failure with clang 9
3058         https://bugs.webkit.org/show_bug.cgi?id=197911
3059
3060         Reviewed by Alex Christensen.
3061
3062         Use std namespace for nullptr_t in tagArrayPtr templates.
3063
3064         * wtf/PtrTag.h:
3065         (WTF::tagArrayPtr):
3066
3067 2019-05-14  Commit Queue  <commit-queue@webkit.org>
3068
3069         Unreviewed, rolling out r245281.
3070         https://bugs.webkit.org/show_bug.cgi?id=197887
3071
3072         Broke API Test TestWebKitAPI.Challenge.ClientCertificate
3073         (Requested by aakashjain on #webkit).
3074
3075         Reverted changeset:
3076
3077         "Add a unit test for client certificate authentication"
3078         https://bugs.webkit.org/show_bug.cgi?id=197800
3079         https://trac.webkit.org/changeset/245281
3080
3081 2019-05-14  Alex Christensen  <achristensen@webkit.org>
3082
3083         Add a unit test for client certificate authentication
3084         https://bugs.webkit.org/show_bug.cgi?id=197800
3085
3086         Reviewed by Youenn Fablet.
3087
3088         * wtf/spi/cocoa/SecuritySPI.h:
3089         Move declarations from ArgumentCodersCF.cpp so they can be shared.
3090
3091 2019-05-13  Robin Morisset  <rmorisset@apple.com>
3092
3093         IndexSet::isEmpty should use BitVector::isEmpty() instead of size()
3094         https://bugs.webkit.org/show_bug.cgi?id=197857
3095
3096         Reviewed by Darin Adler.
3097
3098         * wtf/IndexSet.h:
3099         (WTF::IndexSet::isEmpty const):
3100
3101 2019-05-13  Youenn Fablet  <youenn@apple.com>
3102
3103         [Mac] Use realpath for dlopen_preflight
3104         https://bugs.webkit.org/show_bug.cgi?id=197803
3105
3106         Reviewed by Eric Carlson.
3107
3108         * wtf/cocoa/SoftLinking.h:
3109
3110 2019-05-13  Yusuke Suzuki  <ysuzuki@apple.com>
3111
3112         Unreviewed, wrokaround for MACH_VM_MAX_ADDRESS in ARM32_64
3113         https://bugs.webkit.org/show_bug.cgi?id=197730
3114
3115         Interestingly, MACH_VM_MAX_ADDRESS is larger than 32bit in ARM32_64, I think this is a bug.
3116         But for now, we workaround for this case by using `CPU(ADDRESS64)`.
3117
3118         * wtf/WTFAssertions.cpp:
3119
3120 2019-05-13  Yusuke Suzuki  <ysuzuki@apple.com>
3121
3122         [WTF] Remove Threading workaround for support libraries in Windows
3123         https://bugs.webkit.org/show_bug.cgi?id=197350
3124
3125         Reviewed by Darin Adler.
3126
3127         We kept old APIs for some support libraries at 2017. This patch removes them.
3128
3129         * wtf/Threading.h:
3130         * wtf/win/ThreadingWin.cpp:
3131         (WTF::createThread): Deleted.
3132         (WTF::waitForThreadCompletion): Deleted.
3133
3134 2019-05-13  Yusuke Suzuki  <ysuzuki@apple.com>
3135
3136         [WTF] Simplify GCThread and CompilationThread flags by adding them to WTF::Thread
3137         https://bugs.webkit.org/show_bug.cgi?id=197146
3138
3139         Reviewed by Saam Barati.
3140
3141         Since GCThread and CompilationThread flags exist in WTF, we put these flags into WTF::Thread directly instead of holding them in ThreadSpecific<>.
3142         And this patch removes dependency from Threading.h to ThreadSpecific.h. ThreadSpecific.h's OS threading primitives are moved to ThreadingPrimitives.h,
3143         and Threading.h relies on it instead.
3144
3145         * wtf/CompilationThread.cpp:
3146         (WTF::isCompilationThread):
3147         (WTF::initializeCompilationThreads): Deleted.
3148         (WTF::exchangeIsCompilationThread): Deleted.
3149         * wtf/CompilationThread.h:
3150         (WTF::CompilationScope::CompilationScope):
3151         (WTF::CompilationScope::~CompilationScope):
3152         (WTF::CompilationScope::leaveEarly):
3153         * wtf/MainThread.cpp:
3154         (WTF::initializeMainThread):
3155         (WTF::initializeMainThreadToProcessMainThread):
3156         (WTF::isMainThreadOrGCThread):
3157         (WTF::initializeGCThreads): Deleted.
3158         (WTF::registerGCThread): Deleted.
3159         (WTF::mayBeGCThread): Deleted.
3160         * wtf/MainThread.h:
3161         * wtf/ThreadSpecific.h:
3162         (WTF::canBeGCThread>::ThreadSpecific):
3163         (WTF::canBeGCThread>::set):
3164         (WTF::threadSpecificKeyCreate): Deleted.
3165         (WTF::threadSpecificKeyDelete): Deleted.
3166         (WTF::threadSpecificSet): Deleted.
3167         (WTF::threadSpecificGet): Deleted.
3168         * wtf/Threading.cpp:
3169         (WTF::Thread::exchangeIsCompilationThread):
3170         (WTF::Thread::registerGCThread):
3171         (WTF::Thread::mayBeGCThread):
3172         * wtf/Threading.h:
3173         (WTF::Thread::isCompilationThread const):
3174         (WTF::Thread::gcThreadType const):
3175         (WTF::Thread::joinableState const):
3176         (WTF::Thread::hasExited const):
3177         (WTF::Thread::Thread):
3178         (WTF::Thread::joinableState): Deleted.
3179         (WTF::Thread::hasExited): Deleted.
3180         * wtf/ThreadingPrimitives.h:
3181         (WTF::threadSpecificKeyCreate):
3182         (WTF::threadSpecificKeyDelete):
3183         (WTF::threadSpecificSet):
3184         (WTF::threadSpecificGet):
3185         * wtf/win/ThreadSpecificWin.cpp:
3186         (WTF::flsKeys):
3187
3188 2019-05-13  Yusuke Suzuki  <ysuzuki@apple.com>
3189
3190         Unreviewed, follow-up after r245214
3191         https://bugs.webkit.org/show_bug.cgi?id=197730
3192
3193         Suggested by Sam. We should have static_assert with MACH_VM_MAX_ADDRESS.
3194
3195         * wtf/WTFAssertions.cpp:
3196
3197 2019-05-13  Youenn Fablet  <youenn@apple.com>
3198
3199         Use kDNSServiceFlagsKnownUnique for DNSServiceRegisterRecord only on platforms supporting it
3200         https://bugs.webkit.org/show_bug.cgi?id=197802
3201
3202         Reviewed by Eric Carlson.
3203
3204         * wtf/Platform.h:
3205
3206 2019-05-13  Yusuke Suzuki  <ysuzuki@apple.com>
3207
3208         [JSC] Compress miscelaneous JIT related data structures with Packed<>
3209         https://bugs.webkit.org/show_bug.cgi?id=197830
3210
3211         Reviewed by Saam Barati.
3212
3213         * wtf/Packed.h:
3214         (WTF::alignof):
3215
3216 2019-05-13  Michael Catanzaro  <mcatanzaro@igalia.com>
3217
3218         Unreviewed, fix unused variable warnings in release builds
3219
3220         * wtf/URLHelpers.cpp:
3221         (WTF::URLHelpers::escapeUnsafeCharacters):
3222
3223 2019-05-12  Yusuke Suzuki  <ysuzuki@apple.com>
3224
3225         [JSC] Compress Watchpoint size by using enum type and Packed<> data structure
3226         https://bugs.webkit.org/show_bug.cgi?id=197730
3227
3228         Reviewed by Filip Pizlo.
3229
3230         This patch introduces a new data structures, WTF::Packed, WTF::PackedPtr, and WTF::PackedAlignedPtr.
3231
3232         - WTF::Packed
3233
3234             WTF::Packed is data storage. We can read and write trivial (in C++ term [1]) data to this storage. The difference to
3235             the usual storage is that the alignment of this storage is always 1. We access the underlying data by using unalignedLoad/unalignedStore.
3236             This class offers alignment = 1 data structure instead of missing the following characteristics.
3237
3238                 1. Load / Store are non atomic even if the data size is within a pointer width. We should not use this for a member which can be accessed
3239                    in a racy way. (e.g. fields accessed optimistically from the concurrent compilers).
3240
3241                 2. We cannot take reference / pointer to the underlying storage since they are unaligned.
3242
3243                 3. Access to this storage is unaligned access. The code is using memcpy, and the compiler will convert to an appropriate unaligned access
3244                    in certain architectures (x86_64 / ARM64). It could be slow. So use it for non performance sensitive & memory sensitive places.
3245
3246         - WTF::PackedPtr
3247
3248             WTF::PackedPtr is a specialization of WTF::Packed<T*>. And it is basically WTF::PackedAlignedPtr with alignment = 1. We further compact
3249             the pointer by leveraging the platform specific knowledge. In 64bit architectures, the effective width of pointers are less than 64 bit.
3250             In x86_64, it is 48 bits. And Darwin ARM64 is further smaller, 36 bits. This information allows us to compact the pointer to 6 bytes in
3251             x86_64 and 5 bytes in Darwin ARM64.
3252
3253         - WTF::PackedAlignedPtr
3254
3255             WTF::PackedAlignedPtr is the WTF::PackedPtr with alignment information of the T. If we use this alignment information, we could reduce the
3256             size of packed pointer further in some cases. For example, since we guarantee that JSCells are 16 byte aligned, low 4 bits are empty. Leveraging
3257             this information in Darwin ARM64 platform allows us to make packed JSCell pointer 4 bytes (36 - 4 bits). We do not use passed alignment
3258             information if it is not profitable.
3259
3260         We also have PackedPtrTraits. This is new PtrTraits and use it for various data structures such as Bag<>.
3261
3262         [1]: https://en.cppreference.com/w/cpp/types/is_trivial
3263
3264         * WTF.xcodeproj/project.pbxproj:
3265         * wtf/Bag.h:
3266         (WTF::Bag::clear):
3267         (WTF::Bag::iterator::operator++):
3268         * wtf/CMakeLists.txt:
3269         * wtf/DumbPtrTraits.h:
3270         * wtf/DumbValueTraits.h:
3271         * wtf/MathExtras.h:
3272         (WTF::clzConstexpr):
3273         (WTF::clz):
3274         (WTF::ctzConstexpr):
3275         (WTF::ctz):
3276         (WTF::getLSBSetConstexpr):
3277         (WTF::getMSBSetConstexpr):
3278         * wtf/Packed.h: Added.
3279         (WTF::Packed::Packed):
3280         (WTF::Packed::get const):
3281         (WTF::Packed::set):
3282         (WTF::Packed::operator=):
3283         (WTF::Packed::exchange):
3284         (WTF::Packed::swap):
3285         (WTF::alignof):
3286         (WTF::PackedPtrTraits::exchange):
3287         (WTF::PackedPtrTraits::swap):
3288         (WTF::PackedPtrTraits::unwrap):
3289         * wtf/Platform.h:
3290         * wtf/SentinelLinkedList.h:
3291         (WTF::BasicRawSentinelNode::BasicRawSentinelNode):
3292         (WTF::BasicRawSentinelNode::prev):
3293         (WTF::BasicRawSentinelNode::next):
3294         (WTF::PtrTraits>::remove):
3295         (WTF::PtrTraits>::prepend):
3296         (WTF::PtrTraits>::append):
3297         (WTF::RawNode>::SentinelLinkedList):
3298         (WTF::RawNode>::remove):
3299         (WTF::BasicRawSentinelNode<T>::remove): Deleted.
3300         (WTF::BasicRawSentinelNode<T>::prepend): Deleted.
3301         (WTF::BasicRawSentinelNode<T>::append): Deleted.
3302         * wtf/StdLibExtras.h:
3303         (WTF::roundUpToMultipleOfImpl):
3304         (WTF::roundUpToMultipleOfImpl0): Deleted.
3305         * wtf/UnalignedAccess.h:
3306         (WTF::unalignedLoad):
3307         (WTF::unalignedStore):
3308
3309 2019-05-10  Saam barati  <sbarati@apple.com>
3310
3311         Bag's move operator= leaks memory
3312         https://bugs.webkit.org/show_bug.cgi?id=197757
3313
3314         Reviewed by Keith Miller.
3315
3316         It was unused. So I'm just removing it. We can implement it properly
3317         if we ever need it.
3318
3319         * wtf/Bag.h:
3320         (WTF::Bag::operator=): Deleted.
3321
3322 2019-05-10  Fujii Hironori  <Hironori.Fujii@sony.com>
3323
3324         [WinCairo] storage/indexeddb tests are timing out
3325         https://bugs.webkit.org/show_bug.cgi?id=196289
3326
3327         Reviewed by Alex Christensen.
3328
3329         * wtf/FileSystem.h: Added hardLink.
3330         * wtf/glib/FileSystemGlib.cpp:
3331         (WTF::FileSystemImpl::hardLink):
3332         (WTF::FileSystemImpl::hardLinkOrCopyFile):
3333         * wtf/posix/FileSystemPOSIX.cpp:
3334         (WTF::FileSystemImpl::hardLink):
3335         (WTF::FileSystemImpl::hardLinkOrCopyFile):
3336         * wtf/win/FileSystemWin.cpp:
3337         (WTF::FileSystemImpl::hardLink):
3338         (WTF::FileSystemImpl::hardLinkOrCopyFile):
3339         Added hardLink. Let hardLinkOrCopyFile use the hardLink.
3340
3341 2019-05-10  Yusuke Suzuki  <ysuzuki@apple.com>
3342
3343         [WTF] Remove "private:" from Noncopyable and Nonmovable macros
3344         https://bugs.webkit.org/show_bug.cgi?id=197767
3345
3346         Reviewed by Saam Barati.
3347
3348         We no longer need "private:".
3349
3350         * wtf/Noncopyable.h:
3351         * wtf/Nonmovable.h:
3352
3353 2019-05-08  Zan Dobersek  <zdobersek@igalia.com>
3354
3355         [GLib] Rework WPE RunLoopSourcePriority values
3356         https://bugs.webkit.org/show_bug.cgi?id=197167
3357
3358         Reviewed by Carlos Garcia Campos.
3359
3360         The GLib priorities for the WPE port were initially aligned on the -70
3361         value, theory being that this would help avoid any default-priority
3362         GSources spawned in different dependency libraries affecting our
3363         scheduling. Today it seems that extra caution might not be really
3364         necessary.
3365
3366         This change aligns the base priority value with GLib's default priority
3367         value of 0. We maintain the relativity of priority values by effectively
3368         increasing each priority by 70.
3369
3370         * wtf/glib/RunLoopSourcePriority.h:
3371
3372 2019-05-08  Alex Christensen  <achristensen@webkit.org>
3373
3374         Add SPI to set HSTS storage directory
3375         https://bugs.webkit.org/show_bug.cgi?id=197259
3376
3377         Reviewed by Brady Eidson.
3378
3379         * wtf/Platform.h:
3380
3381 2019-05-08  Keith Miller  <keith_miller@apple.com>
3382
3383         Remove Gigacage from arm64 and use PAC for arm64e instead
3384         https://bugs.webkit.org/show_bug.cgi?id=197110
3385
3386         Reviewed by Saam Barati.
3387
3388         This patch changes the Gigacage to use PAC on arm64e. As part of
3389         this process all platforms must provide their length when
3390         materializing the caged pointer. Since it would be somewhat
3391         confusing to have two parameters for an operator [] those methods
3392         have been removed. Lastly, this patch removes the specializations
3393         for void* caged pointers, instead opting to use enable_if on the
3394         methods that would normally fail on void* e.g. anything that
3395         returns a T&.
3396
3397         * WTF.xcodeproj/project.pbxproj:
3398         * wtf/CMakeLists.txt:
3399         * wtf/CagedPtr.h:
3400         (WTF::CagedPtr::CagedPtr):
3401         (WTF::CagedPtr::get const):
3402         (WTF::CagedPtr::getMayBeNull const):
3403         (WTF::CagedPtr::getUnsafe const):
3404         (WTF::CagedPtr::at const):
3405         (WTF::CagedPtr::reauthenticate):
3406         (WTF::CagedPtr::operator=):
3407         (WTF::CagedPtr::operator== const):
3408         (WTF::CagedPtr::operator bool const):
3409         (WTF::CagedPtr::operator* const): Deleted.
3410         (WTF::CagedPtr::operator-> const): Deleted.
3411         (WTF::CagedPtr::operator[] const): Deleted.
3412         (): Deleted.
3413         * wtf/CagedUniquePtr.h:
3414         (WTF::CagedUniquePtr::CagedUniquePtr):
3415         (WTF::CagedUniquePtr::create):
3416         (WTF::CagedUniquePtr::~CagedUniquePtr):
3417         (WTF::CagedUniquePtr::destroy):
3418         (): Deleted.
3419         * wtf/Gigacage.h:
3420         (Gigacage::cagedMayBeNull):
3421         * wtf/PtrTag.h:
3422         (WTF::tagArrayPtr):
3423         (WTF::untagArrayPtr):
3424         (WTF::removeArrayPtrTag):
3425         (WTF::retagArrayPtr):
3426         * wtf/TaggedArrayStoragePtr.h: Copied from Source/JavaScriptCore/runtime/ArrayBufferView.cpp.
3427         (WTF::TaggedArrayStoragePtr::TaggedArrayStoragePtr):
3428         (WTF::TaggedArrayStoragePtr::get const):
3429         (WTF::TaggedArrayStoragePtr::getUnsafe const):
3430         (WTF::TaggedArrayStoragePtr::resize):
3431         (WTF::TaggedArrayStoragePtr::operator bool const):
3432
3433 2019-05-08  Robin Morisset  <rmorisset@apple.com>
3434
3435         WTF::TimingScope should show the total duration and not just the mean
3436         https://bugs.webkit.org/show_bug.cgi?id=197672
3437
3438         Reviewed by Alex Christensen.
3439
3440         * wtf/TimingScope.cpp:
3441         (WTF::TimingScope::scopeDidEnd):
3442
3443 2019-05-07  Yusuke Suzuki  <ysuzuki@apple.com>
3444
3445         [JSC] LLIntPrototypeLoadAdaptiveStructureWatchpoint does not require Bag<>
3446         https://bugs.webkit.org/show_bug.cgi?id=197645
3447
3448         Reviewed by Saam Barati.
3449
3450         * WTF.xcodeproj/project.pbxproj:
3451         * wtf/CMakeLists.txt:
3452         * wtf/Nonmovable.h: Copied from Source/JavaScriptCore/bytecode/LLIntPrototypeLoadAdaptiveStructureWatchpoint.h.
3453         * wtf/Vector.h:
3454         (WTF::minCapacity>::uncheckedConstructAndAppend):
3455
3456 2019-05-07  Eric Carlson  <eric.carlson@apple.com>
3457
3458         Define media buffering policy
3459         https://bugs.webkit.org/show_bug.cgi?id=196979
3460         <rdar://problem/28383861>
3461
3462         Reviewed by Jer Noble.
3463
3464         * wtf/Platform.h:
3465
3466 2019-05-07  Robin Morisset  <rmorisset@apple.com>
3467
3468         WTF::BitVector should have an isEmpty() method
3469         https://bugs.webkit.org/show_bug.cgi?id=197637
3470
3471         Reviewed by Keith Miller.
3472
3473         * wtf/BitVector.cpp:
3474         (WTF::BitVector::isEmptySlow const):
3475         * wtf/BitVector.h:
3476         (WTF::BitVector::isEmpty const):
3477
3478 2019-05-07  Brent Fulgham  <bfulgham@apple.com>
3479
3480         Correct JSON parser to address unterminated escape character
3481         https://bugs.webkit.org/show_bug.cgi?id=197582
3482         <rdar://problem/50459177>
3483
3484         Reviewed by Alex Christensen.
3485
3486         Correct JSON parser code to properly deal with unterminated escape
3487         characters.
3488
3489         * wtf/JSONValues.cpp:
3490         (WTF::JSONImpl::decodeString):
3491         (WTF::JSONImpl::parseStringToken):
3492
3493 2019-05-07  Alex Christensen  <achristensen@webkit.org>
3494
3495         Add a release assertion that Functions can only be constructed from non-null CompletionHandlers
3496         https://bugs.webkit.org/show_bug.cgi?id=197641
3497
3498         Reviewed by Chris Dumez.
3499
3500         This will help us find the cause of rdar://problem/48679972 by seeing the crash when the Function is dispatched,
3501         not when it's called with no interesting stack trace.  I manually verified this assertion is hit in such a case.
3502         We should also have no legitimate use of creating a Function out of a null CompletionHandler then never calling it.
3503
3504         * wtf/CompletionHandler.h:
3505         (WTF::Detail::CallableWrapper<CompletionHandler<Out):
3506         * wtf/Function.h:
3507         (WTF::Detail::CallableWrapperBase::~CallableWrapperBase):
3508         (WTF::Detail::CallableWrapper::CallableWrapper):
3509         (WTF::Function<Out):
3510
3511 2019-05-06  Christopher Reid  <chris.reid@sony.com>
3512
3513         [JSC] Respect already defined USE_LLINT_EMBEDDED_OPCODE_ID compiler variable.
3514         https://bugs.webkit.org/show_bug.cgi?id=197633
3515
3516         Reviewed by Don Olmstead.
3517
3518         When the variable `USE_LLINT_EMBEDDED_OPCODE_ID` is defined, stop defining
3519         its value with platform default one.
3520
3521         * wtf/Platform.h:
3522
3523 2019-05-03  Sihui Liu  <sihui_liu@apple.com>
3524
3525         Add assertion to check whether shm files have maximum FileProtection of CompleteUnlessOpen
3526         https://bugs.webkit.org/show_bug.cgi?id=197390
3527         <rdar://problem/42685773>
3528
3529         Reviewed by Geoffrey Garen.
3530
3531         * wtf/FileSystem.cpp:
3532         (WTF::FileSystemImpl::isSafeToUseMemoryMapForPath):
3533         (WTF::FileSystemImpl::makeSafeToUseMemoryMapForPath):
3534         * wtf/FileSystem.h:
3535         * wtf/cocoa/FileSystemCocoa.mm:
3536         (WTF::FileSystemImpl::isSafeToUseMemoryMapForPath):
3537         (WTF::FileSystemImpl::makeSafeToUseMemoryMapForPath):
3538
3539 2019-05-03  Commit Queue  <commit-queue@webkit.org>
3540
3541         Unreviewed, rolling out r244881.
3542         https://bugs.webkit.org/show_bug.cgi?id=197559
3543
3544         Breaks compilation of jsconly on linux, breaking compilation
3545         for jsc-i386-ews, jsc-mips-ews and jsc-armv7-ews (Requested by
3546         guijemont on #webkit).
3547
3548         Reverted changeset:
3549
3550         "[CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into
3551         WEBKIT_COPY_FILES"
3552         https://bugs.webkit.org/show_bug.cgi?id=197174
3553         https://trac.webkit.org/changeset/244881
3554
3555 2019-05-02  Alex Christensen  <achristensen@webkit.org>
3556
3557         Mark U+01C0 as a homograph of U+006C
3558         https://bugs.webkit.org/show_bug.cgi?id=197526
3559         <rdar://problem/50301904>
3560
3561         Reviewed by Tim Horton.
3562
3563         * wtf/URLHelpers.cpp:
3564         (WTF::URLHelpers::isLookalikeCharacter):
3565
3566 2019-05-02  Don Olmstead  <don.olmstead@sony.com>
3567
3568         [CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into WEBKIT_COPY_FILES
3569         https://bugs.webkit.org/show_bug.cgi?id=197174
3570
3571         Reviewed by Alex Christensen.
3572
3573         Replace WEBKIT_MAKE_FORWARDING_HEADERS with WEBKIT_COPY_FILES.
3574
3575         * wtf/CMakeLists.txt:
3576
3577 2019-05-01  Darin Adler  <darin@apple.com>
3578
3579         WebKit has too much of its own UTF-8 code and should rely more on ICU's UTF-8 support
3580         https://bugs.webkit.org/show_bug.cgi?id=195535
3581
3582         Reviewed by Alexey Proskuryakov.
3583
3584         * wtf/text/AtomicString.cpp:
3585         (WTF::AtomicString::fromUTF8Internal): Added code to compute string length when the
3586         end is nullptr; this behavior used to be implemented inside the
3587         calculateStringHashAndLengthFromUTF8MaskingTop8Bits function.
3588
3589         * wtf/text/AtomicStringImpl.cpp:
3590         (WTF::HashAndUTF8CharactersTranslator::translate): Updated for change to
3591         convertUTF8ToUTF16.
3592
3593         * wtf/text/AtomicStringImpl.h: Took the WTF_EXPORT_PRIVATE off of the
3594         AtomicStringImpl::addUTF8 function. This is used only inside a non-inlined function in
3595         the AtomicString class and its behavior changed subtly in this patch; it's helpful
3596         to document that it's not exported.
3597
3598         * wtf/text/StringImpl.cpp: