1 2019-08-07 Chris Dumez <cdumez@apple.com>
3 Tighten WeakPtr threading assertions for GC threads
4 https://bugs.webkit.org/show_bug.cgi?id=200451
6 Reviewed by Youenn Fablet.
8 Make sure our GC threads do not dereference WeakPtr for main thread
9 objects by tightening our threading assertions in WeakPtr. They are
10 still allowed to call WeakPtr::get() for now though.
13 (WTF::WeakPtrImpl::get):
14 (WTF::WeakPtrImpl::wasConstructedOnMainThread const):
15 (WTF::WeakPtr::get const):
16 (WTF::WeakPtr::operator-> const):
17 (WTF::WeakPtr::operator* const):
19 2019-08-06 Jiewen Tan <jiewen_tan@apple.com>
21 Unreviewed, a build fix after r248308
23 Use kSecUseDataProtectionKeychain for iOS 13 and macOS Catalina or newer.
27 2019-08-06 Chris Dumez <cdumez@apple.com>
29 Fix inefficiency in HTTPHeaderMap::set(CFStringRef, const String&)
30 https://bugs.webkit.org/show_bug.cgi?id=200475
32 Reviewed by Darin Adler.
34 Add convenience constuctor to StringView which takes in a const char*
35 and an unsigned length, similarly to what we already have for String.
38 (WTF::URL::protocolIs const):
39 (WTF::protocolIsInternal):
40 * wtf/text/StringView.h:
41 (WTF::StringView::StringView):
42 (WTF::StringView::empty):
44 2019-08-06 Jiewen Tan <jiewen_tan@apple.com>
46 [WebAuthN] Enable LocalAuthenticator for macOS
47 https://bugs.webkit.org/show_bug.cgi?id=182772
48 <rdar://problem/43347920>
50 Reviewed by Brent Fulgham.
53 Adds HAVE_DEVICE_IDENTITY.
54 * wtf/spi/cocoa/SecuritySPI.h:
55 Adds a SPI for telling macOS keychain to use the modern one.
57 2019-08-06 Claudio Saavedra <csaavedra@igalia.com>
59 FileSystem: silent build warning
61 Unreviewed compilation warning fix.
63 Remove unused parameter in empty method
65 (WTF::FileSystemImpl::createTemporaryZipArchive):
67 2019-08-05 Youenn Fablet <youenn@apple.com>
69 Make Logger::log thread safe so that it can be used from background threads
70 https://bugs.webkit.org/show_bug.cgi?id=200448
72 Reviewed by Eric Carlson.
74 Add a lock to ensure calling log is thread-safe.
77 (WTF::Logger::addObserver):
78 (WTF::Logger::removeObserver):
80 (WTF::Logger::observerLock):
82 2019-08-05 Takashi Komori <Takashi.Komori@sony.com>
84 [Curl] implement CertificateInfo::summaryInfo
85 https://bugs.webkit.org/show_bug.cgi?id=191498
87 Reviewed by Alex Christensen.
89 Fixed function template for encoding vector.
91 * wtf/persistence/PersistentCoders.h:
93 2019-08-02 Mark Lam <mark.lam@apple.com>
95 [ARM64E] Harden the diversity of the DOMJIT::Signature::unsafeFunction pointer.
96 https://bugs.webkit.org/show_bug.cgi?id=200292
97 <rdar://problem/53706881>
99 Reviewed by Geoffrey Garen.
102 - Introducing WTF_VTBL_FUNCPTR_PTRAUTH and WTF_VTBL_FUNCPTR_PTRAUTH_STR macros for
103 defining vtbl function pointer style pointer signing modifier.
105 2019-08-02 Eric Carlson <eric.carlson@apple.com>
107 uniqueLogIdentifier() should generate a 64-bit identifier
108 https://bugs.webkit.org/show_bug.cgi?id=200403
109 <rdar://problem/53878447>
111 Reviewed by Youenn Fablet.
113 * wtf/LoggerHelper.h:
114 (WTF::LoggerHelper::childLogIdentifier const): Use uint64_t masks.
115 (WTF::LoggerHelper::uniqueLogIdentifier): cryptographicallyRandomNumber returns a
116 uint32_t so use two to generate a 64-bit identifier.
118 2019-08-02 Alex Christensen <achristensen@webkit.org>
120 Fix an internal build after r248139
121 https://bugs.webkit.org/show_bug.cgi?id=200102
123 * wtf/cocoa/FileSystemCocoa.mm:
124 Some internal builds couldn't find BOM framework headers.
125 No problem. They're not needed. Just remove references to them.
127 2019-08-01 Alex Christensen <achristensen@webkit.org>
129 Move FormData zip file generation to NetworkProcess and enable it for all WebKit clients for uploading directories
130 https://bugs.webkit.org/show_bug.cgi?id=200102
131 <rdar://problem/53275114>
133 Reviewed by Darin Adler.
135 Move code from BlobDataFileReference::generateReplacementFile to FileSystem::createZipArchive.
137 * wtf/FileSystem.cpp:
138 (WTF::FileSystemImpl::createZipArchive):
140 * wtf/cocoa/FileSystemCocoa.mm:
141 (WTF::FileSystemImpl::createZipArchive):
143 2019-08-01 Per Arne Vollan <pvollan@apple.com>
145 Initialize memory pressure flag in MemoryPressureHandler
146 https://bugs.webkit.org/show_bug.cgi?id=200353
148 Reviewed by Geoffrey Garen.
150 The flag 'm_underMemoryPressure' in MemoryPressureHandler should be initialized to 'false'.
152 * wtf/MemoryPressureHandler.h:
154 2019-08-01 Chris Dumez <cdumez@apple.com>
156 Add threading assertion to WeakPtr's operator->()
157 https://bugs.webkit.org/show_bug.cgi?id=199922
159 Reviewed by Ryosuke Niwa.
161 Add threading assertion to WeakPtr's operator->() to make sure that the WeakPtr
162 always gets dereferenced on the same thread it was constructed on.
165 (WTF::WeakPtrImpl::get):
166 (WTF::WeakPtrImpl::WeakPtrImpl):
168 2019-07-31 Youenn Fablet <youenn@apple.com>
170 Use CTFontCreateForCharactersWithLanguageAndOption if available instead of CTFontCreateForCharactersWithLanguage
171 https://bugs.webkit.org/show_bug.cgi?id=200241
173 Reviewed by Myles C. Maxfield.
175 * wtf/Platform.h: Add macro to enable/disable new SPI.
177 2019-07-31 Keith Rollin <krollin@apple.com>
179 Fix 64-bit vs 32-bit mismatch in PersistentCoders.h
180 https://bugs.webkit.org/show_bug.cgi?id=200288
181 <rdar://problem/53734203>
183 Reviewed by Chris Dumez.
185 hashMapSize is declared as a uint64_t. It is passed to
186 HashMapType::reserveInitialCapacity, which takes an unsigned int. This
187 is a 32-bit value on 32-bit platforms, leading to a compile time
188 error. Fix his by casting hashMapSize to the expected type.
190 * wtf/persistence/PersistentCoders.h:
192 2019-07-31 Keith Rollin <krollin@apple.com>
194 Fix 64-bit vs 32-bit mismatch in LogArgument
195 https://bugs.webkit.org/show_bug.cgi?id=200286
196 <rdar://problem/53733671>
198 Reviewed by Darin Adler.
200 LogArgument is a utility for converting scalars into strings. It has a
201 number of versions of a toString() method that is specialized for each
202 type and converts the value to a string in a manner appropriate for
203 that type. However, the versions of toString() for "long long" and
204 "unsigned long long" are actually declared to take an "long" or
205 "unsigned long" as a parameter. This difference leads to a 64-bit vs
206 32-bit build error on 32-bit systems. Fix this by specifying
207 correct/matching types.
210 (WTF::LogArgument::toString):
212 2019-07-30 Myles C. Maxfield <mmaxfield@apple.com>
214 REGRESSION(r241288): Text on Yahoo Japan mobile looks too bold
215 https://bugs.webkit.org/show_bug.cgi?id=200065
216 <rdar://problem/50912757>
218 Reviewed by Simon Fraser.
222 2019-07-30 Michael Catanzaro <mcatanzaro@igalia.com>
224 Fix CRASH_WITH_INFO() so that it doesn't complain about unused parameters on non Clang / MSVC compilers.
225 https://bugs.webkit.org/show_bug.cgi?id=200243
227 Reviewed by Mark Lam.
229 For GCC, we'll implement WTFCrashWithInfo as a function rather than a macro. To use
230 ##__VA_ARGS we would need to enable GNU extensions, and don't want to do that. The proper
231 solution, format __VA_OPT__(,) __VA_ARGS__, requires C++20. So just use an inline function
232 for now as a workaround.
236 (CRASH_WITH_SECURITY_IMPLICATION_AND_INFO):
238 2019-07-25 Dean Jackson <dino@apple.com>
240 Add helper for ignoring deprecated implementation warnings
241 https://bugs.webkit.org/show_bug.cgi?id=200135
243 Reviewed by Wenson Hsieh.
245 Add ALLOW_DEPRECATED_IMPLEMENTATIONS_BEGIN/END macro which
246 is IGNORE_WARNINGS_BEGIN("deprecated-implementations")
250 2019-07-24 Yusuke Suzuki <ysuzuki@apple.com>
252 [bmalloc] Add IsoHeap test to ensure that IsoHeap pages are not allocating too large VA
253 https://bugs.webkit.org/show_bug.cgi?id=200103
255 Reviewed by Mark Lam.
257 We move VMTag page investigation code from PAL to WTF to use it in TestWTF.
258 And we also accumulate allocated VA size in `reserved` field of `TagInfo`.
260 * WTF.xcodeproj/project.pbxproj:
261 * wtf/CMakeLists.txt:
262 * wtf/PlatformMac.cmake:
263 * wtf/ResourceUsage.h: Added.
264 * wtf/cocoa/MemoryPressureHandlerCocoa.mm:
265 * wtf/cocoa/ResourceUsageCocoa.cpp: Added.
267 (WTF::logFootprintComparison):
268 (WTF::displayNameForVMTag):
269 (WTF::pagesPerVMTag):
270 * wtf/spi/cocoa/MachVMSPI.h: Added.
272 2019-07-23 Keith Miller <keith_miller@apple.com>
274 Add cheat sheet comment for HashMap/Set iterator/AddResult
275 https://bugs.webkit.org/show_bug.cgi?id=200061
277 Reviewed by Saam Barati.
282 2019-07-23 Keith Rollin <krollin@apple.com>
284 Remove rest of NavigatorContentUtils support
285 https://bugs.webkit.org/show_bug.cgi?id=200052
286 <rdar://problem/53467357>
288 Reviewed by Alex Christensen.
290 Bug 196070 removes most of the support for the never-used
291 NavigatorContentUtils facility. However, there were still a couple of
292 left-over references after that change. This patch sweeps those up.
294 * wtf/FeatureDefines.h:
296 2019-07-23 Keith Rollin <krollin@apple.com>
298 Enable HAVE_APP_LINKS_WITH_ISENABLED for entire iOS family
299 https://bugs.webkit.org/show_bug.cgi?id=200040
300 <rdar://problem/53457670>
302 Reviewed by Tim Horton.
304 This feature was enabled for just iOS, but should be enabled for tvOS
309 2019-07-23 Alicia Boya GarcÃa <aboya@igalia.com>
311 [WTF] Add DataMutex and MainThreadData wrappers
312 https://bugs.webkit.org/show_bug.cgi?id=199831
314 Reviewed by Alex Christensen.
316 This patch adds two new wrapper classes:
318 DataMutex<T> stores an instance of T in a private member along with a
319 mutex. In order to use its fields, users need to instantiate a
320 DataMutex<T>::LockedWrapper instance in the stack. This class uses
321 RAII to lock and unlock the mutex in construction and destruction
322 respectively, and by using the arrow operator lets the user access T's
325 This way, DataMutex<T> prevents most instances of accidental access to
326 data fields that should only be read and modified in an atomic matter.
328 Still, both the Lock and the LockHolder are exposed once the user has
329 taken the lock so that special cases such as waiting for a condition
330 variable or performing an early unlock are doable.
332 MainThreadData<T> is another wrapper class, in this case for data
333 fields that should only be accessed from the main thread. In this
334 case, it works similar to a smart pointer, except that (1) there is no
335 actual memory indirection, T is stored directly inside
336 MainThreadData<T> and (2) attempts to use the -> or * operator have an
337 isMainThread() assertion.
339 Together, these two wrapper classes make it easier to write
340 multi-threaded code in a safer, more self-documented way by letting
341 the author group data into structures that have certain access safety
344 These structures were originally part of the new GStreamer
345 WebKitMediaSrc rework patch: https://bugs.webkit.org/show_bug.cgi?id=199719
347 * wtf/CMakeLists.txt:
348 * wtf/DataMutex.h: Added.
349 (WTF::DataMutex::DataMutex):
350 (WTF::DataMutex::LockedWrapper::LockedWrapper):
351 (WTF::DataMutex::LockedWrapper::operator->):
352 (WTF::DataMutex::LockedWrapper::operator*):
353 (WTF::DataMutex::LockedWrapper::mutex):
354 (WTF::DataMutex::LockedWrapper::lockHolder):
355 * wtf/MainThreadData.h: Added.
356 (WTF::MainThreadData::MainThreadData):
357 (WTF::MainThreadData::operator->):
358 (WTF::MainThreadData::operator*):
360 2019-07-22 Yusuke Suzuki <ysuzuki@apple.com>
362 [bmalloc] Each IsoPage gets 1MB VA because VMHeap::tryAllocateLargeChunk rounds up
363 https://bugs.webkit.org/show_bug.cgi?id=200024
365 Reviewed by Saam Barati.
367 Start using a VM tag for IsoHeap instead of CLoop Stack.
372 2019-07-20 Chris Dumez <cdumez@apple.com>
374 Speed up HashTable decoding by reserving capacity and avoiding rehashing
375 https://bugs.webkit.org/show_bug.cgi?id=199982
377 Reviewed by Saam Barati.
379 Introduce reserveInitialCapacity() on HashMap to reserve capacity on a
380 HashMap and cut down on rehashing cost when possible.
384 (WTF::HashTable::reserveInitialCapacity):
386 * wtf/persistence/PersistentCoders.h:
387 Use HashMap::reserveInitialCapacity() in the HashMap persistent decoder for
390 2019-07-20 Alexander Mikhaylenko <exalm7659@gmail.com>
392 REGRESSION(r246033/r246496): [GTK] Kinetic scrolling doesn't work
393 https://bugs.webkit.org/show_bug.cgi?id=199322
395 Reviewed by Michael Catanzaro.
397 Introduce ENABLE_KINETIC_SCROLLING to explicitly always have kinetic scrolling on GTK.
401 2019-07-18 Youenn Fablet <youenn@apple.com>
403 Make sure to set kCTFontFallbackOptionAttribute to kCTFontFallbackOptionSystem for system fonts
404 https://bugs.webkit.org/show_bug.cgi?id=199769
405 <rdar://problem/49390297>
407 Reviewed by Myles C. Maxfield.
411 2019-07-17 Christopher Reid <chris.reid@sony.com>
413 Bytecode cache should use FileSystem
414 https://bugs.webkit.org/show_bug.cgi?id=199759
416 Reviewed by Yusuke Suzuki.
418 * wtf/FileSystem.cpp:
420 Add support for creating MappedFileData from a preexisting file handle
421 for use with locked files. Also support creating MappedFileData
422 with either private or shared mappings.
425 Avoid ASSERT with returning a LazyNeverDestroyed object that hasn't been created.
427 * wtf/glib/FileSystemGlib.cpp:
428 * wtf/win/FileSystemWin.cpp:
429 Add truncateFile implementations.
431 2019-07-17 Sam Weinig <weinig@apple.com>
433 Add StringBuilder member function which allows makeString() style variadic argument construction
434 https://bugs.webkit.org/show_bug.cgi?id=198997
436 Reviewed by Darin Adler.
438 Adds new StringBuilder::flexibleAppend(...) member function which allows passing one or more
439 string-adaptable (in the sense that there is StringTypeAdapter specialization for the
440 type) parameters. This re-ususes the variadic template infrastructure in StringConcatenate.h
441 that is used for makeString(...) allowing for improvements in one to benefit the other.
443 The advantage of StringBuilder::flexibleAppend(...) over calling StringBuilder::append(...)
444 multiple times (beyond the code sharing with makeString(...) is that it can avoid unnecessary
445 additional re-allocations when the StringBuilder needs to expand it's capacity. It does this
446 by computing the complete required length for all the passed arguments and then ensuring enough
447 capacity is available. It also reduces the allocation overhead versus the anti-pattern of
448 builder.append(makeString(...)).
450 Ideally, this member function should eventually just be called StringBuilder::append(...), but
451 the current overload set for StringBuilder::append(...) makes this complicated due to overloads
452 that take two arguments such as StringBuilder::append(const UChar*, unsigned). Going forward, we
453 should rename or remove those overloads and move to a standard interface.
455 * wtf/posix/FileSystemPOSIX.cpp:
456 (WTF::FileSystemImpl::pathByAppendingComponents):
457 Adopt StringBuilder::flexibleAppend, using to combine the append of '/' and component.
459 * wtf/text/StringBuilder.cpp:
460 (WTF::StringBuilder::appendUninitialized):
461 (WTF::StringBuilder::appendUninitializedWithoutOverflowCheck):
462 Extract the part of appendUnitialized that doesn't do the overflow check
463 into it's own member function to allow callers that have already done the
464 overflow check to bypass it.
466 (WTF::StringBuilder::appendUninitializedWithoutOverflowCheckForUChar):
467 (WTF::StringBuilder::appendUninitializedWithoutOverflowCheckForLChar):
468 Added to allow template member function flexibleAppendFromAdapters to call
469 appendUninitializedWithoutOverflowCheck without moving it to the header.
471 * wtf/text/StringBuilder.h:
472 (WTF::StringBuilder::flexibleAppendFromAdapters):
473 (WTF::StringBuilder::flexibleAppend):
474 Modeled on tryMakeStringFromAdapters in StringConcatenate.h, these
475 eagerly compute the required length, expand the buffer and then use
476 the existing string type adaptor accumulation functions used by makeString.
478 * wtf/text/StringConcatenate.h:
479 (WTF::stringTypeAdapterAccumulator):
480 (WTF::tryMakeStringFromAdapters):
481 (WTF::makeStringAccumulator): Deleted.
482 Renames makeStringAccumulator to stringTypeAdapterAccumulator now that it is used
483 by more than just makeString.
485 2019-07-17 Commit Queue <commit-queue@webkit.org>
487 Unreviewed, rolling out r247505.
488 https://bugs.webkit.org/show_bug.cgi?id=199871
490 "Caused failed ASSERT in stress test" (Requested by creid on
495 "Bytecode cache should use FileSystem"
496 https://bugs.webkit.org/show_bug.cgi?id=199759
497 https://trac.webkit.org/changeset/247505
499 2019-07-16 Christopher Reid <chris.reid@sony.com>
501 Bytecode cache should use FileSystem
502 https://bugs.webkit.org/show_bug.cgi?id=199759
504 Reviewed by Yusuke Suzuki.
506 * wtf/FileSystem.cpp:
508 Add support for creating MappedFileData from a preexisting file handle
509 for use with locked files. Also support creating MappedFileData
510 with either private or shared mappings.
513 Avoid ASSERT with returning a LazyNeverDestroyed object that hasn't been created.
515 * wtf/glib/FileSystemGlib.cpp:
516 * wtf/win/FileSystemWin.cpp:
517 Add truncateFile implementations.
519 2019-07-16 Myles C. Maxfield <mmaxfield@apple.com>
521 New York font erroneously gets synthetic bold
522 https://bugs.webkit.org/show_bug.cgi?id=199653
524 Unreviewed MacCatalyst build fix.
528 2019-07-16 Michael Catanzaro <mcatanzaro@igalia.com>
530 [WPE][GTK] Improvements and fixes in FileSystemGlib.cpp
531 https://bugs.webkit.org/show_bug.cgi?id=199800
533 Reviewed by Carlos Garcia Campos.
537 Fix a GFileInfo leak in getFileSize.
539 Use GRefPtr to clarify ownership of the GFileIOStream in openFile.
541 * wtf/glib/FileSystemGlib.cpp:
542 (WTF::FileSystemImpl::getFileSize):
543 (WTF::FileSystemImpl::getVolumeFreeSpace):
544 (WTF::FileSystemImpl::openTemporaryFile):
545 (WTF::FileSystemImpl::openFile):
546 (WTF::FileSystemImpl::seekFile):
547 (WTF::FileSystemImpl::writeToFile):
548 (WTF::FileSystemImpl::readFromFile):
550 2019-07-15 Myles C. Maxfield <mmaxfield@apple.com>
552 New York font erroneously gets synthetic bold
553 https://bugs.webkit.org/show_bug.cgi?id=199653
555 Unreviewed watchOS build fix.
559 2019-07-15 Commit Queue <commit-queue@webkit.org>
561 Unreviewed, rolling out r247462.
562 https://bugs.webkit.org/show_bug.cgi?id=199816
564 completely messed up the patch (Requested by litherum on
569 "New York font erroneously gets synthetic bold"
570 https://bugs.webkit.org/show_bug.cgi?id=199653
571 https://trac.webkit.org/changeset/247462
573 2019-07-11 Myles C. Maxfield <mmaxfield@apple.com>
575 New York font erroneously gets synthetic bold
576 https://bugs.webkit.org/show_bug.cgi?id=199653
577 <rdar://problem/51692592>
579 Reviewed by Simon Fraser.
583 2019-07-15 Brady Eidson <beidson@apple.com>
585 Make WKURLSchemeTask thread safe.
586 <rdar://problem/50471863> and https://bugs.webkit.org/show_bug.cgi?id=199764
588 Reviewed by Alex Christensen.
590 * wtf/MainThread.cpp:
591 (WTF::callOnMainAndWait):
592 (WTF::callOnMainRunLoopAndWait):
593 (WTF::callOnMainThreadAndWait):
596 2019-07-15 Dean Jackson <dino@apple.com>
598 MacCatalyst asserts when command key is raised
599 https://bugs.webkit.org/show_bug.cgi?id=199805
600 <rdar://problem/53120393>
602 Reviewed by Tim Horton.
604 Add USE_UIKIT_KEYBOARD_ADDITIONS for iOS 13+ and macCatalyst.
606 * wtf/FeatureDefines.h:
608 2019-07-14 Chris Dumez <cdumez@apple.com>
610 Add threading assertion to WeakPtrFactory::createWeakPtr()
611 https://bugs.webkit.org/show_bug.cgi?id=199639
613 Reviewed by Ryosuke Niwa.
615 Add threading assertion to WeakPtrFactory::createWeakPtr() to make sure it
616 is called on the same thread where the WeakPtrFactory wad constructed.
619 (WTF::WeakPtrFactory::WeakPtrFactory):
620 (WTF::WeakPtrFactory::createWeakPtr const):
622 2019-07-14 Dean Jackson <dino@apple.com>
624 WebGL not supported on WKWebView on UIKit for Mac
625 https://bugs.webkit.org/show_bug.cgi?id=199785
626 <rdar://problem/52911449>
628 Reviewed by Antoine Quint.
630 MacCatalyst has Apple Graphics Control, although
631 this area is very messy, see <rdar://53062794>.
635 2019-07-11 Myles C. Maxfield <mmaxfield@apple.com>
637 New York font erroneously gets synthetic bold
638 https://bugs.webkit.org/show_bug.cgi?id=199653
639 <rdar://problem/51692592>
641 Reviewed by Simon Fraser.
645 2019-07-11 Pablo Saavedra <psaavedra@igalia.com>
647 [WPE][GTK] Build failure with ENABLE_ACCESSIBILITY=OFF
648 https://bugs.webkit.org/show_bug.cgi?id=199625
650 Added ENABLE(ACCESSIBILITY) and replaced HAVE(ACCESSIBILITY)
651 with ENABLE(ACCESSIBILITY) in the code.
653 Additionally, the TestRunner code generator now honors the
654 Conditional IDL format.
656 Reviewed by Konstantin Tokarev.
658 * wtf/FeatureDefines.h:
661 2019-07-10 Ryan Haddad <ryanhaddad@apple.com>
663 Unreviewed, rolling out r247286.
665 Caused TestWTF.WTF.StringOperators to fail on debug bots
669 "Add StringBuilder member function which allows makeString()
670 style variadic argument construction"
671 https://bugs.webkit.org/show_bug.cgi?id=198997
672 https://trac.webkit.org/changeset/247286
674 2019-07-09 Michael Catanzaro <mcatanzaro@igalia.com>
676 [WPE][GTK] GUniqueOutPtr::release should return a raw pointer
677 https://bugs.webkit.org/show_bug.cgi?id=199579
679 Reviewed by Carlos Garcia Campos.
681 GUniqueOutPtr::release should release to a raw pointer, rather than a GUniquePtr. If a
682 GUniquePtr is desired, it's trivial to construct one from the raw pointer, but all existing
683 callsites under Source/ would rather have a raw pointer. Currently they have to call
684 release().release() to get the raw pointer, which is annoying.
686 * wtf/glib/GUniquePtr.h:
687 (WTF::GUniqueOutPtr::release):
689 2019-07-09 Sam Weinig <weinig@apple.com>
691 Add StringBuilder member function which allows makeString() style variadic argument construction
692 https://bugs.webkit.org/show_bug.cgi?id=198997
694 Reviewed by Darin Adler.
696 Adds new StringBuilder::flexibleAppend(...) member function which allows passing one or more
697 string-adaptable (in the sense that there is StringTypeAdapter specialization for the
698 type) parameters. This re-ususes the variadic template infrastructure in StringConcatenate.h
699 that is used for makeString(...) allowing for improvements in one to benefit the other.
701 The advantage of StringBuilder::flexibleAppend(...) over calling StringBuilder::append(...)
702 multiple times (beyond the code sharing with makeString(...) is that it can avoid unnecessary
703 additional re-allocations when the StringBuilder needs to expand it's capacity. It does this
704 by computing the complete required length for all the passed arguments and then ensuring enough
705 capacity is available. It also reduces the allocation overhead versus the anti-pattern of
706 builder.append(makeString(...)).
708 Ideally, this member function should eventually just be called StringBuilder::append(...), but
709 the current overload set for StringBuilder::append(...) makes this complicated due to overloads
710 that take two arguments such as StringBuilder::append(const UChar*, unsigned). Going forward, we
711 should rename or remove those overloads and move to a standard interface.
713 * wtf/posix/FileSystemPOSIX.cpp:
714 (WTF::FileSystemImpl::pathByAppendingComponents):
715 Adopt StringBuilder::flexibleAppend, using to combine the append of '/' and component.
717 * wtf/text/StringBuilder.cpp:
718 (WTF::StringBuilder::appendUninitialized):
719 (WTF::StringBuilder::appendUninitializedWithoutOverflowCheck):
720 Extract the part of appendUnitialized that doesn't do the overflow check
721 into it's own member function to allow callers that have already done the
722 overflow check to bypass it.
724 (WTF::StringBuilder::appendUninitializedWithoutOverflowCheckForUChar):
725 (WTF::StringBuilder::appendUninitializedWithoutOverflowCheckForLChar):
726 Added to allow template member function flexibleAppendFromAdapters to call
727 appendUninitializedWithoutOverflowCheck without moving it to the header.
729 * wtf/text/StringBuilder.h:
730 (WTF::StringBuilder::flexibleAppendFromAdapters):
731 (WTF::StringBuilder::flexibleAppend):
732 Modeled on tryMakeStringFromAdapters in StringConcatenate.h, these
733 eagerly compute the required length, expand the buffer and then use
734 the existing string type adaptor accumulation functions used by makeString.
736 * wtf/text/StringConcatenate.h:
737 (WTF::stringTypeAdapterAccumulator):
738 (WTF::tryMakeStringFromAdapters):
739 (WTF::makeStringAccumulator): Deleted.
740 Renames makeStringAccumulator to stringTypeAdapterAccumulator now that it is used
741 by more than just makeString.
743 2019-07-09 Alex Christensen <achristensen@webkit.org>
745 When parsing an IPv4 address, wait until after deciding it is indeed an IPv4 address before reporting syntax violations
746 https://bugs.webkit.org/show_bug.cgi?id=199628
748 Reviewed by Brady Eidson.
750 Otherwise, we sometimes report syntax violations on things that are not IPv4 addresses and don't have syntax violations.
751 I added a unit test with one such URL that used to cause an assertion.
754 (WTF::URLParser::parseIPv4Host):
756 2019-07-09 Alex Christensen <achristensen@webkit.org>
758 Remove invalid assertion in URLParser::domainToASCII
759 https://bugs.webkit.org/show_bug.cgi?id=199624
761 Reviewed by Brady Eidson.
763 When a non-ASCII domain's punycode encoding is longer than 63 characters,
764 the URL is supposed to fail to parse, according to https://www.unicode.org/reports/tr46/#ToASCII
765 We and all other browsers do this. When uidna_nameToASCII tries to punycode encode such a domain,
766 it can return a number larger than 63. In this case, processingDetails.errors is UIDNA_ERROR_LABEL_TOO_LONG
767 and we fail to parse as desired and uidna_nameToASCII did not write out of bounds, so it was just the assertion
768 that was wrong. I added some unit tests that would have hit the assertion and verify that we fail at the correct length.
771 (WTF::URLParser::domainToASCII):
773 2019-07-09 Alex Christensen <achristensen@webkit.org>
775 URLParser should reserialize IPv6 addresses that end with a colon
776 https://bugs.webkit.org/show_bug.cgi?id=199627
778 Reviewed by Brady Eidson.
780 When an IPv6 address ends in a colon, the colon should be removed which means the
781 serialized output is different than the input, which the URLParser calls a syntax violation.
782 This matches the URL specification, and I added a unit test that used to assert.
785 (WTF::URLParser::parseIPv6Host):
787 2019-07-08 Chris Dumez <cdumez@apple.com>
789 Use WeakHashSet for WebUserContentControllerProxy::m_processes
790 https://bugs.webkit.org/show_bug.cgi?id=199591
791 <rdar://problem/52798721>
793 Reviewed by Youenn Fablet.
795 Update WeakHashSet::add() to return an AddResult type, similarly to our other containers.
798 (WTF::WeakHashSet::add):
800 2019-07-08 Christopher Reid <chris.reid@sony.com>
802 Implement MappedFileData for Windows
803 https://bugs.webkit.org/show_bug.cgi?id=198269
805 Reviewed by Darin Adler.
807 Original patch by Fujii Hironori.
809 Add Windows implementations for MappedFileData constructor and destructor.
811 * wtf/FileSystem.cpp:
813 * wtf/win/FileSystemWin.cpp:
815 2019-07-08 Chris Dumez <cdumez@apple.com>
817 Add threading assertion to WTF::CompletionHandler
818 https://bugs.webkit.org/show_bug.cgi?id=199516
820 Reviewed by Alex Christensen.
822 Add threading assertion to WTF::CompletionHandler to try and catch common cases
823 of unsafe usage (completion handler constructed on one thread but called on
826 * wtf/CompletionHandler.h:
827 (WTF::CompletionHandler<Out):
829 2019-07-08 Antoine Quint <graouts@apple.com>
831 [Pointer Events] Enable only on the most recent version of the supported iOS family
832 https://bugs.webkit.org/show_bug.cgi?id=199562
833 <rdar://problem/52766511>
835 Reviewed by Dean Jackson.
837 We really don't need HAVE_UI_WEB_TOUCH_EVENTS_GESTURE_RECOGNIZER_WITH_ACTIVE_TOUCHES_BY_ID since the UIKit SPI
838 that was added in iOS 13 that it's checking for is really required for all parts of the implementation of Pointer
839 Events, including dispatch of the "pointercancel" event and support for the "touch-action" CSS property.
843 2019-07-05 Ryan Haddad <ryanhaddad@apple.com>
845 Unreviewed, rolling out r247115.
847 Breaks lldbWebKitTester (and by extension, test-webkitpy)
851 "[WHLSL] Standard library is too big to directly include in
853 https://bugs.webkit.org/show_bug.cgi?id=198186
854 https://trac.webkit.org/changeset/247115
856 2019-07-03 Jonathan Bedard <jbedard@apple.com>
858 [Catalina] Enable WebKit build
859 https://bugs.webkit.org/show_bug.cgi?id=199209
861 Reviewed by Darin Adler.
863 * wtf/spi/cocoa/SecuritySPI.h: Declare SecTrustedApplicationCreateFromPath(...).
865 2019-07-03 Keith Miller <keith_miller@apple.com>
867 PACCage should first cage leaving PAC bits intact then authenticate
868 https://bugs.webkit.org/show_bug.cgi?id=199372
870 Reviewed by Saam Barati.
873 (WTF::CagedPtr::get const):
874 (WTF::CagedPtr::getMayBeNull const):
875 (WTF::CagedPtr::mergePointers):
877 2019-07-03 Ryan Haddad <ryanhaddad@apple.com>
879 Unreviewed, rolling out r246616.
881 Caused http/tests/inspector/network/har/har-page.html to fail
886 "Web Inspector: Network: replace CFNetwork SPI with new API
888 https://bugs.webkit.org/show_bug.cgi?id=198762
889 https://trac.webkit.org/changeset/246616
891 2019-07-02 Commit Queue <commit-queue@webkit.org>
893 Unreviewed, rolling out r247041.
894 https://bugs.webkit.org/show_bug.cgi?id=199425
896 broke some iOS arm64e tests (Requested by keith_miller on
901 "PACCage should first cage leaving PAC bits intact then
903 https://bugs.webkit.org/show_bug.cgi?id=199372
904 https://trac.webkit.org/changeset/247041
906 2019-07-02 Chris Dumez <cdumez@apple.com>
908 ThreadSafeRefCounted<DestructionThread::Main> is not safe to use in the UIProcess
909 https://bugs.webkit.org/show_bug.cgi?id=199420
910 <rdar://problem/52289717>
912 Reviewed by Ryosuke Niwa.
914 * wtf/MainThread.cpp:
915 (WTF::isMainRunLoop):
916 (WTF::callOnMainRunLoop):
918 Add some function to MainThread.h to be used by ThreadSafeRefCounted to interact with the
919 main RunLoop. This is used to avoid a circular dependency between RunLoop (which is
920 ThreadSafeRefCounted) and ThreadSafeReCounted.
922 * wtf/ThreadSafeRefCounted.h:
923 (WTF::ThreadSafeRefCounted::deref const):
924 Add a new DestructionThread::MainRunLoop enum value to be used by classes that need to
925 be destroyed on the main RunLoop rather than the main thread (which may be different
928 2019-07-02 Robin Morisset <rmorisset@apple.com>
930 [WHLSL] the initializer in VariableDeclaration should be a std::unique_ptr, not Optional<UniqueRef<..>>
931 https://bugs.webkit.org/show_bug.cgi?id=199389
933 Reviewed by Sam Weinig.
936 (WTF::UniqueRef::moveToUniquePtr): Added.
938 2019-07-02 Keith Miller <keith_miller@apple.com>
940 PACCage should first cage leaving PAC bits intact then authenticate
941 https://bugs.webkit.org/show_bug.cgi?id=199372
943 Reviewed by Saam Barati.
946 (WTF::CagedPtr::get const):
947 (WTF::CagedPtr::getMayBeNull const):
948 (WTF::CagedPtr::mergePointers):
950 2019-07-01 Philippe Normand <pnormand@igalia.com>
952 [GStreamer] Cannot play Bert's Bytes radio stream from http://radio.dos.nl/
953 https://bugs.webkit.org/show_bug.cgi?id=198376
955 Reviewed by Xabier Rodriguez-Calvar.
957 * wtf/glib/GLibUtilities.h:
958 (enumToString): Utility function to get a string representation of of a GLib enum.
960 2019-06-22 Darin Adler <darin@apple.com>
962 Streamline some string code, focusing on functions that were using substringSharingImpl
963 https://bugs.webkit.org/show_bug.cgi?id=198898
965 Reviewed by Daniel Bates.
967 * wtf/URLHelpers.cpp:
968 (WTF::URLHelpers::applyHostNameFunctionToURLString): Change code using
969 substringSharingImpl so it could call String::find to call StringView::contains
970 instead. Also rewrote lambdas to be simpler and likely more efficient.
971 Rewrote another case using substringSharingImpl so it could call String::find
972 to call StringView::find instead.
974 * wtf/text/StringView.cpp:
975 (WTF::StringView::startsWith const): Added.
977 * wtf/text/StringView.h: Tweaked style a bit, and added an overload of
978 StringView::contains that takes a CodeUnitMatchFunction and an overload
979 of startsWith that cakes a UChar.
981 2019-06-28 Konstantin Tokarev <annulen@yandex.ru>
983 Remove traces of ENABLE_ICONDATABASE remaining after its removal in 219733
984 https://bugs.webkit.org/show_bug.cgi?id=199317
986 Reviewed by Michael Catanzaro.
988 While IconDatabase and all code using it was removed,
989 ENABLE_ICONDATABASE still exists as build option and C++ macro.
991 * wtf/FeatureDefines.h:
993 2019-06-27 Konstantin Tokarev <annulen@yandex.ru>
995 Avoid using WTF::Function for passing local function pointers and closures in URLHelpers.cpp
996 https://bugs.webkit.org/show_bug.cgi?id=199271
998 Reviewed by Yusuke Suzuki.
1000 WTF::Function allocates memory on heap, which is totally redundant in this
1003 * wtf/URLHelpers.cpp:
1004 (WTF::URLHelpers::isSecondLevelDomainNameAllowedByTLDRules):
1006 2019-06-27 Timothy Hatcher <timothy@apple.com>
1008 Move WebKitLegacy off of a couple AppKit ivars.
1009 https://bugs.webkit.org/show_bug.cgi?id=199279
1010 rdar://problem/34983438
1012 Reviewed by Tim Horton.
1014 * wtf/Platform.h: Added HAVE_SUBVIEWS_IVAR_SPI.
1016 2019-06-27 Beth Dakin <bdakin@apple.com>
1018 Upstream use of MACCATALYST
1019 https://bugs.webkit.org/show_bug.cgi?id=199245
1020 rdar://problem/51687723
1022 Reviewed by Tim Horton.
1024 * Configurations/SDKVariant.xcconfig:
1025 * wtf/FeatureDefines.h:
1028 2019-06-27 Don Olmstead <don.olmstead@sony.com>
1030 [FTW] Build JavaScriptCore
1031 https://bugs.webkit.org/show_bug.cgi?id=199254
1033 Reviewed by Brent Fulgham.
1035 * wtf/PlatformFTW.cmake: Added.
1037 2019-06-27 Fujii Hironori <Hironori.Fujii@sony.com>
1039 [CMake] Bump cmake_minimum_required version to 3.10
1040 https://bugs.webkit.org/show_bug.cgi?id=199181
1042 Reviewed by Don Olmstead.
1046 2019-06-26 Konstantin Tokarev <annulen@yandex.ru>
1048 Remove unneeded #include <wtf/glib/GRefPtr.h>
1049 https://bugs.webkit.org/show_bug.cgi?id=199228
1051 Reviewed by Michael Catanzaro.
1053 * wtf/MemoryPressureHandler.h:
1055 2019-06-26 Myles C. Maxfield <mmaxfield@apple.com>
1057 REGRESSION: ( r246394 ) webgpu/whlsl-buffer-fragment.html and webgpu/whlsl-buffer-vertex.html are failing
1058 https://bugs.webkit.org/show_bug.cgi?id=199012
1060 Reviewed by Saam Barati.
1064 2019-06-25 Keith Miller <keith_miller@apple.com>
1066 CagedPtr doesn't merge PAC bits back into the resulting caged pointer.
1067 https://bugs.webkit.org/show_bug.cgi?id=199214
1069 Reviewed by Yusuke Suzuki.
1071 The current code means that caging will just strip the any failed
1072 authentication bits. Adding this code doesn't appear to be a
1073 regression on iPhone Xs.
1076 (WTF::CagedPtr::get const):
1077 (WTF::CagedPtr::getMayBeNull const):
1078 (WTF::CagedPtr::getUnsafe const):
1079 (WTF::CagedPtr::mergePointers):
1081 2019-06-25 Sam Weinig <weinig@apple.com>
1083 Experiment with simple structured bindings use
1084 https://bugs.webkit.org/show_bug.cgi?id=198905
1086 Reviewed by Darin Adler.
1088 * wtf/URLHelpers.cpp:
1089 (WTF::URLHelpers::mapHostNames):
1090 Simplify code using c++ structured bindings (https://en.cppreference.com/w/cpp/language/structured_binding)
1091 to see if all the platforms will work with it.
1093 2019-06-25 Adam Barth <abarth@webkit.org>
1095 [fuchsia] Update to newer zx_clock_get syscall
1096 https://bugs.webkit.org/show_bug.cgi?id=199191
1098 Reviewed by Sam Weinig.
1100 Fuchsia has changed the zx_clock_get syscall to return the clock value
1101 via an out parameter rather than via its return value. This change
1102 makes zx_clock_get consistent with all the other syscalls.
1104 This patch updates our use of zx_clock_get to use the new syscall. The
1105 old syscall is no longer supported by Fuchsia.
1107 * wtf/fuchsia/CPUTimeFuchsia.cpp:
1108 (WTF::CPUTime::get): Switch to using the out parameter.
1109 (WTF::CPUTime::forCurrentThread): Switch to using the out parameter.
1111 2019-06-25 Michael Catanzaro <mcatanzaro@igalia.com>
1113 Fully rename WebKitGTK+ -> WebKitGTK everywhere
1114 https://bugs.webkit.org/show_bug.cgi?id=199159
1116 Reviewed by Carlos Garcia Campos.
1118 * wtf/URLParser.cpp:
1119 (WTF::URLParser::internationalDomainNameTranscoder):
1121 2019-06-25 Michael Catanzaro <mcatanzaro@igalia.com>
1124 https://bugs.webkit.org/show_bug.cgi?id=198914
1126 Reviewed by Darin Adler.
1128 Remove now-stale GCC version check.
1132 2019-06-23 Simon Fraser <simon.fraser@apple.com>
1134 Add OverflowScrollProxyNodes to the scrolling tree
1135 https://bugs.webkit.org/show_bug.cgi?id=199132
1137 Reviewed by Antti Koivisto.
1139 Setting indent is useful if you want to make a new stream with the indent of an
1142 * wtf/text/TextStream.h:
1143 (WTF::TextStream::setIndent):
1145 2019-06-20 Fujii Hironori <Hironori.Fujii@sony.com>
1147 Try to use C++14 std::enable_if_t in CheckedArithmetic.h again
1148 https://bugs.webkit.org/show_bug.cgi?id=199099
1150 Reviewed by Ross Kirsling.
1152 r242235 changed CheckedArithmetic to not use C++14. Let's try
1155 * wtf/CheckedArithmetic.h: Use C++14 std::make_unsigned_t and std::enable_if_t.
1157 2019-06-18 Darin Adler <darin@apple.com>
1159 Tidy up the remaining bits of the AtomicString to AtomString rename
1160 https://bugs.webkit.org/show_bug.cgi?id=198990
1162 Reviewed by Michael Catanzaro.
1164 * wtf/text/AtomString.cpp: Fix a comment.
1165 * wtf/text/AtomString.h: Tweak formatting a bit. Use nullptr instead of 0.
1166 Removed "using AtomicString = AtomString".
1167 * wtf/text/AtomStringImpl.cpp:
1168 (WTF::CStringTranslator::translate): Use setIsAtom instead of setIsAtomic.
1169 (WTF::UCharBufferTranslator::translate): Ditto.
1170 (WTF::HashAndUTF8CharactersTranslator::translate): Ditto.
1171 (WTF::SubstringTranslator::translate): Ditto.
1172 (WTF::LCharBufferTranslator::translate): Ditto.
1173 (WTF::BufferFromStaticDataTranslator::translate): Ditto.
1174 (WTF::AtomStringImpl::addSlowCase): Ditto.
1175 (WTF::AtomStringImpl::lookUpSlowCase): Updated assertion message.
1177 * wtf/text/AtomStringImpl.h: Tweaked the implementation of add.
1178 Updated comments to say AtomString.
1180 * wtf/text/AtomStringTable.cpp:
1181 (WTF::AtomStringTable::~AtomStringTable): Use setIsAtom.
1183 * wtf/text/StringImpl.h: Updated name of StringAtomic and
1184 s_hashFlagStringKindIsAtom. Renamed to flagIsAtom and setIsAtom.
1186 * wtf/text/WTFString.cpp:
1187 (WTF::String::isSafeToSendToAnotherThread const): Updated comment.
1189 2019-06-20 Carlos Garcia Campos <cgarcia@igalia.com>
1191 [GTK] Remove support for GTK2 plugins
1192 https://bugs.webkit.org/show_bug.cgi?id=199065
1194 Reviewed by Sergio Villar Senin.
1197 * wtf/glib/GTypedefs.h:
1199 2019-06-19 Yusuke Suzuki <ysuzuki@apple.com>
1201 [bmalloc] IsoHeap's initialization is racy with IsoHeap::isInitialized
1202 https://bugs.webkit.org/show_bug.cgi?id=199053
1204 Reviewed by Saam Barati.
1206 Add constexpr static functions to generate pseudo random numbers from __LINE__.
1209 (WTF::WeakRandom::nextState):
1210 (WTF::WeakRandom::generate):
1211 (WTF::WeakRandom::advance):
1213 2019-06-19 Fujii Hironori <Hironori.Fujii@sony.com>
1215 Add WTF::crossThreadCopy(T&&) to utilize String::isolatedCopy() &&
1216 https://bugs.webkit.org/show_bug.cgi?id=198957
1218 Reviewed by Alex Christensen.
1220 &&-qualified String::isolatedCopy() has a optimization path which
1221 does just WTFMove if it isSafeToSendToAnotherThread which means
1222 the object hasOneRef.
1224 However, WTF::crossThreadCopy was using only &-qualified
1225 isolatedCopy. To use the optimization, added
1226 WTF::crossThreadCopy(T&&) overloading.
1228 * wtf/CrossThreadCopier.h:
1229 (WTF::crossThreadCopy): Added a overload of (T&&).
1230 * wtf/CrossThreadTask.h:
1231 (WTF::createCrossThreadTask): Removed explicit template arguments of crossThreadCopy.
1233 2019-06-19 Devin Rousso <drousso@apple.com>
1235 Web Inspector: Network: replace CFNetwork SPI with new API where able
1236 https://bugs.webkit.org/show_bug.cgi?id=198762
1238 Reviewed by Timothy Hatcher.
1242 2019-06-19 Alex Christensen <achristensen@webkit.org>
1244 Add a unit test for client certificate authentication
1245 https://bugs.webkit.org/show_bug.cgi?id=197800
1247 Reviewed by Youenn Fablet.
1249 * wtf/spi/cocoa/SecuritySPI.h:
1250 Move declarations from ArgumentCodersCF.cpp so they can be shared.
1252 2019-06-19 Adrian Perez de Castro <aperez@igalia.com>
1254 [WPE][GTK] Fix build with unified sources disabled
1255 https://bugs.webkit.org/show_bug.cgi?id=198752
1257 Reviewed by Michael Catanzaro.
1259 * wtf/text/StringBuilder.h: Add missing include of StringConcatenateNumbers.h
1261 2019-06-19 Zan Dobersek <zdobersek@igalia.com>
1263 USE_ANGLE macro can be evaluated without being defined
1264 https://bugs.webkit.org/show_bug.cgi?id=198991
1266 Reviewed by Carlos Garcia Campos.
1268 * wtf/Platform.h: On platforms not yet defining USE_ANGLE, the
1269 incompatibility check with some other flags leads to the macro being
1270 evaluated even when it was not defined, producing compiler warnings.
1271 To avoid this, the macro should be defined to 0 before the check in
1272 case it was not defined already.
1274 2019-06-18 Dean Jackson <dino@apple.com>
1276 UIContextMenuInteraction implementation for WKContentView
1277 https://bugs.webkit.org/show_bug.cgi?id=198986
1278 <rdar://problem/51875189>
1280 Reviewed by Andy Estes.
1282 Add USE_UICONTEXTMENU for iOS 13+.
1286 2019-06-18 Kenneth Russell <kbr@chromium.org>
1288 Add preliminary ANGLE backend to WebCore
1289 https://bugs.webkit.org/show_bug.cgi?id=197755
1291 Reviewed by Dean Jackson.
1293 Add a USE_ANGLE definition to wtf/Platform.h (currently disabled)
1294 which, when enabled, uses ANGLE instead of the OpenGL or OpenGL ES
1299 2019-06-17 Jiewen Tan <jiewen_tan@apple.com>
1301 Move SOAuthorization from WebKitAdditions to WebKit
1302 https://bugs.webkit.org/show_bug.cgi?id=198874
1303 <rdar://problem/47573431>
1305 Reviewed by Brent Fulgham.
1308 Adds a feature flag to detect AppSSO framework.
1310 2019-06-17 Ryan Haddad <ryanhaddad@apple.com>
1312 Unreviewed, rolling out r246501.
1314 Breaks Apple internal builds.
1318 "Support using ANGLE as the backend for the WebGL
1320 https://bugs.webkit.org/show_bug.cgi?id=197755
1321 https://trac.webkit.org/changeset/246501
1323 2019-06-17 Kenneth Russell <kbr@chromium.org>
1325 Support using ANGLE as the backend for the WebGL implementation
1326 https://bugs.webkit.org/show_bug.cgi?id=197755
1328 Reviewed by Dean Jackson.
1330 Add a USE_ANGLE definition to wtf/Platform.h (currently disabled)
1331 which, when enabled, uses ANGLE instead of the OpenGL or OpenGL ES
1336 2019-06-16 Darin Adler <darin@apple.com>
1338 Rename AtomicString to AtomString
1339 https://bugs.webkit.org/show_bug.cgi?id=195276
1341 Reviewed by Michael Catanzaro.
1343 * many files: Let do-webcore-rename do the renaming.
1345 * wtf/text/AtomString.h: After renaming, added AtomicString as a synonym for
1346 now; helps smooth things over with a tiny bit of Apple internal software so
1347 we don't have to do this all at once. Can remove it soon.
1349 2019-06-16 Eric Carlson <eric.carlson@apple.com>
1351 [MediaStream] Avoid roundoff error when setting AVCapture min/max frame rate
1352 https://bugs.webkit.org/show_bug.cgi?id=198875
1353 <rdar://problem/51768374>
1355 Reviewed by Youenn Fablet.
1358 (WTF::LogArgument<MediaTime>::toString):
1359 (WTF::LogArgument<MediaTimeRange>::toString):
1361 2019-06-12 Antoine Quint <graouts@apple.com>
1363 Show the web page URL when sharing an AR model
1364 https://bugs.webkit.org/show_bug.cgi?id=198812
1365 <rdar://problem/48689498>
1367 Reviewed by Dean Jackson.
1371 2019-06-12 Youenn Fablet <youenn@apple.com>
1373 Use NSURLSession for WebSocket
1374 https://bugs.webkit.org/show_bug.cgi?id=198568
1376 Reviewed by Geoffrey Garen.
1379 Introduce compile flag for WebSocket NSURLSession
1381 2019-06-12 Commit Queue <commit-queue@webkit.org>
1383 Unreviewed, rolling out r246322.
1384 https://bugs.webkit.org/show_bug.cgi?id=198796
1386 "It's a huge page load regression on iOS" (Requested by
1387 saamyjoon on #webkit).
1392 https://bugs.webkit.org/show_bug.cgi?id=198726
1393 https://trac.webkit.org/changeset/246322
1395 2019-06-10 Simon Fraser <simon.fraser@apple.com>
1397 Add logging for UI-side compositing hit-testing
1398 https://bugs.webkit.org/show_bug.cgi?id=198739
1400 Reviewed by Antti Koivisto.
1402 Make it possible to output an Objective-C object to TextStream, which will
1403 log its -description.
1405 Also add a template for OptionSet<> printing.
1407 * WTF.xcodeproj/project.pbxproj:
1408 * wtf/text/TextStream.h:
1410 * wtf/text/cocoa/TextStreamCocoa.mm: Added.
1411 (WTF::TextStream::operator<<):
1413 2019-06-11 Saam Barati <sbarati@apple.com>
1416 https://bugs.webkit.org/show_bug.cgi?id=198726
1418 Reviewed by Keith Miller.
1420 * WTF.xcodeproj/project.pbxproj:
1421 * wtf/CMakeLists.txt:
1423 (WTF::CagedPtr::CagedPtr):
1424 (WTF::CagedPtr::get const):
1425 (WTF::CagedPtr::getMayBeNull const):
1426 (WTF::CagedPtr::operator=):
1427 (WTF::CagedPtr::operator== const):
1428 (WTF::CagedPtr::operator!= const):
1429 (WTF::CagedPtr::operator bool const):
1430 (WTF::CagedPtr::operator* const):
1431 (WTF::CagedPtr::operator-> const):
1432 (WTF::CagedPtr::operator[] const):
1433 (WTF::CagedPtr::getUnsafe const): Deleted.
1434 (WTF::CagedPtr::at const): Deleted.
1435 (WTF::CagedPtr::recage): Deleted.
1436 * wtf/CagedUniquePtr.h:
1437 (WTF::CagedUniquePtr::CagedUniquePtr):
1438 (WTF::CagedUniquePtr::create):
1439 (WTF::CagedUniquePtr::operator=):
1440 (WTF::CagedUniquePtr::~CagedUniquePtr):
1441 (WTF::CagedUniquePtr::destroy):
1444 (Gigacage::cagedMayBeNull): Deleted.
1446 (WTF::tagArrayPtr): Deleted.
1447 (WTF::untagArrayPtr): Deleted.
1448 (WTF::removeArrayPtrTag): Deleted.
1449 (WTF::retagArrayPtr): Deleted.
1450 * wtf/TaggedArrayStoragePtr.h:
1451 (WTF::TaggedArrayStoragePtr::TaggedArrayStoragePtr): Deleted.
1452 (WTF::TaggedArrayStoragePtr::get const): Deleted.
1453 (WTF::TaggedArrayStoragePtr::getUnsafe const): Deleted.
1454 (WTF::TaggedArrayStoragePtr::resize): Deleted.
1455 (WTF::TaggedArrayStoragePtr::operator bool const): Deleted.
1457 2019-06-10 Andy Estes <aestes@apple.com>
1459 [iOS] Use PDFKit SPI for taking snapshots when the hosting app is not entitled for global capture
1460 https://bugs.webkit.org/show_bug.cgi?id=198731
1461 <rdar://problem/46215174>
1463 Reviewed by Tim Horton.
1465 * wtf/FeatureDefines.h:
1467 2019-06-10 Sam Weinig <weinig@apple.com>
1469 Remove Dashboard support
1470 https://bugs.webkit.org/show_bug.cgi?id=198615
1472 Reviewed by Ryosuke Niwa.
1474 * wtf/FeatureDefines.h:
1476 2019-06-10 Timothy Hatcher <timothy@apple.com>
1478 Integrate dark mode support for iOS.
1479 https://bugs.webkit.org/show_bug.cgi?id=198687
1480 rdar://problem/51545643
1482 Reviewed by Tim Horton.
1486 2019-06-08 Andy Estes <aestes@apple.com>
1488 [Apple Pay] If we have a bound interface identifier, set it on new PKPaymentRequests
1489 https://bugs.webkit.org/show_bug.cgi?id=198690
1490 <rdar://problem/48041803>
1492 Reviewed by Tim Horton.
1494 * wtf/FeatureDefines.h: Defined HAVE_PASSKIT_BOUND_INTERFACE_IDENTIFIER, and cleaned up some
1495 other PassKit HAVEs.
1497 2019-06-06 Caio Lima <ticaiolima@gmail.com>
1499 [JSCOnly] JSCOnly port is not building on macOS
1500 https://bugs.webkit.org/show_bug.cgi?id=198563
1502 Reviewed by Don Olmstead.
1504 We are adding `<mach/vm_types.h>` to fix build issues when compiling
1505 JSCOnly port on macOS.
1507 * wtf/WTFAssertions.cpp:
1509 2019-06-03 Commit Queue <commit-queue@webkit.org>
1511 Unreviewed, rolling out r246022.
1512 https://bugs.webkit.org/show_bug.cgi?id=198486
1514 Causing Internal build failures and JSC test failures
1515 (Requested by ShawnRoberts on #webkit).
1519 "Reenable Gigacage on ARM64."
1520 https://bugs.webkit.org/show_bug.cgi?id=198453
1521 https://trac.webkit.org/changeset/246022
1523 2019-06-03 Darin Adler <darin@apple.com>
1525 Finish cleanup of String::number for floating point
1526 https://bugs.webkit.org/show_bug.cgi?id=198471
1528 Reviewed by Yusuke Suzuki.
1530 * wtf/JSONValues.cpp:
1531 (WTF::JSONImpl::Value::writeJSON const): Use appendNumber instead of
1532 appendECMAScriptNumber, since that's now the default.
1534 * wtf/text/StringBuilder.cpp:
1535 (WTF::StringBuilder::appendNumber): Renamed from appendShortestFormNumber.
1536 * wtf/text/StringBuilder.h: Removed appendShortestFormNumber and
1537 appendECMAScriptNumber, replacing both with overload of appendNumber.
1539 * wtf/text/WTFString.cpp:
1540 (WTF::String::number): Renamed from numberToStringShortest.
1541 * wtf/text/WTFString.h: Removed numberToStringShortest and
1542 numberToStringECMAScript, replacing both with overload of number.
1544 2019-06-02 Keith Miller <keith_miller@apple.com>
1546 Reenable Gigacage on ARM64.
1547 https://bugs.webkit.org/show_bug.cgi?id=198453
1549 Reviewed by Filip Pizlo.
1552 (WTF::CagedPtr::authenticatingLoad):
1553 (WTF::CagedPtr::get const):
1554 (WTF::CagedPtr::getMayBeNull const):
1556 2019-05-31 Alex Christensen <achristensen@webkit.org>
1558 URLParser::parseIPv6Host should properly parse 0's around compression
1559 https://bugs.webkit.org/show_bug.cgi?id=198424
1561 Reviewed by Tim Horton.
1563 * wtf/URLParser.cpp:
1564 (WTF::URLParser::parseIPv6Host):
1566 2019-05-31 Alex Christensen <achristensen@webkit.org>
1568 URLParser::parseHostAndPort should not allow non-port characters after an ipv6 host
1569 https://bugs.webkit.org/show_bug.cgi?id=198428
1570 <rdar://problem/51209196>
1572 Reviewed by Tim Horton.
1574 This matches Chrome and Firefox.
1576 * wtf/URLParser.cpp:
1577 (WTF::URLParser::parseHostAndPort):
1579 2019-05-31 Tim Horton <timothy_horton@apple.com>
1581 Optionally respect device management restrictions when loading from the network
1582 https://bugs.webkit.org/show_bug.cgi?id=198318
1583 <rdar://problem/44263806>
1585 Reviewed by Alex Christensen.
1588 Add a HAVE flag for DeviceManagement.framework.
1589 It does exist in the simulator, but does not function; pretend it doesn't exist.
1591 2019-05-31 Geoffrey Garen <ggaren@apple.com>
1593 Some WeakPtr cleanup
1594 https://bugs.webkit.org/show_bug.cgi?id=198390
1596 Reviewed by Chris Dumez.
1598 * wtf/WeakHashSet.h:
1599 (WTF::HashTraits<Ref<WeakPtrImpl>>::isReleasedWeakValue):
1600 (WTF::WeakHashSet::WeakHashSetConstIterator::WeakHashSetConstIterator):
1601 Updated for rename to WeakPtrImpl.
1603 (WTF::WeakHashSet::WeakHashSetConstIterator::get const): Updated for new
1604 get() interface. Also, switched to iterator operator* to help clarify
1605 the double dereference here.
1607 (WTF::WeakHashSet::add):
1608 (WTF::WeakHashSet::remove):
1609 (WTF::WeakHashSet::contains const):
1610 (WTF::WeakHashSet::computeSize const):
1611 (WTF::HashTraits<Ref<WeakReference>>::isReleasedWeakValue): Deleted.
1612 Updated for rename to WeakPtrImpl.
1615 (WTF::WeakPtrImpl::create):
1616 (WTF::WeakPtrImpl::~WeakPtrImpl): Renamed WeakReference to WeakPtrImpl.
1617 Now we don't need a comment explaining that this class is the backing
1618 implementation of WeakPtr.
1620 (WTF::WeakPtrImpl::get): Return the pointer type we stored, rather than
1621 the pointer type requested by our client. It's a little too surprising
1622 for a field to store one pointer type and load another.
1624 (WTF::WeakPtrImpl::WeakPtrImpl): Fixed a theoretical type safety bug.
1625 Make sure to store T::WeakValueType* instead of T*, since they might
1626 not be the same pointer value. (In practice, T and T::WeakValueType*
1627 are always the same type in this constructor because WeakPtrFactory
1628 makes them so, but it's best not to depend on implementation details
1631 (WTF::WeakPtr::get const): Updated for new get() interface.
1633 (WTF::WeakPtr::operator bool const):
1634 (WTF::WeakPtr::operator=):
1635 (WTF::WeakPtr::clear):
1636 (WTF::WeakPtr::WeakPtr): Updated for WeakPtrImpl rename.
1638 (WTF::WeakPtrFactory::~WeakPtrFactory): Updated for WeakPtrImpl rename.
1640 (WTF::WeakPtrFactory::createWeakPtr const): ASSERT that the passed-in
1641 pointer is equal to the stored pointer. As a space optimization, we
1642 require our client to remind us what we point to each time a weak
1643 pointer is created -- but nothing guarantees that our client will do
1646 (WTF::WeakPtrFactory::revokeAll): Updated for WeakPtrImpl rename.
1648 (WTF::CanMakeWeakPtr::weakPtrFactory const):
1649 (WTF::CanMakeWeakPtr::weakPtrFactory): Use idiomatic accessor naming.
1651 (WTF::weak_ptr_impl_cast): Fixed a theoretical type safety bug.
1652 Previously, if Base and Derived both inherited CanMakeWeakPtr, and
1653 you casted WeakPtr<Base> to WeakPtr<Derived> (or vice versa), and
1654 casting Base <-> Derived required pointer fixup, the previous
1655 compile-time check would accept the cast, even though the stored pointer
1658 (WTF::WeakPtr<T>::WeakPtr):
1661 (WTF::WeakReference::create): Deleted.
1662 (WTF::WeakReference::~WeakReference): Deleted.
1663 (WTF::WeakReference::get const): Deleted.
1664 (WTF::WeakReference::operator bool const): Deleted.
1665 (WTF::WeakReference::clear): Deleted.
1666 (WTF::WeakReference::WeakReference): Deleted.
1667 (WTF::weak_reference_cast): Deleted. Updated for rename to WeakPtrImpl.
1669 Don't export WeakPtrImpl because it's an implmenetation detail and
1670 it shouldn't be easy to use outside WTF.
1672 2019-05-31 Don Olmstead <don.olmstead@sony.com>
1674 [CMake] Add WebKit::WTF target
1675 https://bugs.webkit.org/show_bug.cgi?id=198400
1677 Reviewed by Konstantin Tokarev.
1679 Create the WebKit::WTF target and use that to propagate headers. Use
1680 WEBKIT_COPY_FILES instead of WEBKIT_MAKE_FORWARDING_HEADERS.
1682 * wtf/CMakeLists.txt:
1684 2019-05-30 Saam Barati <sbarati@apple.com>
1686 [WHLSL] Enforce variable lifetimes
1687 https://bugs.webkit.org/show_bug.cgi?id=195794
1688 <rdar://problem/50746293>
1690 Reviewed by Myles C. Maxfield.
1692 * wtf/PrintStream.h:
1694 2019-05-30 Keith Rollin <krollin@apple.com>
1696 Fix yet more deprecated uses of -[UIApplication interfaceOrientation]
1697 https://bugs.webkit.org/show_bug.cgi?id=198381
1698 <rdar://problem/51265846>
1700 Reviewed by Wenson Hsieh.
1702 r245267, r245272, and r245874 fixed many instances of this issue; this
1703 change fixes the issue for tvOS.
1705 * wtf/FeatureDefines.h:
1707 2019-05-29 David Kilzer <ddkilzer@apple.com>
1709 Clean up a few #include statements in WTF
1710 <https://webkit.org/b/198351>
1712 Reviewed by Alex Christensen.
1714 * benchmarks/HashSetDFGReplay.cpp:
1715 - Add missing "config.h" include.
1716 * wtf/ParallelJobsGeneric.cpp:
1717 - Replace include of ParallelJobs.h with
1718 ParallelJobsGeneric.h.
1719 * wtf/StackBounds.cpp:
1720 - Fix include ordering of StackBounds.h.
1722 2019-05-29 Keith Rollin <krollin@apple.com>
1724 Followup to r245267 and r245272: fix even more deprecated uses of -[UIApplication interfaceOrientation]
1725 https://bugs.webkit.org/show_bug.cgi?id=198348
1726 <rdar://problem/51234077>
1728 Reviewed by Wenson Hsieh.
1730 r245267 and r245272 fixed many instances of this issue; this change
1731 fixes the issue for watchOS.
1733 * wtf/FeatureDefines.h:
1735 2019-05-29 David Kilzer <ddkilzer@apple.com>
1737 IndexedDatabase Server thread in com.apple.WebKit.Networking process leaks objects into an autoreleasePool that's never cleared
1738 <https://webkit.org/b/198346>
1739 <rdar://problem/50895658>
1741 Reviewed by Brent Fulgham.
1743 * wtf/CrossThreadTaskHandler.cpp:
1744 (WTF::CrossThreadTaskHandler::CrossThreadTaskHandler):
1745 - Add optional second argument to enable use of an
1746 AutodrainedPool when running the runloop.
1747 (WTF::CrossThreadTaskHandler::taskRunLoop):
1748 - Create an AutodrainedPool if requested when
1749 CrossThreadTaskHandler was created.
1750 * wtf/CrossThreadTaskHandler.h:
1751 (WTF::CrossThreadTaskHandler::AutodrainedPoolForRunLoop):
1752 - Add enum class for enabling an AutodrainedPool for
1753 CrossThreadTaskHandler::taskRunLoop().
1754 (WTF::CrossThreadTaskHandler::CrossThreadTaskHandler):
1755 - Add optional second argument to enable use of an
1756 AutodrainedPool when running the runloop.
1758 2019-05-29 Geoffrey Garen <ggaren@apple.com>
1760 WeakPtr breaks vtables when upcasting to base classes
1761 https://bugs.webkit.org/show_bug.cgi?id=188799
1763 Reviewed by Youenn Fablet.
1765 This patch switches from reinterpret_cast to static_cast when loading
1766 from WeakReference storage.
1768 We know which type to cast *to* because it's specified by the type of
1769 the calling WeakPtr.
1771 We know which type to cast *from* because it's specified by a typedef
1774 (Our convention is that we store a pointer to the class that derives
1775 from CanMakeWeakPtr. We cast from that pointer to derived pointers when
1776 we get(). This means that #include of the derived type header is now
1777 required in order to get() the pointer.)
1779 * wtf/WeakHashSet.h:
1780 (WTF::HashTraits<Ref<WeakReference>>::isReleasedWeakValue): Definition
1781 is now eagerly required because WeakReference is not a template anymore.
1783 (WTF::WeakHashSet::WeakHashSetConstIterator::get const):
1784 (WTF::WeakHashSet::WeakHashSetConstIterator::skipEmptyBuckets):
1785 (WTF::WeakHashSet::remove):
1786 (WTF::WeakHashSet::contains const):
1787 (WTF::WeakHashSet::computesEmpty const):
1788 (WTF::WeakHashSet::hasNullReferences const):
1789 (WTF::WeakHashSet::computeSize const):
1790 (WTF::HashTraits<Ref<WeakReference<T>>>::isReleasedWeakValue): Deleted.
1791 Updated for new WeakReference get() API.
1793 * wtf/WeakPtr.h: Use a macro for TestAPI support. We can't use template
1794 specialization because WeakReference is not a class template anymore.
1795 (Or maybe we could have kept it working with a dummy template argument?
1796 Felt weird, so I switched.)
1798 (WTF::WeakReference::create):
1799 (WTF::WeakReference::~WeakReference):
1800 (WTF::WeakReference::get const):
1801 (WTF::WeakReference::operator bool const):
1802 (WTF::WeakReference::WeakReference): WeakReference is just a void* now.
1803 It's the caller's responsibility, when creating and getting, to use
1804 a consistent storage type. We ensure a canonical storage type using a
1805 typedef inside CanMakeWeakPtr.
1807 (WTF::WeakPtr::WeakPtr):
1808 (WTF::WeakPtr::get const):
1809 (WTF::WeakPtr::operator bool const):
1810 (WTF::WeakPtr::operator-> const):
1811 (WTF::WeakPtr::operator* const): Adopted new WeakReference API.
1813 (WTF::WeakPtrFactory::createWeakPtr const): No need for reinterpret_cast.
1815 (WTF::weak_reference_cast): This isn't required for correctness, but it's
1816 nice to show a complier error at WeakPtr construction sites when you know
1817 that the types won't work. Otherwise, you get compiler errors at
1818 dereference sites, which are slightly more mysterious ways of saying that
1819 you constructed your WeakPtr incorrectly.
1821 (WTF::WeakPtr<T>::WeakPtr):
1824 (WTF::weak_reference_upcast): Deleted.
1825 (WTF::weak_reference_downcast): Deleted.
1827 2019-05-29 Ryan Haddad <ryanhaddad@apple.com>
1829 Unreviewed, rolling out r245857.
1831 Breaks internal builds.
1835 "WeakPtr breaks vtables when upcasting to base classes"
1836 https://bugs.webkit.org/show_bug.cgi?id=188799
1837 https://trac.webkit.org/changeset/245857
1839 2019-05-28 Geoffrey Garen <ggaren@apple.com>
1841 WeakPtr breaks vtables when upcasting to base classes
1842 https://bugs.webkit.org/show_bug.cgi?id=188799
1844 Reviewed by Youenn Fablet.
1846 This patch switches from reinterpret_cast to static_cast when loading
1847 from WeakReference storage.
1849 We know which type to cast *to* because it's specified by the type of
1850 the calling WeakPtr.
1852 We know which type to cast *from* because it's specified by a typedef
1855 (Our convention is that we store a pointer to the class that derives
1856 from CanMakeWeakPtr. We cast from that pointer to derived pointers when
1857 we get(). This means that #include of the derived type header is now
1858 required in order to get() the pointer.)
1860 * wtf/WeakHashSet.h:
1861 (WTF::HashTraits<Ref<WeakReference>>::isReleasedWeakValue): Definition
1862 is now eagerly required because WeakReference is not a template anymore.
1864 (WTF::WeakHashSet::WeakHashSetConstIterator::get const):
1865 (WTF::WeakHashSet::WeakHashSetConstIterator::skipEmptyBuckets):
1866 (WTF::WeakHashSet::remove):
1867 (WTF::WeakHashSet::contains const):
1868 (WTF::WeakHashSet::computesEmpty const):
1869 (WTF::WeakHashSet::hasNullReferences const):
1870 (WTF::WeakHashSet::computeSize const):
1871 (WTF::HashTraits<Ref<WeakReference<T>>>::isReleasedWeakValue): Deleted.
1872 Updated for new WeakReference get() API.
1874 * wtf/WeakPtr.h: Use a macro for TestAPI support. We can't use template
1875 specialization because WeakReference is not a class template anymore.
1876 (Or maybe we could have kept it working with a dummy template argument?
1877 Felt weird, so I switched.)
1879 (WTF::WeakReference::create):
1880 (WTF::WeakReference::~WeakReference):
1881 (WTF::WeakReference::get const):
1882 (WTF::WeakReference::operator bool const):
1883 (WTF::WeakReference::WeakReference): WeakReference is just a void* now.
1884 It's the caller's responsibility, when creating and getting, to use
1885 a consistent storage type. We ensure a canonical storage type using a
1886 typedef inside CanMakeWeakPtr.
1888 (WTF::WeakPtr::WeakPtr):
1889 (WTF::WeakPtr::get const):
1890 (WTF::WeakPtr::operator bool const):
1891 (WTF::WeakPtr::operator-> const):
1892 (WTF::WeakPtr::operator* const): Adopted new WeakReference API.
1894 (WTF::WeakPtrFactory::createWeakPtr const): No need for reinterpret_cast.
1896 (WTF::weak_reference_cast): This isn't required for correctness, but it's
1897 nice to show a complier error at WeakPtr construction sites when you know
1898 that the types won't work. Otherwise, you get compiler errors at
1899 dereference sites, which are slightly more mysterious ways of saying that
1900 you constructed your WeakPtr incorrectly.
1902 (WTF::WeakPtr<T>::WeakPtr):
1905 (WTF::weak_reference_upcast): Deleted.
1906 (WTF::weak_reference_downcast): Deleted.
1908 2019-05-27 Chris Dumez <cdumez@apple.com>
1910 Use a strongly-typed identifier for pages
1911 https://bugs.webkit.org/show_bug.cgi?id=198206
1913 Reviewed by Youenn Fablet.
1915 * wtf/ObjectIdentifier.h:
1918 2019-05-23 Don Olmstead <don.olmstead@sony.com>
1920 [CMake] Use target oriented design for bmalloc
1921 https://bugs.webkit.org/show_bug.cgi?id=198046
1923 Reviewed by Konstantin Tokarev.
1925 Use WebKit::bmalloc target.
1927 * wtf/CMakeLists.txt:
1929 2019-05-23 Ross Kirsling <ross.kirsling@sony.com>
1931 [PlayStation] Implement platformUserPreferredLanguages.
1932 https://bugs.webkit.org/show_bug.cgi?id=198149
1934 Reviewed by Fujii Hironori.
1936 * wtf/PlatformPlayStation.cmake:
1937 * wtf/playstation/LanguagePlayStation.cpp: Added.
1938 (WTF::platformUserPreferredLanguages):
1940 2019-05-22 Myles C. Maxfield <mmaxfield@apple.com>
1942 font-optical-sizing applies the wrong variation value
1943 https://bugs.webkit.org/show_bug.cgi?id=197528
1944 <rdar://problem/50152854>
1946 Reviewed by Antti Koivisto.
1950 2019-05-22 Ryan Haddad <ryanhaddad@apple.com>
1952 Unreviewed, rolling out r245598.
1954 Breaks watchOS build.
1958 "font-optical-sizing applies the wrong variation value"
1959 https://bugs.webkit.org/show_bug.cgi?id=197528
1960 https://trac.webkit.org/changeset/245598
1962 2019-05-21 Ross Kirsling <ross.kirsling@sony.com>
1964 [PlayStation] Don't call fcntl.
1965 https://bugs.webkit.org/show_bug.cgi?id=197961
1967 Reviewed by Fujii Hironori.
1969 * wtf/PlatformGTK.cmake:
1970 * wtf/PlatformJSCOnly.cmake:
1971 * wtf/PlatformPlayStation.cmake:
1972 * wtf/PlatformWPE.cmake:
1973 * wtf/UniStdExtras.h:
1974 * wtf/playstation/UniStdExtrasPlayStation.cpp: Added.
1975 (WTF::setCloseOnExec):
1976 (WTF::dupCloseOnExec):
1978 * wtf/unix/UniStdExtrasUnix.cpp: Renamed from Source/WTF/wtf/UniStdExtras.cpp.
1980 Move UniStdExtras to unix/, add a PlayStation version that doesn't use fcntl, add an abstraction for O_NONBLOCK.
1982 2019-05-20 Tadeu Zagallo <tzagallo@apple.com>
1984 Only cache bytecode for API clients in data vaults
1985 https://bugs.webkit.org/show_bug.cgi?id=197898
1987 Reviewed by Keith Miller.
1989 Add SPI to check if a filesystem path is restricted as a data vault.
1991 * WTF.xcodeproj/project.pbxproj:
1992 * wtf/spi/darwin/DataVaultSPI.h: Added.
1994 2019-05-20 Carlos Garcia Campos <cgarcia@igalia.com>
1996 [GLIB] Repeating timer is not stopped when stop is called from the callback
1997 https://bugs.webkit.org/show_bug.cgi?id=197986
1999 Reviewed by Michael Catanzaro.
2001 In case of repeating timers we always update the ready time to fire interval after the user callback is called.
2003 * wtf/glib/RunLoopGLib.cpp:
2004 (WTF::RunLoop::TimerBase::stop): Reset m_fireInterval and m_isRepeating.
2006 2019-05-19 Darin Adler <darin@apple.com>
2008 Change String::number to use "shortest" instead of "fixed precision 6 digits"
2009 https://bugs.webkit.org/show_bug.cgi?id=178319
2011 Reviewed by Sam Weinig.
2013 * wtf/text/StringBuilder.h: Delete appendNumber for floating point and
2014 appendECMAScriptNumber for single-precision.
2016 * wtf/text/WTFString.h: Delete String::number for floating point and
2017 numberToStringECMAScript for single-precision.
2019 2019-05-18 Tadeu Zagallo <tzagallo@apple.com>
2021 Add extra information to dumpJITMemory
2022 https://bugs.webkit.org/show_bug.cgi?id=197998
2024 Reviewed by Saam Barati.
2026 Add a new trace point code for JSC::dumpJITMemory
2028 * wtf/SystemTracing.h:
2030 2019-05-17 Don Olmstead <don.olmstead@sony.com>
2032 [CMake] Use builtin FindICU
2033 https://bugs.webkit.org/show_bug.cgi?id=197934
2035 Reviewed by Michael Catanzaro.
2037 Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES. Use ICU:: targets which end
2038 up propagating to all consumers of WTF.
2040 * wtf/CMakeLists.txt:
2041 * wtf/PlatformPlayStation.cmake:
2043 2019-05-17 Commit Queue <commit-queue@webkit.org>
2045 Unreviewed, rolling out r245418.
2046 https://bugs.webkit.org/show_bug.cgi?id=197989
2048 New API test causing crashes on Mojave testers (Requested by
2049 ShawnRoberts on #webkit).
2053 "Add a unit test for client certificate authentication"
2054 https://bugs.webkit.org/show_bug.cgi?id=197800
2055 https://trac.webkit.org/changeset/245418
2057 2019-05-16 Keith Miller <keith_miller@apple.com>
2059 Wasm should cage the memory base pointers in structs
2060 https://bugs.webkit.org/show_bug.cgi?id=197620
2062 Reviewed by Saam Barati.
2064 Rename reauthenticate to recage.
2067 (WTF::CagedPtr::recage):
2068 (WTF::CagedPtr::reauthenticate): Deleted.
2070 2019-05-16 Alex Christensen <achristensen@webkit.org>
2072 Add a unit test for client certificate authentication
2073 https://bugs.webkit.org/show_bug.cgi?id=197800
2075 Reviewed by Youenn Fablet.
2077 * wtf/spi/cocoa/SecuritySPI.h:
2078 Move declarations from ArgumentCodersCF.cpp so they can be shared.
2080 2019-05-16 Eike Rathke <erack@redhat.com>
2082 Fix memcpy() call for big endian
2083 https://bugs.webkit.org/show_bug.cgi?id=197945
2085 Reviewed by Michael Catanzaro.
2090 2019-05-15 Ross Kirsling <ross.kirsling@sony.com>
2092 [PlayStation] WTFCrash should preserve register state.
2093 https://bugs.webkit.org/show_bug.cgi?id=197932
2095 Reviewed by Don Olmstead.
2097 * wtf/Assertions.cpp:
2099 Let r196397 apply to PlayStation port as well.
2101 2019-05-15 Simon Fraser <simon.fraser@apple.com>
2103 Make LOG_WITH_STREAM more efficient
2104 https://bugs.webkit.org/show_bug.cgi?id=197905
2106 Reviewed by Alex Christensen.
2108 Add a streamable repeat() class that can be used to output a series of characters.
2109 This is useful for indenting output.
2111 * wtf/text/TextStream.h:
2112 (WTF::TextStream::repeat::repeat):
2113 (WTF::TextStream::operator<<):
2115 2019-05-15 VÃctor Manuel Jáquez Leal <vjaquez@igalia.com>
2117 compilation failure with clang 9
2118 https://bugs.webkit.org/show_bug.cgi?id=197911
2120 Reviewed by Alex Christensen.
2122 Use std namespace for nullptr_t in tagArrayPtr templates.
2127 2019-05-14 Commit Queue <commit-queue@webkit.org>
2129 Unreviewed, rolling out r245281.
2130 https://bugs.webkit.org/show_bug.cgi?id=197887
2132 Broke API Test TestWebKitAPI.Challenge.ClientCertificate
2133 (Requested by aakashjain on #webkit).
2137 "Add a unit test for client certificate authentication"
2138 https://bugs.webkit.org/show_bug.cgi?id=197800
2139 https://trac.webkit.org/changeset/245281
2141 2019-05-14 Alex Christensen <achristensen@webkit.org>
2143 Add a unit test for client certificate authentication
2144 https://bugs.webkit.org/show_bug.cgi?id=197800
2146 Reviewed by Youenn Fablet.
2148 * wtf/spi/cocoa/SecuritySPI.h:
2149 Move declarations from ArgumentCodersCF.cpp so they can be shared.
2151 2019-05-13 Robin Morisset <rmorisset@apple.com>
2153 IndexSet::isEmpty should use BitVector::isEmpty() instead of size()
2154 https://bugs.webkit.org/show_bug.cgi?id=197857
2156 Reviewed by Darin Adler.
2159 (WTF::IndexSet::isEmpty const):
2161 2019-05-13 Youenn Fablet <youenn@apple.com>
2163 [Mac] Use realpath for dlopen_preflight
2164 https://bugs.webkit.org/show_bug.cgi?id=197803
2166 Reviewed by Eric Carlson.
2168 * wtf/cocoa/SoftLinking.h:
2170 2019-05-13 Yusuke Suzuki <ysuzuki@apple.com>
2172 Unreviewed, wrokaround for MACH_VM_MAX_ADDRESS in ARM32_64
2173 https://bugs.webkit.org/show_bug.cgi?id=197730
2175 Interestingly, MACH_VM_MAX_ADDRESS is larger than 32bit in ARM32_64, I think this is a bug.
2176 But for now, we workaround for this case by using `CPU(ADDRESS64)`.
2178 * wtf/WTFAssertions.cpp:
2180 2019-05-13 Yusuke Suzuki <ysuzuki@apple.com>
2182 [WTF] Remove Threading workaround for support libraries in Windows
2183 https://bugs.webkit.org/show_bug.cgi?id=197350
2185 Reviewed by Darin Adler.
2187 We kept old APIs for some support libraries at 2017. This patch removes them.
2190 * wtf/win/ThreadingWin.cpp:
2191 (WTF::createThread): Deleted.
2192 (WTF::waitForThreadCompletion): Deleted.
2194 2019-05-13 Yusuke Suzuki <ysuzuki@apple.com>
2196 [WTF] Simplify GCThread and CompilationThread flags by adding them to WTF::Thread
2197 https://bugs.webkit.org/show_bug.cgi?id=197146
2199 Reviewed by Saam Barati.
2201 Since GCThread and CompilationThread flags exist in WTF, we put these flags into WTF::Thread directly instead of holding them in ThreadSpecific<>.
2202 And this patch removes dependency from Threading.h to ThreadSpecific.h. ThreadSpecific.h's OS threading primitives are moved to ThreadingPrimitives.h,
2203 and Threading.h relies on it instead.
2205 * wtf/CompilationThread.cpp:
2206 (WTF::isCompilationThread):
2207 (WTF::initializeCompilationThreads): Deleted.
2208 (WTF::exchangeIsCompilationThread): Deleted.
2209 * wtf/CompilationThread.h:
2210 (WTF::CompilationScope::CompilationScope):
2211 (WTF::CompilationScope::~CompilationScope):
2212 (WTF::CompilationScope::leaveEarly):
2213 * wtf/MainThread.cpp:
2214 (WTF::initializeMainThread):
2215 (WTF::initializeMainThreadToProcessMainThread):
2216 (WTF::isMainThreadOrGCThread):
2217 (WTF::initializeGCThreads): Deleted.
2218 (WTF::registerGCThread): Deleted.
2219 (WTF::mayBeGCThread): Deleted.
2221 * wtf/ThreadSpecific.h:
2222 (WTF::canBeGCThread>::ThreadSpecific):
2223 (WTF::canBeGCThread>::set):
2224 (WTF::threadSpecificKeyCreate): Deleted.
2225 (WTF::threadSpecificKeyDelete): Deleted.
2226 (WTF::threadSpecificSet): Deleted.
2227 (WTF::threadSpecificGet): Deleted.
2228 * wtf/Threading.cpp:
2229 (WTF::Thread::exchangeIsCompilationThread):
2230 (WTF::Thread::registerGCThread):
2231 (WTF::Thread::mayBeGCThread):
2233 (WTF::Thread::isCompilationThread const):
2234 (WTF::Thread::gcThreadType const):
2235 (WTF::Thread::joinableState const):
2236 (WTF::Thread::hasExited const):
2237 (WTF::Thread::Thread):
2238 (WTF::Thread::joinableState): Deleted.
2239 (WTF::Thread::hasExited): Deleted.
2240 * wtf/ThreadingPrimitives.h:
2241 (WTF::threadSpecificKeyCreate):
2242 (WTF::threadSpecificKeyDelete):
2243 (WTF::threadSpecificSet):
2244 (WTF::threadSpecificGet):
2245 * wtf/win/ThreadSpecificWin.cpp:
2248 2019-05-13 Yusuke Suzuki <ysuzuki@apple.com>
2250 Unreviewed, follow-up after r245214
2251 https://bugs.webkit.org/show_bug.cgi?id=197730
2253 Suggested by Sam. We should have static_assert with MACH_VM_MAX_ADDRESS.
2255 * wtf/WTFAssertions.cpp:
2257 2019-05-13 Youenn Fablet <youenn@apple.com>
2259 Use kDNSServiceFlagsKnownUnique for DNSServiceRegisterRecord only on platforms supporting it
2260 https://bugs.webkit.org/show_bug.cgi?id=197802
2262 Reviewed by Eric Carlson.
2266 2019-05-13 Yusuke Suzuki <ysuzuki@apple.com>
2268 [JSC] Compress miscelaneous JIT related data structures with Packed<>
2269 https://bugs.webkit.org/show_bug.cgi?id=197830
2271 Reviewed by Saam Barati.
2276 2019-05-13 Michael Catanzaro <mcatanzaro@igalia.com>
2278 Unreviewed, fix unused variable warnings in release builds
2280 * wtf/URLHelpers.cpp:
2281 (WTF::URLHelpers::escapeUnsafeCharacters):
2283 2019-05-12 Yusuke Suzuki <ysuzuki@apple.com>
2285 [JSC] Compress Watchpoint size by using enum type and Packed<> data structure
2286 https://bugs.webkit.org/show_bug.cgi?id=197730
2288 Reviewed by Filip Pizlo.
2290 This patch introduces a new data structures, WTF::Packed, WTF::PackedPtr, and WTF::PackedAlignedPtr.
2294 WTF::Packed is data storage. We can read and write trivial (in C++ term [1]) data to this storage. The difference to
2295 the usual storage is that the alignment of this storage is always 1. We access the underlying data by using unalignedLoad/unalignedStore.
2296 This class offers alignment = 1 data structure instead of missing the following characteristics.
2298 1. Load / Store are non atomic even if the data size is within a pointer width. We should not use this for a member which can be accessed
2299 in a racy way. (e.g. fields accessed optimistically from the concurrent compilers).
2301 2. We cannot take reference / pointer to the underlying storage since they are unaligned.
2303 3. Access to this storage is unaligned access. The code is using memcpy, and the compiler will convert to an appropriate unaligned access
2304 in certain architectures (x86_64 / ARM64). It could be slow. So use it for non performance sensitive & memory sensitive places.
2308 WTF::PackedPtr is a specialization of WTF::Packed<T*>. And it is basically WTF::PackedAlignedPtr with alignment = 1. We further compact
2309 the pointer by leveraging the platform specific knowledge. In 64bit architectures, the effective width of pointers are less than 64 bit.
2310 In x86_64, it is 48 bits. And Darwin ARM64 is further smaller, 36 bits. This information allows us to compact the pointer to 6 bytes in
2311 x86_64 and 5 bytes in Darwin ARM64.
2313 - WTF::PackedAlignedPtr
2315 WTF::PackedAlignedPtr is the WTF::PackedPtr with alignment information of the T. If we use this alignment information, we could reduce the
2316 size of packed pointer further in some cases. For example, since we guarantee that JSCells are 16 byte aligned, low 4 bits are empty. Leveraging
2317 this information in Darwin ARM64 platform allows us to make packed JSCell pointer 4 bytes (36 - 4 bits). We do not use passed alignment
2318 information if it is not profitable.
2320 We also have PackedPtrTraits. This is new PtrTraits and use it for various data structures such as Bag<>.
2322 [1]: https://en.cppreference.com/w/cpp/types/is_trivial
2324 * WTF.xcodeproj/project.pbxproj:
2327 (WTF::Bag::iterator::operator++):
2328 * wtf/CMakeLists.txt:
2329 * wtf/DumbPtrTraits.h:
2330 * wtf/DumbValueTraits.h:
2332 (WTF::clzConstexpr):
2334 (WTF::ctzConstexpr):
2336 (WTF::getLSBSetConstexpr):
2337 (WTF::getMSBSetConstexpr):
2338 * wtf/Packed.h: Added.
2339 (WTF::Packed::Packed):
2340 (WTF::Packed::get const):
2342 (WTF::Packed::operator=):
2343 (WTF::Packed::exchange):
2344 (WTF::Packed::swap):
2346 (WTF::PackedPtrTraits::exchange):
2347 (WTF::PackedPtrTraits::swap):
2348 (WTF::PackedPtrTraits::unwrap):
2350 * wtf/SentinelLinkedList.h:
2351 (WTF::BasicRawSentinelNode::BasicRawSentinelNode):
2352 (WTF::BasicRawSentinelNode::prev):
2353 (WTF::BasicRawSentinelNode::next):
2354 (WTF::PtrTraits>::remove):
2355 (WTF::PtrTraits>::prepend):
2356 (WTF::PtrTraits>::append):
2357 (WTF::RawNode>::SentinelLinkedList):
2358 (WTF::RawNode>::remove):
2359 (WTF::BasicRawSentinelNode<T>::remove): Deleted.
2360 (WTF::BasicRawSentinelNode<T>::prepend): Deleted.
2361 (WTF::BasicRawSentinelNode<T>::append): Deleted.
2362 * wtf/StdLibExtras.h:
2363 (WTF::roundUpToMultipleOfImpl):
2364 (WTF::roundUpToMultipleOfImpl0): Deleted.
2365 * wtf/UnalignedAccess.h:
2366 (WTF::unalignedLoad):
2367 (WTF::unalignedStore):
2369 2019-05-10 Saam barati <sbarati@apple.com>
2371 Bag's move operator= leaks memory
2372 https://bugs.webkit.org/show_bug.cgi?id=197757
2374 Reviewed by Keith Miller.
2376 It was unused. So I'm just removing it. We can implement it properly
2380 (WTF::Bag::operator=): Deleted.
2382 2019-05-10 Fujii Hironori <Hironori.Fujii@sony.com>
2384 [WinCairo] storage/indexeddb tests are timing out
2385 https://bugs.webkit.org/show_bug.cgi?id=196289
2387 Reviewed by Alex Christensen.
2389 * wtf/FileSystem.h: Added hardLink.
2390 * wtf/glib/FileSystemGlib.cpp:
2391 (WTF::FileSystemImpl::hardLink):
2392 (WTF::FileSystemImpl::hardLinkOrCopyFile):
2393 * wtf/posix/FileSystemPOSIX.cpp:
2394 (WTF::FileSystemImpl::hardLink):
2395 (WTF::FileSystemImpl::hardLinkOrCopyFile):
2396 * wtf/win/FileSystemWin.cpp:
2397 (WTF::FileSystemImpl::hardLink):
2398 (WTF::FileSystemImpl::hardLinkOrCopyFile):
2399 Added hardLink. Let hardLinkOrCopyFile use the hardLink.
2401 2019-05-10 Yusuke Suzuki <ysuzuki@apple.com>
2403 [WTF] Remove "private:" from Noncopyable and Nonmovable macros
2404 https://bugs.webkit.org/show_bug.cgi?id=197767
2406 Reviewed by Saam Barati.
2408 We no longer need "private:".
2410 * wtf/Noncopyable.h:
2413 2019-05-08 Zan Dobersek <zdobersek@igalia.com>
2415 [GLib] Rework WPE RunLoopSourcePriority values
2416 https://bugs.webkit.org/show_bug.cgi?id=197167
2418 Reviewed by Carlos Garcia Campos.
2420 The GLib priorities for the WPE port were initially aligned on the -70
2421 value, theory being that this would help avoid any default-priority
2422 GSources spawned in different dependency libraries affecting our
2423 scheduling. Today it seems that extra caution might not be really
2426 This change aligns the base priority value with GLib's default priority
2427 value of 0. We maintain the relativity of priority values by effectively
2428 increasing each priority by 70.
2430 * wtf/glib/RunLoopSourcePriority.h:
2432 2019-05-08 Alex Christensen <achristensen@webkit.org>
2434 Add SPI to set HSTS storage directory
2435 https://bugs.webkit.org/show_bug.cgi?id=197259
2437 Reviewed by Brady Eidson.
2441 2019-05-08 Keith Miller <keith_miller@apple.com>
2443 Remove Gigacage from arm64 and use PAC for arm64e instead
2444 https://bugs.webkit.org/show_bug.cgi?id=197110
2446 Reviewed by Saam Barati.
2448 This patch changes the Gigacage to use PAC on arm64e. As part of
2449 this process all platforms must provide their length when
2450 materializing the caged pointer. Since it would be somewhat
2451 confusing to have two parameters for an operator [] those methods
2452 have been removed. Lastly, this patch removes the specializations
2453 for void* caged pointers, instead opting to use enable_if on the
2454 methods that would normally fail on void* e.g. anything that
2457 * WTF.xcodeproj/project.pbxproj:
2458 * wtf/CMakeLists.txt:
2460 (WTF::CagedPtr::CagedPtr):
2461 (WTF::CagedPtr::get const):
2462 (WTF::CagedPtr::getMayBeNull const):
2463 (WTF::CagedPtr::getUnsafe const):
2464 (WTF::CagedPtr::at const):
2465 (WTF::CagedPtr::reauthenticate):
2466 (WTF::CagedPtr::operator=):
2467 (WTF::CagedPtr::operator== const):
2468 (WTF::CagedPtr::operator bool const):
2469 (WTF::CagedPtr::operator* const): Deleted.
2470 (WTF::CagedPtr::operator-> const): Deleted.
2471 (WTF::CagedPtr::operator[] const): Deleted.
2473 * wtf/CagedUniquePtr.h:
2474 (WTF::CagedUniquePtr::CagedUniquePtr):
2475 (WTF::CagedUniquePtr::create):
2476 (WTF::CagedUniquePtr::~CagedUniquePtr):
2477 (WTF::CagedUniquePtr::destroy):
2480 (Gigacage::cagedMayBeNull):
2483 (WTF::untagArrayPtr):
2484 (WTF::removeArrayPtrTag):
2485 (WTF::retagArrayPtr):
2486 * wtf/TaggedArrayStoragePtr.h: Copied from Source/JavaScriptCore/runtime/ArrayBufferView.cpp.
2487 (WTF::TaggedArrayStoragePtr::TaggedArrayStoragePtr):
2488 (WTF::TaggedArrayStoragePtr::get const):
2489 (WTF::TaggedArrayStoragePtr::getUnsafe const):
2490 (WTF::TaggedArrayStoragePtr::resize):
2491 (WTF::TaggedArrayStoragePtr::operator bool const):
2493 2019-05-08 Robin Morisset <rmorisset@apple.com>
2495 WTF::TimingScope should show the total duration and not just the mean
2496 https://bugs.webkit.org/show_bug.cgi?id=197672
2498 Reviewed by Alex Christensen.
2500 * wtf/TimingScope.cpp:
2501 (WTF::TimingScope::scopeDidEnd):
2503 2019-05-07 Yusuke Suzuki <ysuzuki@apple.com>
2505 [JSC] LLIntPrototypeLoadAdaptiveStructureWatchpoint does not require Bag<>
2506 https://bugs.webkit.org/show_bug.cgi?id=197645
2508 Reviewed by Saam Barati.
2510 * WTF.xcodeproj/project.pbxproj:
2511 * wtf/CMakeLists.txt:
2512 * wtf/Nonmovable.h: Copied from Source/JavaScriptCore/bytecode/LLIntPrototypeLoadAdaptiveStructureWatchpoint.h.
2514 (WTF::minCapacity>::uncheckedConstructAndAppend):
2516 2019-05-07 Eric Carlson <eric.carlson@apple.com>
2518 Define media buffering policy
2519 https://bugs.webkit.org/show_bug.cgi?id=196979
2520 <rdar://problem/28383861>
2522 Reviewed by Jer Noble.
2526 2019-05-07 Robin Morisset <rmorisset@apple.com>
2528 WTF::BitVector should have an isEmpty() method
2529 https://bugs.webkit.org/show_bug.cgi?id=197637
2531 Reviewed by Keith Miller.
2533 * wtf/BitVector.cpp:
2534 (WTF::BitVector::isEmptySlow const):
2536 (WTF::BitVector::isEmpty const):
2538 2019-05-07 Brent Fulgham <bfulgham@apple.com>
2540 Correct JSON parser to address unterminated escape character
2541 https://bugs.webkit.org/show_bug.cgi?id=197582
2542 <rdar://problem/50459177>
2544 Reviewed by Alex Christensen.
2546 Correct JSON parser code to properly deal with unterminated escape
2549 * wtf/JSONValues.cpp:
2550 (WTF::JSONImpl::decodeString):
2551 (WTF::JSONImpl::parseStringToken):
2553 2019-05-07 Alex Christensen <achristensen@webkit.org>
2555 Add a release assertion that Functions can only be constructed from non-null CompletionHandlers
2556 https://bugs.webkit.org/show_bug.cgi?id=197641
2558 Reviewed by Chris Dumez.
2560 This will help us find the cause of rdar://problem/48679972 by seeing the crash when the Function is dispatched,
2561 not when it's called with no interesting stack trace. I manually verified this assertion is hit in such a case.
2562 We should also have no legitimate use of creating a Function out of a null CompletionHandler then never calling it.
2564 * wtf/CompletionHandler.h:
2565 (WTF::Detail::CallableWrapper<CompletionHandler<Out):
2567 (WTF::Detail::CallableWrapperBase::~CallableWrapperBase):
2568 (WTF::Detail::CallableWrapper::CallableWrapper):
2569 (WTF::Function<Out):
2571 2019-05-06 Christopher Reid <chris.reid@sony.com>
2573 [JSC] Respect already defined USE_LLINT_EMBEDDED_OPCODE_ID compiler variable.
2574 https://bugs.webkit.org/show_bug.cgi?id=197633
2576 Reviewed by Don Olmstead.
2578 When the variable `USE_LLINT_EMBEDDED_OPCODE_ID` is defined, stop defining
2579 its value with platform default one.
2583 2019-05-03 Sihui Liu <sihui_liu@apple.com>
2585 Add assertion to check whether shm files have maximum FileProtection of CompleteUnlessOpen
2586 https://bugs.webkit.org/show_bug.cgi?id=197390
2587 <rdar://problem/42685773>
2589 Reviewed by Geoffrey Garen.
2591 * wtf/FileSystem.cpp:
2592 (WTF::FileSystemImpl::isSafeToUseMemoryMapForPath):
2593 (WTF::FileSystemImpl::makeSafeToUseMemoryMapForPath):
2595 * wtf/cocoa/FileSystemCocoa.mm:
2596 (WTF::FileSystemImpl::isSafeToUseMemoryMapForPath):
2597 (WTF::FileSystemImpl::makeSafeToUseMemoryMapForPath):
2599 2019-05-03 Commit Queue <commit-queue@webkit.org>
2601 Unreviewed, rolling out r244881.
2602 https://bugs.webkit.org/show_bug.cgi?id=197559
2604 Breaks compilation of jsconly on linux, breaking compilation
2605 for jsc-i386-ews, jsc-mips-ews and jsc-armv7-ews (Requested by
2606 guijemont on #webkit).
2610 "[CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into
2612 https://bugs.webkit.org/show_bug.cgi?id=197174
2613 https://trac.webkit.org/changeset/244881
2615 2019-05-02 Alex Christensen <achristensen@webkit.org>
2617 Mark U+01C0 as a homograph of U+006C
2618 https://bugs.webkit.org/show_bug.cgi?id=197526
2619 <rdar://problem/50301904>
2621 Reviewed by Tim Horton.
2623 * wtf/URLHelpers.cpp:
2624 (WTF::URLHelpers::isLookalikeCharacter):
2626 2019-05-02 Don Olmstead <don.olmstead@sony.com>
2628 [CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into WEBKIT_COPY_FILES
2629 https://bugs.webkit.org/show_bug.cgi?id=197174
2631 Reviewed by Alex Christensen.
2633 Replace WEBKIT_MAKE_FORWARDING_HEADERS with WEBKIT_COPY_FILES.
2635 * wtf/CMakeLists.txt:
2637 2019-05-01 Darin Adler <darin@apple.com>
2639 WebKit has too much of its own UTF-8 code and should rely more on ICU's UTF-8 support
2640 https://bugs.webkit.org/show_bug.cgi?id=195535
2642 Reviewed by Alexey Proskuryakov.
2644 * wtf/text/AtomicString.cpp:
2645 (WTF::AtomicString::fromUTF8Internal): Added code to compute string length when the
2646 end is nullptr; this behavior used to be implemented inside the
2647 calculateStringHashAndLengthFromUTF8MaskingTop8Bits function.
2649 * wtf/text/AtomicStringImpl.cpp:
2650 (WTF::HashAndUTF8CharactersTranslator::translate): Updated for change to
2653 * wtf/text/AtomicStringImpl.h: Took the WTF_EXPORT_PRIVATE off of the
2654 AtomicStringImpl::addUTF8 function. This is used only inside a non-inlined function in
2655 the AtomicString class and its behavior changed subtly in this patch; it's helpful
2656 to document that it's not exported.
2658 * wtf/text/StringImpl.cpp:
2659 (WTF::StringImpl::utf8Impl): Don't pass "true" for strictness to convertUTF16ToUTF8
2660 since strict is the default. Also updated for changes to ConversionResult.
2661 (WTF::StringImpl::utf8ForCharacters): Updated for change to convertLatin1ToUTF8.
2662 (WTF::StringImpl::tryGetUtf8ForRange const): Ditto.
2664 * wtf/text/StringView.cpp: Removed uneeded include of UTF8Conversion.h.
2666 * wtf/text/WTFString.cpp:
2667 (WTF::String::fromUTF8): Updated for change to convertUTF8ToUTF16.
2669 * wtf/unicode/UTF8Conversion.cpp:
2670 (WTF::Unicode::inlineUTF8SequenceLengthNonASCII): Deleted.
2671 (WTF::Unicode::inlineUTF8SequenceLength): Deleted.
2672 (WTF::Unicode::UTF8SequenceLength): Deleted.
2673 (WTF::Unicode::decodeUTF8Sequence): Deleted.
2674 (WTF::Unicode::convertLatin1ToUTF8): Use U8_APPEND, enabling us to remove
2675 almost everything in the function. Also changed resturn value to be a boolean
2676 to indicate success since there is only one possible failure (target exhausted).
2677 There is room for further simplification, since most callers have lengths rather
2678 than end pointers for the source buffer, and all but one caller supplies a buffer
2679 size known to be sufficient, so those don't need a return value, nor do they need
2680 to pass an end of buffer pointer.
2681 (WTF::Unicode::convertUTF16ToUTF8): Use U_IS_LEAD, U_IS_TRAIL,
2682 U16_GET_SUPPLEMENTARY, U_IS_SURROGATE, and U8_APPEND. Also changed behavior
2683 for non-strict mode so that unpaired surrogates will be turned into the
2684 replacement character instead of invalid UTF-8 sequences, because U8_APPEND
2685 won't create an invalid UTF-8 sequence, and because we don't need to do that
2686 for any good reason at any call site.
2687 (WTF::Unicode::isLegalUTF8): Deleted.
2688 (WTF::Unicode::readUTF8Sequence): Deleted.
2689 (WTF::Unicode::convertUTF8ToUTF16): Use U8_NEXT instead of
2690 inlineUTF8SequenceLength, isLegalUTF8, and readUTF8Sequence. Use
2691 U16_APPEND instead of lots of code that does the same thing. There is
2692 room for further simplification since most callers don't need the "all ASCII"
2693 feature and could probably pass the arguments in a more natural way.
2694 (WTF::Unicode::calculateStringHashAndLengthFromUTF8MaskingTop8Bits):
2695 Use U8_NEXT instead of isLegalUTF8, readUTF8Sequence, and various
2696 error handling checks for things that are handled by U8_NEXT. Also removed
2697 support for passing nullptr for end to specify a null-terminated string.
2698 (WTF::Unicode::equalUTF16WithUTF8): Ditto.
2700 * wtf/unicode/UTF8Conversion.h: Removed UTF8SequenceLength and
2701 decodeUTF8Sequence. Changed the ConversionResult to match WebKit coding
2702 style, with an eye toward perhaps removing it in the future. Changed
2703 the convertUTF8ToUTF16 return value to a boolean and removed the "strict"
2704 argument since no caller was passing false. Changed the convertLatin1ToUTF8
2705 return value to a boolean. Tweaked comments.
2707 2019-05-01 Shawn Roberts <sroberts@apple.com>
2709 Unreviewed, rolling out r244821.
2715 "WebKit has too much of its own UTF-8 code and should rely
2716 more on ICU's UTF-8 support"
2717 https://bugs.webkit.org/show_bug.cgi?id=195535
2718 https://trac.webkit.org/changeset/244821
2720 2019-05-01 Shawn Roberts <sroberts@apple.com>
2722 Unreviewed, rolling out r244822.
2724 Causing 4 Test262 failures on JSC Release and Debug
2728 https://trac.webkit.org/changeset/244822 https://trac.webkit.org/changeset/244821
2730 2019-04-29 Darin Adler <darin@apple.com>
2732 WebKit has too much of its own UTF-8 code and should rely more on ICU's UTF-8 support
2733 https://bugs.webkit.org/show_bug.cgi?id=195535
2735 Reviewed by Alexey Proskuryakov.
2737 * wtf/text/AtomicString.cpp:
2738 (WTF::AtomicString::fromUTF8Internal): Added code to compute string length when the
2739 end is nullptr; this behavior used to be implemented inside the
2740 calculateStringHashAndLengthFromUTF8MaskingTop8Bits function.
2742 * wtf/text/AtomicStringImpl.cpp:
2743 (WTF::HashAndUTF8CharactersTranslator::translate): Updated for change to
2746 * wtf/text/AtomicStringImpl.h: Took the WTF_EXPORT_PRIVATE off of the
2747 AtomicStringImpl::addUTF8 function. This is used only inside a non-inlined function in
2748 the AtomicString class and its behavior changed subtly in this patch; it's helpful
2749 to document that it's not exported.
2751 * wtf/text/StringImpl.cpp:
2752 (WTF::StringImpl::utf8Impl): Don't pass "true" for strictness to convertUTF16ToUTF8
2753 since strict is the default. Also updated for changes to ConversionResult.
2754 (WTF::StringImpl::utf8ForCharacters): Updated for change to convertLatin1ToUTF8.
2755 (WTF::StringImpl::tryGetUtf8ForRange const): Ditto.
2757 * wtf/text/StringView.cpp: Removed uneeded include of UTF8Conversion.h.
2759 * wtf/text/WTFString.cpp:
2760 (WTF::String::fromUTF8): Updated for change to convertUTF8ToUTF16.
2762 * wtf/unicode/UTF8Conversion.cpp:
2763 (WTF::Unicode::inlineUTF8SequenceLengthNonASCII): Deleted.
2764 (WTF::Unicode::inlineUTF8SequenceLength): Deleted.
2765 (WTF::Unicode::UTF8SequenceLength): Deleted.
2766 (WTF::Unicode::decodeUTF8Sequence): Deleted.
2767 (WTF::Unicode::convertLatin1ToUTF8): Use U8_APPEND, enabling us to remove
2768 almost everything in the function. Also changed resturn value to be a boolean
2769 to indicate success since there is only one possible failure (target exhausted).
2770 There is room for further simplification, since most callers have lengths rather
2771 than end pointers for the source buffer, and all but one caller supplies a buffer
2772 size known to be sufficient, so those don't need a return value, nor do they need
2773 to pass an end of buffer pointer.
2774 (WTF::Unicode::convertUTF16ToUTF8): Use U_IS_LEAD, U_IS_TRAIL,
2775 U16_GET_SUPPLEMENTARY, U_IS_SURROGATE, and U8_APPEND. Also changed behavior
2776 for non-strict mode so that unpaired surrogates will be turned into the
2777 replacement character instead of invalid UTF-8 sequences, because U8_APPEND
2778 won't create an invalid UTF-8 sequence, and because we don't need to do that
2779 for any good reason at any call site.
2780 (WTF::Unicode::isLegalUTF8): Deleted.
2781 (WTF::Unicode::readUTF8Sequence): Deleted.
2782 (WTF::Unicode::convertUTF8ToUTF16): Use U8_NEXT instead of
2783 inlineUTF8SequenceLength, isLegalUTF8, and readUTF8Sequence. Use
2784 U16_APPEND instead of lots of code that does the same thing. There is
2785 room for further simplification since most callers don't need the "all ASCII"
2786 feature and could probably pass the arguments in a more natural way.
2787 (WTF::Unicode::calculateStringHashAndLengthFromUTF8MaskingTop8Bits):
2788 Use U8_NEXT instead of isLegalUTF8, readUTF8Sequence, and various
2789 error handling checks for things that are handled by U8_NEXT. Also removed
2790 support for passing nullptr for end to specify a null-terminated string.
2791 (WTF::Unicode::equalUTF16WithUTF8): Ditto.
2793 * wtf/unicode/UTF8Conversion.h: Removed UTF8SequenceLength and
2794 decodeUTF8Sequence. Changed the ConversionResult to match WebKit coding
2795 style, with an eye toward perhaps removing it in the future. Changed
2796 the convertUTF8ToUTF16 return value to a boolean and removed the "strict"
2797 argument since no caller was passing false. Changed the convertLatin1ToUTF8
2798 return value to a boolean. Tweaked comments.
2800 2019-04-30 John Wilander <wilander@apple.com>
2802 Add logging of Ad Click Attribution errors and events to a dedicated channel
2803 https://bugs.webkit.org/show_bug.cgi?id=197332
2804 <rdar://problem/49918800>
2806 Reviewed by Youenn Fablet.
2808 Added missing RELEASE_LOG_INFO and RELEASE_LOG_INFO_IF dummies
2809 for RELEASE_LOG_DISABLED.
2813 2019-04-30 Youenn Fablet <youenn@apple.com>
2815 Make Document audio producers use WeakPtr
2816 https://bugs.webkit.org/show_bug.cgi?id=197382
2818 Reviewed by Eric Carlson.
2820 * wtf/WeakHashSet.h:
2821 (WTF::WeakHashSet::hasNullReferences const):
2823 2019-04-30 Commit Queue <commit-queue@webkit.org>
2825 Unreviewed, rolling out r244773.
2826 https://bugs.webkit.org/show_bug.cgi?id=197436
2828 Causing assertion failures on debug queues (Requested by
2829 ShawnRoberts on #webkit).
2833 "Make Document audio producers use WeakPtr"
2834 https://bugs.webkit.org/show_bug.cgi?id=197382
2835 https://trac.webkit.org/changeset/244773
2837 2019-04-30 Youenn Fablet <youenn@apple.com>
2839 Make Document audio producers use WeakPtr
2840 https://bugs.webkit.org/show_bug.cgi?id=197382
2842 Reviewed by Eric Carlson.
2844 * wtf/WeakHashSet.h:
2845 (WTF::WeakHashSet::hasNullReferences const):
2847 2019-04-29 Alex Christensen <achristensen@webkit.org>
2849 <rdar://problem/50299396> Fix internal High Sierra build
2850 https://bugs.webkit.org/show_bug.cgi?id=197388
2852 * Configurations/Base.xcconfig:
2854 2019-04-29 Yusuke Suzuki <ysuzuki@apple.com>
2856 JITStubRoutineSet wastes 180KB of HashTable capacity on can.com
2857 https://bugs.webkit.org/show_bug.cgi?id=186732
2859 Reviewed by Saam Barati.
2862 (WTF::Range::contains const):
2864 2019-04-29 Basuke Suzuki <Basuke.Suzuki@sony.com>
2866 [Win] Add flag to enable version information stamping and disable by default.
2867 https://bugs.webkit.org/show_bug.cgi?id=197249
2868 <rdar://problem/50224412>
2870 Reviewed by Ross Kirsling.
2872 This feature is only used in AppleWin port. Add flag for this task and make it OFF by default.
2873 Then enable it by default on AppleWin.
2875 * wtf/CMakeLists.txt:
2877 2019-04-26 Don Olmstead <don.olmstead@sony.com>
2879 Add WTF::findIgnoringASCIICaseWithoutLength to replace strcasestr
2880 https://bugs.webkit.org/show_bug.cgi?id=197291
2882 Reviewed by Konstantin Tokarev.
2884 Adds an implementation of strcasestr within WTF.
2886 * wtf/text/StringCommon.h:
2887 (WTF::findIgnoringASCIICaseWithoutLength):
2889 2019-04-26 Sihui Liu <sihui_liu@apple.com>
2891 Stop IDB transactions to release locked database files when network process is ready to suspend
2892 https://bugs.webkit.org/show_bug.cgi?id=196372
2893 <rdar://problem/48930116>
2895 Reviewed by Brady Eidson.
2897 Provide a method to suspend the thread and block main thread until the thread is suspended.
2899 * wtf/CrossThreadTaskHandler.cpp:
2900 (WTF::CrossThreadTaskHandler::taskRunLoop):
2901 (WTF::CrossThreadTaskHandler::suspendAndWait):
2902 (WTF::CrossThreadTaskHandler::resume):
2903 * wtf/CrossThreadTaskHandler.h:
2905 2019-04-25 Fujii Hironori <Hironori.Fujii@sony.com>
2907 Unreviewed, rolling out r244669.
2909 Windows ports can't clean build.
2913 "[Win] Add flag to enable version information stamping and
2914 disable by default."
2915 https://bugs.webkit.org/show_bug.cgi?id=197249
2916 https://trac.webkit.org/changeset/244669
2918 2019-04-25 Basuke Suzuki <Basuke.Suzuki@sony.com>
2920 [Win] Add flag to enable version information stamping and disable by default.
2921 https://bugs.webkit.org/show_bug.cgi?id=197249
2923 Reviewed by Ross Kirsling.
2925 This feature is only used in AppleWin port. Add flag for this task and make it OFF by default.
2926 Then enable it by default on AppleWin.
2928 * wtf/CMakeLists.txt:
2930 2019-04-25 Timothy Hatcher <timothy@apple.com>
2932 Disable date and time inputs on iOSMac.
2933 https://bugs.webkit.org/show_bug.cgi?id=197287
2934 rdar://problem/46794376
2936 Reviewed by Wenson Hsieh.
2938 * wtf/FeatureDefines.h:
2940 2019-04-25 Alex Christensen <achristensen@webkit.org>
2942 Fix High Sierra build after r244653
2943 https://bugs.webkit.org/show_bug.cgi?id=197131
2945 * wtf/StdLibExtras.h:
2946 High Sierra thinks __cplusplus is 201406 even when using C++17.
2947 Removing the __cplusplus check resolves the build failure on High Sierra.
2948 We can clean up StdLibExtras more later.
2950 2019-04-25 Alex Christensen <achristensen@webkit.org>
2953 https://bugs.webkit.org/show_bug.cgi?id=197131
2955 Reviewed by Darin Adler.
2957 * Configurations/Base.xcconfig:
2958 * wtf/CMakeLists.txt:
2962 2019-04-25 Alex Christensen <achristensen@webkit.org>
2964 Remove DeprecatedOptional
2965 https://bugs.webkit.org/show_bug.cgi?id=197161
2967 Reviewed by Darin Adler.
2969 * WTF.xcodeproj/project.pbxproj:
2970 * wtf/CMakeLists.txt:
2971 * wtf/DeprecatedOptional.h: Removed.
2973 2019-04-24 Carlos Garcia Campos <cgarcia@igalia.com>
2975 [GTK] Hardcoded text color in input fields
2976 https://bugs.webkit.org/show_bug.cgi?id=126907
2978 Reviewed by Michael Catanzaro.
2980 Define HAVE_OS_DARK_MODE_SUPPORT for GTK port.
2984 2019-04-24 Tim Horton <timothy_horton@apple.com>
2986 Clean up WKActionSheetAssistant's use of LaunchServices
2987 https://bugs.webkit.org/show_bug.cgi?id=194645
2988 <rdar://problem/47707952>
2990 Reviewed by Andy Estes.
2994 2019-04-24 chris fleizach <cfleizach@apple.com>
2996 AX: Remove deprecated Accessibility Object Model events
2997 https://bugs.webkit.org/show_bug.cgi?id=197073
2998 <rdar://problem/50027819>
3000 Reviewed by Ryosuke Niwa.
3004 2019-04-23 Commit Queue <commit-queue@webkit.org>
3006 Unreviewed, rolling out r244558.
3007 https://bugs.webkit.org/show_bug.cgi?id=197219
3009 Causing crashes on iOS Sim Release and Debug (Requested by
3010 ShawnRoberts on #webkit).
3014 "Remove DeprecatedOptional"
3015 https://bugs.webkit.org/show_bug.cgi?id=197161
3016 https://trac.webkit.org/changeset/244558
3018 2019-04-23 Alex Christensen <achristensen@webkit.org>
3020 Remove DeprecatedOptional
3021 https://bugs.webkit.org/show_bug.cgi?id=197161
3023 Reviewed by Darin Adler.
3025 This was added in r209326 to be compatible with a shipping version of Safari.
3026 We have released several versions of Safari since then, so do what the comments say and remove it.
3027 The existence of this std::optional makes migrating to C++17 harder, and there's no reason to keep it.
3029 * WTF.xcodeproj/project.pbxproj:
3030 * wtf/CMakeLists.txt:
3031 * wtf/DeprecatedOptional.h: Removed.
3033 2019-04-21 Zan Dobersek <zdobersek@igalia.com>
3035 [WTF] Generic memoryFootprint() implementation should use bmalloc on Linux
3036 https://bugs.webkit.org/show_bug.cgi?id=196963
3038 Reviewed by Don Olmstead.
3040 Have the generic memoryFootprint() implementation use bmalloc's
3041 memoryFootprint() API on Linux, whenever the system malloc option is
3042 not enabled. Limitation to Linux platforms is due to the bmalloc
3043 implementation being limited to those configurations (excluding iOS
3044 which doesn't use MemoryFootprintGeneric.cpp).
3046 * wtf/PlatformWPE.cmake: Switch to building MemoryFootprintGeneric.cpp.
3047 * wtf/generic/MemoryFootprintGeneric.cpp:
3048 (WTF::memoryFootprint):
3050 2019-04-19 Ryosuke Niwa <rniwa@webkit.org>
3052 HashTable::removeIf always shrinks the hash table by half even if there is nothing left
3053 https://bugs.webkit.org/show_bug.cgi?id=196681
3054 <rdar://problem/49917764>
3056 Reviewed by Darin Adler.
3058 Address Darin's comments by removing the explicit type from std::max.
3061 (WTF::KeyTraits>::computeBestTableSize):
3062 (WTF::KeyTraits>::shrinkToBestSize):
3064 2019-04-18 Chris Dumez <cdumez@apple.com>
3066 [iOS] Improve detection of when web views go to background / foreground
3067 https://bugs.webkit.org/show_bug.cgi?id=197035
3068 <rdar://problem/45281182>
3070 Reviewed by Tim Horton.
3072 Add build time flag.
3074 * wtf/FeatureDefines.h:
3076 2019-04-18 Jer Noble <jer.noble@apple.com>
3078 Add support for parsing FairPlayStreaming PSSH boxes.
3079 https://bugs.webkit.org/show_bug.cgi?id=197064
3081 Reviewed by Eric Carlson.
3085 2019-04-18 Yusuke Suzuki <ysuzuki@apple.com>
3087 [WTF] StringBuilder should set correct m_is8Bit flag when merging
3088 https://bugs.webkit.org/show_bug.cgi?id=197053
3090 Reviewed by Saam Barati.
3092 When appending StringBuilder to the other StringBuilder, we have a path that does not set m_is8Bit flag correctly.
3093 This patch correctly sets this flag. And we also change 0 to nullptr when we are using 0 as a pointer.
3095 * wtf/text/StringBuilder.cpp:
3096 (WTF::StringBuilder::reserveCapacity):
3097 (WTF::StringBuilder::appendUninitializedSlow):
3098 (WTF::StringBuilder::append):
3099 * wtf/text/StringBuilder.h:
3100 (WTF::StringBuilder::append):
3101 (WTF::StringBuilder::characters8 const):
3102 (WTF::StringBuilder::characters16 const):
3103 (WTF::StringBuilder::clear):
3105 2019-04-17 Tim Horton <timothy_horton@apple.com>
3107 Adopt different scroll view flashing SPI
3108 https://bugs.webkit.org/show_bug.cgi?id=197043
3109 <rdar://problem/49996476>
3111 Reviewed by Wenson Hsieh.
3115 2019-04-17 Jer Noble <jer.noble@apple.com>
3117 Enable HAVE_AVFOUNDATION_VIDEO_OUTPUT on PLATFORM(IOSMAC)
3118 https://bugs.webkit.org/show_bug.cgi?id=196994
3119 <rdar://problem/44158331>
3121 Reviewed by Alex Christensen.
3125 2019-04-16 Stephan Szabo <stephan.szabo@sony.com>
3127 [PlayStation] Update port for system library changes
3128 https://bugs.webkit.org/show_bug.cgi?id=196978
3130 Reviewed by Ross Kirsling.
3132 * wtf/PlatformPlayStation.cmake:
3133 Remove reference to deleted system library
3135 2019-04-16 Jer Noble <jer.noble@apple.com>
3137 Enable HAVE_AVKIT on PLATFORM(IOSMAC)
3138 https://bugs.webkit.org/show_bug.cgi?id=196987
3140 Reviewed by Tim Horton.
3144 2019-04-16 Robin Morisset <rmorisset@apple.com>
3146 [WTF] holdLock should be marked WARN_UNUSED_RETURN
3147 https://bugs.webkit.org/show_bug.cgi?id=196922
3149 Reviewed by Keith Miller.
3153 2019-04-16 Don Olmstead <don.olmstead@sony.com>
3155 [CMake] Set WTF_SCRIPTS_DIR
3156 https://bugs.webkit.org/show_bug.cgi?id=196917
3158 Reviewed by Konstantin Tokarev.
3160 Use WTF_SCRIPTS_DIR for copying the unified sources script.
3162 * wtf/CMakeLists.txt:
3164 2019-04-15 Myles C. Maxfield <mmaxfield@apple.com>
3166 [Cocoa] FontPlatformData objects aren't cached at all when using font-family:system-ui
3167 https://bugs.webkit.org/show_bug.cgi?id=196846
3168 <rdar://problem/49499971>
3170 Reviewed by Simon Fraser and Darin Adler.
3176 2019-04-12 Ryosuke Niwa <rniwa@webkit.org>
3178 HashTable::removeIf always shrinks the hash table by half even if there is nothing left
3179 https://bugs.webkit.org/show_bug.cgi?id=196681
3181 Reviewed by Darin Adler.
3183 Made HashTable::removeIf shrink to the "best size", which is the least power of two bigger
3184 than twice the key count as already used in the copy constructor.
3187 (WTF::HashTable::computeBestTableSize): Extracted from the copy constructor.
3188 (WTF::HashTable::shrinkToBestSize): Added.
3189 (WTF::HashTable::removeIf): Use shrinkToBestSize instead of shrink.
3190 (WTF::HashTable::HashTable):
3192 2019-04-12 Eric Carlson <eric.carlson@apple.com>
3194 Update AudioSession route sharing policy
3195 https://bugs.webkit.org/show_bug.cgi?id=196776
3196 <rdar://problem/46501611>
3198 Reviewed by Jer Noble.
3200 * wtf/Platform.h: Define HAVE_ROUTE_SHARING_POLICY_LONG_FORM_VIDEO.
3202 2019-04-10 Said Abou-Hallawa <sabouhallawa@apple.com>
3204 requestAnimationFrame should execute before the next frame
3205 https://bugs.webkit.org/show_bug.cgi?id=177484
3207 Reviewed by Simon Fraser.
3209 Add trace points for the page RenderingUpdate.
3211 * wtf/SystemTracing.h:
3213 2019-04-10 Claudio Saavedra <csaavedra@igalia.com>
3215 Do not generate empty unified sources when unified builds are disabled
3216 https://bugs.webkit.org/show_bug.cgi?id=196767
3218 Reviewed by Konstantin Tokarev.
3220 If unified builds are disabled, the ruby script to generate them
3221 is still used to list the sources that need to be
3222 compiled. Currently, the script always generates bundled unified
3223 sources, even if it's being used just to list all the sources. So
3224 when the unified builds are disabled and no files are going to be
3225 bundled, the script generates one empty file per bundle manager
3226 (that is, one C++ and one ObjectiveC), that gets added to the
3227 sources to be compiled.
3229 * Scripts/generate-unified-source-bundles.rb: Only go through the
3230 bundle managers file generation when not running in
3231 PrintAllSources mode, to avoid generating empty bundle files.
3233 2019-04-10 Enrique Ocaña González <eocanha@igalia.com>
3235 [WPE] Avoid async IO starving timers
3236 https://bugs.webkit.org/show_bug.cgi?id=196733
3238 Reviewed by Carlos Garcia Campos.
3240 If AsyncIONetwork and DiskCacheRead priorities are higher than
3241 MainThreadSharedTimer the timers get starved. This causes the NetworkProcess
3242 to accumulate MB of data instead of handing it down to the WebProcess (done
3243 using a Timer). This eventually causes an Out Of Memory kill on the
3244 NetworkProcess on some embedded platforms with low memory limits.
3246 This patch levels the three priorities to the same value, while still leaving
3247 DiskCacheWrite with less priority than DiskCacheRead.
3249 * wtf/glib/RunLoopSourcePriority.h: Changed RunLoopSourcePriority values for WPE.
3251 2019-04-09 Don Olmstead <don.olmstead@sony.com>
3253 [CMake] WTF derived sources should only be referenced inside WTF
3254 https://bugs.webkit.org/show_bug.cgi?id=196706
3256 Reviewed by Konstantin Tokarev.
3258 Use ${WTF_DERIVED_SOURCES_DIR} instead of ${DERIVED_SOURCES_DIR} within WTF.
3260 * wtf/CMakeLists.txt:
3261 * wtf/PlatformJSCOnly.cmake:
3262 * wtf/PlatformMac.cmake:
3264 2019-04-09 Don Olmstead <don.olmstead@sony.com>
3266 [CMake] Apple builds should use ICU_INCLUDE_DIRS
3267 https://bugs.webkit.org/show_bug.cgi?id=196720
3269 Reviewed by Konstantin Tokarev.
3271 Copy ICU headers for Apple builds into ICU_INCLUDE_DIRS.
3274 * wtf/PlatformMac.cmake:
3276 2019-04-08 Don Olmstead <don.olmstead@sony.com>
3278 [CMake][WinCairo] Separate copied headers into different directories
3279 https://bugs.webkit.org/show_bug.cgi?id=196655
3281 Reviewed by Michael Catanzaro.
3283 * wtf/CMakeLists.txt:
3285 2019-04-08 Guillaume Emont <guijemont@igalia.com>
3288 https://bugs.webkit.org/show_bug.cgi?id=196689
3290 Reviewed by Žan Doberšek.
3292 Since the bytecode change, we enabled the baseline JIT on mips in
3293 r240432, but DFG is still missing. With this change, all tests are
3294 passing on a ci20 board.
3296 * wtf/Platform.h: Enable DFG on MIPS by default.
3298 2019-04-06 Ryosuke Niwa <rniwa@webkit.org>
3300 Added tests for WeakHashSet::computesEmpty and WeakHashSet::computeSize
3301 https://bugs.webkit.org/show_bug.cgi?id=196669
3303 Reviewed by Geoffrey Garen.
3305 Removed the superflous type names from forward declarations, and made WeakHashSet::add
3306 take a const object to match other container types in WTF.
3308 * wtf/WeakHashSet.h:
3309 (WTF::WeakHashSet::add):
3312 2019-04-05 Ryosuke Niwa <rniwa@webkit.org>
3314 Make WeakPtr<Element> possible and deploy it in form associated elements code
3315 https://bugs.webkit.org/show_bug.cgi?id=196626
3317 Reviewed by Antti Koivisto.
3319 Make it possible to call WeakHashSet::remove and WeakHashSet::contains with
3320 a subclass type U of a type T used to define WeakReference<T>.
3322 Also added computesEmpty, which is slightly more efficient than computeSize
3323 when m_set is either empty or when there are non-released weak references in the set.
3325 * wtf/WeakHashSet.h:
3326 (WTF::WeakHashSet::remove):
3327 (WTF::WeakHashSet::contains const):
3328 (WTF::WeakHashSet::computesEmpty const): Added.
3329 * wtf/WeakPtr.h: Added an explicit forward declaration of WeakHashSet to avoid
3330 build failures in GTK+ and WPE ports.
3332 2019-04-05 Eric Carlson <eric.carlson@apple.com>
3334 Remove AUDIO_TOOLBOX_AUDIO_SESSION
3335 https://bugs.webkit.org/show_bug.cgi?id=196653
3336 <rdar://problem/49652098>
3338 Reviewed by Jer Noble.
3342 2019-04-05 Michael Catanzaro <mcatanzaro@igalia.com>
3344 Unreviewed manual rollout of r243929
3345 https://bugs.webkit.org/show_bug.cgi?id=196626
3347 * wtf/WeakHashSet.h:
3348 (WTF::WeakHashSet::remove):
3349 (WTF::WeakHashSet::contains const):
3350 (WTF::WeakHashSet::computesEmpty const): Deleted.
3352 2019-04-05 Commit Queue <commit-queue@webkit.org>
3354 Unreviewed, rolling out r243833.
3355 https://bugs.webkit.org/show_bug.cgi?id=196645
3357 This change breaks build of WPE and GTK ports (Requested by
3358 annulen on #webkit).
3362 "[CMake][WTF] Mirror XCode header directories"
3363 https://bugs.webkit.org/show_bug.cgi?id=191662
3364 https://trac.webkit.org/changeset/243833
3366 2019-04-05 Ryosuke Niwa <rniwa@webkit.org>
3368 Make WeakPtr<Element> possible and deploy it in form associated elements code
3369 https://bugs.webkit.org/show_bug.cgi?id=196626
3371 Reviewed by Antti Koivisto.
3373 Make it possible to call WeakHashSet::remove and WeakHashSet::contains with
3374 a subclass type U of a type T used to define WeakReference<T>.
3376 Also added computesEmpty, which is slightly more efficient than computeSize
3377 when m_set is either empty or when there are non-released weak references in the set.
3379 * wtf/WeakHashSet.h:
3380 (WTF::WeakHashSet::remove):
3381 (WTF::WeakHashSet::contains const):
3382 (WTF::WeakHashSet::computesEmpty const): Added.
3384 2019-04-04 Yusuke Suzuki <ysuzuki@apple.com>
3386 [WebCore] Put most of derived classes of ScriptWrappable into IsoHeap
3387 https://bugs.webkit.org/show_bug.cgi?id=196475
3389 Reviewed by Saam Barati.
3391 * wtf/ForbidHeapAllocation.h:
3393 * wtf/IsoMallocInlines.h:
3395 2019-04-03 Don Olmstead <don.olmstead@sony.com>
3397 [CMake][WTF] Mirror XCode header directories
3398 https://bugs.webkit.org/show_bug.cgi?id=191662
3400 Reviewed by Konstantin Tokarev.
3402 Rename WTF forwarding header target to WTFFramework and update the install location
3403 to WTF_FRAMEWORK_HEADERS_DIR.
3405 * wtf/CMakeLists.txt:
3407 2019-04-03 Joseph Pecoraro <pecoraro@apple.com>
3409 Web Inspector: Remote Inspector indicate callback should always happen on the main thread
3410 https://bugs.webkit.org/show_bug.cgi?id=196513
3411 <rdar://problem/49498284>
3413 Reviewed by Devin Rousso.
3416 * wtf/cocoa/MainThreadCocoa.mm:
3417 (WTF::dispatchAsyncOnMainThreadWithWebThreadLockIfNeeded):
3418 * wtf/ios/WebCoreThread.cpp:
3419 * wtf/ios/WebCoreThread.h:
3421 2019-04-02 Keith Rollin <krollin@apple.com>
3423 Inhibit CFNetwork logging in private sessions
3424 https://bugs.webkit.org/show_bug.cgi?id=196268
3425 <rdar://problem/48210793>
3427 Fix a conditional in Platform.h where IOS should have been used
3428 instead of IOS_FAMILY. The latter happened to work, but we really want
3429 to be using the proper symbol here.
3431 Reviewed by Alexey Proskuryakov.
3435 2019-04-01 Michael Catanzaro <mcatanzaro@igalia.com>
3437 Stop trying to support building JSC with clang 3.8
3438 https://bugs.webkit.org/show_bug.cgi?id=195947
3439 <rdar://problem/49069219>
3441 Reviewed by Darin Adler.
3443 It seems WebKit hasn't built with clang 3.8 in a while, no devs are using this compiler, we
3444 don't know how much effort it would be to make JSC work again, and it's making the code
3445 worse. Remove my hacks to support clang 3.8 from WTF.
3447 * wtf/MetaAllocator.cpp:
3448 (WTF::MetaAllocator::allocate):
3449 * wtf/text/StringConcatenate.h:
3450 (WTF::tryMakeStringFromAdapters):
3452 2019-03-31 Yusuke Suzuki <ysuzuki@apple.com>
3454 [JSC] Butterfly allocation from LargeAllocation should try "realloc" behavior if collector thread is not active
3455 https://bugs.webkit.org/show_bug.cgi?id=196160
3457 Reviewed by Saam Barati.
3460 (WTF::FastMalloc::tryRealloc):
3462 (Gigacage::tryRealloc):
3465 2019-03-31 Andy Estes <aestes@apple.com>
3467 [iOS] WebKit should consult the navigation response policy delegate before previewing a QuickLook document
3468 https://bugs.webkit.org/show_bug.cgi?id=196433
3469 <rdar://problem/49293305>
3471 Reviewed by Tim Horton.
3473 * wtf/NeverDestroyed.h:
3474 (WTF::NeverDestroyed::operator->):
3475 (WTF::NeverDestroyed::operator-> const):
3477 2019-03-28 Fujii Hironori <Hironori.Fujii@sony.com>
3479 Unreviewed build fix.
3481 * wtf/CMakeLists.txt: Added SpanningTree.h to WTF_PUBLIC_HEADERS.
3483 2019-03-28 Saam Barati <sbarati@apple.com>
3485 BackwardsGraph needs to consider back edges as the backward's root successor
3486 https://bugs.webkit.org/show_bug.cgi?id=195991
3488 Reviewed by Filip Pizlo.
3490 Previously, our backwards graph analysis was slightly wrong. The idea of
3491 backwards graph is that the root of the graph has edges to terminals in
3492 the original graph. And then the original directed edges in the graph are flipped.
3494 However, we weren't considering loops as a form of terminality. For example,
3495 we wouldn't consider an infinite loop as a terminal. So there were no edges
3496 from the root to a node in the infinite loop. This lead us to make mistakes
3497 when we used backwards dominators to compute control flow equivalence.
3499 This is better understood in an example:
3513 In the previous version of this algorithm, the only edge from the backwards
3514 root would be to the block containing the return. This would lead us to
3515 believe that the loading of the structureID backwards dominates the preheader,
3516 leading us to believe it's control flow equivalent to preheader. This is
3517 obviously wrong, since we can loop forever if "v" isn't a cell.
3519 The solution here is to treat any backedge in the graph as a "terminal" node.
3520 Since a backedge implies the existence of a loop.
3522 In the above example, the backwards root now has an edge to both blocks with
3523 "continue". This prevents us from falsely claiming that the return is control
3524 flow equivalent with the preheader.
3526 This patch uses DFS spanning trees to compute back edges. An edge
3527 u->v is a back edge when u is a descendent of v in the DFS spanning
3530 * WTF.xcodeproj/project.pbxproj:
3531 * wtf/BackwardsGraph.h:
3532 (WTF::BackwardsGraph::BackwardsGraph):
3533 * wtf/SpanningTree.h: Added.
3534 (SpanningTree::SpanningTree):
3535 (SpanningTree::isDescendent):
3537 2019-03-28 Tim Horton <timothy_horton@apple.com>
3542 It is no longer necessary to exclude this from PLATFORM(IOSMAC).
3544 2019-03-27 Per Arne Vollan <pvollan@apple.com>
3546 Layout Test js/math-clz32.html is failing
3547 https://bugs.webkit.org/show_bug.cgi?id=196209
3549 Reviewed by Ross Kirsling.
3551 Use the correct number of loop iterations when counting leading zeros. Also, the
3552 count was off by one for the Win64 case.
3557 2019-03-26 Keith Rollin <krollin@apple.com>
3559 Inhibit CFNetwork logging in private sessions
3560 https://bugs.webkit.org/show_bug.cgi?id=196268
3561 <rdar://problem/48210793>
3563 Reviewed by Alex Christensen.
3565 Before performing any logging, the NetworkProcess checks to see if
3566 it's performing an operation associated with a private (ephemeral)
3567 browsing session. If so, it skips the logging. However, networking
3568 layers below the NetworkProcess don't know about private browsing, so
3569 they would still perform their own logging. CFNetwork now has a flag
3570 that lets us control that, so set it to False if private browsing.
3574 2019-03-25 Alex Christensen <achristensen@webkit.org>
3576 Expected shouldn't assume its contained types are copyable
3577 https://bugs.webkit.org/show_bug.cgi?id=195986
3579 Reviewed by JF Bastien.
3582 (std::experimental::fundamentals_v3::__expected_detail::constexpr_base::constexpr_base):
3583 (std::experimental::fundamentals_v3::operator==):
3584 (std::experimental::fundamentals_v3::operator!=):
3586 (std::experimental::fundamentals_v3::unexpected::unexpected):
3588 2019-03-24 Keith Miller <keith_miller@apple.com>
3590 Unreviewed, forgot to refactor variable name for windows build in
3597 2019-03-24 Andy Estes <aestes@apple.com>
3599 [watchOS] Remove unused Proximity Networking code
3600 https://bugs.webkit.org/show_bug.cgi?id=196188
3602 Reviewed by Tim Horton.
3604 * wtf/FeatureDefines.h:
3606 2019-03-23 Keith Miller <keith_miller@apple.com>
3608 Refactor clz/ctz and fix getLSBSet.
3609 https://bugs.webkit.org/show_bug.cgi?id=196162
3611 Reviewed by Saam Barati.
3613 This patch makes clz32/64 and ctz32 generic so they work on any
3614 numeric type. Since these methods work on any type we don't need
3615 to have a separate implementation of getLSBSet, which also
3616 happened to be getMSBSet. This patch also adds getMSBSet as there
3617 may be users who want that in the future.
3624 (getLSBSet): Deleted.
3625 (WTF::clz32): Deleted.
3626 (WTF::clz64): Deleted.
3627 (WTF::ctz32): Deleted.
3629 2019-03-22 Keith Rollin <krollin@apple.com>
3631 Enable ThinLTO support in Production builds
3632 https://bugs.webkit.org/show_bug.cgi?id=190758
3633 <rdar://problem/45413233>
3635 Reviewed by Daniel Bates.
3637 Enable building with Thin LTO in Production when using Xcode 10.2 or
3638 later. This change results in a 1.45% progression in PLT5. Full
3639 Production build times increase about 2-3%. Incremental build times
3640 are more severely affected, and so LTO is not enabled for local
3643 LTO is enabled only on macOS for now, until rdar://problem/49013399,
3644 which affects ARM builds, is fixed.
3646 To change the LTO setting when building locally:
3648 - If building with `make`, specify WK_LTO_MODE={none,thin,full} on the
3650 - If building with `build-webkit`, specify --lto-mode={none,thin,full}
3651 on the command line.
3652 - If building with `build-root`, specify --lto={none,thin,full} on the
3654 - If building with Xcode, create a LocalOverrides.xcconfig file at the
3655 top level of your repository directory (if needed) and define
3656 WK_LTO_MODE to full, thin, or none.
3658 * Configurations/Base.xcconfig:
3660 2019-03-22 Tim Horton <timothy_horton@apple.com>
3662 Fix the build after r243354
3666 2019-03-22 Tim Horton <timothy_horton@apple.com>
3668 Fix the build after r243354
3669 https://bugs.webkit.org/show_bug.cgi?id=196138
3670 <rdar://problem/49145951>
3674 2019-03-21 Eric Carlson <eric.carlson@apple.com>
3676 Add UI process WebRTC runtime logging.
3677 https://bugs.webkit.org/show_bug.cgi?id=196020
3678 <rdar://problem/49071443>
3680 Reviewed by Youenn Fablet.
3683 (WTF::LogArgument::toString): Add long long and unsigned long long variants.
3685 2019-03-20 Simon Fraser <simon.fraser@apple.com>
3687 Rename ENABLE_ACCELERATED_OVERFLOW_SCROLLING macro to ENABLE_OVERFLOW_SCROLLING_TOUCH
3688 https://bugs.webkit.org/show_bug.cgi?id=196049
3690 Reviewed by Tim Horton.
3692 This macro is about the -webkit-overflow-scrolling CSS property, not accelerated
3693 overflow scrolling in general, so rename it.
3695 * wtf/FeatureDefines.h:
3697 2019-03-20 Mark Lam <mark.lam@apple.com>
3699 Open source arm64e code.
3700 https://bugs.webkit.org/show_bug.cgi?id=196012
3701 <rdar://problem/49066237>
3703 Reviewed by Keith Miller.
3705 * WTF.xcodeproj/project.pbxproj:
3708 * wtf/PlatformRegisters.cpp: Added.
3709 (WTF::threadStateLRInternal):
3710 (WTF::threadStatePCInternal):
3711 * wtf/PlatformRegisters.h:
3712 * wtf/PointerPreparations.h:
3713 * wtf/PtrTag.cpp: Added.
3716 (WTF::registerPtrTagLookup):
3717 (WTF::reportBadTag):
3719 (WTF::removeCodePtrTag):
3720 (WTF::tagCodePtrImpl):
3722 (WTF::untagCodePtrImplHelper):
3723 (WTF::untagCodePtrImpl):
3724 (WTF::untagCodePtr):
3725 (WTF::retagCodePtrImplHelper):
3726 (WTF::retagCodePtrImpl):
3727 (WTF::retagCodePtr):
3728 (WTF::tagCFunctionPtrImpl):
3729 (WTF::tagCFunctionPtr):
3730 (WTF::untagCFunctionPtrImpl):
3731 (WTF::untagCFunctionPtr):
3733 (WTF::assertIsCFunctionPtr):
3734 (WTF::assertIsNullOrCFunctionPtr):
3735 (WTF::assertIsNotTagged):
3736 (WTF::assertIsTagged):
3737 (WTF::assertIsNullOrTagged):
3738 (WTF::isTaggedWith):
3739 (WTF::assertIsTaggedWith):
3740 (WTF::assertIsNullOrTaggedWith):
3741 (WTF::usesPointerTagging):
3742 (WTF::registerPtrTagLookup):
3743 (WTF::reportBadTag):
3744 (WTF::tagForPtr): Deleted.
3746 2019-03-20 Keith Rollin <krollin@apple.com>
3748 Update checks that determine if WebKit is system WebKit
3749 https://bugs.webkit.org/show_bug.cgi?id=195756
3751 Reviewed by Alexey Proskuryakov.
3753 The system WebKit can be installed in additional locations, so check
3754 for and allow those, too.
3758 2019-03-20 Michael Catanzaro <mcatanzaro@igalia.com>
3760 Unreviewed, further attempt to fix clang 3.8 build
3761 https://bugs.webkit.org/show_bug.cgi?id=195947
3763 * wtf/MetaAllocator.cpp:
3764 (WTF::MetaAllocator::allocate):
3766 2019-03-20 Michael Catanzaro <mcatanzaro@igalia.com>
3768 REGRESSION(r243115) breaks build for clang 3.8
3769 https://bugs.webkit.org/show_bug.cgi?id=195947
3771 Reviewed by Chris Dumez.
3773 * wtf/text/StringConcatenate.h:
3774 (WTF::tryMakeStringFromAdapters):
3776 2019-03-20 Tim Horton <timothy_horton@apple.com>
3778 Add an platform-driven spell-checking mechanism
3779 https://bugs.webkit.org/show_bug.cgi?id=195795
3781 Reviewed by Ryosuke Niwa.
3786 2019-03-19 Michael Catanzaro <mcatanzaro@igalia.com>
3788 Build cleanly with GCC 9
3789 https://bugs.webkit.org/show_bug.cgi?id=195920
3791 Reviewed by Chris Dumez.
3793 WebKit triggers three new GCC 9 warnings:
3796 -Wdeprecated-copy, implied by -Wextra, warns about the C++11 deprecation of implicitly
3797 declared copy constructor and assignment operator if one of them is user-provided.
3800 Solution is to either add a copy constructor or copy assignment operator, if required, or
3801 else remove one if it is redundant.
3804 -Wredundant-move, implied by -Wextra, warns about redundant calls to std::move.
3805 -Wpessimizing-move, implied by -Wall, warns when a call to std::move prevents copy elision.
3808 These account for most of this patch. Solution is to just remove the bad WTFMove().
3810 Additionally, -Wclass-memaccess has been enhanced to catch a few cases that GCC 8 didn't.
3811 These are solved by casting nontrivial types to void* before using memcpy. (Of course, it
3812 would be safer to not use memcpy on nontrivial types, but that's too complex for this
3813 patch. Searching for memcpy used with static_cast<void*> will reveal other cases to fix.)
3815 * wtf/CheckedArithmetic.h:
3816 (WTF::Checked::Checked):
3817 * wtf/MetaAllocator.cpp:
3818 (WTF::MetaAllocator::allocate):
3819 * wtf/URLParser.cpp:
3820 (WTF::CodePointIterator::operator!= const):
3821 (WTF::CodePointIterator::operator=): Deleted.
3822 * wtf/text/StringView.h:
3823 (WTF::StringView::CodePoints::Iterator::operator=): Deleted.
3825 2019-03-19 Alex Christensen <achristensen@webkit.org>
3827 Make WTFLogChannelState and WTFLogLevel enum classes
3828 https://bugs.webkit.org/show_bug.cgi?id=195904
3830 Reviewed by Eric Carlson.
3832 * wtf/Assertions.cpp:
3835 (WTF::Logger::logAlways const):
3836 (WTF::Logger::error const):
3837 (WTF::Logger::warning const):
3838 (WTF::Logger::info const):
3839 (WTF::Logger::debug const):
3840 (WTF::Logger::willLog const):
3842 * wtf/MemoryPressureHandler.cpp:
3843 * wtf/RefCountedLeakCounter.cpp:
3845 2019-03-19 Michael Catanzaro <mcatanzaro@igalia.com>
3847 Unreviewed, rolling out r243132.
3853 "Make WTFLogChannelState and WTFLogLevel enum classes"
3854 https://bugs.webkit.org/show_bug.cgi?id=195904
3855 https://trac.webkit.org/changeset/243132
3857 2019-03-18 Alex Christensen <achristensen@webkit.org>
3859 Make WTFLogChannelState and WTFLogLevel enum classes
3860 https://bugs.webkit.org/show_bug.cgi?id=195904
3862 Reviewed by Eric Carlson.
3864 * wtf/Assertions.cpp:
3867 (WTF::Logger::logAlways const):
3868 (WTF::Logger::error const):
3869 (WTF::Logger::warning const):
3870 (WTF::Logger::info const):
3871 (WTF::Logger::debug const):
3872 (WTF::Logger::willLog const):
3874 * wtf/MemoryPressureHandler.cpp:
3875 * wtf/RefCountedLeakCounter.cpp:
3877 2019-03-18 Darin Adler <darin@apple.com>
3879 Cut down on use of StringBuffer, possibly leading toward removing it entirely
3880 https://bugs.webkit.org/show_bug.cgi?id=195870
3882 Reviewed by Daniel Bates.
3884 * wtf/URL.cpp: Remove a now-inaccurate comment mentioning StringBuffer.
3886 * wtf/text/StringView.cpp:
3887 (WTF::convertASCIICase): Use createUninitialized instead of StringBuffer.
3889 2019-03-18 Xan Lopez <xan@igalia.com>
3891 [WTF] Remove redundant std::move in StringConcatenate
3892 https://bugs.webkit.org/show_bug.cgi?id=195798
3894 Reviewed by Darin Adler.
3896 Remove redundant calls to WTFMove in return values for this
3897 method. C++ will already do an implicit move here since we are
3898 returning a local value where copy/move elision is not applicable.
3900 * wtf/text/StringConcatenate.h:
3901 (WTF::tryMakeStringFromAdapters):
3903 2019-03-16 Darin Adler <darin@apple.com>
3905 Improve normalization code, including moving from unorm.h to unorm2.h
3906 https://bugs.webkit.org/show_bug.cgi?id=195330
3908 Reviewed by Michael Catanzaro.
3910 * wtf/URLHelpers.cpp: Removed unneeded include of unorm.h since the
3911 normalization code is now in StringView.cpp.
3912 (WTF::URLHelpers::escapeUnsafeCharacters): Renamed from
3913 createStringWithEscapedUnsafeCharacters since it now only creates
3914 a new string if one is needed. Use unsigned for string lengths, since
3915 that's what WTF::String uses, not size_t. Added a first loop so that
3916 we can return the string unmodified if no lookalike characters are
3917 found. Removed unnecessary round trip from UTF-16 and then back in
3918 the case where the character is not a lookalike.
3919 (WTF::URLHelpers::toNormalizationFormC): Deleted. Moved this logic
3920 into the WTF::normalizedNFC function in StringView.cpp.
3921 (WTF::URLHelpers::userVisibleURL): Call escapeUnsafeCharacters and
3922 normalizedNFC. The normalizedNFC function is better in multiple ways,
3923 but primarily it handles 8-bit strings and other already-normalized
3924 strings much more efficiently.
3926 * wtf/text/StringView.cpp:
3927 (WTF::normalizedNFC): Added. This has two overloads. One is for when
3928 we already have a String, and want to re-use it if no normalization
3929 is needed, and another is when we only have a StringView, and may need
3930 to allocate a String to hold the result. Includes a fast special case
3931 for 8-bit and already-normalized strings, and uses the same strategy
3932 that JSC::normalize was already using: calls unorm2_normalize twice,
3933 first just to determine the length.
3935 * wtf/text/StringView.h: Added normalizedNFC, which can be called with
3936 either a StringView or a String. Also moved StringViewWithUnderlyingString
3937 here from JSString.h, here for use as the return value of normalizedNFC;
3938 it is used for a similar purpose in the JavaScriptCore rope implementation.
3939 Also removed an inaccurate comment.
3941 2019-03-16 Diego Pino Garcia <dpino@igalia.com>
3943 [GTK] [WPE] Fix compilation errors due to undefined ALWAYS_LOG_IF
3944 https://bugs.webkit.org/show_bug.cgi?id=195850
3946 Unreviewed build fix after r243033.
3948 * wtf/LoggerHelper.h:
3950 2019-03-15 Per Arne Vollan <pvollan@apple.com>
3952 [iOS] Block the accessibility server when accessibility is not enabled.
3953 https://bugs.webkit.org/show_bug.cgi?id=195342
3955 Reviewed by Brent Fulgham.
3957 Add SPI to issue a mach extension to a process by pid. Also, add a macro for
3958 the availability of this SPI.
3961 * wtf/spi/darwin/SandboxSPI.h:
3963 2019-03-15 Eric Carlson <eric.carlson@apple.com>
3965 Add media stream release logging
3966 https://bugs.webkit.org/show_bug.cgi?id=195823
3968 Reviewed by Youenn Fablet.
3970 * wtf/LoggerHelper.h: Add LOG_IF variants that check a condition before logging.
3972 2019-03-15 Truitt Savell <tsavell@apple.com>
3974 Unreviewed, rolling out r243008.
3976 This revision broke High Sierra builders
3980 "[iOS] Block the accessibility server when accessibility is
3982 https://bugs.webkit.org/show_bug.cgi?id=195342
3983 https://trac.webkit.org/changeset/243008
3985 2019-03-15 Per Arne Vollan <pvollan@apple.com>
3987 [iOS] Block the accessibility server when accessibility is not enabled.
3988 https://bugs.webkit.org/show_bug.cgi?id=195342
3990 Reviewed by Brent Fulgham.
3992 Add SPI to issue a mach extension to a process by pid.
3994 * wtf/spi/darwin/SandboxSPI.h:
3996 2019-03-13 Sam Weinig <sam@webkit.org>
3998 Add utility function to allow easy reverse range-based iteration of a container
3999 https://bugs.webkit.org/show_bug.cgi?id=195542
4001 Reviewed by Antti Koivisto.
4003 Add functions to create an IteratorRange<T> that will iterate a container backwards. It
4004 works with any container that is compatible with std::rbegin() and std::rend(). It is
4005 expected to be used in conjunction with range-based for-loops like so:
4007 for (auto& value : WTF::makeReversedRange(myContainer))
4010 * wtf/IteratorRange.h:
4011 (WTF::makeReversedRange):
4013 2019-03-13 Keith Rollin <krollin@apple.com>
4015 Add support for new StagedFrameworks layout
4016 https://bugs.webkit.org/show_bug.cgi?id=195543
4018 Reviewed by Alexey Proskuryakov.
4020 Opportunistic cleanup: remove unused JAVASCRIPTCORE_FRAMEWORKS_DIR
4023 * Configurations/Base.xcconfig:
4025 2019-03-13 Dominik Infuehr <dinfuehr@igalia.com>
4027 String overflow when using StringBuilder in JSC::createError
4028 https://bugs.webkit.org/show_bug.cgi?id=194957
4030 Reviewed by Mark Lam.
4032 When calculating the new capacity of a StringBuilder object,
4033 use a limit of MaxLength instead of MaxLength+1. Allocating
4034 a string of size MaxLength+1 always fails. This means that expanding
4035 a StringBuilder only worked when the newly doubled capacity is less or
4038 * wtf/text/StringBuilder.cpp:
4040 2019-03-13 Chris Dumez <cdumez@apple.com>
4042 Better build fix after r242901.
4044 Reviewed by Jer Noble.
4047 (WTF::LogArgument::toString):
4049 2019-03-13 Jer Noble <jer.noble@apple.com>
4051 Add AggregateLogger, a Logger specialization for singleton classes.
4052 https://bugs.webkit.org/show_bug.cgi?id=195644
4054 Reviewed by Eric Carlson.
4056 Add a new class, AggregateLogger, which will log messages to each of its aggregated loggers.
4058 Drive-by fixes: allow "const void*" to be directly logged by converting the pointer to a hex string.
4060 * WTF.xcodeproj/project.pbxproj:
4061 * wtf/AggregateLogger.h: Added.
4062 (WTF::AggregateLogger::create):
4063 (WTF::AggregateLogger::addLogger):
4064 (WTF::AggregateLogger::removeLogger):
4065 (WTF::AggregateLogger::logAlways const):
4066 (WTF::AggregateLogger::error const):
4067 (WTF::AggregateLogger::warning const):
4068 (WTF::AggregateLogger::info const):
4069 (WTF::AggregateLogger::debug const):
4070 (WTF::AggregateLogger::willLog const):
4071 (WTF::AggregateLogger::AggregateLogger):
4072 (WTF::AggregateLogger::log const):
4078 2019-03-12 Commit Queue <commit-queue@webkit.org>
4080 Unreviewed, rolling out r242747.
4081 https://bugs.webkit.org/show_bug.cgi?id=195641
4083 Performance measurement is difficult in this period, rolling
4084 out it and rolling in later to isolate it from the other
4085 sensitive patches (Requested by yusukesuzuki on #webkit).
4089 "[JSC] Make StaticStringImpl & StaticSymbolImpl actually
4091 https://bugs.webkit.org/show_bug.cgi?id=194212
4092 https://trac.webkit.org/changeset/242747
4094 2019-03-12 Robin Morisset <rmorisset@apple.com>
4096 A lot more classes have padding that can be reduced by reordering their fields
4097 https://bugs.webkit.org/show_bug.cgi?id=195579
4099 Reviewed by Mark Lam.
4101 * wtf/CrossThreadQueue.h:
4103 * wtf/MemoryPressureHandler.h:
4104 * wtf/MetaAllocator.h:
4105 * wtf/Threading.cpp:
4107 2019-03-11 Alex Christensen <achristensen@webkit.org>
4109 WTF::Expected should use std::addressof instead of operator&
4110 https://bugs.webkit.org/show_bug.cgi?id=195604
4112 Reviewed by Myles Maxfield.
4114 The latter was causing problems with types that do tricky things with constructors and operator&,
4115 specifically UniqueRef but I made a reduced test case. When it used operator&, it would get the contained
4116 type and call the constructor that takes a contained type instead of the move constructor.
4119 (std::experimental::fundamentals_v3::__expected_detail::base::base):
4120 (std::experimental::fundamentals_v3::expected::swap):
4122 2019-03-11 Ross Kirsling <ross.kirsling@sony.com>
4124 Add Optional to Forward.h.
4125 https://bugs.webkit.org/show_bug.cgi?id=195586
4127 Reviewed by Darin Adler.
4130 Add forward declaration for Optional.
4135 * wtf/MemoryFootprint.h:
4136 * wtf/URLHelpers.cpp:
4138 * wtf/cocoa/CPUTimeCocoa.cpp:
4139 * wtf/fuchsia/CPUTimeFuchsia.cpp:
4140 * wtf/unix/CPUTimeUnix.cpp:
4141 * wtf/win/CPUTimeWin.cpp:
4142 Remove unnecessary includes from headers.
4144 2019-03-11 Andy Estes <aestes@apple.com>
4146 [Apple Pay] Use PKPaymentAuthorizationController to present the Apple Pay UI remotely from the Networking service on iOS
4147 https://bugs.webkit.org/show_bug.cgi?id=195530
4148 <rdar://problem/48747164>
4150 Reviewed by Alex Christensen.
4152 * wtf/FeatureDefines.h: Defined ENABLE_APPLE_PAY_REMOTE_UI.
4154 2019-03-11 Yusuke Suzuki <ysuzuki@apple.com>
4156 [JSC] Make StaticStringImpl & StaticSymbolImpl actually static
4157 https://bugs.webkit.org/show_bug.cgi?id=194212
4159 Reviewed by Mark Lam.
4161 Avoid mutation onto refcounts if `isStatic()` returns true so that the content of StaticStringImpl never gets modified.
4163 * wtf/text/StringImpl.h:
4164 (WTF::StringImpl::ref):
4165 (WTF::StringImpl::deref):
4167 2019-03-11 Sihui Liu <sihui_liu@apple.com>
4169 Crash under WebCore::IDBDatabase::connectionToServerLost
4170 https://bugs.webkit.org/show_bug.cgi?id=195563
4171 <rdar://problem/37193655>
4173 CrossThreadTask should protect callee if it is ThreadSafeRefCounted.
4175 Reviewed by Geoffrey Garen.
4177 * wtf/CrossThreadTask.h:
4178 (WTF::createCrossThreadTask):
4180 2019-03-11 Ryan Haddad <ryanhaddad@apple.com>
4182 Unreviewed, rolling out r242688, r242643, r242624.
4184 Caused multiple layout test failures and crashes on iOS and macOS.
4188 "requestAnimationFrame should execute before the next frame"
4189 https://bugs.webkit.org/show_bug.cgi?id=177484
4190 https://trac.webkit.org/changeset/242624/webkit
4192 * wtf/SystemTracing.h:
4194 2019-03-11 Darin Adler <darin@apple.com>
4196 Specify fixed precision explicitly to prepare to change String::number and StringBuilder::appendNumber floating point behavior
4197 https://bugs.webkit.org/show_bug.cgi?id=195533
4199 Reviewed by Brent Fulgham.
4201 Soon, we will change String::number and StringBuilder::appendNumber for floating
4202 point to use "shortest form" serialization instead of the current default, which is
4203 "6-digit fixed precision stripping trailing zeros". To prepare to do this safely
4204 without accidentally changing any behavior, changing callers to call the explicit
4205 versions. Later, we may want to return and change many of them to use shortest form
4206 instead, but that may require rebaselining tests, and in some extreme cases, getting
4207 rid of flawed logic that converts between different single and double precision
4208 floating point; such problems may be hidden by fixed precision serialization.
4210 Since "shortest form" is already the behavior for AtomicString::number and
4211 for makeString, no changes required for clients of either of those.
4214 (WTF::LogArgument::toString): Use numberToStringFixedPrecision.
4215 * wtf/MediaTime.cpp:
4216 (WTF::MediaTime::toString const): Use appendFixedPrecisionNumber.
4217 * wtf/text/ValueToString.h:
4218 (WTF::ValueToString<float>::string): Use numberToStringFixedPrecision.
4219 (WTF::ValueToString<double>::string): Ditto.
4221 2019-03-11 Truitt Savell <tsavell@apple.com>
4223 Unreviewed, rolling out r242702.
4225 Broke High Sierra builders.
4229 "Add utility function to allow easy reverse range-based
4230 iteration of a container"
4231 https://bugs.webkit.org/show_bug.cgi?id=195542
4232 https://trac.webkit.org/changeset/242702
4234 2019-03-11 Sam Weinig <sam@webkit.org>
4236 Add utility function to allow easy reverse range-based iteration of a container
4237 https://bugs.webkit.org/show_bug.cgi?id=195542
4239 Reviewed by Antti Koivisto.
4241 Add functions to create an IteratorRange<T> that will iterate a container backwards. It
4242 works with any container that is compatible with std::rbegin() and std::rend(). It is
4243 expected to be used in conjunction with range-based for-loops like so:
4245 for (auto& value : WTF::makeReversedRange(myContainer))
4248 * wtf/IteratorRange.h:
4249 (WTF::makeReversedRange):
4251 2019-03-10 Yusuke Suzuki <utatane.tea@gmail.com> and Fujii Hironori <Hironori.Fujii@sony.com>
4253 [WTF] Align assumption in RunLoopWin to the other platform's RunLoop
4254 https://bugs.webkit.org/show_bug.cgi?id=181151
4256 Reviewed by Don Olmstead.
4258 This patch fixes RunLoop in Windows to align it to the implementations in the other platforms
4259 to use RunLoop more aggressively.
4262 (WTF::RunLoop::Timer::Timer):
4263 * wtf/win/MainThreadWin.cpp:
4264 (initializeMainThreadPlatform): Call RunLoop::registerRunLoopMessageWindowClass.
4265 * wtf/win/RunLoopWin.cpp:
4266 (WTF::RunLoop::wndProc):
4267 (WTF::RunLoop::iterate):
4268 (WTF::RunLoop::stop):
4269 PostQuitMessage is only available in the RunLoop's thread. We should post a message and call
4270 it inside this task.
4272 (WTF::RunLoop::registerRunLoopMessageWindowClass):
4273 Changed the return type from bool to void, and added RELEASE_ASSERT to check the return value of RegisterClass.
4275 (WTF::RunLoop::~RunLoop):
4276 When the RunLoop's thread is freed, its associated window is freed. We do not need to do here.
4278 (WTF::RunLoop::TimerBase::timerFired):
4279 (WTF::RunLoop::TimerBase::TimerBase):
4280 (WTF::RunLoop::TimerBase::start):
4281 (WTF::RunLoop::TimerBase::stop):
4282 (WTF::RunLoop::TimerBase::isActive const):
4283 (WTF::RunLoop::TimerBase::secondsUntilFire const):
4284 (WTF::generateTimerID): Deleted.
4285 We can use TimerBase's pointer as ID since it is uintptr_t.
4287 2019-03-07 Said Abou-Hallawa <sabouhallawa@apple.com>
4289 requestAnimationFrame should execute before the next frame
4290 https://bugs.webkit.org/show_bug.cgi?id=177484
4292 Reviewed by Simon Fraser.
4294 Add trace points for the page RenderingUpdate.
4296 * wtf/SystemTracing.h:
4298 2019-03-06 Ross Kirsling <ross.kirsling@sony.com>
4300 [Win] Remove -DUCHAR_TYPE=wchar_t stopgap and learn to live with char16_t.
4301 https://bugs.webkit.org/show_bug.cgi?id=195346
4303 Reviewed by Fujii Hironori.
4305 * wtf/PlatformWin.cmake: