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