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