884d88418ca0fc66efcf1ea4e814f058d1159fb9
[WebKit-https.git] / Source / WTF / ChangeLog
1 2019-03-22  Keith Rollin  <krollin@apple.com>
2
3         Enable ThinLTO support in Production builds
4         https://bugs.webkit.org/show_bug.cgi?id=190758
5         <rdar://problem/45413233>
6
7         Reviewed by Daniel Bates.
8
9         Enable building with Thin LTO in Production when using Xcode 10.2 or
10         later. This change results in a 1.45% progression in PLT5. Full
11         Production build times increase about 2-3%. Incremental build times
12         are more severely affected, and so LTO is not enabled for local
13         engineering builds.
14
15         LTO is enabled only on macOS for now, until rdar://problem/49013399,
16         which affects ARM builds, is fixed.
17
18         To change the LTO setting when building locally:
19
20         - If building with `make`, specify WK_LTO_MODE={none,thin,full} on the
21           command line.
22         - If building with `build-webkit`, specify --lto-mode={none,thin,full}
23           on the command line.
24         - If building with `build-root`, specify --lto={none,thin,full} on the
25           command line.
26         - If building with Xcode, create a LocalOverrides.xcconfig file at the
27           top level of your repository directory (if needed) and define
28           WK_LTO_MODE to full, thin, or none.
29
30         * Configurations/Base.xcconfig:
31
32 2019-03-22  Tim Horton  <timothy_horton@apple.com>
33
34         Fix the build after r243354
35
36         * wtf/Platform.h:
37
38 2019-03-22  Tim Horton  <timothy_horton@apple.com>
39
40         Fix the build after r243354
41         https://bugs.webkit.org/show_bug.cgi?id=196138
42         <rdar://problem/49145951>
43
44         * wtf/Platform.h:
45
46 2019-03-21  Eric Carlson  <eric.carlson@apple.com>
47
48         Add UI process WebRTC runtime logging.
49         https://bugs.webkit.org/show_bug.cgi?id=196020
50         <rdar://problem/49071443>
51
52         Reviewed by Youenn Fablet.
53
54         * wtf/Logger.h:
55         (WTF::LogArgument::toString): Add long long and unsigned long long variants.
56
57 2019-03-20  Simon Fraser  <simon.fraser@apple.com>
58
59         Rename ENABLE_ACCELERATED_OVERFLOW_SCROLLING macro to ENABLE_OVERFLOW_SCROLLING_TOUCH
60         https://bugs.webkit.org/show_bug.cgi?id=196049
61
62         Reviewed by Tim Horton.
63
64         This macro is about the -webkit-overflow-scrolling CSS property, not accelerated
65         overflow scrolling in general, so rename it.
66
67         * wtf/FeatureDefines.h:
68
69 2019-03-20  Mark Lam  <mark.lam@apple.com>
70
71         Open source arm64e code.
72         https://bugs.webkit.org/show_bug.cgi?id=196012
73         <rdar://problem/49066237>
74
75         Reviewed by Keith Miller.
76
77         * WTF.xcodeproj/project.pbxproj:
78         * wtf/BlockPtr.h:
79         * wtf/Platform.h:
80         * wtf/PlatformRegisters.cpp: Added.
81         (WTF::threadStateLRInternal):
82         (WTF::threadStatePCInternal):
83         * wtf/PlatformRegisters.h:
84         * wtf/PointerPreparations.h:
85         * wtf/PtrTag.cpp: Added.
86         (WTF::tagForPtr):
87         (WTF::ptrTagName):
88         (WTF::registerPtrTagLookup):
89         (WTF::reportBadTag):
90         * wtf/PtrTag.h:
91         (WTF::removeCodePtrTag):
92         (WTF::tagCodePtrImpl):
93         (WTF::tagCodePtr):
94         (WTF::untagCodePtrImplHelper):
95         (WTF::untagCodePtrImpl):
96         (WTF::untagCodePtr):
97         (WTF::retagCodePtrImplHelper):
98         (WTF::retagCodePtrImpl):
99         (WTF::retagCodePtr):
100         (WTF::tagCFunctionPtrImpl):
101         (WTF::tagCFunctionPtr):
102         (WTF::untagCFunctionPtrImpl):
103         (WTF::untagCFunctionPtr):
104         (WTF::tagInt):
105         (WTF::assertIsCFunctionPtr):
106         (WTF::assertIsNullOrCFunctionPtr):
107         (WTF::assertIsNotTagged):
108         (WTF::assertIsTagged):
109         (WTF::assertIsNullOrTagged):
110         (WTF::isTaggedWith):
111         (WTF::assertIsTaggedWith):
112         (WTF::assertIsNullOrTaggedWith):
113         (WTF::usesPointerTagging):
114         (WTF::registerPtrTagLookup):
115         (WTF::reportBadTag):
116         (WTF::tagForPtr): Deleted.
117
118 2019-03-20  Keith Rollin  <krollin@apple.com>
119
120         Update checks that determine if WebKit is system WebKit
121         https://bugs.webkit.org/show_bug.cgi?id=195756
122
123         Reviewed by Alexey Proskuryakov.
124
125         The system WebKit can be installed in additional locations, so check
126         for and allow those, too.
127
128         * wtf/Platform.h:
129
130 2019-03-20  Michael Catanzaro  <mcatanzaro@igalia.com>
131
132         Unreviewed, further attempt to fix clang 3.8 build
133         https://bugs.webkit.org/show_bug.cgi?id=195947
134
135         * wtf/MetaAllocator.cpp:
136         (WTF::MetaAllocator::allocate):
137
138 2019-03-20  Michael Catanzaro  <mcatanzaro@igalia.com>
139
140         REGRESSION(r243115) breaks build for clang 3.8
141         https://bugs.webkit.org/show_bug.cgi?id=195947
142
143         Reviewed by Chris Dumez.
144
145         * wtf/text/StringConcatenate.h:
146         (WTF::tryMakeStringFromAdapters):
147
148 2019-03-20  Tim Horton  <timothy_horton@apple.com>
149
150         Add an platform-driven spell-checking mechanism
151         https://bugs.webkit.org/show_bug.cgi?id=195795
152
153         Reviewed by Ryosuke Niwa.
154
155         * wtf/Platform.h:
156         Add an ENABLE flag.
157
158 2019-03-19  Michael Catanzaro  <mcatanzaro@igalia.com>
159
160         Build cleanly with GCC 9
161         https://bugs.webkit.org/show_bug.cgi?id=195920
162
163         Reviewed by Chris Dumez.
164
165         WebKit triggers three new GCC 9 warnings:
166
167         """
168         -Wdeprecated-copy, implied by -Wextra, warns about the C++11 deprecation of implicitly
169         declared copy constructor and assignment operator if one of them is user-provided.
170         """
171
172         Solution is to either add a copy constructor or copy assignment operator, if required, or
173         else remove one if it is redundant.
174
175         """
176         -Wredundant-move, implied by -Wextra, warns about redundant calls to std::move.
177         -Wpessimizing-move, implied by -Wall, warns when a call to std::move prevents copy elision.
178         """
179
180         These account for most of this patch. Solution is to just remove the bad WTFMove().
181
182         Additionally, -Wclass-memaccess has been enhanced to catch a few cases that GCC 8 didn't.
183         These are solved by casting nontrivial types to void* before using memcpy. (Of course, it
184         would be safer to not use memcpy on nontrivial types, but that's too complex for this
185         patch. Searching for memcpy used with static_cast<void*> will reveal other cases to fix.)
186
187         * wtf/CheckedArithmetic.h:
188         (WTF::Checked::Checked):
189         * wtf/MetaAllocator.cpp:
190         (WTF::MetaAllocator::allocate):
191         * wtf/URLParser.cpp:
192         (WTF::CodePointIterator::operator!= const):
193         (WTF::CodePointIterator::operator=): Deleted.
194         * wtf/text/StringView.h:
195         (WTF::StringView::CodePoints::Iterator::operator=): Deleted.
196
197 2019-03-19  Alex Christensen  <achristensen@webkit.org>
198
199         Make WTFLogChannelState and WTFLogLevel enum classes
200         https://bugs.webkit.org/show_bug.cgi?id=195904
201
202         Reviewed by Eric Carlson.
203
204         * wtf/Assertions.cpp:
205         * wtf/Assertions.h:
206         * wtf/Logger.h:
207         (WTF::Logger::logAlways const):
208         (WTF::Logger::error const):
209         (WTF::Logger::warning const):
210         (WTF::Logger::info const):
211         (WTF::Logger::debug const):
212         (WTF::Logger::willLog const):
213         (WTF::Logger::log):
214         * wtf/MemoryPressureHandler.cpp:
215         * wtf/RefCountedLeakCounter.cpp:
216
217 2019-03-19  Michael Catanzaro  <mcatanzaro@igalia.com>
218
219         Unreviewed, rolling out r243132.
220
221         Broke GTK build
222
223         Reverted changeset:
224
225         "Make WTFLogChannelState and WTFLogLevel enum classes"
226         https://bugs.webkit.org/show_bug.cgi?id=195904
227         https://trac.webkit.org/changeset/243132
228
229 2019-03-18  Alex Christensen  <achristensen@webkit.org>
230
231         Make WTFLogChannelState and WTFLogLevel enum classes
232         https://bugs.webkit.org/show_bug.cgi?id=195904
233
234         Reviewed by Eric Carlson.
235
236         * wtf/Assertions.cpp:
237         * wtf/Assertions.h:
238         * wtf/Logger.h:
239         (WTF::Logger::logAlways const):
240         (WTF::Logger::error const):
241         (WTF::Logger::warning const):
242         (WTF::Logger::info const):
243         (WTF::Logger::debug const):
244         (WTF::Logger::willLog const):
245         (WTF::Logger::log):
246         * wtf/MemoryPressureHandler.cpp:
247         * wtf/RefCountedLeakCounter.cpp:
248
249 2019-03-18  Darin Adler  <darin@apple.com>
250
251         Cut down on use of StringBuffer, possibly leading toward removing it entirely
252         https://bugs.webkit.org/show_bug.cgi?id=195870
253
254         Reviewed by Daniel Bates.
255
256         * wtf/URL.cpp: Remove a now-inaccurate comment mentioning StringBuffer.
257
258         * wtf/text/StringView.cpp:
259         (WTF::convertASCIICase): Use createUninitialized instead of StringBuffer.
260
261 2019-03-18  Xan Lopez  <xan@igalia.com>
262
263         [WTF] Remove redundant std::move in StringConcatenate
264         https://bugs.webkit.org/show_bug.cgi?id=195798
265
266         Reviewed by Darin Adler.
267
268         Remove redundant calls to WTFMove in return values for this
269         method. C++ will already do an implicit move here since we are
270         returning a local value where copy/move elision is not applicable.
271
272         * wtf/text/StringConcatenate.h:
273         (WTF::tryMakeStringFromAdapters):
274
275 2019-03-16  Darin Adler  <darin@apple.com>
276
277         Improve normalization code, including moving from unorm.h to unorm2.h
278         https://bugs.webkit.org/show_bug.cgi?id=195330
279
280         Reviewed by Michael Catanzaro.
281
282         * wtf/URLHelpers.cpp: Removed unneeded include of unorm.h since the
283         normalization code is now in StringView.cpp.
284         (WTF::URLHelpers::escapeUnsafeCharacters): Renamed from
285         createStringWithEscapedUnsafeCharacters since it now only creates
286         a new string if one is needed. Use unsigned for string lengths, since
287         that's what WTF::String uses, not size_t. Added a first loop so that
288         we can return the string unmodified if no lookalike characters are
289         found. Removed unnecessary round trip from UTF-16 and then back in
290         the case where the character is not a lookalike.
291         (WTF::URLHelpers::toNormalizationFormC): Deleted. Moved this logic
292         into the WTF::normalizedNFC function in StringView.cpp.
293         (WTF::URLHelpers::userVisibleURL): Call escapeUnsafeCharacters and
294         normalizedNFC. The normalizedNFC function is better in multiple ways,
295         but primarily it handles 8-bit strings and other already-normalized
296         strings much more efficiently.
297
298         * wtf/text/StringView.cpp:
299         (WTF::normalizedNFC): Added. This has two overloads. One is for when
300         we already have a String, and want to re-use it if no normalization
301         is needed, and another is when we only have a StringView, and may need
302         to allocate a String to hold the result. Includes a fast special case
303         for 8-bit and already-normalized strings, and uses the same strategy
304         that JSC::normalize was already using: calls unorm2_normalize twice,
305         first just to determine the length.
306
307         * wtf/text/StringView.h: Added normalizedNFC, which can be called with
308         either a StringView or a String. Also moved StringViewWithUnderlyingString
309         here from JSString.h, here for use as the return value of normalizedNFC;
310         it is used for a similar purpose in the JavaScriptCore rope implementation.
311         Also removed an inaccurate comment.
312
313 2019-03-16  Diego Pino Garcia  <dpino@igalia.com>
314
315         [GTK] [WPE] Fix compilation errors due to undefined ALWAYS_LOG_IF
316         https://bugs.webkit.org/show_bug.cgi?id=195850
317
318         Unreviewed build fix after r243033. 
319
320         * wtf/LoggerHelper.h:
321
322 2019-03-15  Per Arne Vollan  <pvollan@apple.com>
323
324         [iOS] Block the accessibility server when accessibility is not enabled.
325         https://bugs.webkit.org/show_bug.cgi?id=195342
326
327         Reviewed by Brent Fulgham.
328
329         Add SPI to issue a mach extension to a process by pid. Also, add a macro for
330         the availability of this SPI.
331
332         * wtf/Platform.h:
333         * wtf/spi/darwin/SandboxSPI.h:
334
335 2019-03-15  Eric Carlson  <eric.carlson@apple.com>
336
337         Add media stream release logging
338         https://bugs.webkit.org/show_bug.cgi?id=195823
339
340         Reviewed by Youenn Fablet.
341
342         * wtf/LoggerHelper.h: Add LOG_IF variants that check a condition before logging.
343
344 2019-03-15  Truitt Savell  <tsavell@apple.com>
345
346         Unreviewed, rolling out r243008.
347
348         This revision broke High Sierra builders
349
350         Reverted changeset:
351
352         "[iOS] Block the accessibility server when accessibility is
353         not enabled."
354         https://bugs.webkit.org/show_bug.cgi?id=195342
355         https://trac.webkit.org/changeset/243008
356
357 2019-03-15  Per Arne Vollan  <pvollan@apple.com>
358
359         [iOS] Block the accessibility server when accessibility is not enabled.
360         https://bugs.webkit.org/show_bug.cgi?id=195342
361
362         Reviewed by Brent Fulgham.
363
364         Add SPI to issue a mach extension to a process by pid.
365
366         * wtf/spi/darwin/SandboxSPI.h:
367
368 2019-03-13  Sam Weinig  <sam@webkit.org>
369
370         Add utility function to allow easy reverse range-based iteration of a container
371         https://bugs.webkit.org/show_bug.cgi?id=195542
372
373         Reviewed by Antti Koivisto.
374
375         Add functions to create an IteratorRange<T> that will iterate a container backwards. It
376         works with any container that is compatible with std::rbegin() and std::rend(). It is
377         expected to be used in conjunction with range-based for-loops like so:
378
379         for (auto& value : WTF::makeReversedRange(myContainer)) 
380             ...
381
382         * wtf/IteratorRange.h:
383         (WTF::makeReversedRange):
384
385 2019-03-13  Keith Rollin  <krollin@apple.com>
386
387         Add support for new StagedFrameworks layout
388         https://bugs.webkit.org/show_bug.cgi?id=195543
389
390         Reviewed by Alexey Proskuryakov.
391
392         Opportunistic cleanup: remove unused JAVASCRIPTCORE_FRAMEWORKS_DIR
393         variable.
394
395         * Configurations/Base.xcconfig:
396
397 2019-03-13  Dominik Infuehr  <dinfuehr@igalia.com>
398
399         String overflow when using StringBuilder in JSC::createError
400         https://bugs.webkit.org/show_bug.cgi?id=194957
401
402         Reviewed by Mark Lam.
403
404         When calculating the new capacity of a StringBuilder object,
405         use a limit of MaxLength instead of MaxLength+1.  Allocating
406         a string of size MaxLength+1 always fails. This means that expanding
407         a StringBuilder only worked when the newly doubled capacity is less or
408         equal to MaxLength.
409
410         * wtf/text/StringBuilder.cpp:
411
412 2019-03-13  Chris Dumez  <cdumez@apple.com>
413
414         Better build fix after r242901.
415
416         Reviewed by Jer Noble.
417
418         * wtf/Logger.h:
419         (WTF::LogArgument::toString):
420
421 2019-03-13  Jer Noble  <jer.noble@apple.com>
422
423         Add AggregateLogger, a Logger specialization for singleton classes.
424         https://bugs.webkit.org/show_bug.cgi?id=195644
425
426         Reviewed by Eric Carlson.
427
428         Add a new class, AggregateLogger, which will log messages to each of its aggregated loggers.
429
430         Drive-by fixes: allow "const void*" to be directly logged by converting the pointer to a hex string.
431
432         * WTF.xcodeproj/project.pbxproj:
433         * wtf/AggregateLogger.h: Added.
434         (WTF::AggregateLogger::create):
435         (WTF::AggregateLogger::addLogger):
436         (WTF::AggregateLogger::removeLogger):
437         (WTF::AggregateLogger::logAlways const):
438         (WTF::AggregateLogger::error const):
439         (WTF::AggregateLogger::warning const):
440         (WTF::AggregateLogger::info const):
441         (WTF::AggregateLogger::debug const):
442         (WTF::AggregateLogger::willLog const):
443         (WTF::AggregateLogger::AggregateLogger):
444         (WTF::AggregateLogger::log const):
445         * wtf/CMakeLists.h:
446         * wtf/Logger.cpp:
447         (WTF::>::toString):
448         * wtf/Logger.h:
449
450 2019-03-12  Commit Queue  <commit-queue@webkit.org>
451
452         Unreviewed, rolling out r242747.
453         https://bugs.webkit.org/show_bug.cgi?id=195641
454
455         Performance measurement is difficult in this period, rolling
456         out it and rolling in later to isolate it from the other
457         sensitive patches (Requested by yusukesuzuki on #webkit).
458
459         Reverted changeset:
460
461         "[JSC] Make StaticStringImpl & StaticSymbolImpl actually
462         static"
463         https://bugs.webkit.org/show_bug.cgi?id=194212
464         https://trac.webkit.org/changeset/242747
465
466 2019-03-12  Robin Morisset  <rmorisset@apple.com>
467
468         A lot more classes have padding that can be reduced by reordering their fields
469         https://bugs.webkit.org/show_bug.cgi?id=195579
470
471         Reviewed by Mark Lam.
472
473         * wtf/CrossThreadQueue.h:
474         * wtf/Logger.h:
475         * wtf/MemoryPressureHandler.h:
476         * wtf/MetaAllocator.h:
477         * wtf/Threading.cpp:
478
479 2019-03-11  Alex Christensen  <achristensen@webkit.org>
480
481         WTF::Expected should use std::addressof instead of operator&
482         https://bugs.webkit.org/show_bug.cgi?id=195604
483
484         Reviewed by Myles Maxfield.
485
486         The latter was causing problems with types that do tricky things with constructors and operator&,
487         specifically UniqueRef but I made a reduced test case.  When it used operator&, it would get the contained
488         type and call the constructor that takes a contained type instead of the move constructor.
489
490         * wtf/Expected.h:
491         (std::experimental::fundamentals_v3::__expected_detail::base::base):
492         (std::experimental::fundamentals_v3::expected::swap):
493
494 2019-03-11  Ross Kirsling  <ross.kirsling@sony.com>
495
496         Add Optional to Forward.h.
497         https://bugs.webkit.org/show_bug.cgi?id=195586
498
499         Reviewed by Darin Adler.
500
501         * wtf/Forward.h:
502         Add forward declaration for Optional.
503
504         * wtf/CPUTime.h:
505         * wtf/Expected.h:
506         * wtf/MainThread.h:
507         * wtf/MemoryFootprint.h:
508         * wtf/URLHelpers.cpp:
509         * wtf/URLHelpers.h:
510         * wtf/cocoa/CPUTimeCocoa.cpp:
511         * wtf/fuchsia/CPUTimeFuchsia.cpp:
512         * wtf/unix/CPUTimeUnix.cpp:
513         * wtf/win/CPUTimeWin.cpp:
514         Remove unnecessary includes from headers.
515
516 2019-03-11  Andy Estes  <aestes@apple.com>
517
518         [Apple Pay] Use PKPaymentAuthorizationController to present the Apple Pay UI remotely from the Networking service on iOS
519         https://bugs.webkit.org/show_bug.cgi?id=195530
520         <rdar://problem/48747164>
521
522         Reviewed by Alex Christensen.
523
524         * wtf/FeatureDefines.h: Defined ENABLE_APPLE_PAY_REMOTE_UI.
525
526 2019-03-11  Yusuke Suzuki  <ysuzuki@apple.com>
527
528         [JSC] Make StaticStringImpl & StaticSymbolImpl actually static
529         https://bugs.webkit.org/show_bug.cgi?id=194212
530
531         Reviewed by Mark Lam.
532
533         Avoid mutation onto refcounts if `isStatic()` returns true so that the content of StaticStringImpl never gets modified.
534
535         * wtf/text/StringImpl.h:
536         (WTF::StringImpl::ref):
537         (WTF::StringImpl::deref):
538
539 2019-03-11  Sihui Liu  <sihui_liu@apple.com>
540
541         Crash under WebCore::IDBDatabase::connectionToServerLost
542         https://bugs.webkit.org/show_bug.cgi?id=195563
543         <rdar://problem/37193655>
544
545         CrossThreadTask should protect callee if it is ThreadSafeRefCounted.
546
547         Reviewed by Geoffrey Garen.
548
549         * wtf/CrossThreadTask.h:
550         (WTF::createCrossThreadTask):
551
552 2019-03-11  Ryan Haddad  <ryanhaddad@apple.com>
553
554         Unreviewed, rolling out r242688, r242643, r242624.
555
556         Caused multiple layout test failures and crashes on iOS and macOS.
557
558         Reverted changeset:
559
560         "requestAnimationFrame should execute before the next frame"
561         https://bugs.webkit.org/show_bug.cgi?id=177484
562         https://trac.webkit.org/changeset/242624/webkit
563
564         * wtf/SystemTracing.h:
565
566 2019-03-11  Darin Adler  <darin@apple.com>
567
568         Specify fixed precision explicitly to prepare to change String::number and StringBuilder::appendNumber floating point behavior
569         https://bugs.webkit.org/show_bug.cgi?id=195533
570
571         Reviewed by Brent Fulgham.
572
573         Soon, we will change String::number and StringBuilder::appendNumber for floating
574         point to use "shortest form" serialization instead of the current default, which is
575         "6-digit fixed precision stripping trailing zeros". To prepare to do this safely
576         without accidentally changing any behavior, changing callers to call the explicit
577         versions. Later, we may want to return and change many of them to use shortest form
578         instead, but that may require rebaselining tests, and in some extreme cases, getting
579         rid of flawed logic that converts between different single and double precision
580         floating point; such problems may be hidden by fixed precision serialization.
581
582         Since "shortest form" is already the behavior for AtomicString::number and
583         for makeString, no changes required for clients of either of those.
584
585         * wtf/Logger.h:
586         (WTF::LogArgument::toString): Use numberToStringFixedPrecision.
587         * wtf/MediaTime.cpp:
588         (WTF::MediaTime::toString const): Use appendFixedPrecisionNumber.
589         * wtf/text/ValueToString.h:
590         (WTF::ValueToString<float>::string): Use numberToStringFixedPrecision.
591         (WTF::ValueToString<double>::string): Ditto.
592
593 2019-03-11  Truitt Savell  <tsavell@apple.com>
594
595         Unreviewed, rolling out r242702.
596
597         Broke High Sierra builders.
598
599         Reverted changeset:
600
601         "Add utility function to allow easy reverse range-based
602         iteration of a container"
603         https://bugs.webkit.org/show_bug.cgi?id=195542
604         https://trac.webkit.org/changeset/242702
605
606 2019-03-11  Sam Weinig  <sam@webkit.org>
607
608         Add utility function to allow easy reverse range-based iteration of a container
609         https://bugs.webkit.org/show_bug.cgi?id=195542
610
611         Reviewed by Antti Koivisto.
612
613         Add functions to create an IteratorRange<T> that will iterate a container backwards. It
614         works with any container that is compatible with std::rbegin() and std::rend(). It is
615         expected to be used in conjunction with range-based for-loops like so:
616
617         for (auto& value : WTF::makeReversedRange(myContainer)) 
618             ...
619
620         * wtf/IteratorRange.h:
621         (WTF::makeReversedRange):
622
623 2019-03-10  Yusuke Suzuki <utatane.tea@gmail.com> and Fujii Hironori  <Hironori.Fujii@sony.com>
624
625         [WTF] Align assumption in RunLoopWin to the other platform's RunLoop
626         https://bugs.webkit.org/show_bug.cgi?id=181151
627
628         Reviewed by Don Olmstead.
629
630         This patch fixes RunLoop in Windows to align it to the implementations in the other platforms
631         to use RunLoop more aggressively.
632
633         * wtf/RunLoop.h:
634         (WTF::RunLoop::Timer::Timer):
635         * wtf/win/MainThreadWin.cpp:
636         (initializeMainThreadPlatform): Call RunLoop::registerRunLoopMessageWindowClass.
637         * wtf/win/RunLoopWin.cpp:
638         (WTF::RunLoop::wndProc):
639         (WTF::RunLoop::iterate):
640         (WTF::RunLoop::stop):
641         PostQuitMessage is only available in the RunLoop's thread. We should post a message and call
642         it inside this task.
643
644         (WTF::RunLoop::registerRunLoopMessageWindowClass):
645         Changed the return type from bool to void, and added RELEASE_ASSERT to check the return value of RegisterClass.
646
647         (WTF::RunLoop::~RunLoop):
648         When the RunLoop's thread is freed, its associated window is freed. We do not need to do here.
649
650         (WTF::RunLoop::TimerBase::timerFired):
651         (WTF::RunLoop::TimerBase::TimerBase):
652         (WTF::RunLoop::TimerBase::start):
653         (WTF::RunLoop::TimerBase::stop):
654         (WTF::RunLoop::TimerBase::isActive const):
655         (WTF::RunLoop::TimerBase::secondsUntilFire const):
656         (WTF::generateTimerID): Deleted.
657         We can use TimerBase's pointer as ID since it is uintptr_t.
658
659 2019-03-07  Said Abou-Hallawa  <sabouhallawa@apple.com>
660
661         requestAnimationFrame should execute before the next frame
662         https://bugs.webkit.org/show_bug.cgi?id=177484
663
664         Reviewed by Simon Fraser.
665
666         Add trace points for the page RenderingUpdate.
667
668         * wtf/SystemTracing.h:
669
670 2019-03-06  Ross Kirsling  <ross.kirsling@sony.com>
671
672         [Win] Remove -DUCHAR_TYPE=wchar_t stopgap and learn to live with char16_t.
673         https://bugs.webkit.org/show_bug.cgi?id=195346
674
675         Reviewed by Fujii Hironori.
676
677         * wtf/PlatformWin.cmake:
678         * wtf/text/AtomicString.h:
679         (WTF::AtomicString::AtomicString):
680         * wtf/text/WTFString.h:
681         (WTF::String::String):
682         * wtf/text/win/StringWin.cpp: Added.
683         (WTF::String::wideCharacters const): Renamed from WTF::stringToNullTerminatedWChar.
684         * wtf/text/win/WCharStringExtras.h:
685         (WTF::ucharFrom):
686         (WTF::wcharFrom):
687         (WTF::stringToNullTerminatedWChar): Deleted.
688         (WTF::wcharToString): Deleted.
689         (WTF::nullTerminatedWCharToString): Deleted.
690         Add static_assert-guarded reinterpret_cast wrappers for going between UChar* and wchar_t*.
691         Move existing to/from-String helpers into the String (and AtomicString) class(es).
692
693         * wtf/win/FileSystemWin.cpp:
694         (WTF::FileSystemImpl::getFindData):
695         (WTF::FileSystemImpl::getFinalPathName):
696         (WTF::FileSystemImpl::createSymbolicLink):
697         (WTF::FileSystemImpl::deleteFile):
698         (WTF::FileSystemImpl::deleteEmptyDirectory):
699         (WTF::FileSystemImpl::moveFile):
700         (WTF::FileSystemImpl::pathByAppendingComponent):
701         (WTF::FileSystemImpl::fileSystemRepresentation):
702         (WTF::FileSystemImpl::makeAllDirectories):
703         (WTF::FileSystemImpl::pathGetFileName):
704         (WTF::FileSystemImpl::storageDirectory):
705         (WTF::FileSystemImpl::generateTemporaryPath):
706         (WTF::FileSystemImpl::openTemporaryFile):
707         (WTF::FileSystemImpl::openFile):
708         (WTF::FileSystemImpl::hardLinkOrCopyFile):
709         (WTF::FileSystemImpl::deleteNonEmptyDirectory):
710         * wtf/win/LanguageWin.cpp:
711         (WTF::localeInfo):
712         * wtf/win/PathWalker.cpp:
713         (WTF::PathWalker::PathWalker):
714         Use wchar helpers as needed.
715
716 2019-02-28  Ryosuke Niwa  <rniwa@webkit.org>
717
718         Add WeakHashSet
719         https://bugs.webkit.org/show_bug.cgi?id=195152
720
721         Reviewed by Antti Koivisto.
722
723         Added WeakHashSet which is a HashSet of WeakPtr. When the object pointed by WeakPtr is deleted,
724         WeakHashSet treats the key to be no longer in the set. That is, WeakHashSet::contains returns false
725         and const_iterator skips such a WeakPtr in the set.
726
727         We decided not to make HashSet<WeahPtr<T>> work because it involves weird semantics such as making
728         find(X) delete the table entry as remove(find(X)) would be a no-op otherwise as find(X) would return
729         necessarily need to return HashSet<WeakPtr<T>>::end().
730
731         Furthermore, we cannot determine the true size of this set in O(1) because the objected pointed by
732         some of WeakPtr in the set may have already been deleted. This has implications that we can't have
733         size(), isEmpty(), random(), etc... as O(1) operation.
734
735         WeakHashSet is implemented as HashSet<WeakReference<T>>. HashTable::rehash has been updated to delete
736         WeakReference<T>'s whose m_ptr has become null, and HashTable::expand first deletes any such entry
737         before deciding an actual expansion is needed. This is accomplished via newly added hash trait,
738         hasIsReleasedWeakValueFunction, and HashTraits<Ref<WeakReference<T>>>::isReleasedWeakValue which
739         returns true for when WeakReference<T> pointed by Ref<WeakReference<T>> has null m_ptr, not to be
740         confused with Ref<WeakReference<T>> itself pointing to a null WeakReference<T>.
741
742         * WTF.xcodeproj/project.pbxproj:
743         * wtf/CMakeLists.txt:
744         * wtf/Forward.h:
745         * wtf/HashSet.h:
746         (WTF::HashSet<T, U, V>::checkConsistency const): Added.
747         * wtf/HashTable.h:
748         (WTF::HashTable::isReleasedWeakBucket): Added.
749         (WTF::HashTable::expand): Delete WeakReference<T> with null m_ptr first. This updates m_keyCount
750         and may make mustRehashInPlace() return true.
751         (WTF::HashTable::deleteReleasedWeakBuckets): Added.
752         (WTF::HashTable::rehash): Delete WeakReference<T> with null m_ptr. Also refactored the code a bit
753         to avoid keep repeating oldTable[i].
754         * wtf/HashTraits.h:
755         (WTF::HashTraits<T>::isHashTraitsReleasedWeakValue): Added.
756         (WTF::RefHashTraits<T>): Extracted from HashTraits<Ref<P>> to share code with
757         HashTraits<Ref<WeakReference<T>>>.
758         (WTF::HashTraitsReleasedWeakValueChecker<Traits, hasIsReleasedWeakValueFunction>): Added.
759         (WTF::isHashTraitsReleasedWeakValue<Traits, hasIsReleasedWeakValueFunction>): Added.
760         * wtf/WeakHashSet.h: Added.
761         (WTF::WeakHashSet): Added.
762         (WTF::WeakHashSet::WeakHashSetConstIterator::WeakHashSetConstIterator):
763         (WTF::WeakHashSet::WeakHashSetConstIterator::get const):
764         (WTF::WeakHashSet::WeakHashSetConstIterator::operator* const):
765         (WTF::WeakHashSet::WeakHashSetConstIterator::operator-> const):
766         (WTF::WeakHashSet::WeakHashSetConstIterator::operator++):
767         (WTF::WeakHashSet::WeakHashSetConstIterator::skipEmptyBuckets):
768         (WTF::WeakHashSet::WeakHashSetConstIterator::operator== const):
769         (WTF::WeakHashSet::WeakHashSetConstIterator::operator!= const):
770         (WTF::WeakHashSet::WeakHashSet):
771         (WTF::WeakHashSet::begin const):
772         (WTF::WeakHashSet::end const):
773         (WTF::WeakHashSet::add):
774         (WTF::WeakHashSet::remove):
775         (WTF::WeakHashSet::contains const):
776         (WTF::WeakHashSet::capacity const):
777         (WTF::WeakHashSet::computeSize const): Deletes any WeakReference<T> with null m_ptr first.
778         (WTF::WeakHashSet::checkConsistency const):
779         (WTF::HashTraits<Ref<WeakReference<T>>>): Added. This hash traits triggers the new code in HashTable's
780         expand and rehash methods to delete WeakReference<T> with null m_ptr.
781         (WTF::HashTraits<Ref<WeakReference<T>>>::isReleasedWeakValue):
782         * wtf/WeakPtr.h:
783         (WTF::WeakReference::~WeakReference): Added so that we can keep track the number of live WeakReference
784         in API tests by template specializations.
785
786 2019-03-03  Darin Adler  <darin@apple.com>
787
788         Prepare to improve handling of conversion of float to strings
789         https://bugs.webkit.org/show_bug.cgi?id=195262
790
791         Reviewed by Daniel Bates.
792
793         * wtf/dtoa.cpp:
794         (WTF::truncateTrailingZeros): Renamed from
795         formatStringTruncatingTrailingZerosIfNeeded and removed the calls
796         to double_conversion::StringBuilder::Finalizer, since the caller
797         already does that.
798         (WTF::numberToFixedPrecisionString): Added an overload for float
799         and updated to use the new truncateTrailingZeros.
800         (WTF::numberToFixedWidthString): Added an overload for float.
801
802         * wtf/text/AtomicString.cpp:
803         (WTF::AtomicString::number): Added float overload. This is a
804         behavior change, but in all cases for the better. The old behavior
805         was to convert to double first and then do "shortest form"
806         conversion, and it's always better to just do that as float.
807         * wtf/text/AtomicString.h: Added float overload of AtomicString::number.
808
809         * wtf/text/StringBuilder.cpp:
810         (WTF::StringBuilder::appendFixedPrecisionNumber): Added float
811         overload.
812         (WTF::StringBuilder::appendShortestFormNumber): Renamed from
813         appendECMAScriptNumber and did the above.
814         (WTF::StringBuilder::appendFixedWidthNumber): Ditto.
815         * wtf/text/StringBuilder.h: Added overloads for float and
816         appendShortestFormNumber. The appendNumber and appendECMAScriptNumber
817         functions are now inlines in the header, since they are expressed
818         entirely in terms of the other functions.
819
820         * wtf/text/WTFString.cpp:
821         (WTF::String::numberToStringFixedPrecision): Added float overload.
822         Removed unnecessary explicit conversion to String.
823         (WTF::String::numberToStringShortest): Renamed from
824         numberToStringECMAScript and did the above.
825         (WTF::String::numberToStringFixedWidth): Ditto.
826
827         * wtf/text/WTFString.h: Added overloads for float and
828         numberToStringShortest. The number and numberToStringECMAScript
829         functions are now inlines in the header, since they are expressed
830         entirely in terms of the other functions.
831
832 2019-03-04  Andy Estes  <aestes@apple.com>
833
834         [Apple Pay] Move WebPaymentCoordinatorProxy from Source/WebKit/UIProcess to Source/WebKit/Shared
835         https://bugs.webkit.org/show_bug.cgi?id=195080
836         <rdar://problem/48421558>
837
838         Reviewed by Antti Koivisto.
839
840         * wtf/FeatureDefines.h:
841
842 2019-03-04  Michael Catanzaro  <mcatanzaro@igalia.com>
843
844         URLHelpers should use unorm2_quickCheck before converting to NFC
845         https://bugs.webkit.org/show_bug.cgi?id=194272
846
847         Reviewed by Darin Adler.
848
849         If the string is already in normalization form C, don't try to normalize it.
850
851         * wtf/URLHelpers.cpp:
852         (WTF::URLHelpers::toNormalizationFormC):
853
854 2019-03-02  Darin Adler  <darin@apple.com>
855
856         Retire legacy dtoa function and DecimalNumber class
857         https://bugs.webkit.org/show_bug.cgi?id=195253
858
859         Reviewed by Daniel Bates.
860
861         * WTF.xcodeproj/project.pbxproj: Removed DecimalNumber.cpp/h.
862         * wtf/CMakeLists.txt: Ditto.
863
864         * wtf/DecimalNumber.cpp: Removed.
865         * wtf/DecimalNumber.h: Removed.
866
867         * wtf/JSONValues.cpp:
868         (WTF::JSONImpl::Value::writeJSON const): Use
869         StringBuilder::appendECMAScriptNumber instead of custom logic
870         using the DecimalNumber class.
871
872         * wtf/dtoa.cpp:
873         (WTF::storeInc): Deleted.
874         (WTF::BigInt): Deleted.
875         (WTF::multadd): Deleted.
876         (WTF::hi0bits): Deleted.
877         (WTF::lo0bits): Deleted.
878         (WTF::i2b): Deleted.
879         (WTF::mult): Deleted.
880         (WTF::P5Node::P5Node): Deleted.
881         (WTF::pow5mult): Deleted.
882         (WTF::lshift): Deleted.
883         (WTF::cmp): Deleted.
884         (WTF::diff): Deleted.
885         (WTF::d2b): Deleted.
886         (WTF::quorem): Deleted.
887         (WTF::dtoa): Deleted.
888
889         * wtf/dtoa.h: Removed DtoaBuffer, dtoa, and NumberToStringBufferLength.
890
891 2019-02-27  Darin Adler  <darin@apple.com>
892
893         Fixed makeString(float) to do shortest-form serialization without first converting to double
894         https://bugs.webkit.org/show_bug.cgi?id=195142
895
896         Reviewed by Daniel Bates.
897
898         * wtf/DecimalNumber.cpp: Removed unneeded includes.
899
900         * wtf/DecimalNumber.h: Removed unused constructors; over time we will be
901         deprecating DecimalNumber, so we should removed the unused parts. Also
902         marked the constructor explicit, removed types used only for arguments for
903         the constructors, and removed the sign, exponent, significand, and precision
904         member functions.
905
906         * wtf/JSONValues.cpp:
907         (WTF::JSONImpl::Value::writeJSON const): Updated for changes to DecimalNumber
908         switched from NumberToLStringBuffer to NumberToStringBuffer, and for use of
909         std::array instead of C arrays.
910
911         * wtf/dtoa.cpp: Removed unused dtoaRoundSF and dtoaRoundDP functions.
912         (WTF::dtoa): Updated to use std::array instead of C arrays.
913         (WTF::dtoaRoundSF): Removed.
914         (WTF::dtoaRoundDP): Removed.
915         (WTF::numberToString): Added an overload for float and updated to use std::array.
916         (WTF::formatStringTruncatingTrailingZerosIfNeeded): Updated to use std::array.
917         (WTF::numberToFixedPrecisionString): Ditto.
918         (WTF::numberToFixedWidthString): Ditto.
919
920         * wtf/dtoa.h: Changed arrays to be std::array instead of C arrays so the
921         array types will be checked. Removed dtoaRoundSF and dtoaRoundDP.
922         Added float overloads for numberToString, numberToFixedPrecisionString,
923         and numberToFixedWidthString. The only one of these that is called at this
924         time is numberToString, called by the floating point StringTypeAdapter in
925         StringConcatenateNummbers.h.
926
927         * wtf/text/StringConcatenateNumbers.h: Updated for std::array.
928
929 2019-03-01  Darin Adler  <darin@apple.com>
930
931         Finish removing String::format
932         https://bugs.webkit.org/show_bug.cgi?id=194893
933
934         Reviewed by Daniel Bates.
935
936         * wtf/Assertions.cpp:
937         (WTF::createWithFormatAndArguments): Moved this here from WTFString.cpp.
938         (WTFLog): Use WTF::createWithFormatAndArguments instead of String::format.
939
940         * wtf/HexNumber.h: Deleted unneeded toString function.
941
942         * wtf/text/StringConcatenate.h: Got rid of unneeded forward declaration of
943         StringTypeAdapter, since that's now in Forward.h. Tweaked formatting of templates
944         a bit. Use function templates for writeTo functions rather than having two of each.
945         Removed unused toString functions. Optimized case where we use have a UChar* and
946         a length of zero to not force the result to be 16-bit. Also gets rid of a small
947         NO_RETURN_DUE_TO_CRASH mess that we don't need. Refactored constructors to use some
948         static member helper functions to compute string lengths. Added the pad function
949         and the PaddingSpecification struct template, so we can add padding to anything
950         we can turn into a string. Got rid of the special case overload for single
951         arguments, since it only worked for things that the String constructor can handle.
952         Instead we will now use StringTypeAdapter, which works for more types. Possibly
953         less optimal for some special cases, which we could specialize for later if we like.
954         * wtf/text/StringConcatenateNumbers.h: Ditto.
955         * wtf/text/StringOperators.h: Ditto.
956         * wtf/text/StringView.h: Ditto.
957
958         * wtf/text/WTFString.cpp:
959         (WTF::createWithFormatAndArguments): Deleted.
960         (WTF::String::format): Deleted.
961         * wtf/text/WTFString.h: Deleted declaration of String::format.
962
963 2019-03-01  Alex Christensen  <achristensen@webkit.org>
964
965         Revert r241223, r241235, and r241287
966         https://bugs.webkit.org/show_bug.cgi?id=194427
967         <rdar://48045861>
968
969         * wtf/spi/darwin/XPCSPI.h:
970
971 2019-03-01  Simon Fraser  <simon.fraser@apple.com>
972
973         Add a system trace scope for event region building
974         https://bugs.webkit.org/show_bug.cgi?id=195226
975
976         Reviewed by Jon Lee.
977
978         This trace scope measures the time spend converting element rects into Region objects,
979         which can be large on some pages.
980
981         The value for "Display Refresh Dispatch to main thread" was wrong and I fixed it.
982
983         * wtf/SystemTracing.h:
984
985 2019-02-28  Yusuke Suzuki  <ysuzuki@apple.com>
986
987         [JSC] sizeof(JSString) should be 16
988         https://bugs.webkit.org/show_bug.cgi?id=194375
989
990         Reviewed by Saam Barati.
991
992         * wtf/text/StringImpl.h:
993         (WTF::StringImpl::flagIs8Bit):
994         (WTF::StringImpl::flagIsAtomic):
995         (WTF::StringImpl::flagIsSymbol):
996         (WTF::StringImpl::maskStringKind):
997         * wtf/text/WTFString.cpp:
998         (WTF::nullString):
999         * wtf/text/WTFString.h:
1000
1001 2019-02-28  Mark Lam  <mark.lam@apple.com>
1002
1003         Change CheckedArithmetic to not use std::enable_if_t.
1004         https://bugs.webkit.org/show_bug.cgi?id=195187
1005         <rdar://problem/48464665>
1006
1007         Reviewed by Keith Miller.
1008
1009         Because C++11 does not like std::enable_if_t and there's a need to use this file with C++11.
1010
1011         * wtf/CheckedArithmetic.h:
1012
1013 2019-02-27  Simon Fraser  <simon.fraser@apple.com>
1014
1015         Roll out r242014; it caused crashes in compositing logging (webkit.org/b/195141)
1016
1017         * wtf/Assertions.cpp:
1018         (WTF::createWithFormatAndArguments): Deleted.
1019         * wtf/HexNumber.h:
1020         (WTF::StringTypeAdapter<HexNumberBuffer>::toString const):
1021         * wtf/text/StringConcatenate.h:
1022         (WTF::makeString):
1023         (WTF::pad): Deleted.
1024         (WTF::StringTypeAdapter<PaddingSpecification<UnderlyingAdapterType>>::StringTypeAdapter): Deleted.
1025         (WTF::StringTypeAdapter<PaddingSpecification<UnderlyingAdapterType>>::length const): Deleted.
1026         (WTF::StringTypeAdapter<PaddingSpecification<UnderlyingAdapterType>>::is8Bit const): Deleted.
1027         (WTF::StringTypeAdapter<PaddingSpecification<UnderlyingAdapterType>>::writeTo const): Deleted.
1028         * wtf/text/StringConcatenateNumbers.h:
1029         (WTF::FormattedNumber::fixedPrecision):
1030         (WTF::FormattedNumber::fixedWidth):
1031         (WTF::StringTypeAdapter<FormattedNumber>::toString const):
1032         * wtf/text/StringOperators.h:
1033         (WTF::StringAppend::StringAppend):
1034         * wtf/text/StringView.h:
1035         (WTF::StringView::invalidate):
1036         * wtf/text/WTFString.cpp:
1037         (WTF::createWithFormatAndArguments):
1038         (WTF::String::format):
1039         * wtf/text/WTFString.h:
1040
1041 2019-02-26  Mark Lam  <mark.lam@apple.com>
1042
1043         Remove remaining poisoning code.
1044         https://bugs.webkit.org/show_bug.cgi?id=194138
1045
1046         Reviewed by Saam Barati.
1047
1048         This patch removes the instantiation of Poisoned variants of the various containers
1049         but retains the ability of those containers to work with pointer traits.  This
1050         allows us to use them with smart pointers in the future (just like we used to with
1051         Poisoned values).  At minimum, this ability will be useful when we want to insert
1052         an observer into the container storage type for debugging purposes, or to collect
1053         statistics for profiling.
1054
1055         * WTF.xcodeproj/project.pbxproj:
1056         * wtf/Bag.h:
1057         * wtf/CMakeLists.txt:
1058         * wtf/Platform.h:
1059         * wtf/Poisoned.cpp: Removed.
1060         * wtf/Poisoned.h: Removed.
1061         * wtf/PoisonedUniquePtr.h: Removed.
1062         * wtf/Ref.h:
1063         * wtf/RefCountedArray.h:
1064         * wtf/RefPtr.h:
1065         * wtf/WTFAssertions.cpp:
1066
1067 2019-02-26  Keith Miller  <keith_miller@apple.com>
1068
1069         Code quality cleanup in NeverDestroyed
1070         https://bugs.webkit.org/show_bug.cgi?id=194824
1071
1072         Reviewed by Yusuke Suzuki.
1073
1074         First, move data members to the end of the class per WebKit
1075         style. Also, add forbid heap allocation since we expect the
1076         NeverDestroyed classes to be static.
1077
1078         * wtf/NeverDestroyed.h:
1079
1080 2019-02-25  Xabier Rodriguez Calvar  <calvaris@igalia.com>
1081
1082         Fix WTFLogVerbose variadic parameters forwarding
1083         https://bugs.webkit.org/show_bug.cgi?id=194920
1084
1085         Reviewed by Alex Christensen.
1086
1087         WTFLogVerbose was passing the va_list to WTFLog but this function
1088         also used variadic parameters and this is not allowed in C (that
1089         part of the code is extern "C").
1090
1091         * wtf/Assertions.cpp:
1092         (WTF::WTFLogVaList): Created to take a va_list argument instead of
1093         variadic parameters.
1094         (WTF::WTFLog): Kept with variadic parameters, which are
1095         transformed to va_list and passed to WTFLogVaList.
1096         (WTF::WTFLogVerbose): Use WTFLogVaList instead of WTFLog.
1097
1098 2019-02-25  Sam Weinig  <sam@webkit.org>
1099
1100         Update double-conversion to the latest version
1101         https://bugs.webkit.org/show_bug.cgi?id=194994
1102
1103         Import the latest version of the double-conversion library based on
1104         https://github.com/google/double-conversion/commit/990c44707c70832dc1ce1578048c2198bafd3307
1105
1106         In additon to importing the code, the following changes were applied (or re-applied) to maintain 
1107         parity with what we had previously:
1108              - Add #include "config.h" to each cpp file.
1109              - Put everything inside the WTF namespace.
1110              - Changed all in library includes to be of the form #include <wtf/dtoa/FILE.h>.
1111              - Renamed double_conversion::Vector<> to double_conversion::BufferReference<>.
1112              - Replaced duplicated functions with ASCIICType.h variants
1113              - Made CachedPower table a constexpr.
1114              - Exported (via WTF_EXPORT_PRIVATE) several functions in double-conversion.h.
1115              - Made substantial changes to StringToDoubleConverter to avoid unnecessary overhead of 
1116                parameterization, as we only ever want one configuration. Instead of constructing a
1117                configured class and calling StringToDouble on it, StringToDouble is now a static
1118                function. This allows a bunch of now dead code (hex support, octal support, etc.) to
1119                be eliminated. As StringToDoubleConverter now supports single precision floats, some
1120                additional templating of StringToIeee was added to avoid extra unnecessary branching.
1121              - Added RemoveCharacters function to double_conversion::StringBuilder.
1122
1123         Reviewed by Darin Adler.
1124
1125         * WTF.xcodeproj/project.pbxproj:
1126         * wtf/CMakeLists.txt:
1127         * wtf/dtoa/AUTHORS: Added.
1128         * wtf/dtoa/README: Removed.
1129         * wtf/dtoa/README.md: Added.
1130         * wtf/dtoa/bignum-dtoa.cc:
1131         * wtf/dtoa/bignum-dtoa.h:
1132         * wtf/dtoa/bignum.cc:
1133         * wtf/dtoa/bignum.h:
1134         (WTF::double_conversion::Bignum::Times10):
1135         (WTF::double_conversion::Bignum::Equal):
1136         (WTF::double_conversion::Bignum::LessEqual):
1137         (WTF::double_conversion::Bignum::Less):
1138         (WTF::double_conversion::Bignum::PlusEqual):
1139         (WTF::double_conversion::Bignum::PlusLessEqual):
1140         (WTF::double_conversion::Bignum::PlusLess):
1141         (WTF::double_conversion::Bignum::EnsureCapacity):
1142         (WTF::double_conversion::Bignum::BigitLength const):
1143         * wtf/dtoa/cached-powers.cc:
1144         * wtf/dtoa/cached-powers.h:
1145         * wtf/dtoa/diy-fp.cc:
1146         * wtf/dtoa/diy-fp.h:
1147         (WTF::double_conversion::DiyFp::DiyFp):
1148         (WTF::double_conversion::DiyFp::Subtract):
1149         (WTF::double_conversion::DiyFp::Minus):
1150         (WTF::double_conversion::DiyFp::Times):
1151         (WTF::double_conversion::DiyFp::Normalize):
1152         (WTF::double_conversion::DiyFp::f const):
1153         (WTF::double_conversion::DiyFp::e const):
1154         (WTF::double_conversion::DiyFp::set_f):
1155         (WTF::double_conversion::DiyFp::set_e):
1156         * wtf/dtoa/double-conversion.cc:
1157         * wtf/dtoa/double-conversion.h:
1158         (WTF::double_conversion::DoubleToStringConverter::DoubleToStringConverter):
1159         (WTF::double_conversion::DoubleToStringConverter::ToShortest const):
1160         (WTF::double_conversion::DoubleToStringConverter::ToShortestSingle const):
1161         (WTF::double_conversion::StringToDoubleConverter::StringToDoubleConverter):
1162         * wtf/dtoa/double.h: Removed.
1163         * wtf/dtoa/fast-dtoa.cc:
1164         * wtf/dtoa/fast-dtoa.h:
1165         * wtf/dtoa/fixed-dtoa.cc:
1166         * wtf/dtoa/fixed-dtoa.h:
1167         * wtf/dtoa/ieee.h: Added.
1168         (WTF::double_conversion::double_to_uint64):
1169         (WTF::double_conversion::uint64_to_double):
1170         (WTF::double_conversion::float_to_uint32):
1171         (WTF::double_conversion::uint32_to_float):
1172         (WTF::double_conversion::Double::Double):
1173         (WTF::double_conversion::Double::AsDiyFp const):
1174         (WTF::double_conversion::Double::AsNormalizedDiyFp const):
1175         (WTF::double_conversion::Double::AsUint64 const):
1176         (WTF::double_conversion::Double::NextDouble const):
1177         (WTF::double_conversion::Double::PreviousDouble const):
1178         (WTF::double_conversion::Double::Exponent const):
1179         (WTF::double_conversion::Double::Significand const):
1180         (WTF::double_conversion::Double::IsDenormal const):
1181         (WTF::double_conversion::Double::IsSpecial const):
1182         (WTF::double_conversion::Double::IsNan const):
1183         (WTF::double_conversion::Double::IsInfinite const):
1184         (WTF::double_conversion::Double::Sign const):
1185         (WTF::double_conversion::Double::UpperBoundary const):
1186         (WTF::double_conversion::Double::NormalizedBoundaries const):
1187         (WTF::double_conversion::Double::LowerBoundaryIsCloser const):
1188         (WTF::double_conversion::Double::value const):
1189         (WTF::double_conversion::Double::SignificandSizeForOrderOfMagnitude):
1190         (WTF::double_conversion::Double::Infinity):
1191         (WTF::double_conversion::Double::NaN):
1192         (WTF::double_conversion::Double::DiyFpToUint64):
1193         (WTF::double_conversion::Single::Single):
1194         (WTF::double_conversion::Single::AsDiyFp const):
1195         (WTF::double_conversion::Single::AsUint32 const):
1196         (WTF::double_conversion::Single::Exponent const):
1197         (WTF::double_conversion::Single::Significand const):
1198         (WTF::double_conversion::Single::IsDenormal const):
1199         (WTF::double_conversion::Single::IsSpecial const):
1200         (WTF::double_conversion::Single::IsNan const):
1201         (WTF::double_conversion::Single::IsInfinite const):
1202         (WTF::double_conversion::Single::Sign const):
1203         (WTF::double_conversion::Single::NormalizedBoundaries const):
1204         (WTF::double_conversion::Single::UpperBoundary const):
1205         (WTF::double_conversion::Single::LowerBoundaryIsCloser const):
1206         (WTF::double_conversion::Single::value const):
1207         (WTF::double_conversion::Single::Infinity):
1208         (WTF::double_conversion::Single::NaN):
1209         * wtf/dtoa/strtod.cc:
1210         * wtf/dtoa/strtod.h:
1211         * wtf/dtoa/utils.h:
1212         (abort_noreturn):
1213         (WTF::double_conversion::Max):
1214         (WTF::double_conversion::Min):
1215         (WTF::double_conversion::StrLength):
1216         (WTF::double_conversion::BufferReference::BufferReference):
1217         (WTF::double_conversion::BufferReference::SubVector):
1218         (WTF::double_conversion::BufferReference::length const):
1219         (WTF::double_conversion::BufferReference::is_empty const):
1220         (WTF::double_conversion::BufferReference::start const):
1221         (WTF::double_conversion::BufferReference::operator[] const):
1222         (WTF::double_conversion::BufferReference::first):
1223         (WTF::double_conversion::BufferReference::last):
1224         (WTF::double_conversion::StringBuilder::StringBuilder):
1225         (WTF::double_conversion::StringBuilder::~StringBuilder):
1226         (WTF::double_conversion::StringBuilder::size const):
1227         (WTF::double_conversion::StringBuilder::position const):
1228         (WTF::double_conversion::StringBuilder::Reset):
1229         (WTF::double_conversion::StringBuilder::AddCharacter):
1230         (WTF::double_conversion::StringBuilder::AddString):
1231         (WTF::double_conversion::StringBuilder::AddSubstring):
1232         (WTF::double_conversion::StringBuilder::AddPadding):
1233         (WTF::double_conversion::StringBuilder::RemoveCharacters):
1234         (WTF::double_conversion::StringBuilder::Finalize):
1235         (WTF::double_conversion::StringBuilder::is_finalized const):
1236         (WTF::double_conversion::BitCast):
1237         (WTF::double_conversion::BufferReference::SubBufferReference): Deleted.
1238         (WTF::double_conversion::StringBuilder::SetPosition): Deleted.
1239
1240 2019-02-20  Darin Adler  <darin@apple.com>
1241
1242         Finish removing String::format
1243         https://bugs.webkit.org/show_bug.cgi?id=194893
1244
1245         Reviewed by Daniel Bates.
1246
1247         * wtf/Assertions.cpp:
1248         (WTF::createWithFormatAndArguments): Moved this here from WTFString.cpp.
1249         (WTFLog): Use WTF::createWithFormatAndArguments instead of String::format.
1250
1251         * wtf/HexNumber.h: Deleted unneeded toString function.
1252
1253         * wtf/text/StringConcatenate.h: Got rid of unneeded forward declaration of
1254         StringTypeAdapter, since that's now in Forward.h. Tweaked formatting of templates
1255         a bit. Use function templates for writeTo functions rather than having two of each.
1256         Removed unused toString functions. Optimized case where we use have a UChar* and
1257         a length of zero to not force the result to be 16-bit. Also gets rid of a small
1258         NO_RETURN_DUE_TO_CRASH mess that we don't need. Refactored constructors to use some
1259         static member helper functions to compute string lengths. Added the pad function
1260         and the PaddingSpecification struct template, so we can add padding to anything
1261         we can turn into a string. Got rid of the special case overload for single
1262         arguments, since it only worked for things that the String constructor can handle.
1263         Instead we will now use StringTypeAdapter, which works for more types. Possibly
1264         less optimal for some special cases, which we could specialize for later if we like.
1265         * wtf/text/StringConcatenateNumbers.h: Ditto.
1266         * wtf/text/StringOperators.h: Ditto.
1267         * wtf/text/StringView.h: Ditto.
1268
1269         * wtf/text/WTFString.cpp:
1270         (WTF::createWithFormatAndArguments): Deleted.
1271         (WTF::String::format): Deleted.
1272         * wtf/text/WTFString.h: Deleted declaration of String::format.
1273
1274 2019-02-23  Michael Catanzaro  <mcatanzaro@igalia.com>
1275
1276         Unreviewed, fix find/replace error from r232178
1277
1278         Looks like this was the only such error in that commit.
1279
1280         * wtf/URLHelpers.cpp:
1281         (WTF::URLHelpers::isLookalikeCharacter):
1282
1283 2019-02-23  Mark Lam  <mark.lam@apple.com>
1284
1285         Add an exception check and some assertions in StringPrototype.cpp.
1286         https://bugs.webkit.org/show_bug.cgi?id=194962
1287         <rdar://problem/48013416>
1288
1289         Reviewed by Yusuke Suzuki and Saam Barati.
1290
1291         Add an AssertNoOverflow overflow handler which allows us to do CheckedArithmetic
1292         for assertion purpose only on debug builds but sacrifices no performance on
1293         release builds.
1294
1295         * wtf/CheckedArithmetic.h:
1296         (WTF::AssertNoOverflow::overflowed):
1297         (WTF::AssertNoOverflow::clearOverflow):
1298         (WTF::AssertNoOverflow::crash):
1299         (WTF::AssertNoOverflow::hasOverflowed const):
1300         (WTF::observesOverflow):
1301         (WTF::observesOverflow<AssertNoOverflow>):
1302         (WTF::safeAdd):
1303         (WTF::safeSub):
1304         (WTF::safeMultiply):
1305         (WTF::Checked::operator+=):
1306         (WTF::Checked::operator-=):
1307         (WTF::Checked::operator*=):
1308         (WTF::operator+):
1309         (WTF::operator-):
1310         (WTF::operator*):
1311
1312 2019-02-23  Keith Miller  <keith_miller@apple.com>
1313
1314         Add new mac target numbers
1315         https://bugs.webkit.org/show_bug.cgi?id=194955
1316
1317         Reviewed by Tim Horton.
1318
1319         * Configurations/Base.xcconfig:
1320         * Configurations/DebugRelease.xcconfig:
1321
1322 2019-02-21  Antoine Quint  <graouts@apple.com>
1323
1324         Move UIWebTouchEventsGestureRecognizer.activeTouchesByIdentifier to SPI
1325         https://bugs.webkit.org/show_bug.cgi?id=194531
1326         <rdar://problem/47714562>
1327
1328         Reviewed by Tim Horton.
1329
1330         Follow-up commit to ensure this SPI is only called on newer versions of iOS.
1331
1332         * wtf/Platform.h:
1333
1334 2019-02-21  Dean Jackson  <dino@apple.com>
1335
1336         Rotation animations sometimes use the wrong origin (affects apple.com)
1337         https://bugs.webkit.org/show_bug.cgi?id=194878
1338         <rdar://problem/43908047>
1339
1340         Follow-up commit to ensure this change only affects newer versions
1341         of iOS.
1342
1343         * wtf/Platform.h: Add a version check.
1344
1345 2019-02-20  Alex Christensen  <achristensen@webkit.org>
1346
1347         URL percent-encode operations should use checked arithmetic for buffer allocation length
1348         https://bugs.webkit.org/show_bug.cgi?id=194877
1349         <rdar://problem/48212062>
1350
1351         Reviewed by Tim Horton.
1352
1353         * wtf/URLHelpers.cpp:
1354         (WTF::URLHelpers::userVisibleURL):
1355         * wtf/cocoa/NSURLExtras.mm:
1356         (WTF::dataWithUserTypedString):
1357
1358 2019-02-20  Dean Jackson  <dino@apple.com>
1359
1360         Rotation animations sometimes use the wrong origin (affects apple.com)
1361         https://bugs.webkit.org/show_bug.cgi?id=194878
1362         <rdar://problem/43908047>
1363
1364         Reviewed by Simon Fraser.
1365
1366         * wtf/Platform.h: Add HAVE(CA_WHERE_ADDITIVE_TRANSFORMS_ARE_REVERSED).
1367
1368 2019-02-20  Andy Estes  <aestes@apple.com>
1369
1370         [Xcode] Add SDKVariant.xcconfig to various Xcode projects
1371         https://bugs.webkit.org/show_bug.cgi?id=194869
1372
1373         Rubber-stamped by Jer Noble.
1374
1375         * WTF.xcodeproj/project.pbxproj:
1376
1377 2019-02-20  Adrian Perez de Castro  <aperez@igalia.com>
1378
1379         [WPE][GTK] Enable support for CONTENT_EXTENSIONS
1380         https://bugs.webkit.org/show_bug.cgi?id=167941
1381
1382         Reviewed by Carlos Garcia Campos.
1383
1384         Add specialization of the refGPtr() and derefGPtr() templates for GMappedFile.
1385
1386         * wtf/glib/GRefPtr.cpp:
1387         (WTF::refGPtr): Added.
1388         (WTF::derefGPtr): Added.
1389         * wtf/glib/GRefPtr.h: Declare template specializations.
1390
1391 2019-02-19  Commit Queue  <commit-queue@webkit.org>
1392
1393         Unreviewed, rolling out r241770.
1394         https://bugs.webkit.org/show_bug.cgi?id=194833
1395
1396         Caused crashes (Requested by smfr on #webkit).
1397
1398         Reverted changeset:
1399
1400         "Code quality cleanup in NeverDestroyed"
1401         https://bugs.webkit.org/show_bug.cgi?id=194824
1402         https://trac.webkit.org/changeset/241770
1403
1404 2019-02-19  Keith Miller  <keith_miller@apple.com>
1405
1406         Code quality cleanup in NeverDestroyed
1407         https://bugs.webkit.org/show_bug.cgi?id=194824
1408
1409         Reviewed by Yusuke Suzuki.
1410
1411         First, move data members to the end of the class per WebKit
1412         style. Also, add forbid heap allocation since we expect the
1413         NeverDestroyed classes to be static.
1414
1415         * wtf/NeverDestroyed.h:
1416
1417 2019-02-16  Darin Adler  <darin@apple.com>
1418
1419         Continue reducing use of String::format, now focusing on hex: "%p", "%x", etc.
1420         https://bugs.webkit.org/show_bug.cgi?id=194752
1421
1422         Reviewed by Daniel Bates.
1423
1424         * WTF.xcodeproj/project.pbxproj: Added HexNumber.cpp and Logger.cpp.
1425         * wtf/CMakeLists.txt: Ditto.
1426
1427         * wtf/HexNumber.cpp: Added.
1428         (WTF::Internal::appendHex): Non-inline, non-template hex formatting logic.
1429
1430         * wtf/HexNumber.h:
1431         (WTF::Internal::appendHex): Refactored main logic of appendUnsignedAsHex and
1432         appendUnsignedAsHexFixedSize so they can be reused in a function named hex for
1433         use with StringTypeAdapter.
1434         (WTF::appendUnsignedAsHex): Ditto.
1435         (WTF::appendUnsignedAsHexFixedSize): Ditto.
1436         (WTF::hex): Added.
1437         (WTF::StringTypeAdapter<HexNumberBuffer>): Added.
1438
1439         * wtf/Logger.cpp: Added.
1440         (WTF::Logger::LogSiteIdentifier::toString const): Made this a non-template
1441         function and moved it here so that we don't need to include HexNumber.h
1442         in Logger.h. Since HexNumber.h has substantial code in it, it's good if we
1443         don't include it in any other headers.
1444
1445         * wtf/Logger.h:
1446         (WTF::LogArgument<Logger::LogSiteIdentifier>::toString): Changed to call
1447         a non-template function, LogSiteIdentifier::toString.
1448
1449         * wtf/text/StringConcatenateNumbers.h: Replaced overloaded writeTo functions
1450         with function templates and used StringImpl::copyCharacters instead of
1451         hand-written loops.
1452
1453 2019-02-18  Joseph Pecoraro  <pecoraro@apple.com>
1454
1455         Web Inspector: Better categorize CPU usage per-thread / worker
1456         https://bugs.webkit.org/show_bug.cgi?id=194564
1457
1458         Reviewed by Devin Rousso.
1459
1460         * wtf/Threading.h:
1461         * wtf/Threading.cpp:
1462         (WTF::Thread::allThreadsMutex):
1463         (WTF::Thread::create):
1464         (WTF::Thread::didExit):
1465         Add a set of all WTF::Thread created threads.
1466
1467 2019-02-18  Tadeu Zagallo  <tzagallo@apple.com>
1468
1469         Bytecode cache should a have a boot-specific validation
1470         https://bugs.webkit.org/show_bug.cgi?id=194769
1471         <rdar://problem/48149509>
1472
1473         Reviewed by Keith Miller.
1474
1475         Add helper to get kern.bootsessionuuid from sysctl
1476
1477         * wtf/UUID.cpp:
1478         (WTF::bootSessionUUIDString):
1479         * wtf/UUID.h:
1480
1481 2019-02-17  David Kilzer  <ddkilzer@apple.com>
1482
1483         Unreviewed, rolling out r241620.
1484
1485         "Causes use-after-free crashes running layout tests with ASan and GuardMalloc."
1486         (Requested by ddkilzer on #webkit.)
1487
1488         Reverted changeset:
1489
1490         "[WTF] Add environment variable helpers"
1491         https://bugs.webkit.org/show_bug.cgi?id=192405
1492         https://trac.webkit.org/changeset/241620
1493
1494 2019-02-15  Ross Kirsling  <ross.kirsling@sony.com>
1495
1496         [WTF] Add environment variable helpers
1497         https://bugs.webkit.org/show_bug.cgi?id=192405
1498
1499         Reviewed by Michael Catanzaro.
1500
1501         Create a new Environment API as a platform-independent, thread-safe(r)
1502         way to get and set environment variables.
1503
1504         * WTF.xcodeproj/project.pbxproj:
1505         * wtf/CMakeLists.txt:
1506         * wtf/Environment.h: Added.
1507         * wtf/PlatformGTK.cmake:
1508         * wtf/PlatformJSCOnly.cmake:
1509         * wtf/PlatformMac.cmake:
1510         * wtf/PlatformPlayStation.cmake:
1511         * wtf/PlatformWPE.cmake:
1512         * wtf/PlatformWin.cmake:
1513         * wtf/posix/EnvironmentPOSIX.cpp: Added.
1514         * wtf/win/EnvironmentWin.cpp: Added.
1515         Introduce WTF::Environment.
1516
1517         * wtf/Threading.cpp:
1518         (WTF::threadingIsInitialized):
1519         (WTF::initializeThreading):
1520         * wtf/Threading.h:
1521         Introduce WTF::threadingIsInitialized() so that we can ASSERT that it's
1522         false before setting an environment variable through the new API.
1523
1524         * wtf/DataLog.cpp:
1525         (WTF::initializeLogFileOnce):
1526         * wtf/NumberOfCores.cpp:
1527         (WTF::numberOfProcessorCores):
1528         * wtf/posix/FileSystemPOSIX.cpp:
1529         (WTF::FileSystemImpl::openTemporaryFile):
1530         Utilize WTF::Environment where possible.
1531
1532 2019-02-15  Brian Burg  <bburg@apple.com>
1533
1534         [Mac] WebInspectorUI.framework does not need to be soft-linked anymore
1535         https://bugs.webkit.org/show_bug.cgi?id=194411
1536         <rdar://problem/47787614>
1537
1538         Reviewed by Joseph Pecoraro.
1539
1540         * wtf/cocoa/SoftLinking.h:
1541         Remove macro that now has no uses.
1542
1543 2019-02-15  Commit Queue  <commit-queue@webkit.org>
1544
1545         Unreviewed, rolling out r241559 and r241566.
1546         https://bugs.webkit.org/show_bug.cgi?id=194710
1547
1548         Causes layout test crashes under GuardMalloc (Requested by
1549         ryanhaddad on #webkit).
1550
1551         Reverted changesets:
1552
1553         "[WTF] Add environment variable helpers"
1554         https://bugs.webkit.org/show_bug.cgi?id=192405
1555         https://trac.webkit.org/changeset/241559
1556
1557         "Unreviewed build fix for WinCairo Debug after r241559."
1558         https://trac.webkit.org/changeset/241566
1559
1560 2019-02-15  Truitt Savell  <tsavell@apple.com>
1561
1562         Unreviewed, rolling out r241564.
1563
1564         Caused 50+ Timeouts on Mac WK2, mostly in the http/ directory
1565
1566         Reverted changeset:
1567
1568         "[Mac] WebInspectorUI.framework does not need to be soft-
1569         linked anymore"
1570         https://bugs.webkit.org/show_bug.cgi?id=194411
1571         https://trac.webkit.org/changeset/241564
1572
1573 2019-02-15  Dominik Infuehr  <dinfuehr@igalia.com>
1574
1575         Fix deadlock on Linux/x64 between SamplingProfiler and VMTraps
1576         https://bugs.webkit.org/show_bug.cgi?id=194014
1577
1578         Reviewed by Michael Catanzaro.
1579
1580         Do not block SIGUSR1 when installing signal handlers, since this signal
1581         is used to suspend/resume machine threads on Linux.
1582
1583         ftl-ai-filter-phantoms-should-clear-clear-value.js deadlocked with
1584         enabled watchdog and sampling.
1585
1586         Deadlock happened in the following situation:
1587
1588         Thread 1 (Sampling): SamplingProfiler.cpp:takeSample takes all needed locks
1589         and then tries to suspend the main thread.
1590
1591         Thread 2 (Watchdog/VMTraps): Before the Sampling-Thread suspends the main thread
1592         a signal is caught and the signal handler is invoked (VMTraps.cpp:SignalSender).
1593         SignalSender tries to lock codeBlockSet, but this is already locked by the
1594         SamplingProfiler.
1595
1596         The SamplingProfiler can only give up the lock when it suspends
1597         the thread. However since the VMTraps signal handler is active, all other signals blocked,
1598         therefore the SamplingProfiler also waits until its signal handler is invoked.
1599
1600         This patch fixes this by not blocking SIGUSR1 in installSignalHandler, since
1601         it is used to suspend/resume threads on Linux.
1602
1603         * wtf/Threading.h:
1604         * wtf/posix/ThreadingPOSIX.cpp:
1605         * wtf/threads/Signals.cpp:
1606         (WTF::installSignalHandler):
1607
1608 2019-02-15  Saam barati  <sbarati@apple.com>
1609
1610         [WebAssembly] Write a new register allocator for Air O0 and make BBQ use it
1611         https://bugs.webkit.org/show_bug.cgi?id=194036
1612
1613         Reviewed by Yusuke Suzuki.
1614
1615         * wtf/IndexMap.h:
1616         (WTF::IndexMap::at):
1617         (WTF::IndexMap::at const):
1618         (WTF::IndexMap::operator[]):
1619         (WTF::IndexMap::operator[] const):
1620
1621 2019-02-14  Brian Burg  <bburg@apple.com>
1622
1623         [Mac] WebInspectorUI.framework does not need to be soft-linked anymore
1624         https://bugs.webkit.org/show_bug.cgi?id=194411
1625         <rdar://problem/47787614>
1626
1627         Reviewed by Joseph Pecoraro.
1628
1629         * wtf/cocoa/SoftLinking.h:
1630         Remove macro that now has no uses.
1631
1632 2019-02-14  Ross Kirsling  <ross.kirsling@sony.com>
1633
1634         [WTF] Add environment variable helpers
1635         https://bugs.webkit.org/show_bug.cgi?id=192405
1636
1637         Reviewed by Michael Catanzaro.
1638
1639         Create a new Environment API as a platform-independent, thread-safe(r)
1640         way to get and set environment variables.
1641
1642         * WTF.xcodeproj/project.pbxproj:
1643         * wtf/CMakeLists.txt:
1644         * wtf/Environment.h: Added.
1645         * wtf/PlatformGTK.cmake:
1646         * wtf/PlatformJSCOnly.cmake:
1647         * wtf/PlatformMac.cmake:
1648         * wtf/PlatformPlayStation.cmake:
1649         * wtf/PlatformWPE.cmake:
1650         * wtf/PlatformWin.cmake:
1651         * wtf/posix/EnvironmentPOSIX.cpp: Added.
1652         * wtf/win/EnvironmentWin.cpp: Added.
1653         Introduce WTF::Environment.
1654
1655         * wtf/Threading.cpp:
1656         (WTF::threadingIsInitialized):
1657         (WTF::initializeThreading):
1658         * wtf/Threading.h:
1659         Introduce WTF::threadingIsInitialized() so that we can ASSERT that it's
1660         false before setting an environment variable through the new API.
1661
1662         * wtf/DataLog.cpp:
1663         (WTF::initializeLogFileOnce):
1664         * wtf/NumberOfCores.cpp:
1665         (WTF::numberOfProcessorCores):
1666         * wtf/posix/FileSystemPOSIX.cpp:
1667         (WTF::FileSystemImpl::openTemporaryFile):
1668         Utilize WTF::Environment where possible.
1669
1670 2019-02-13  Yusuke Suzuki  <ysuzuki@apple.com>
1671
1672         We should only make rope strings when concatenating strings long enough.
1673         https://bugs.webkit.org/show_bug.cgi?id=194465
1674
1675         Reviewed by Mark Lam.
1676
1677         * wtf/text/StringImpl.h:
1678         (WTF::StringImpl::headerSize):
1679
1680 2019-02-12  Tim Horton  <timothy_horton@apple.com>
1681
1682         Remove WKLegacyPDFView
1683         https://bugs.webkit.org/show_bug.cgi?id=194559
1684
1685         Reviewed by Andy Estes.
1686
1687         * wtf/FeatureDefines.h:
1688
1689 2019-02-12  David Kilzer  <ddkilzer@apple.com>
1690
1691         REGRESSION (r238955, r240494): Soft-linking optional Lookup.framework triggers release assertion when missing
1692         <https://webkit.org/b/194529>
1693         <rdar://problem/47924449>
1694
1695         Reviewed by Eric Carlson.
1696
1697         * wtf/cocoa/SoftLinking.h:
1698         (SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT_AND_IS_OPTIONAL): Rename
1699         SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT_AND_ASSERTION() to this
1700         and change `assertion` argument to `isOptional`.  Pass
1701         `isOptional` to framework##Library() method to control assertion
1702         behavior.  Only check RELEASE_ASSERT() if `!isOptional`, else
1703         that code should be optimized out by the compiler.  This fixes
1704         the crash.
1705         (NO_ASSERT): Remove macro since it's no longer used.
1706         (SOFT_LINK_IS_OPTIONAL): Add macro to use for soft-linking
1707         optional classes.
1708         (SOFT_LINK_IS_NOT_OPTIONAL): Add macro to use for soft-linking
1709         non-optional classes.
1710         (SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT): Update to use new
1711         SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT_AND_IS_OPTIONAL() macro.
1712         (SOFT_LINK_CLASS_FOR_SOURCE_OPTIONAL_WITH_EXPORT): Ditto.
1713         (SOFT_LINK_CLASS_FOR_SOURCE): Ditto.
1714         (SOFT_LINK_CLASS_FOR_SOURCE_OPTIONAL): Ditto.
1715
1716 2019-02-12  Andy Estes  <aestes@apple.com>
1717
1718         [iOSMac] Enable Parental Controls Content Filtering
1719         https://bugs.webkit.org/show_bug.cgi?id=194521
1720         <rdar://39732376>
1721
1722         Reviewed by Tim Horton.
1723
1724         * wtf/Platform.h:
1725
1726 2019-02-11  Myles C. Maxfield  <mmaxfield@apple.com>
1727
1728         [Cocoa] Ask platform for generic font family mappings
1729         https://bugs.webkit.org/show_bug.cgi?id=187723
1730         <rdar://problem/41892438>
1731
1732         Reviewed by Brent Fulgham.
1733
1734         Add an ENABLE in Platform.
1735
1736         * wtf/Platform.h:
1737
1738 2019-02-11  Truitt Savell  <tsavell@apple.com>
1739
1740         Unreviewed, rolling out r241229.
1741
1742         Revision broke internal builds for watchOS.
1743
1744         Reverted changeset:
1745
1746         "[Cocoa] Ask platform for generic font family mappings"
1747         https://bugs.webkit.org/show_bug.cgi?id=187723
1748         https://trac.webkit.org/changeset/241229
1749
1750 2019-02-10  Darin Adler  <darin@apple.com>
1751
1752         Switch uses of StringBuilder with String::format for hex numbers to use HexNumber.h instead
1753         https://bugs.webkit.org/show_bug.cgi?id=194485
1754
1755         Reviewed by Daniel Bates.
1756
1757         * wtf/HexNumber.h: Removed unused functions placeByteAsHexCompressIfPossible and
1758         placeByteAsHex. Can always bring them back if someone needs them. Updated
1759         appendUnsignedAsHex to be a template so we can use it on any integer type,
1760         got rid of unnecessary use of Vector and unnecessary reversing, and got rid of
1761         appendUnsigned64AsHex since callers can now just use appendUnsignedAsHex.
1762         Rewrote appendUnsignedAsHexFixedSize to share mode code rather than replicating.
1763
1764         * wtf/Logger.h: Use appendUnsignedAsHex instead of appendUnsigned64AsHex.
1765
1766         * wtf/URL.cpp: Removed unnecessary include of HexNumber.h.
1767
1768         * wtf/cocoa/NSURLExtras.h: Added missing include of Foundation.h that was
1769         worked around in NSURLExtras.mm.
1770         * wtf/cocoa/NSURLExtras.mm: Removed unnecessary includes of HexNumber.h
1771         and Foundation.h.
1772
1773 2019-02-09  Darin Adler  <darin@apple.com>
1774
1775         Eliminate unnecessary String temporaries by using StringConcatenateNumbers
1776         https://bugs.webkit.org/show_bug.cgi?id=194021
1777
1778         Reviewed by Geoffrey Garen.
1779
1780         * wtf/URL.cpp:
1781         (WTF::URL::setPort): Remove String::number and let makeString do the conversion
1782         without allocating/destroying a String. Added a cast to "unsigned" to sidestep the
1783         ambiguity with 16-bit unsigned types that are sometimes used for numbers (uint16_t)
1784         and sometimes used for UTF-16 code units (UChar) and can be the same type.
1785
1786         * wtf/text/StringConcatenateNumbers.h:
1787         Changed FormattedNumber::fixedPrecision to more closely match String::number and
1788         StringBuilder::appendNumber by defaulting to truncating trailing zeros and using
1789         a named enumeration for the truncation policy rather than a boolean.
1790
1791
1792 2019-02-09  Yusuke Suzuki  <ysuzuki@apple.com>
1793
1794         Unreviewed, rolling in r241237 again
1795         https://bugs.webkit.org/show_bug.cgi?id=194469
1796
1797         After the measurement, this patch was unrelated to recent regression.
1798
1799         * wtf/text/StringImpl.h:
1800         (WTF::StringImpl::isSubString const):
1801         (WTF::StringImpl::createSubstringSharingImpl):
1802
1803 2019-02-09  Commit Queue  <commit-queue@webkit.org>
1804
1805         Unreviewed, rolling out r241237.
1806         https://bugs.webkit.org/show_bug.cgi?id=194474
1807
1808         Shows significant memory increase in WSL (Requested by
1809         yusukesuzuki on #webkit).
1810
1811         Reverted changeset:
1812
1813         "[WTF] Use BufferInternal StringImpl if substring StringImpl
1814         takes more memory"
1815         https://bugs.webkit.org/show_bug.cgi?id=194469
1816         https://trac.webkit.org/changeset/241237
1817
1818 2019-02-08  Yusuke Suzuki  <ysuzuki@apple.com>
1819
1820         [WTF] Use BufferInternal StringImpl if substring StringImpl takes more memory
1821         https://bugs.webkit.org/show_bug.cgi?id=194469
1822
1823         Reviewed by Geoffrey Garen.
1824
1825         Because pointer is large and aligned in 64bit in 64bit architecture, BufferSubstring StringImpl
1826         implementation takes more memory than BufferInternal StringImpl implementation for small strings.
1827         And BufferInternal StringImpl does not have a problem like, small substring StringImpl keeps super
1828         large owner StringImpl. This patch calculates the required size of memory and selects the more efficient one.
1829
1830         * wtf/text/StringImpl.h:
1831         (WTF::StringImpl::isSubString const):
1832         (WTF::StringImpl::createSubstringSharingImpl):
1833
1834 2019-02-08  Alex Christensen  <achristensen@webkit.org>
1835
1836         Add SPI to use networking daemon instead of XPC service
1837         https://bugs.webkit.org/show_bug.cgi?id=194427
1838
1839         Reviewed by Geoffrey Garen.
1840
1841         * wtf/spi/darwin/XPCSPI.h:
1842         Instead of using XPC bootstrap SPI, we just send a separate message.
1843         xpc_copy_bootstrap does not seem to work in  daemons.
1844
1845 2019-02-08  Truitt Savell  <tsavell@apple.com>
1846
1847         Unreviewed, rolling out r241197.
1848
1849         Broke iOS Simulator Debug build and casued 1 API failure on
1850         High Sierra
1851
1852         Reverted changeset:
1853
1854         "Add SPI to use networking daemon instead of XPC service"
1855         https://bugs.webkit.org/show_bug.cgi?id=194427
1856         https://trac.webkit.org/changeset/241197
1857
1858 2019-02-08  Alex Christensen  <achristensen@webkit.org>
1859
1860         Add SPI to use networking daemon instead of XPC service
1861         https://bugs.webkit.org/show_bug.cgi?id=194427
1862
1863         Reviewed by Geoffrey Garen.
1864
1865         * wtf/spi/darwin/XPCSPI.h:
1866         Instead of using XPC bootstrap SPI, we just send a separate message.
1867         xpc_copy_bootstrap does not seem to work in  daemons.
1868
1869 2019-02-08  Benjamin Poulain  <benjamin@webkit.org>
1870
1871         clampTo(): do not convert the input to double when dealing with integers
1872         https://bugs.webkit.org/show_bug.cgi?id=194263
1873         <rdar://problem/47692312>
1874
1875         Reviewed by Darin Adler.
1876
1877         Previously, every use of clampTo() was converting the input to double,
1878         doing the comparison in double, then casting back to whatever type was needed.
1879
1880         In many case, that was very wasteful. WebKit has many cases of clampTo() with
1881         the same type as input/output, or with integer types of different size/sign.
1882
1883         This patch adds a few versions of clampTo() for the common cases seen in WebKit.
1884         In each case, I tried to minimize the amount of conversion needed at runtime.
1885
1886         * wtf/MathExtras.h:
1887         (clampTo):
1888
1889 2019-02-07  Chris Dumez  <cdumez@apple.com>
1890
1891         Mark more heap-allocated classes as fast allocated
1892         https://bugs.webkit.org/show_bug.cgi?id=194422
1893
1894         Reviewed by Ryosuke Niwa.
1895
1896         * wtf/Function.h:
1897         (WTF::Function<Out):
1898         * wtf/RefCounter.h:
1899         * wtf/URL.h:
1900         * wtf/text/StringView.cpp:
1901
1902 2019-02-07  Per Arne Vollan  <pvollan@apple.com>
1903
1904         [macOS] Block coreservicesd in sandbox.
1905         https://bugs.webkit.org/show_bug.cgi?id=192670
1906
1907         Reviewed by Alexey Proskuryakov.
1908
1909         Add HAVE_CSCHECKFIXDISABLE define.
1910
1911         * wtf/Platform.h:
1912
1913 2019-02-07  Eric Carlson  <eric.carlson@apple.com>
1914
1915         [MSE] Convert debug-only logging to runtime logging
1916         https://bugs.webkit.org/show_bug.cgi?id=194348
1917         <rdar://problem/47566449>
1918
1919         Reviewed by Jer Noble.
1920
1921         * wtf/LoggerHelper.h:
1922         (WTF::LoggerHelper::childLogIdentifier const): Helper to generate a log identifier for an
1923         object that is associated with another logging object.
1924         * wtf/MediaTime.cpp:
1925         (WTF::MediaTime::toJSONObject const):
1926         (WTF::MediaTime::toJSONString const):
1927         (WTF::MediaTimeRange::toJSONString const):
1928         (WTF::toJSONStringInternal): Deleted.
1929         * wtf/MediaTime.h:
1930
1931 2019-02-05  Keith Rollin  <krollin@apple.com>
1932
1933         Enable the automatic checking and regenerations of .xcfilelists during builds
1934         https://bugs.webkit.org/show_bug.cgi?id=194124
1935         <rdar://problem/47721277>
1936
1937         Reviewed by Tim Horton.
1938
1939         Bug 193790 add a facility for checking -- during build time -- that
1940         any needed .xcfilelist files are up-to-date and for updating them if
1941         they are not. This facility was initially opt-in by setting
1942         WK_ENABLE_CHECK_XCFILELISTS until other pieces were in place and until
1943         the process seemed robust. Its now time to enable this facility and
1944         make it opt-out. If there is a need to disable this facility, set and
1945         export WK_DISABLE_CHECK_XCFILELISTS=1 in your environment before
1946         running `make` or `build-webkit`, or before running Xcode from the
1947         command line.
1948
1949         Additionally, remove the step that generates a list of source files
1950         going into the UnifiedSources build step. It's only necessarily to
1951         specify Sources.txt and SourcesCocoa.txt as inputs.
1952
1953         * Scripts/generate-unified-source-bundles.rb:
1954
1955 2019-02-05  Yusuke Suzuki  <ysuzuki@apple.com>
1956
1957         [JSC] Shrink sizeof(UnlinkedCodeBlock)
1958         https://bugs.webkit.org/show_bug.cgi?id=194281
1959
1960         Reviewed by Michael Saboff.
1961
1962         * wtf/TriState.h:
1963
1964 2019-02-05  Zan Dobersek  <zdobersek@igalia.com>
1965
1966         [GLib] Stop URI-escaping file system representations
1967         https://bugs.webkit.org/show_bug.cgi?id=194213
1968
1969         Reviewed by Carlos Garcia Campos.
1970
1971         Stop URI-escaping of file representation strings in
1972         FileSystem::stringFromFileSystemRepresentation(), and URI-unescaping
1973         of strings in FileSystem::fileSystemRepresentation().
1974
1975         This behavior deviates from POSIX and CF implementations and is
1976         currently breaking IndexedDB-specific calculation of database sizes due
1977         to directory components used in that process that are URL-based and are
1978         as such URI-escaped. When unescaped, those single directory components
1979         explode into multiple directory components, leading to incorrect total
1980         database size calculation when iterating the database directory.
1981
1982         FileSystem::stringFromFileSystemRepresentation() now retrieves GLib's
1983         filename charsets and in worst case converts the filesystem
1984         representation to UTF-8 before String::fromUTF8() is used.
1985         FileSystem::fileSystemRepresentation() reverses that process, taking
1986         String's UTF-8 data and converting it to target charset if necessary.
1987
1988         Other FileSystem functions are adjusted to convert passed-in String
1989         objects to filesystem representations.
1990
1991         * wtf/glib/FileSystemGlib.cpp:
1992         (WTF::FileSystemImpl::stringFromFileSystemRepresentation):
1993         (WTF::FileSystemImpl::fileSystemRepresentation):
1994         (WTF::FileSystemImpl::validRepresentation):
1995         (WTF::FileSystemImpl::filenameForDisplay):
1996         (WTF::FileSystemImpl::fileExists):
1997         (WTF::FileSystemImpl::deleteFile):
1998         (WTF::FileSystemImpl::deleteEmptyDirectory):
1999         (WTF::FileSystemImpl::getFileStat):
2000         (WTF::FileSystemImpl::getFileLStat):
2001         (WTF::FileSystemImpl::makeAllDirectories):
2002         (WTF::FileSystemImpl::createSymbolicLink):
2003         (WTF::FileSystemImpl::pathGetFileName):
2004         (WTF::FileSystemImpl::getVolumeFreeSpace):
2005         (WTF::FileSystemImpl::directoryName):
2006         (WTF::FileSystemImpl::listDirectory):
2007         (WTF::FileSystemImpl::openFile):
2008         (WTF::FileSystemImpl::moveFile):
2009         (WTF::FileSystemImpl::hardLinkOrCopyFile):
2010         (WTF::FileSystemImpl::getFileDeviceId): Align with POSIX implementation
2011         and treat input CString as an existing filesystem representation.
2012         (WTF::FileSystemImpl::unescapedFilename): Deleted.
2013
2014 2019-02-04  Ms2ger  <Ms2ger@igalia.com>
2015
2016         [GTK][WPE] Need a function to convert internal URI to display ("pretty") URI
2017         https://bugs.webkit.org/show_bug.cgi?id=174816
2018
2019         Reviewed by Michael Catanzaro.
2020
2021         Translate userVisibleString and dependent code into platform-neutral C++
2022         in wtf/URLHelpers.{h,cpp}.
2023
2024         * WTF.xcodeproj/project.pbxproj:
2025         * wtf/CMakeLists.txt:
2026         * wtf/URLHelpers.cpp: Added.
2027         (WTF::URLHelpers::loadIDNScriptWhiteList):
2028         (WTF::URLHelpers::isArmenianLookalikeCharacter):
2029         (WTF::URLHelpers::isArmenianScriptCharacter):
2030         (WTF::URLHelpers::isASCIIDigitOrValidHostCharacter):
2031         (WTF::URLHelpers::isLookalikeCharacter):
2032         (WTF::URLHelpers::whiteListIDNScript):
2033         (WTF::URLHelpers::initializeDefaultIDNScriptWhiteList):
2034         (WTF::URLHelpers::allCharactersInIDNScriptWhiteList):
2035         (WTF::URLHelpers::isSecondLevelDomainNameAllowedByTLDRules):
2036         (WTF::URLHelpers::isRussianDomainNameCharacter):
2037         (WTF::URLHelpers::allCharactersAllowedByTLDRules):
2038         (WTF::URLHelpers::mapHostName):
2039         (WTF::URLHelpers::collectRangesThatNeedMapping):
2040         (WTF::URLHelpers::applyHostNameFunctionToMailToURLString):
2041         (WTF::URLHelpers::applyHostNameFunctionToURLString):
2042         (WTF::URLHelpers::mapHostNames):
2043         (WTF::URLHelpers::createStringWithEscapedUnsafeCharacters):
2044         (WTF::URLHelpers::toNormalizationFormC):
2045         (WTF::URLHelpers::userVisibleURL):
2046         * wtf/URLHelpers.h: Added.
2047         * wtf/cocoa/NSURLExtras.mm:
2048         (WTF::URLHelpers::loadIDNScriptWhiteList):
2049         (WTF::decodePercentEscapes):
2050         (WTF::decodeHostName):
2051         (WTF::encodeHostName):
2052         (WTF::URLWithUserTypedString):
2053         (WTF::userVisibleString):
2054
2055 2019-02-03  Commit Queue  <commit-queue@webkit.org>
2056
2057         Unreviewed, rolling out r240896.
2058         https://bugs.webkit.org/show_bug.cgi?id=194202
2059
2060         "Fixes leaks, but is probably not the correct fix." (Requested
2061         by ddkilzer on #webkit).
2062
2063         Reverted changeset:
2064
2065         "Leak of WTF::StringImpl under SymbolImpl::createNullSymbol()
2066         (48 bytes) in com.apple.WebKit.WebContent running layout
2067         tests"
2068         https://bugs.webkit.org/show_bug.cgi?id=193291
2069         https://trac.webkit.org/changeset/240896
2070
2071 2019-02-02  David Kilzer  <ddkilzer@apple.com>
2072
2073         Leak of WTF::StringImpl under SymbolImpl::createNullSymbol() (48 bytes) in com.apple.WebKit.WebContent running layout tests
2074         <https://webkit.org/b/193291>
2075         <rdar://problem/46655953>
2076
2077         Reviewed by Keith Miller.
2078
2079         * wtf/text/SymbolImpl.h:
2080         (WTF::SymbolImpl::~SymbolImpl): Fix the leak by implementing the
2081         class destructor that calls StringImpl::deref() on `m_owner`.
2082         Two of the three constructors leak the StringImpl when setting
2083         `m_owner`, so we need to balance that by manually calling
2084         deref().
2085
2086 2018-12-16  Darin Adler  <darin@apple.com>
2087
2088         Convert additional String::format clients to alternative approaches
2089         https://bugs.webkit.org/show_bug.cgi?id=192746
2090
2091         Reviewed by Alexey Proskuryakov.
2092
2093         * wtf/JSONValues.cpp:
2094         (WTF::appendDoubleQuotedStringEscapedCharacter): Renamed from
2095         escapeChar and reordered arguments to make sense as an append function.
2096         (WTF::appendDoubleQuotedString): Renamed from doubleQuoteString,
2097         reordered arguments to make sense as an append function, take a
2098         StringView instead of a String, used early exit to make the code
2099         a bit easier to read. Use the ASCIIHexDigit functions to construct
2100         a hex number a nibble at a time rather than using String::format.
2101         (WTF::JSONImpl::Value::writeJSON const): Update for name change.
2102         (WTF::JSONImpl::ObjectBase::writeJSON const): Ditto.
2103
2104 2019-01-31  Carlos Garcia Campos  <cgarcia@igalia.com>
2105
2106         Unreviewed. Fix WPE compile warnings due to deprecated glib API.
2107
2108         * wtf/Platform.h:
2109
2110 2019-01-29  Chris Dumez  <cdumez@apple.com>
2111
2112         Make sure WTF::generateObjectIdentifier() internal counter does not get duplicated
2113         https://bugs.webkit.org/show_bug.cgi?id=193848
2114
2115         Reviewed by Youenn Fablet.
2116
2117         Move WTF::generateObjectIdentifier()'s internal counter out-of-line so make sure it never gets
2118         duplicated at each call site. This has caused some hard-to-debug issues with duplicate
2119         identifiers such as Bug 193761.
2120
2121         Also move it to ObjectIdentifier and rename it to generate() as this make call sites nicer
2122         when they have a typedef for the ObjectIdentifier<T> type.
2123
2124         * WTF.xcodeproj/project.pbxproj:
2125         * wtf/CMakeLists.txt:
2126         * wtf/ObjectIdentifier.cpp: Copied from Source/WebCore/platform/Process.cpp.
2127         (WTF::ObjectIdentifierBase::generateIdentifierInternal):
2128         (WTF::ObjectIdentifierBase::generateThreadSafeIdentifierInternal):
2129         * wtf/ObjectIdentifier.h:
2130         (WTF::ObjectIdentifier::generate):
2131         (WTF::ObjectIdentifier::generateThreadSafe):
2132
2133 2019-01-28  Ross Kirsling  <ross.kirsling@sony.com>
2134
2135         Move platform-specific files out of WTF root directory.
2136         https://bugs.webkit.org/show_bug.cgi?id=193929
2137
2138         Reviewed by Alex Christensen.
2139
2140         * WTF.xcodeproj/project.pbxproj:
2141         * wtf/CMakeLists.txt:
2142         * wtf/PlatformGTK.cmake:
2143         * wtf/PlatformJSCOnly.cmake:
2144         * wtf/PlatformMac.cmake:
2145         * wtf/PlatformPlayStation.cmake:
2146         * wtf/PlatformWPE.cmake:
2147         * wtf/PlatformWin.cmake:
2148         * wtf/cf/RunLoopTimerCF.cpp: Renamed from Source/WTF/wtf/RunLoopTimerCF.cpp.
2149         * wtf/cf/SchedulePairCF.cpp: Renamed from Source/WTF/wtf/SchedulePairCF.cpp.
2150         * wtf/mac/SchedulePairMac.mm: Renamed from Source/WTF/wtf/SchedulePairMac.mm.
2151         * wtf/posix/OSAllocatorPOSIX.cpp: Renamed from Source/WTF/wtf/OSAllocatorPosix.cpp.
2152         * wtf/posix/ThreadingPOSIX.cpp: Renamed from Source/WTF/wtf/ThreadingPthreads.cpp.
2153         * wtf/win/CONTRIBUTORS.pthreads-win32: Renamed from Source/WTF/wtf/CONTRIBUTORS.pthreads-win32.
2154         * wtf/win/OSAllocatorWin.cpp: Renamed from Source/WTF/wtf/OSAllocatorWin.cpp.
2155         * wtf/win/ThreadSpecificWin.cpp: Renamed from Source/WTF/wtf/ThreadSpecificWin.cpp.
2156         * wtf/win/ThreadingWin.cpp: Renamed from Source/WTF/wtf/ThreadingWin.cpp.
2157
2158 2019-01-28  Andy Estes  <aestes@apple.com>
2159
2160         [watchOS] Enable Parental Controls content filtering
2161         https://bugs.webkit.org/show_bug.cgi?id=193939
2162         <rdar://problem/46641912>
2163
2164         Reviewed by Ryosuke Niwa.
2165
2166         * wtf/Platform.h:
2167
2168 2019-01-28  Ross Kirsling  <ross.kirsling@sony.com>
2169
2170         [JSCOnly][WTF] Expose FileSystem.
2171         https://bugs.webkit.org/show_bug.cgi?id=193789
2172
2173         Reviewed by Don Olmstead.
2174
2175         * wtf/FileSystem.h:
2176         * wtf/PlatformJSCOnly.cmake:
2177         * wtf/posix/FileSystemPOSIX.cpp:
2178         (WTF::FileSystemImpl::getVolumeFreeSpace):
2179         * wtf/win/FileSystemWin.cpp:
2180         (WTF::FileSystemImpl::fileSystemRepresentation):
2181
2182 2019-01-28  Eric Carlson  <eric.carlson@apple.com>
2183
2184         AVStreamSession isn't always available, make a HAVE compile flag for it
2185         https://bugs.webkit.org/show_bug.cgi?id=193889
2186         <rdar://problem/47452863>
2187
2188         Reviewed by Jer Noble.
2189
2190         * wtf/FeatureDefines.h:
2191
2192 2018-12-15  Darin Adler  <darin@apple.com>
2193
2194         Replace many uses of String::format with more type-safe alternatives
2195         https://bugs.webkit.org/show_bug.cgi?id=192742
2196
2197         Reviewed by Mark Lam.
2198
2199         * wtf/WorkQueue.cpp:
2200         (WTF::WorkQueue::concurrentApply): Use makeString.
2201
2202         * wtf/dtoa.cpp:
2203         (WTF::dtoa): Use sprintf instead of String::format in the comments,
2204         since these functions have nothing to do with WTF::String.
2205
2206 2019-01-25  Chris Dumez  <cdumez@apple.com>
2207
2208         [iOS] Add support for the download attribute
2209         https://bugs.webkit.org/show_bug.cgi?id=167341
2210         <rdar://problem/30296281>
2211
2212         Reviewed by Geoffrey Garen.
2213
2214         Turn on HTML download attribute support on iOS.
2215
2216         * wtf/FeatureDefines.h:
2217
2218 2019-01-25  David Kilzer  <ddkilzer@apple.com>
2219
2220         Move soft-linking of Lookup.framework out of LookupSPI.h
2221         <https://webkit.org/b/193815>
2222
2223         Reviewed by Tim Horton.
2224
2225         * wtf/cocoa/SoftLinking.h:
2226         (SOFT_LINK_CONSTANT_FOR_HEADER):
2227         (SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT):
2228         (SOFT_LINK_CONSTANT_MAY_FAIL_FOR_HEADER):
2229         - Remove local declaration of constant.  This should be handled
2230           by including *SPI.h or "real" headers.
2231         (SOFT_LINK_CONSTANT_MAY_FAIL_FOR_SOURCE_WITH_EXPORT):
2232         - Remove local declaration of constant.
2233         - Rename from SOFT_LINK_CONSTANT_MAY_FAIL_FOR_SOURCE() and add
2234           `export` argument to support exporting of functions.
2235         (SOFT_LINK_CONSTANT_MAY_FAIL_FOR_SOURCE):
2236         - Redefine in terms of
2237           SOFT_LINK_CONSTANT_MAY_FAIL_FOR_SOURCE_WITH_EXPORT().
2238
2239 2019-01-24  Youenn Fablet  <youenn@apple.com>
2240
2241         Use MonotonicTime in WorkerRunLoop
2242         https://bugs.webkit.org/show_bug.cgi?id=193417
2243
2244         Reviewed by Saam Barati.
2245
2246         * wtf/MessageQueue.h:
2247         (WTF::MessageQueue<DataType>::waitForMessage):
2248         (WTF::MessageQueue<DataType>::waitForMessageFilteredWithTimeout):
2249
2250 2019-01-24  Ross Kirsling  <ross.kirsling@sony.com>
2251
2252         Move FileSystem to WTF
2253         https://bugs.webkit.org/show_bug.cgi?id=193602
2254
2255         Reviewed by Yusuke Suzuki.
2256
2257         * WTF.xcodeproj/project.pbxproj:
2258         * wtf/CMakeLists.txt:
2259         * wtf/FileMetadata.h: Renamed from Source/WebCore/platform/FileMetadata.h.
2260         * wtf/FileSystem.cpp: Renamed from Source/WebCore/platform/FileSystem.cpp.
2261         * wtf/FileSystem.h: Renamed from Source/WebCore/platform/FileSystem.h.
2262         * wtf/PlatformGTK.cmake:
2263         * wtf/PlatformMac.cmake:
2264         * wtf/PlatformPlayStation.cmake:
2265         * wtf/PlatformWPE.cmake:
2266         * wtf/PlatformWin.cmake:
2267         * wtf/cf/FileSystemCF.cpp: Renamed from Source/WebCore/platform/cf/FileSystemCF.cpp.
2268         * wtf/cocoa/FileSystemCocoa.mm: Renamed from Source/WebCore/platform/cocoa/FileSystemCocoa.mm.
2269         * wtf/glib/FileSystemGlib.cpp: Renamed from Source/WebCore/platform/glib/FileSystemGlib.cpp.
2270         * wtf/mac/FileSystemMac.mm: Renamed from Source/WebCore/platform/mac/FileSystemMac.mm.
2271         * wtf/posix/FileSystemPOSIX.cpp: Renamed from Source/WebCore/platform/posix/FileSystemPOSIX.cpp.
2272         * wtf/spi/mac/MetadataSPI.h: Renamed from Source/WebCore/PAL/pal/spi/mac/MetadataSPI.h.
2273         * wtf/win/FileSystemWin.cpp: Renamed from Source/WebCore/platform/win/FileSystemWin.cpp.
2274         * wtf/win/PathWalker.cpp: Renamed from Source/WebCore/platform/win/PathWalker.cpp.
2275         * wtf/win/PathWalker.h: Renamed from Source/WebCore/platform/win/PathWalker.h.
2276
2277 2019-01-24  Guillaume Emont  <guijemont@igalia.com>
2278
2279         [JSC] Reenable baseline JIT on mips
2280         https://bugs.webkit.org/show_bug.cgi?id=192983
2281
2282         Reviewed by Mark Lam.
2283
2284         Use baseline JIT by default on MIPS.
2285
2286         * wtf/Platform.h:
2287
2288 2019-01-24  David Kilzer  <ddkilzer@apple.com>
2289
2290         Duplicate global variables: WTF::asciiCaseFoldTable
2291         <https://webkit.org/b/193726>
2292         <rdar://problem/47334622>
2293
2294         Reviewed by Michael Catanzaro.
2295
2296         * WTF.xcodeproj/project.pbxproj:
2297         * wtf/CMakeLists.txt:
2298         - Add ASCIICType.cpp to build systems.
2299
2300         * wtf/ASCIICType.cpp: Added.
2301         (WTF::asciiCaseFoldTable): Move table to here so there is only
2302         one copy.  Mark as exported for other frameworks to use.
2303         * wtf/ASCIICType.h:
2304         (WTF::asciiCaseFoldTable): Change to extern declaration, and
2305         mark as exported for other frameworks to use.
2306
2307 2019-01-23  Mark Lam  <mark.lam@apple.com>
2308
2309         ARM64E should not ENABLE(SEPARATED_WX_HEAP).
2310         https://bugs.webkit.org/show_bug.cgi?id=193744
2311         <rdar://problem/46262952>
2312
2313         Reviewed by Saam Barati.
2314
2315         * wtf/Platform.h:
2316
2317 2019-01-23  David Kilzer  <ddkilzer@apple.com>
2318
2319         Switch remaining CoreMedia soft-linking in WebKit over to CoreMediaSoftLink.{cpp,h}
2320         <https://webkit.org/b/193694>
2321         <rdar://problem/47464025>
2322
2323         Reviewed by Tim Horton.
2324
2325         * wtf/win/SoftLinking.h:
2326         (SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT):
2327         - Implement for Windows.
2328         (SOFT_LINK_CONSTANT_FOR_SOURCE):
2329         - Define using SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT().
2330
2331 2019-01-22  Tadeu Zagallo  <tzagallo@apple.com>
2332
2333         Cache bytecode to disk
2334         https://bugs.webkit.org/show_bug.cgi?id=192782
2335         <rdar://problem/46084932>
2336
2337         Reviewed by Keith Miller.
2338
2339         BitVectors have to be friends with JSC::CacheBitVector to allow
2340         serializing its buffer as part of the bytecode cache encoding.
2341
2342         * wtf/BitVector.h:
2343
2344 2019-01-21  Claudio Saavedra  <csaavedra@igalia.com>
2345
2346         [GTK] Speculative build fix for Ubuntu LTS
2347         https://bugs.webkit.org/show_bug.cgi?id=193651
2348
2349         Unreviewed build fix.
2350
2351         * wtf/Assertions.h: Add missing <cstdlib> include.
2352
2353 2019-01-20  Saam Barati  <sbarati@apple.com>
2354
2355         Rollout r240210: It broke tests on iOS
2356         https://bugs.webkit.org/show_bug.cgi?id=193640
2357
2358         Unreviewed.
2359
2360         * wtf/BitVector.h:
2361
2362 2019-01-20  Tadeu Zagallo  <tzagallo@apple.com>
2363
2364         Cache bytecode to disk
2365         https://bugs.webkit.org/show_bug.cgi?id=192782
2366         <rdar://problem/46084932>
2367
2368         Reviewed by Keith Miller.
2369
2370         BitVectors have to be friends with JSC::CacheBitVector to allow
2371         serializing its buffer as part of the bytecode cache encoding.
2372
2373         * wtf/BitVector.h:
2374
2375 2019-01-18  Tim Horton  <timothy_horton@apple.com>
2376
2377         Get rid of ADVANCED_SPELL_CHECKING
2378         https://bugs.webkit.org/show_bug.cgi?id=193592
2379
2380         Reviewed by Wenson Hsieh.
2381
2382         * wtf/Platform.h:
2383
2384 2019-01-18  Jer Noble  <jer.noble@apple.com>
2385
2386         SDK_VARIANT build destinations should be separate from non-SDK_VARIANT builds
2387         https://bugs.webkit.org/show_bug.cgi?id=189553
2388
2389         Reviewed by Tim Horton.
2390
2391         * Configurations/Base.xcconfig:
2392         * Configurations/SDKVariant.xcconfig: Added.
2393
2394 2019-01-18  Keith Miller  <keith_miller@apple.com>
2395
2396         Gigacages should start allocations from a slide
2397         https://bugs.webkit.org/show_bug.cgi?id=193523
2398
2399         Reviewed by Mark Lam.
2400
2401         This patch changes some macros into constants since macros are the
2402         devil.
2403
2404         * wtf/Gigacage.cpp:
2405         * wtf/Gigacage.h:
2406
2407 2019-01-18  Matt Lewis  <jlewis3@apple.com>
2408
2409         Unreviewed, rolling out r240160.
2410
2411         This broke multiple internal builds.
2412
2413         Reverted changeset:
2414
2415         "Gigacages should start allocations from a slide"
2416         https://bugs.webkit.org/show_bug.cgi?id=193523
2417         https://trac.webkit.org/changeset/240160
2418
2419 2019-01-18  Keith Miller  <keith_miller@apple.com>
2420
2421         Gigacages should start allocations from a slide
2422         https://bugs.webkit.org/show_bug.cgi?id=193523
2423
2424         Reviewed by Mark Lam.
2425
2426         This patch changes some macros into constants since macros are the
2427         devil.
2428
2429         * wtf/Gigacage.cpp:
2430         * wtf/Gigacage.h:
2431
2432 2019-01-17  Truitt Savell  <tsavell@apple.com>
2433
2434         Unreviewed, rolling out r240124.
2435
2436         This commit broke an internal build.
2437
2438         Reverted changeset:
2439
2440         "SDK_VARIANT build destinations should be separate from non-
2441         SDK_VARIANT builds"
2442         https://bugs.webkit.org/show_bug.cgi?id=189553
2443         https://trac.webkit.org/changeset/240124
2444
2445 2019-01-17  Jer Noble  <jer.noble@apple.com>
2446
2447         SDK_VARIANT build destinations should be separate from non-SDK_VARIANT builds
2448         https://bugs.webkit.org/show_bug.cgi?id=189553
2449
2450         Reviewed by Tim Horton.
2451
2452         * Configurations/Base.xcconfig:
2453         * Configurations/SDKVariant.xcconfig: Added.
2454
2455 2019-01-16  Keith Miller  <keith_miller@apple.com>
2456
2457         bmalloc should use JSC VM tag for gigacage
2458         https://bugs.webkit.org/show_bug.cgi?id=193496
2459
2460         Reviewed by Mark Lam.
2461
2462         Move most of the macros for vm tagging to bmalloc.
2463
2464         * wtf/VMTags.h:
2465
2466 2019-01-16  Alberto Garcia  <berto@igalia.com>
2467
2468         [WTF] Compilation fails with system malloc
2469         https://bugs.webkit.org/show_bug.cgi?id=172445
2470
2471         Reviewed by Michael Catanzaro.
2472
2473         Follow-up to r217270. The sysinfo() system call is specific to
2474         Linux so update the #ifdef checks accordingly.
2475
2476         * wtf/RAMSize.cpp:
2477         (WTF::computeRAMSize):
2478
2479 2019-01-15  Chris Dumez  <cdumez@apple.com>
2480
2481         Unreviewed, revert part of r239997 as it is not needed to fix the build.
2482
2483         * wtf/RefCounter.h:
2484
2485 2019-01-15  Alex Christensen  <achristensen@webkit.org>
2486
2487         Fix iOS build after r239993
2488         https://bugs.webkit.org/show_bug.cgi?id=193361
2489
2490         * wtf/RefCounter.h:
2491
2492 2019-01-14  Michael Catanzaro  <mcatanzaro@igalia.com>
2493
2494         Use unorm2_normalize instead of precomposedStringWithCanonicalMapping in userVisibleString
2495         https://bugs.webkit.org/show_bug.cgi?id=192945
2496
2497         Reviewed by Alex Christensen.
2498
2499         Replace use of the nice NSString function precomposedStringWithCanonicalMapping with the ICU
2500         API unorm2_normalize. This is to prep the code for translation to cross-platform C++. Of
2501         course this is much worse than the preexisting code, but this is just a transitional
2502         measure and not the final state of the code. It wouldn't make sense to do this if the code
2503         were to remain Objective C++.
2504
2505         * wtf/cocoa/NSURLExtras.mm:
2506         (WTF::toNormalizationFormC):
2507         (WTF::userVisibleString):
2508
2509 2019-01-14  Alex Christensen  <achristensen@webkit.org>
2510
2511         Bulgarian TLD should not punycode-encode URLs with Bulgarian Cyrillic characters
2512         https://bugs.webkit.org/show_bug.cgi?id=193411
2513         <rdar://problem/47215929>
2514
2515         Reviewed by Alexey Proskuryakov.
2516
2517         * wtf/cocoa/NSURLExtras.mm:
2518         (WTF::allCharactersAllowedByTLDRules):
2519
2520 2019-01-12  Timothy Hatcher  <timothy@apple.com>
2521
2522         Have prefers-color-scheme: light always match on macOS versions before Mojave.
2523         https://bugs.webkit.org/show_bug.cgi?id=191655
2524         rdar://problem/46074680
2525
2526         Reviewed by Megan Gardner.
2527
2528         * wtf/Platform.h: Define HAVE_OS_DARK_MODE_SUPPORT on macOS 10.14.
2529
2530 2019-01-11  David Kilzer  <ddkilzer@apple.com>
2531
2532         Follow-up: WorkQueue::concurrentApply() passes a raw pointer to a temporary String to Thread::create().
2533         https://bugs.webkit.org/show_bug.cgi?id=191350
2534
2535         * wtf/WorkQueue.cpp:
2536         (WTF::WorkQueue::concurrentApply): Fix whitespace.
2537
2538 2019-01-11  Devin Rousso  <drousso@apple.com>
2539
2540         Fix style CFNetworkSPI style checker warnings from r239698
2541         https://bugs.webkit.org/show_bug.cgi?id=193369
2542
2543         Reviewed by Joseph Pecoraro.
2544
2545         * wtf/Platform.h:
2546
2547 2019-01-11  Said Abou-Hallawa  <sabouhallawa@apple.com>
2548
2549         WorkQueue::concurrentApply() passes a raw pointer to a temporary String to Thread::create().
2550         https://bugs.webkit.org/show_bug.cgi?id=191350
2551
2552         Reviewed by Brent Fulgham.
2553
2554         The non COCOA version of WorkQueue::concurrentApply() creates a temporary
2555         String for the threadName and passes the raw pointer of this String to
2556         Thread::create(). After freeing this String, Thread::entryPoint() uses
2557         the raw char pointer to internally initialize the thread.
2558
2559         The fix is to use a single literal string for all the threads' names since
2560         they are created for a thread-pool.
2561
2562         * wtf/WorkQueue.cpp:
2563         (WTF::WorkQueue::concurrentApply):
2564
2565 2019-01-11  Dominik Infuehr  <dinfuehr@igalia.com>
2566
2567         Enable DFG on ARM/Linux again
2568         https://bugs.webkit.org/show_bug.cgi?id=192496
2569
2570         Reviewed by Yusuke Suzuki.
2571
2572         After changing the bytecode format DFG was disabled on all 32-bit
2573         architectures. Enable DFG now again on ARM/Linux.
2574
2575         * wtf/Platform.h:
2576
2577 2019-01-10  Commit Queue  <commit-queue@webkit.org>
2578
2579         Unreviewed, rolling out r239825.
2580         https://bugs.webkit.org/show_bug.cgi?id=193330
2581
2582         Broke tests on armv7/linux bots (Requested by guijemont on
2583         #webkit).
2584
2585         Reverted changeset:
2586
2587         "Enable DFG on ARM/Linux again"
2588         https://bugs.webkit.org/show_bug.cgi?id=192496
2589         https://trac.webkit.org/changeset/239825
2590
2591 2019-01-10  John Wilander  <wilander@apple.com>
2592
2593         Override the session configuration for cookieAcceptPolicy
2594         https://bugs.webkit.org/show_bug.cgi?id=190925
2595         <rdar://problem/45497382>
2596
2597         Reviewed by Alexey Proskuryakov and Alex Christensen.
2598
2599         * wtf/Platform.h:
2600             Definition of HAVE_CFNETWORK_OVERRIDE_SESSION_COOKIE_ACCEPT_POLICY.
2601
2602 2019-01-10  Dominik Infuehr  <dinfuehr@igalia.com>
2603
2604         Enable DFG on ARM/Linux again
2605         https://bugs.webkit.org/show_bug.cgi?id=192496
2606
2607         Reviewed by Yusuke Suzuki.
2608
2609         After changing the bytecode format DFG was disabled on all 32-bit
2610         architectures. Enable DFG now again on ARM/Linux.
2611
2612         * wtf/Platform.h:
2613
2614 2019-01-10  Carlos Garcia Campos  <cgarcia@igalia.com>
2615
2616         [FreeType] Color emoji not properly supported
2617         https://bugs.webkit.org/show_bug.cgi?id=191976
2618
2619         Reviewed by Michael Catanzaro.
2620
2621         Add a name for combining enclosing keycap character.
2622
2623         * wtf/unicode/CharacterNames.h:
2624
2625 2019-01-09  Carlos Eduardo Ramalho  <cadubentzen@gmail.com> and Fujii Hironori  <Hironori.Fujii@sony.com>
2626
2627         Use directory local sequential numbers for Unified Sources filenames instead of global sequential numbers for CMake
2628         https://bugs.webkit.org/show_bug.cgi?id=192391
2629
2630         Reviewed by Don Olmstead.
2631
2632         Unified Source Builds are using global sequential numbers for
2633         bundle filenames UnifiedSource{sequential-number}.cpp. As the
2634         result, every new source file added would shift the next ones and
2635         prevent compiler caches from speeding up consecutive builds e.g.
2636         in git-bisect sessions.
2637
2638         Changed it to directory local sequential numbers,
2639         UnifiedSource-{hash-of-dir-name}-{sequential-number-within-the-dir}.cpp.
2640
2641         This is affecting only CMake builds which is where no
2642         '--max-cpp-bundle-count' nor '--max-obj-c-bundle-count' options
2643         are set. Xcode builds still use the old convention.
2644
2645         * Scripts/generate-unified-source-bundles.rb: Add new instance
2646         variables @currentDirectory and @extraFiles to BundleManager.
2647         Still use global sequential numbers if --max-cpp-bundle-count or
2648         --max-obj-c-bundle-count is given.
2649
2650 2019-01-09  Alex Christensen  <achristensen@webkit.org>
2651
2652         Expand use of sourceApplicationAuditData
2653         https://bugs.webkit.org/show_bug.cgi?id=192995
2654         <rdar://problem/46627875>
2655
2656         Reviewed by Brady Eidson.
2657
2658         * wtf/Platform.h:
2659
2660 2019-01-09  Mark Lam  <mark.lam@apple.com>
2661
2662         Gigacage disabling checks should handle the GIGACAGE_ALLOCATION_CAN_FAIL case properly.
2663         https://bugs.webkit.org/show_bug.cgi?id=193292
2664         <rdar://problem/46485450>
2665
2666         Reviewed by Yusuke Suzuki.
2667
2668         Update the USE_SYSTEM_MALLOC version of Gigacage.h to match the bmalloc version.
2669
2670         * wtf/Gigacage.h:
2671
2672 2019-01-07  David Kilzer  <ddkilzer@apple.com>
2673
2674         Prefer RetainPtr<NSObject> to RetainPtr<NSObject *>
2675         <https://webkit.org/b/193056>
2676
2677         Reviewed by Alex Christensen.
2678
2679         * wtf/RetainPtr.h:
2680         (WTF::RetainPtr<T>::HelperPtrType):
2681         - Use C++ template metaprogramming to define a shared return
2682           type for adoptNS() and retainPtr() that uses
2683           RetainPtr<NSObject> instead of RetainPtr<NSObject *>.  The
2684           non-Objective-C typedef is used with retainPtr() for CFTypeRef
2685           objects.
2686         (WTF::adoptNS):
2687         - Only make declarations available when compilng with
2688           Objective-C.  The inline implementation is only available for
2689           Objective-C, so this makes the declarations consistent.
2690         - Change return type to remove '*' from NS types using
2691           RetainPtr<T>::HelperPtrType.
2692         (WTF::retainPtr):
2693         - Change return type to remove '*' from NS types using
2694           RetainPtr<T>::HelperPtrType.
2695
2696         * wtf/SchedulePair.h:
2697         - Remove '*' from RetainPtr<> type.
2698
2699 2019-01-07  Eric Carlson  <eric.carlson@apple.com>
2700
2701         A MediaTime timescale must never be zero
2702         https://bugs.webkit.org/show_bug.cgi?id=193156
2703         <rdar://problem/32504501>
2704
2705         Reviewed by Jer Noble.
2706
2707         * wtf/MediaTime.cpp:
2708         (WTF::greatestCommonDivisor): ASSERT if either parameter or return value is zero.
2709         (WTF::MediaTime::MediaTime): Create +/- infinity if passed zero timescale.
2710         (WTF::MediaTime::createWithFloat): Ditto.
2711         (WTF::MediaTime::createWithDouble): Ditto.
2712         (WTF::MediaTime::setTimeScale): Ditto.
2713
2714 2019-01-02  Alex Christensen  <achristensen@webkit.org>
2715
2716         Homograph with LATIN SMALL LETTER R WITH FISHHOOK
2717         https://bugs.webkit.org/show_bug.cgi?id=192944
2718
2719         Reviewed by Tim Horton.
2720
2721         * wtf/cocoa/NSURLExtras.mm:
2722         (WTF::isLookalikeCharacter):
2723
2724 2019-01-02  Commit Queue  <commit-queue@webkit.org>
2725
2726         Unreviewed, rolling out r239524.
2727         https://bugs.webkit.org/show_bug.cgi?id=193083
2728
2729         basic browsing seems not to work (Requested by thorton on
2730         #webkit).
2731
2732         Reverted changeset:
2733
2734         "Expand use of sourceApplicationAuditData"
2735         https://bugs.webkit.org/show_bug.cgi?id=192995
2736         https://trac.webkit.org/changeset/239524
2737
2738 2018-12-28  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
2739
2740         Add ENABLE_UNIFIED_BUILDS option to cmake ports
2741         https://bugs.webkit.org/show_bug.cgi?id=193045
2742
2743         Reviewed by Don Olmstead.
2744
2745         * Scripts/generate-unified-source-bundles.rb:
2746
2747 2018-12-27  Alex Christensen  <achristensen@webkit.org>
2748
2749         Resurrect Mac CMake build
2750         https://bugs.webkit.org/show_bug.cgi?id=192658
2751
2752         Reviewed by Yusuke Suzuki.
2753
2754         * wtf/PlatformMac.cmake:
2755         * wtf/cf/CFURLExtras.cpp:
2756         * wtf/cf/CFURLExtras.h:
2757         * wtf/cf/URLCF.cpp:
2758         * wtf/cocoa/NSURLExtras.h:
2759         * wtf/cocoa/NSURLExtras.mm:
2760         * wtf/cocoa/URLCocoa.mm:
2761
2762 2018-12-21  Dan Bernstein  <mitz@apple.com>
2763
2764         Fixed building for macOS 10.13 using the macOS 10.14 SDK.
2765
2766         * wtf/Platform.h: Changed HAVE_AUTHORIZATION_STATUS_FOR_MEDIA_TYPE to depend on the
2767           deployment target, not the SDK.
2768
2769 2018-12-20  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
2770
2771         [JSC] Implement "well-formed JSON.stringify" proposal
2772         https://bugs.webkit.org/show_bug.cgi?id=191677
2773
2774         Reviewed by Darin Adler.
2775
2776         This patch implements "well-formed JSON.stringify" proposal[1], which is now stage 3.
2777         JSON.stringify appended surrogate pair codes even if it is not paired appropriately.
2778         The proposal requires that broken surrogate pairs are unicode-escaped.
2779
2780         [1]: https://github.com/tc39/proposal-well-formed-stringify
2781
2782         * wtf/text/StringBuilderJSON.cpp:
2783         (WTF::appendQuotedJSONStringInternal):
2784
2785 2018-12-21  Alex Christensen  <achristensen@webkit.org>
2786
2787         Expand use of sourceApplicationAuditData
2788         https://bugs.webkit.org/show_bug.cgi?id=192995
2789         <rdar://problem/46627875>
2790
2791         Reviewed by Brady Eidson.
2792
2793         * wtf/Platform.h:
2794
2795 2018-12-21  Alex Christensen  <achristensen@webkit.org>
2796
2797         Revert r239503.
2798         https://bugs.webkit.org/show_bug.cgi?id=192944
2799
2800         * wtf/cocoa/NSURLExtras.mm:
2801         (WTF::isLookalikeCharacter):
2802
2803 2018-12-20  Brent Fulgham  <bfulgham@apple.com>
2804
2805         Show punycode if URL contains Latin small letter dotless i
2806         https://bugs.webkit.org/show_bug.cgi?id=192944
2807         <rdar://problem/46103047>
2808
2809         Reviewed by Andy Estes.
2810
2811         Revise our "lookalike character" logic to include the small Latin
2812         dotless i character.
2813
2814         Test: fast/url/host.html
2815
2816         * wtf/cocoa/NSURLExtras.mm:
2817         (WTF::isLookalikeCharacter):
2818
2819 2018-12-20  Chris Dumez  <cdumez@apple.com>
2820
2821         Use Optional::hasValue() instead of Optional::has_value()
2822         https://bugs.webkit.org/show_bug.cgi?id=192948
2823
2824         Reviewed by Tim Horton.
2825
2826         * wtf/Hasher.h:
2827         (WTF::add):
2828         * wtf/Optional.h:
2829
2830 2018-12-20  Chris Dumez  <cdumez@apple.com>
2831
2832         Use Optional::valueOr() instead of Optional::value_or()
2833         https://bugs.webkit.org/show_bug.cgi?id=192933
2834
2835         Reviewed by Geoffrey Garen.
2836
2837         * wtf/Optional.h:
2838         (WTF::Optional<T::valueOr const):
2839
2840 2018-12-20  Tadeu Zagallo  <tzagallo@apple.com>
2841
2842         Consistently use MaxLength for all WTF strings
2843         https://bugs.webkit.org/show_bug.cgi?id=192853
2844         <rdar://problem/45726906>
2845
2846         Reviewed by Mark Lam.
2847
2848         MaxLength was introduced to be INT_MAX for WTF::String and StringImpl,
2849         but all the assertions were still done using UINT_MAX. Change it to
2850         use MaxLength for all checks.
2851
2852         * wtf/text/StringImpl.cpp:
2853         (WTF::StringImpl::createUninitializedInternalNonEmpty):
2854         (WTF::StringImpl::reallocateInternal):
2855         (WTF::StringImpl::create):
2856         (WTF::StringImpl::convertToLowercaseWithoutLocale):
2857         (WTF::StringImpl::convertToUppercaseWithoutLocale):
2858         (WTF::StringImpl::convertToLowercaseWithLocale):
2859         (WTF::StringImpl::convertToUppercaseWithLocale):
2860         (WTF::StringImpl::foldCase):
2861         (WTF::StringImpl::find):
2862         (WTF::StringImpl::replace):
2863         (WTF::StringImpl::utf8ForCharacters):
2864         (WTF::StringImpl::tryGetUtf8ForRange const):
2865         * wtf/text/StringImpl.h:
2866         (WTF::lengthOfNullTerminatedString):
2867         (WTF::StringImpl::tryCreateUninitialized):
2868         (WTF::StringImpl::adopt):
2869         (WTF::StringImpl::maxInternalLength):
2870         * wtf/text/WTFString.cpp:
2871         (WTF::String::append):
2872         (WTF::String::insert):
2873         (WTF::String::fromUTF8):
2874         * wtf/text/WTFString.h:
2875         (WTF::String::reverseFind const):
2876
2877 2018-12-19  Chris Dumez  <cdumez@apple.com>
2878
2879         wtf/Optional.h: move-constructor and move-assignment operator should disengage the value being moved from
2880         https://bugs.webkit.org/show_bug.cgi?id=192728
2881         <rdar://problem/46746779>
2882
2883         Reviewed by Geoff Garen.
2884
2885         Update optional's move-constructor and move-assignment operator to disengage the value being moved from.
2886         Rename to optional to Optional, make_optional() to makeOptional(), and move class from std to WTF namespace.
2887
2888         Based on patch by David Kilzer.
2889
2890         * wtf/*:
2891
2892 2018-12-19  Eric Carlson  <eric.carlson@apple.com>
2893
2894         [MediaStream] Force system camera/microphone TCC prompt if necessary
2895         https://bugs.webkit.org/show_bug.cgi?id=192820
2896         <rdar://problem/42680098>
2897
2898         Reviewed by Jer Noble.
2899
2900         * wtf/Platform.h: Define HAVE_AUTHORIZATION_STATUS_FOR_MEDIA_TYPE.
2901
2902 2018-12-17  Chris Fleizach  <cfleizach@apple.com>
2903
2904         Some builds are broken after r239262
2905         https://bugs.webkit.org/show_bug.cgi?id=192777
2906
2907         Reviewed by Simon Fraser.
2908
2909         * wtf/Platform.h:
2910
2911 2018-12-17  Daniel Bates  <dabates@apple.com>
2912
2913         Support concatenating StringView with other string types
2914         https://bugs.webkit.org/show_bug.cgi?id=177566
2915
2916         Reviewed by Darin Adler.
2917
2918         Add operator+ overloads to StringOperators.h to support concatenating a StringView with
2919         other string types (e.g. String). This lets a person write more naturally looking code:
2920
2921         stringView + string
2922
2923         Instead of:
2924
2925         makeString(stringView, string)
2926
2927         * wtf/text/StringOperators.h:
2928         (WTF::operator+): Added various operator+ overloads.
2929
2930 2018-12-17  Commit Queue  <commit-queue@webkit.org>
2931
2932         Unreviewed, rolling out r239265 and r239274.
2933         https://bugs.webkit.org/show_bug.cgi?id=192765
2934
2935         unorm_normalize is deprecated, and broke an internal build
2936         (Requested by Truitt on #webkit).
2937
2938         Reverted changesets:
2939
2940         "[GTK][WPE] Need a function to convert internal URI to display
2941         ("pretty") URI"
2942         https://bugs.webkit.org/show_bug.cgi?id=174816
2943         https://trac.webkit.org/changeset/239265
2944
2945         "Fix the Apple Internal Mac build with a newer SDK"
2946         https://trac.webkit.org/changeset/239274
2947
2948 2018-12-17  Daniel Bates  <dabates@apple.com>
2949
2950         Fix the Apple Internal Mac build with a newer SDK
2951
2952         * wtf/URLHelpers.cpp:
2953         (WTF::URLHelpers::userVisibleURL):
2954
2955 2018-12-17  Matt Lewis  <jlewis3@apple.com>
2956
2957         Unreviewed, rolling out r239254.
2958
2959         This broke the Windows 10 Debug build
2960
2961         Reverted changeset:
2962
2963         "Replace many uses of String::format with more type-safe
2964         alternatives"
2965         https://bugs.webkit.org/show_bug.cgi?id=192742
2966         https://trac.webkit.org/changeset/239254
2967
2968 2018-12-17  Ms2ger  <Ms2ger@igalia.com>
2969
2970         [GTK][WPE] Need a function to convert internal URI to display ("pretty") URI
2971         https://bugs.webkit.org/show_bug.cgi?id=174816
2972
2973         Reviewed by Michael Catanzaro.
2974
2975         Translate userVisibleString and dependent code into platform-neutral C++
2976         in wtf/URLHelpers.{h,cpp}.
2977
2978         * WTF.xcodeproj/project.pbxproj:
2979         * wtf/CMakeLists.txt:
2980         * wtf/URLHelpers.cpp: Added.
2981         (WTF::URLHelpers::loadIDNScriptWhiteList):
2982         (WTF::URLHelpers::isArmenianLookalikeCharacter):
2983         (WTF::URLHelpers::isArmenianScriptCharacter):
2984         (WTF::URLHelpers::isASCIIDigitOrValidHostCharacter):
2985         (WTF::URLHelpers::isLookalikeCharacter):
2986         (WTF::URLHelpers::whiteListIDNScript):
2987         (WTF::URLHelpers::initializeDefaultIDNScriptWhiteList):
2988         (WTF::URLHelpers::allCharactersInIDNScriptWhiteList):
2989         (WTF::URLHelpers::isSecondLevelDomainNameAllowedByTLDRules):
2990         (WTF::URLHelpers::isRussianDomainNameCharacter):
2991         (WTF::URLHelpers::allCharactersAllowedByTLDRules):
2992         (WTF::URLHelpers::mapHostName):
2993         (WTF::URLHelpers::collectRangesThatNeedMapping):
2994         (WTF::URLHelpers::applyHostNameFunctionToMailToURLString):
2995         (WTF::URLHelpers::applyHostNameFunctionToURLString):
2996         (WTF::URLHelpers::mapHostNames):
2997         (WTF::URLHelpers::createStringWithEscapedUnsafeCharacters):
2998         (WTF::URLHelpers::userVisibleURL):
2999         * wtf/URLHelpers.h: Added.
3000         * wtf/cocoa/NSURLExtras.mm:
3001         (WTF::URLHelpers::loadIDNScriptWhiteList):
3002         (WTF::decodePercentEscapes):
3003         (WTF::decodeHostName):
3004         (WTF::encodeHostName):
3005         (WTF::URLWithUserTypedString):
3006         (WTF::userVisibleString):
3007
3008 2018-12-15  Darin Adler  <darin@apple.com>
3009
3010         Use warning-ignoring macros more consistently and simply
3011         https://bugs.webkit.org/show_bug.cgi?id=192743
3012
3013         Reviewed by Mark Lam.
3014
3015         * wtf/Assertions.h: Use IGNORE_WARNINGS_BEGIN rather than
3016         IGNORE_CLANG_WARNINGS_BEGIN since we don't need special handling for
3017         non-clang compilers, in part since the code is already inside
3018         #if COMPILER(CLANG), but also because it would be harmless to ignore this
3019         warning on non-clang; we should almost never use IGNORE_CLANG_WARNINGS_BEGIN.
3020
3021 2018-12-15  Darin Adler  <darin@apple.com>
3022
3023         Replace many uses of String::format with more type-safe alternatives
3024         https://bugs.webkit.org/show_bug.cgi?id=192742
3025
3026         Reviewed by Mark Lam.
3027
3028         * wtf/WorkQueue.cpp:
3029         (WTF::WorkQueue::concurrentApply): Use makeString.
3030
3031         * wtf/dtoa.cpp:
3032         (WTF::dtoa): Use sprintf instead of String::format in the comments,
3033         since these functions have nothing to do with WTF::String.
3034
3035 2018-12-14  Darin Adler  <darin@apple.com>
3036
3037         Verify size is valid in USE_SYSTEM_MALLOC version of tryAllocateZeroedVirtualPages
3038         https://bugs.webkit.org/show_bug.cgi?id=192738
3039         rdar://problem/37502342
3040
3041         Reviewed by Mark Lam.
3042
3043         * wtf/Gigacage.cpp:
3044         (Gigacage::tryAllocateZeroedVirtualPages): Added a RELEASE_ASSERT just
3045         like the one in tryLargeZeroedMemalignVirtual in bmalloc.
3046
3047 2018-12-14  David Kilzer  <ddkilzer@apple.com>
3048
3049         clang-tidy: Fix unnecessary copy of AtomicString each time one is logged
3050         <https://webkit.org/b/192710>
3051         <rdar://problem/46738962>
3052
3053         Reviewed by Eric Carlson.
3054
3055         * wtf/Logger.h:
3056         (WTF::LogArgument::toString): Make argument a const reference to
3057         avoid the copy.
3058
3059 2018-12-14  Zan Dobersek  <zdobersek@igalia.com>
3060
3061         [GLib] RunLoop::dispatchAfter() GSource requires microsecond precision
3062         https://bugs.webkit.org/show_bug.cgi?id=192696
3063
3064         Reviewed by Michael Catanzaro.
3065
3066         The GSource we set up in GLib's RunLoop::dispatchAfter() implementation
3067         should support microsecond-precision delays. Such delays are common in
3068         JSC's Watchdog implementation and missing support for them has been
3069         causing test failures in the `testapi` program as well as some JSC
3070         tests that depend on the termination determination functionality of the
3071         JSC::Watchdog class.
3072
3073         RunLoop::dispatchAfter() is changed to spawn a raw GSource that uses the
3074         existing GSourceFuncs implementation used elsewhere in GLib's RunLoop.
3075         The GSource's ready time is set manually, now with the necessary
3076         microsecond precision.
3077
3078         * wtf/glib/RunLoopGLib.cpp:
3079         (WTF::RunLoop::dispatchAfter):
3080
3081 2018-12-13  Saam Barati  <sbarati@apple.com>
3082
3083         The JSC shell should listen for memory pressure events and respond to them
3084         https://bugs.webkit.org/show_bug.cgi?id=192647
3085
3086         Reviewed by Keith Miller.
3087
3088         * wtf/MemoryPressureHandler.cpp:
3089         (WTF::MemoryPressureHandler::MemoryPressureHandler):
3090         (WTF::MemoryPressureHandler::setDispatchQueue):
3091         Make it so that we can customize which dispatch queue memory pressure
3092         events get handled on.
3093
3094         * wtf/MemoryPressureHandler.h:
3095         (WTF::MemoryPressureHandler::setShouldLogMemoryMemoryPressureEvents):
3096         Make it so that we can disable logging that happens on each memory
3097         pressure event.
3098
3099         * wtf/cocoa/MemoryPressureHandlerCocoa.mm:
3100         (WTF::MemoryPressureHandler::install):
3101         (WTF::MemoryPressureHandler::uninstall):
3102         (WTF::MemoryPressureHandler::holdOff):
3103
3104 2018-12-13  David Kilzer  <ddkilzer@apple.com>
3105
3106         clang-tidy: Fix unnecessary parameter copies in ParallelHelperPool.cpp
3107         <https://webkit.org/b/192666>
3108         <rdar://problem/46697952>
3109
3110         Reviewed by Alex Christensen.
3111
3112         * wtf/ParallelHelperPool.cpp:
3113         (WTF::ParallelHelperClient::ParallelHelperClient): Use rvalue
3114         reference and WTFMove().
3115         (WTF::ParallelHelperClient::setTask): Ditto.
3116         (WTF::ParallelHelperClient::runTaskInParallel): Ditto.
3117         (WTF::ParallelHelperClient::runTask): Use const reference.
3118         * wtf/ParallelHelperPool.h: Update declarations to match
3119         implementations.
3120
3121 2018-12-12  Alex Christensen  <achristensen@webkit.org>
3122
3123         Implement safe browsing in WebKit on WatchOS
3124         https://bugs.webkit.org/show_bug.cgi?id=192641
3125         <rdar://problem/46376188>
3126
3127         Reviewed by Geoff Garen.
3128
3129         * wtf/Platform.h:
3130         WatchOS has safe browsing, too!
3131
3132 2018-12-11  Fujii Hironori  <Hironori.Fujii@sony.com>
3133
3134         [Win][Clang] Fix compilation warnings of WTF
3135         https://bugs.webkit.org/show_bug.cgi?id=192583
3136
3137         Reviewed by Alex Christensen.
3138
3139         clang-cl reports the following warnings.
3140
3141         > [92/206] Building CXX object Source\WTF\wtf\CMakeFiles\WTF.dir\StackBounds.cpp.obj
3142         > ..\..\Source\WTF\wtf\StackBounds.cpp(163,48):  warning: missing field 'AllocationBase' initializer [-Wmissing-field-initializers]
3143         >     MEMORY_BASIC_INFORMATION stackOrigin = { 0 };
3144         >                                                ^
3145         > 1 warning generated.
3146         > [160/206] Building CXX object Source\WTF\wtf\CMakeFiles\WTF.dir\win\RunLoopWin.cpp.obj
3147         > ..\..\Source\WTF\wtf\win\RunLoopWin.cpp(34,54):  warning: ISO C++11 does not allow conversion from string literal to 'const LPWSTR' (aka 'wchar_t *const') [-Wwritable-strings]
3148         > static const LPWSTR kRunLoopMessageWindowClassName = L"RunLoopMessageWindow";
3149         >                                                      ^
3150         > ..\..\Source\WTF\wtf\win\RunLoopWin.cpp(86,32):  warning: missing field 'lpfnWndProc' initializer [-Wmissing-field-initializers]
3151         >     WNDCLASS windowClass = { 0 };
3152         >                                ^
3153         > 2 warnings generated.
3154         > [175/206] Building CXX object Source\WTF\wtf\CMakeFiles\WTF.dir\DateMath.cpp.obj
3155         > ..\..\Source\WTF\wtf\DateMath.cpp(125,20):  warning: unused function 'getLocalTime' [-Wunused-function]
3156         > static inline void getLocalTime(const time_t* localTime, struct tm* localTM)
3157         >                    ^
3158         > 1 warning generated.
3159
3160         * wtf/DateMath.cpp:
3161         (WTF::getLocalTime): Defined only if used.
3162         * wtf/StackBounds.cpp:
3163         (WTF::StackBounds::currentThreadStackBoundsInternal): Initialize stackOrigin with '{ }'.
3164         * wtf/win/RunLoopWin.cpp: Change the type of kRunLoopMessageWindowClassName to LPCWSTR.
3165         (WTF::RunLoop::registerRunLoopMessageWindowClass): Initialize windowClass with '{ }'.
3166
3167 2018-12-11  Andy Estes  <aestes@apple.com>
3168
3169         Introduce makeBlockPtr for lambdas
3170         https://bugs.webkit.org/show_bug.cgi?id=192594
3171
3172         Reviewed by Alex Christensen.
3173
3174         BlockPtr<...>::fromCallable is cumbersome because it requires repeating the callable's
3175         signature as a class template argument. This patch introduces an overload of makeBlockPtr
3176         that deduces the correct BlockPtr instantiation from a lambda's operator() signature.
3177
3178         * wtf/BlockPtr.h:
3179         (WTF::makeBlockPtr):
3180
3181         Adopted makeBlockPtr.
3182
3183         * wtf/cocoa/WorkQueueCocoa.cpp:
3184         (WTF::WorkQueue::dispatch):
3185         (WTF::WorkQueue::dispatchAfter):
3186         (WTF::WorkQueue::concurrentApply):
3187
3188 2018-12-10  Don Olmstead  <don.olmstead@sony.com>
3189
3190         Move ENABLE_RESOURCE_LOAD_STATISTICS to FeatureDefines.xcconfig
3191         https://bugs.webkit.org/show_bug.cgi?id=192573
3192
3193         Reviewed by Simon Fraser.
3194
3195         Remove ENABLE_RESOURCE_LOAD_STATISTICS from Platform.h and instead rely
3196         on it being set in FeatureDefines.xcconfig.
3197
3198         * wtf/Platform.h:
3199
3200 2018-12-10  Alexey Proskuryakov  <ap@apple.com>
3201
3202         Move ENABLE_SEC_ITEM_SHIM out of WebKit's config.h
3203         https://bugs.webkit.org/show_bug.cgi?id=192428
3204
3205         Reviewed by Tim Horton.
3206
3207         * wtf/Platform.h:
3208
3209 2018-12-10  Alexey Proskuryakov  <ap@apple.com>
3210
3211         Move more macros out of WebKit's config.h
3212         https://bugs.webkit.org/show_bug.cgi?id=192430
3213
3214         Reviewed by Tim Horton.
3215
3216         * wtf/Platform.h:
3217
3218 2018-12-09  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
3219
3220         Unreviewed, fix build failure on GCC 8.2, part 2
3221
3222         Add RefCountedArray::assign, and use it instead of operator= internally.
3223         We should have operator=(const RefCountedArray&) since it will be automatically generated
3224         if we do not have correct implementation here.
3225
3226         * wtf/RefCountedArray.h:
3227         (WTF::RefCountedArray::operator=):
3228         (WTF::RefCountedArray::assign):
3229
3230 2018-12-09  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
3231
3232         Unreviewed, fix build failure on GCC 8.2
3233
3234         We remove operator=<PtrTraits> call since it is not necessary.
3235         This is a workaround. It seems that GCC 8.2 fails to parse this specialization.
3236
3237         * wtf/RefCountedArray.h:
3238
3239 2018-12-08  Darin Adler  <darin@apple.com>
3240
3241         Fix stray-semicolon warning seen with a new version of clang in Xcode
3242         https://bugs.webkit.org/show_bug.cgi?id=192534
3243
3244         Reviewed by Alexey Proskuryakov.
3245
3246         * wtf/Lock.h: Removed an unneeded semicolon.
3247
3248 2018-12-08  Adrian Perez de Castro  <aperez@igalia.com>
3249
3250         [WTF] Debug build fails due conflicting abort() method
3251         https://bugs.webkit.org/show_bug.cgi?id=192491
3252
3253         Reviewed by Michael Catanzaro.
3254
3255         * wtf/Assertions.h: Use namespaced std::abort() insted of plain abort() to avoid clashes
3256         inside classes which have an ::abort() method, but only when __cplusplus is defined to
3257         allow inclusion of the header in plain C sources.
3258
3259 2018-12-07  Andy Estes  <aestes@apple.com>
3260
3261         [Cocoa] Add optional variants of SOFT_LINK_CLASS_FOR_SOURCE
3262         https://bugs.webkit.org/show_bug.cgi?id=192498
3263
3264         Reviewed by Tim Horton.
3265
3266         Added SOFT_LINK_CLASS_FOR_SOURCE_OPTIONAL and SOFT_LINK_CLASS_FOR_SOURCE_OPTIONAL_WITH_EXPORT,
3267         which behave like their non-optional variants but do not require their classes to exist.
3268
3269         * wtf/cocoa/SoftLinking.h:
3270
3271 2018-12-06  Alexey Proskuryakov  <ap@apple.com>
3272
3273         Move USE_NEW_THEME out of WebCore's config.h
3274         https://bugs.webkit.org/show_bug.cgi?id=192426
3275
3276         Reviewed by Tim Horton.
3277
3278         * wtf/Platform.h:
3279
3280 2018-12-04  Carlos Garcia Campos  <cgarcia@igalia.com>
3281
3282         [SOUP] Move URLSoup back to WebCore after r238771
3283         https://bugs.webkit.org/show_bug.cgi?id=192306
3284
3285         Reviewed by Michael Catanzaro.
3286
3287         In r238771 URL was moved from WebCore to WTF, including the soup implementation. Unfortunately that added
3288         libsoup as a new dependency of libjavascriptcoregtk.
3289
3290         * wtf/PlatformGTK.cmake:
3291         * wtf/PlatformWPE.cmake:
3292         * wtf/URL.h:
3293         * wtf/glib/URLGLib.cpp: Copied from Source/WTF/wtf/glib/URLSoup.cpp.
3294
3295 2018-12-03  Don Olmstead  <don.olmstead@sony.com>
3296
3297         Fix some unused parameter warnings
3298         https://bugs.webkit.org/show_bug.cgi?id=192336
3299
3300         Reviewed by Fujii Hironori.
3301
3302         * wtf/StackTrace.cpp:
3303         (WTFGetBacktrace):
3304         (WTF::StackTrace::demangle):
3305         * wtf/generic/MemoryPressureHandlerGeneric.cpp:
3306         (WTF::MemoryPressureHandler::holdOff):
3307         (WTF::MemoryPressureHandler::respondToMemoryPressure):
3308
3309 2018-12-01  Alexey Proskuryakov  <ap@apple.com>
3310
3311         Modernize version check for _suppressedAutoAddedHTTPHeaders
3312         https://bugs.webkit.org/show_bug.cgi?id=192175
3313
3314         Reviewed by Tim Horton.
3315
3316         * wtf/Platform.h:
3317
3318 2018-11-30  Alex Christensen  <achristensen@webkit.org>
3319
3320         Fix Windows build after r238771
3321         https://bugs.webkit.org/show_bug.cgi?id=190234
3322
3323         * wtf/URLParser.h:
3324         Just make defaultPortForProtocol public so we don't have to worry about DLL linkage.
3325
3326 2018-11-30  Alex Christensen  <achristensen@webkit.org>
3327
3328         Move URL from WebCore to WTF
3329         https://bugs.webkit.org/show_bug.cgi?id=190234
3330
3331         Reviewed by Keith Miller.
3332
3333         * WTF.xcodeproj/project.pbxproj:
3334         * wtf/CMakeLists.txt:
3335         * wtf/Forward.h:
3336         * wtf/PlatformGTK.cmake:
3337         * wtf/PlatformMac.cmake:
3338         * wtf/PlatformWPE.cmake:
3339         * wtf/PlatformWin.cmake:
3340         * wtf/URL.cpp: Renamed from Source/WebCore/platform/URL.cpp.
3341         (WTF::URL::protocolIs):
3342         * wtf/URL.h: Renamed from Source/WebCore/platform/URL.h.
3343         * wtf/URLHash.h: Renamed from Source/WebCore/platform/URLHash.h.
3344         (WTF::URLHash::hash):
3345         (WTF::URLHash::equal):
3346         * wtf/URLParser.cpp: Renamed from Source/WebCore/platform/URLParser.cpp.
3347         (WTF::URLParser::isInUserInfoEncodeSet):
3348         (WTF::URLParser::parseAuthority):
3349         * wtf/URLParser.h: Renamed from Source/WebCore/platform/URLParser.h.
3350         (WTF::URLParser::URLParser):
3351         (WTF::URLParser::result):
3352         * wtf/cf/CFURLExtras.cpp: Renamed from Source/WebCore/platform/cf/CFURLExtras.cpp.
3353         * wtf/cf/CFURLExtras.h: Renamed from Source/WebCore/platform/cf/CFURLExtras.h.
3354         * wtf/cf/URLCF.cpp: Renamed from Source/WebCore/platform/cf/URLCF.cpp.
3355         * wtf/cocoa/NSURLExtras.h: Copied from Source/WebCore/loader/archive/ArchiveResourceCollection.h.
3356         * wtf/cocoa/NSURLExtras.mm: Copied from Source/WebCore/platform/mac/WebCoreNSURLExtras.mm.
3357         (WTF::isArmenianLookalikeCharacter):
3358         (WTF::isArmenianScriptCharacter):
3359         (WTF::isASCIIDigitOrValidHostCharacter):
3360         (WTF::isLookalikeCharacter):
3361         (WTF::whiteListIDNScript):
3362         (WTF::readIDNScriptWhiteListFile):
3363         (WTF::allCharactersInIDNScriptWhiteList):
3364         (WTF::isSecondLevelDomainNameAllowedByTLDRules):
3365         (WTF::isRussianDomainNameCharacter):
3366         (WTF::allCharactersAllowedByTLDRules):
3367         (WTF::mapHostNameWithRange):
3368         (WTF::hostNameNeedsDecodingWithRange):
3369         (WTF::hostNameNeedsEncodingWithRange):
3370         (WTF::decodeHostNameWithRange):
3371         (WTF::encodeHostNameWithRange):
3372         (WTF::decodeHostName):
3373         (WTF::encodeHostName):
3374         (WTF::collectRangesThatNeedMapping):
3375         (WTF::collectRangesThatNeedEncoding):
3376         (WTF::collectRangesThatNeedDecoding):
3377         (WTF::applyHostNameFunctionToMailToURLString):
3378         (WTF::applyHostNameFunctionToURLString):
3379         (WTF::mapHostNames):
3380         (WTF::stringByTrimmingWhitespace):
3381         (WTF::URLByTruncatingOneCharacterBeforeComponent):
3382         (WTF::URLByRemovingResourceSpecifier):
3383         (WTF::URLWithData):
3384         (WTF::dataWithUserTypedString):
3385         (WTF::URLWithUserTypedString):
3386         (WTF::URLWithUserTypedStringDeprecated):
3387         (WTF::hasQuestionMarkOnlyQueryString):
3388         (WTF::dataForURLComponentType):
3389         (WTF::URLByRemovingComponentAndSubsequentCharacter):
3390         (WTF::URLByRemovingUserInfo):
3391         (WTF::originalURLData):
3392         (WTF::createStringWithEscapedUnsafeCharacters):
3393         (WTF::userVisibleString):
3394         (WTF::isUserVisibleURL):
3395         (WTF::rangeOfURLScheme):
3396         (WTF::looksLikeAbsoluteURL):
3397         * wtf/cocoa/URLCocoa.mm: Renamed from Source/WebCore/platform/mac/URLMac.mm.
3398         (WTF::URL::URL):
3399         (WTF::URL::createCFURL const):
3400         * wtf/glib/GUniquePtrSoup.h: Renamed from Source/WebCore/platform/network/soup/GUniquePtrSoup.h.
3401         * wtf/glib/URLSoup.cpp: Renamed from Source/WebCore/platform/soup/URLSoup.cpp.
3402
3403 2018-11-30  Alexey Proskuryakov  <ap@apple.com>
3404
3405         Move USE_CFNETWORK_IGNORE_HSTS to its proper place
3406         https://bugs.webkit.org/show_bug.cgi?id=192173
3407
3408         Reviewed by Tim Horton.
3409
3410         * wtf/Platform.h: Also renamed it to better match other version checks.
3411
3412 2018-11-29  Alexey Proskuryakov  <ap@apple.com>
3413
3414         Modernize the check for kCFURLRequestContentDecoderSkipURLCheck existence
3415         https://bugs.webkit.org/show_bug.cgi?id=192041
3416
3417         Reviewed by Tim Horton.
3418
3419         * wtf/Platform.h:
3420
3421 2018-11-28  Mark Lam  <mark.lam@apple.com>
3422
3423         ENABLE_SEPARATED_WX_HEAP needs to be defined in Platform.h.
3424         https://bugs.webkit.org/show_bug.cgi?id=192110
3425         <rdar://problem/46317746>
3426
3427         Reviewed by Saam Barati.
3428
3429         Contrary my previous claim in r238564, ENABLE_SEPARATED_WX_HEAP needs to be
3430         defined in Platform.h because it is also needed in WebCore for the CSS JIT.  Also
3431         contrary to my previous claim, ENABLE(FAST_JIT_PERMISSIONS) is defined for WebCore
3432         (and other projects) as well as JSC.  Hence, there's no reason why
3433         ENABLE_SEPARATED_WX_HEAP cannot be defined in Platform.h.
3434
3435         * wtf/Platform.h:
3436
3437 2018-11-28  Keith Rollin  <krollin@apple.com>
3438
3439         Update generate-unified-source-bundles.rb to generate .xcfilelist files
3440         https://bugs.webkit.org/show_bug.cgi?id=192029
3441         <rdar://problem/46285918>
3442
3443         Reviewed by Alex Christensen.
3444
3445         Update generate-unified-source-bundles.rb to generate output for
3446         .xcfilelist files. These files are used to indicate the sets of input
3447         and output files to Run Script build phases in Xcode. By invoking
3448         generate-unified-source-bundles.rb with -generate-xcfilelists, the
3449         script generates these .xcfilelist files. These .xcfilelist files can
3450         then be used to specify the inputs and outputs of the Generate Unified
3451         Sources build phases.
3452
3453         * Scripts/generate-unified-source-bundles.rb:
3454
3455 2018-11-28  Alexey Proskuryakov  <ap@apple.com>
3456
3457         Remove another OS version check from NetworkDataTaskCocoa.mm
3458         https://bugs.webkit.org/show_bug.cgi?id=192046
3459
3460         Reviewed by Alex Christensen.
3461
3462         * wtf/Platform.h:
3463
3464 2018-11-28  Alexey Proskuryakov  <ap@apple.com>
3465
3466         Modernize version checks for same site cookie support
3467         https://bugs.webkit.org/show_bug.cgi?id=192054
3468
3469         Reviewed by Tim Horton.
3470
3471         * wtf/Platform.h:
3472
3473 2018-11-27  Alexey Proskuryakov  <ap@apple.com>
3474
3475         Modernize the check for async _saveCookies existence
3476         https://bugs.webkit.org/show_bug.cgi?id=191987
3477
3478         Reviewed by Dean Jackson.
3479
3480         * wtf/Platform.h: Added a specific macro for this. Not changing the behavior here,
3481         although it seems very likely that we want to do the same on other iOS family OSes.
3482
3483 2018-11-26  Fujii Hironori  <Hironori.Fujii@sony.com>
3484
3485         [Win][Clang] SOFT_LINK reports warning: implicit conversion between pointer-to-function and pointer-to-object is a Microsoft extension [-Wmicrosoft-cast]
3486         https://bugs.webkit.org/show_bug.cgi?id=191960
3487
3488         Reviewed by Alex Christensen.
3489
3490         * wtf/win/SoftLinking.h: Do reinterpret_cast<void*> a function
3491         pointer argument of EncodePointer. Changed the type of stored
3492         function pointer returned by EncodePointer.
3493
3494 2018-11-26  Sam Weinig  <sam@webkit.org>
3495
3496         Streamline ListHashSet use in floating object code
3497         https://bugs.webkit.org/show_bug.cgi?id=191957
3498
3499         Reviewed by Alex Christensen.
3500
3501         * wtf/ListHashSet.h:
3502         Reverses the order of the template arguments for the find() and contains()
3503         overload that allow specifying a hash translator to allow the compiler to
3504         deduce type T. This simplifies call sites and matches other WTF containers.
3505
3506 2018-11-25  Michael Catanzaro  <mcatanzaro@igalia.com>
3507
3508         CRASH() should call abort() except on Darwin and in developer builds
3509         https://bugs.webkit.org/show_bug.cgi?id=184408
3510
3511         Reviewed by Daniel Bates.
3512
3513         CRASH() should call abort() except on Darwin and in developer builds, as discussed on
3514         webkit-dev. This should be slightly nicer than dereferencing 0xbadbeef.
3515
3516         On Darwin, CRASH() uses a breakpoint trap, which seems to corrupt the stack on Linux, so we
3517         can't do that.
3518
3519         Continue to call WTFCrash() in developer mode, and make no changes to WTFCrash(), since it
3520         is reportedly useful in nightmare scenarios where core dumps are unavailable.
3521
3522         We also have to define CRASH_UNDER_CONSTEXPR_CONTEXT(). It's a bit odd that it's possible to
3523         use a non-constexpr function here, but it works. Currently this macro uses WTFCrash(), which
3524         is also non-constexpr.
3525
3526         * wtf/Assertions.h:
3527
3528 2018-11-25  Michael Catanzaro  <mcatanzaro@igalia.com>
3529
3530         Unreviewed, rolling out r238469.
3531
3532         Broke the build
3533
3534         Reverted changeset:
3535
3536         "CRASH() should call abort() except on Darwin and in developer
3537         builds"
3538         https://bugs.webkit.org/show_bug.cgi?id=184408
3539         https://trac.webkit.org/changeset/238469
3540
3541 2018-11-24  Andy Estes  <aestes@apple.com>
3542
3543         [Cocoa] SOFT_LINK_CLASS_FOR_{HEADER,SOURCE} should generate a more concise getter function
3544         https://bugs.webkit.org/show_bug.cgi?id=191899
3545
3546         Reviewed by Dean Jackson.
3547
3548         Currently, SOFT_LINK_CLASS_FOR_HEADER declares a class getter function that includes the
3549         framework name. For example, NSView would have a class getter named
3550         namespace::get_AppKit_NSViewClass().
3551
3552         Including the framework name in the getter is unnecessary. Objective-C classes already exist
3553         in a global namespace, so there is no need to disambiguate class names by framework. This
3554         patch elides the framework name from the getter function. For example, NSView would now have
3555         a getter named namespace::getNSViewClass().
3556
3557         * wtf/cocoa/SoftLinking.h:
3558
3559 2018-11-24  Michael Catanzaro  <mcatanzaro@igalia.com>
3560
3561         CRASH() should call abort() except on Darwin and in developer builds
3562         https://bugs.webkit.org/show_bug.cgi?id=184408
3563
3564         Reviewed by Daniel Bates.
3565
3566         CRASH() should call abort() except on Darwin and in developer builds, as discussed on
3567         webkit-dev. This should be slightly nicer than dereferencing 0xbadbeef.
3568
3569         On Darwin, CRASH() uses a breakpoint trap, which seems to corrupt the stack on Linux, so we
3570         can't do that.
3571
3572         Continue to call WTFCrash() in developer mode, and make no changes to WTFCrash(), since it
3573         is reportedly useful in nightmare scenarios where core dumps are unavailable.
3574
3575         * wtf/Assertions.h:
3576
3577 2018-11-23  Sam Weinig  <sam@webkit.org>
3578
3579         Add raw pointer overloads to ListHashSet via SmartPtr specialized functions
3580         https://bugs.webkit.org/show_bug.cgi?id=191936
3581
3582         Reviewed by Zalan Bujtas.
3583
3584         Adds overloads for find, contains, insertBefore and remove that take raw pointers
3585         when the value type V of a ListHashSet is true for the predicate IsSmartPtr<V>::value.
3586         This brings the interface to ListHashSet closer inline with HashSet, HashMap and HashCountedSet
3587         which already have this functionality. Like in the other collections, this is especially
3588         useful when using std::unique_ptr<> as the value, since there would be no way to pass it
3589         to these functions. One difference between this set of overloads is the inclusion of insertBefore,
3590         which is unique to ListHashSet. As would be expected, this specialization only changes the first
3591         parameter, the one that needs to be found, to support a raw pointer.  
3592
3593         * wtf/ListHashSet.h:
3594         (WTF::U>::find):
3595         (WTF::U>::find const):
3596         (WTF::U>::contains const):
3597         (WTF::U>::insertBefore):
3598         (WTF::U>::remove):
3599
3600 2018-11-21  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
3601
3602         [JSC] Drop ARM_TRADITIONAL support in LLInt, baseline JIT, and DFG
3603         https://bugs.webkit.org/show_bug.cgi?id=191675
3604
3605         Reviewed by Mark Lam.
3606
3607         * wtf/InlineASM.h:
3608    &n