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