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