blob: a4c8951051ad3de5fc9292377680f93467d6d854 [file] [log] [blame]
2020-08-11 Wenson Hsieh <wenson_hsieh@apple.com>
Text input autocorrect="off" attribute ignored on Mac
https://bugs.webkit.org/show_bug.cgi?id=151019
<rdar://problem/65061700>
Reviewed by Simon Fraser.
* wtf/PlatformEnableCocoa.h: Turn the feature on for macOS.
2020-08-10 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Migrate from CTFontTransformGlyphsWithLanguage() to CTFontShapeGlyphs()
https://bugs.webkit.org/show_bug.cgi?id=215059
Reviewed by Darin Adler.
* wtf/PlatformUse.h: Rename CTFONTTRANSFORMGLYPHSWITHLANGUAGE to CTFONTSHAPEGLYPHS,
because that's the new function.
2020-08-09 Ben Nham <nham@apple.com>
Preload graphics drivers in Mac WebProcess
https://bugs.webkit.org/show_bug.cgi?id=215183
Reviewed by Darin Adler.
Enable GPU driver preheating in versions of the OS that might not have the drivers in the dyld
shared cache due to size restrictions.
* wtf/PlatformEnableCocoa.h:
2020-08-09 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r263195, r263252, and r265394.
https://bugs.webkit.org/show_bug.cgi?id=215312
Revert all related GC Bitmap changes because some of perf is
not fully recovered
Reverted changesets:
"Replace JSC::FreeList linked list with a Bitmap."
https://bugs.webkit.org/show_bug.cgi?id=213071
https://trac.webkit.org/changeset/263195
"Unify Bitmap math loops in
MarkedBlock::Handle::specializedSweep()."
https://bugs.webkit.org/show_bug.cgi?id=213345
https://trac.webkit.org/changeset/263252
"[JSC] Disable ENABLE_BITMAP_FREELIST"
https://bugs.webkit.org/show_bug.cgi?id=215285
https://trac.webkit.org/changeset/265394
2020-08-08 Joonghun Park <jh718.park@samsung.com>
[WTF] Remove the build warning since r265344.
https://bugs.webkit.org/show_bug.cgi?id=215269
warning: parameter ‘integer’ set but not used [-Wunused-but-set-parameter]
* wtf/text/IntegerToStringConversion.h:
(WTF::lengthOfIntegerAsString):
2020-08-07 John Wilander <wilander@apple.com>
Experimental: Cap the expiry of persistent cookies set in 3rd-party CNAME cloaked HTTP responses
https://bugs.webkit.org/show_bug.cgi?id=215201
<rdar://problem/57454633>
Reviewed by Brent Fulgham. Also reviewed and commented on by Chris Dumez, Jiten Mehta, Sam Weinig, and Alex Christensen.
This change defines HAVE_CFNETWORK_CNAME_AND_COOKIE_TRANSFORM_SPI.
* wtf/PlatformHave.h:
2020-08-07 Saam Barati <sbarati@apple.com>
Use thread_switch instead of switch_pri to drop priority to zero for 1ms instead of 10
https://bugs.webkit.org/show_bug.cgi?id=215248
Reviewed by Yusuke Suzuki.
This seems to be a slight JetStream2 and Speedometer2 speedup. In the
range of 0%-0.75%, depending on device.
* wtf/posix/ThreadingPOSIX.cpp:
(WTF::Thread::yield):
2020-08-07 Robin Morisset <rmorisset@apple.com>
Fix inequality in newly added assertion
https://bugs.webkit.org/show_bug.cgi?id=215272
Reviewed by Alexey Proskuryakov.
No new tests, as it was caught by our testing infrastructure (not sure why it only got caught after landing).
* wtf/IndexSparseSet.h:
(WTF::OverflowHandler>::validate):
2020-08-07 Robin Morisset <rmorisset@apple.com>
IndexSparseSet::sort() should update m_map
https://bugs.webkit.org/show_bug.cgi?id=215100
Reviewed by Yusuke Suzuki and Mark Lam.
IndexSparseSet is made of two fields: m_values and m_map, and the two must be kept in sync.
But its sort routine currently only sorts m_values.
This might be related to a random crash that seems to occasionally occur in the vicinity of this code in the wild (rdar://problem/64594569)
I added a validation routine, that I run in the tests that I added to TestWTF.
I verified, and without the fix, the validation routine fails after the sorting.
I also fixed remove() which was wrong on non-trivial types (thanks to Mark for catching this other bug).
* wtf/IndexSparseSet.h:
(WTF::OverflowHandler>::remove):
(WTF::OverflowHandler>::sort):
(WTF::OverflowHandler>::validate):
2020-08-07 Youenn Fablet <youenn@apple.com>
Introduce a Vector::isolatedCopy() &&
https://bugs.webkit.org/show_bug.cgi?id=215160
Reviewed by Alex Christensen.
By introducing an isolatedCopy() &&, we remove the need to allocate a vector buffer.
This can make a Vector<String>::isolatedCopy() allocate no memory at all in cases like RegistrationDatabase::schedulePushChanges.
* wtf/Vector.h:
(WTF::Malloc>::isolatedCopy const):
(WTF::Malloc>::isolatedCopy):
2020-08-06 David Kilzer <ddkilzer@apple.com>
WTF::makeString() should handle enum values
<https://webkit.org/b/214906>
Reviewed by Sam Weinig.
* wtf/text/IntegerToStringConversion.h:
(WTF::numberToStringSigned):
- Drive-by fix to change std::make_unsigned<>::type to
std::make_unsigned_t<>.
(WTF::writeNumberToBufferImpl): Delete.
(WTF::writeIntegerToBufferImpl):
- Rename from WTF::writeNumberToBufferImpl().
(WTF::writeNumberToBufferSigned): Delete.
(WTF::writeNumberToBufferUnsigned): Delete.
(WTF::writeIntegerToBuffer):
- Replace WTF::writeNumberToBufferSigned() and
WTF::writeNumberToBufferUnsigned() with a single function that
uses constexpr checks to let the compiler eliminate code. Had
to use if/else if/else construct to help the compiler
eliminate unused cases.
(WTF::lengthOfNumberAsStringImpl): Delete.
(WTF::lengthOfIntegerAsStringImpl):
- Rename from WTF::lengthOfNumberAsStringImpl().
(WTF::lengthOfNumberAsStringSigned): Delete.
(WTF::lengthOfNumberAsStringUnsigned): Delete.
(WTF::lengthOfIntegerAsString):
- Replace WTF::lengthOfNumberAsStringSigned() and
WTF::lengthOfNumberAsStringUnsigned() with a single function
that uses constexpr checks to let the compiler eliminate code.
Had to use if/else if/else construct to help the compiler
eliminate unused cases.
* wtf/text/StringConcatenateNumbers.h:
(WTF::StringTypeAdapter<SignedInt, ...>): Deleted.
(WTF::StringTypeAdapter<UnignedInt, ...>): Deleted.
(WTF::StringTypeAdapter<Integer, ...>):
- Combine signed/unsigned templated classes into a single class
now that WTF::lengthOfIntegerAsString() and
WTF::writeIntegerToBuffer() are templated.
(WTF::StringTypeAdapter<Enum, ...>):
- Add support for enum types to WTF::makeString(). This also
takes advantage of templated WTF::lengthOfIntegerAsString()
and WTF::writeIntegerToBuffer() functions since enum types may
be either signed or unsigned.
2020-08-05 Tim Horton <timothy_horton@apple.com>
Remove all references to non-existent 10.16
https://bugs.webkit.org/show_bug.cgi?id=215202
Reviewed by Wenson Hsieh.
* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* wtf/PlatformEnableCocoa.h:
* wtf/PlatformHave.h:
* wtf/PlatformUse.h:
2020-08-04 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Use LazyNeverDestroyed & std::call_once for complex singletons
https://bugs.webkit.org/show_bug.cgi?id=215153
<rdar://problem/65718983>
Reviewed by Mark Lam.
Add lock's bits in crash information to investigate if this speculative fix does not work.
* wtf/LockAlgorithmInlines.h:
(WTF::Hooks>::lockSlow):
(WTF::Hooks>::unlockSlow):
2020-08-04 Keith Miller <keith_miller@apple.com>
CheckpointSideState shoud play nicely with StackOverflowException unwinding.
https://bugs.webkit.org/show_bug.cgi?id=215114
Reviewed by Saam Barati.
Add a helper so we can have soft stack bounds.
* wtf/StackBounds.h:
(WTF::StackBounds::withSoftOrigin const):
2020-08-04 Fujii Hironori <Hironori.Fujii@sony.com>
[MSVC] wtf/Optional.h: error C2280: 'WTF::constexpr_storage_t<T> &WTF::constexpr_storage_t<T>::operator =(const WTF::constexpr_storage_t<T> &)': attempting to reference a deleted function
https://bugs.webkit.org/show_bug.cgi?id=215003
Reviewed by Yusuke Suzuki.
Microsoft reported the upcoming MSVC can't compile
Optional<std::pair<JSC::SamplingProfiler::StackFrame::CodeLocation,JSC::CodeBlock *>>.
> wtf/Optional.h(419,39): error C2280: 'WTF::constexpr_storage_t<T> &WTF::constexpr_storage_t<T>::operator =(const WTF::constexpr_storage_t<T> &)': attempting to reference a deleted function
They suggests using std::is_trivially_copy_assignable_v in
Optional ctor instead of std::is_trivially_copyable_v.
* wtf/Optional.h:
(WTF::Optional::Optional): Replaced std::is_trivially_copyable_v with std::is_trivially_copy_assignable_v.
2020-08-04 Alex Christensen <achristensen@webkit.org>
about: scheme URL constants should be backed by StaticStringImpl
https://bugs.webkit.org/show_bug.cgi?id=215113
Reviewed by Darin Adler.
* wtf/URL.cpp:
(WTF::aboutBlankURL):
(WTF::aboutSrcDocURL):
2020-08-03 Wenson Hsieh <wenson_hsieh@apple.com>
Remove the ENABLE_DATA_INTERACTION feature flag
https://bugs.webkit.org/show_bug.cgi?id=215091
Reviewed by Megan Gardner.
* wtf/PlatformEnable.h:
* wtf/PlatformEnableCocoa.h:
2020-08-01 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r265097, r265113, and r265122.
https://bugs.webkit.org/show_bug.cgi?id=215065
Broke AppleSilicon Big Sur
Reverted changesets:
"Strip pointers instead of authing for byteOffset to not allow
for a possible way to guess data pac"
https://bugs.webkit.org/show_bug.cgi?id=214952
https://trac.webkit.org/changeset/265097
"Compute number of PAC bits from what the OS says its address
space is"
https://bugs.webkit.org/show_bug.cgi?id=214986
https://trac.webkit.org/changeset/265113
"Remove UB from nonPACBitsMask computation"
https://bugs.webkit.org/show_bug.cgi?id=214996
https://trac.webkit.org/changeset/265122
2020-07-30 Simon Fraser <simon.fraser@apple.com>
Have TimingScope track the max event duration
https://bugs.webkit.org/show_bug.cgi?id=215006
Reviewed by Tim Horton.
Have TimingScope track and print the longest event, as well as the count and
mean duration.
* wtf/TimingScope.cpp:
(WTF::TimingScope::scopeDidEnd):
2020-07-30 Keith Miller <keith_miller@apple.com>
Remove UB from nonPACBitsMask computation
https://bugs.webkit.org/show_bug.cgi?id=214996
Reviewed by Tadeu Zagallo.
For non-ARM64E we now set numberOfPACBits to zero, which was causing UB in our computation of the nonPACBitsMask.
* wtf/CagedPtr.h:
2020-07-30 Jer Noble <jer.noble@apple.com>
[Cocoa] Adopt -[AVContentKeyRequest willOutputBeObscuredDueToInsufficientExternalProtectionForDisplays:]
https://bugs.webkit.org/show_bug.cgi?id=214659
<rdar://problem/63555006>
Reviewed by Darin Adler.
Add a new Observer template class. This allows classes to provide support for listeners without requiring
those listeners to subclass from a pure-virtual (and CanMakeWeakPtr capable) client class. Instead, clients
can just create one of these Observer objects, and pass a WeakPtr to that observer to the notifying object.
When the client object destroys the observer, it is automatically unregistered when the observing object
uses a WeakHashSet.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/Observer.h: Added.
(WTF::Observer<Out):
2020-07-30 Keith Miller <keith_miller@apple.com>
Compute number of PAC bits from what the OS says its address space is
https://bugs.webkit.org/show_bug.cgi?id=214986
Reviewed by Saam Barati.
* wtf/CagedPtr.h:
* wtf/PtrTag.h:
2020-07-29 Fujii Hironori <Hironori.Fujii@sony.com>
[Win Debug] Unreviewed build fix
> JavaScriptCore/runtime/JSArrayBufferView.cpp(51): error C2660: 'Gigacage::isEnabled': function does not take 0 arguments
* wtf/Gigacage.h:
(Gigacage::isEnabled): Added isEnabled taking no argument which was adeed to bmalloc in r249556 (Bug 201521).
2020-07-29 Don Olmstead <don.olmstead@sony.com>
Remove USE(ZLIB)
https://bugs.webkit.org/show_bug.cgi?id=214929
Reviewed by Darin Adler.
Remove setting a default value of USE_ZLIB.
* wtf/PlatformUse.h:
2020-07-28 Karl Rackler <rackler@apple.com>
Unreviewed, reverting r264955.
Reverting because this commit may have caused issues with
tests.
Reverted changeset:
"WebCoreResourceHandleAsOperationQueueDelegate can use
RunLoop::dispatch"
https://bugs.webkit.org/show_bug.cgi?id=214771
https://trac.webkit.org/changeset/264955
2020-07-27 Geoffrey Garen <ggaren@apple.com>
WebCoreResourceHandleAsOperationQueueDelegate can use RunLoop::dispatch
https://bugs.webkit.org/show_bug.cgi?id=214771
Reviewed by Darin Adler.
* wtf/cf/RunLoopCF.cpp:
(WTF::RunLoop::dispatch): Migrated the optimization from
WebCoreResourceHandleAsOperationQueueDelegate. All Cocoa WebViews begin
life with a single SchedulePair scheduled in kCFRunLoopCommonModes, so
this optimization is the common case.
(Note that I did not copy the kCFRunLoopDefaultMode clause from
the WebCoreResourceHandleAsOperationQueueDelegate optimization. That's
because it's not the common case, and also because it's not correct to
do a vanilla disptach() in the case of kCFRunLoopDefaultMode because a
vanilla dispatch() would use kCFRunLoopCommonModes.)
2020-07-27 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Disable BIGINT32 optimization temporarily because of SP2 / JS2 regression
https://bugs.webkit.org/show_bug.cgi?id=214776
Reviewed by Darin Adler.
We disable BIGINT32 optimization because it causes 1% regression in JetStream2 and Speedometer2.
We should enable it after we fix the cause of regression.
* wtf/PlatformUse.h:
2020-07-27 Carlos Garcia Campos <cgarcia@igalia.com>
[WPE][GTK] Add API to support "Privacy Report"
https://bugs.webkit.org/show_bug.cgi?id=213493
Reviewed by Adrian Perez de Castro.
Add support for using GRefPtr with GDateTime.
* wtf/glib/GRefPtr.cpp:
(WTF::refGPtr):
(WTF::derefGPtr):
* wtf/glib/GRefPtr.h:
2020-07-23 Keith Miller <keith_miller@apple.com>
iOS simulator does not support WebAssembly
https://bugs.webkit.org/show_bug.cgi?id=191064
Reviewed by Yusuke Suzuki.
Now that it seems we can JIT in the Simulator we should enable
WebAssembly there. This just means enabling FTL/B3 so WASM gets
enabled.
* wtf/PlatformEnable.h:
* wtf/PlatformEnableCocoa.h:
2020-07-23 Aditya Keerthi <akeerthi@apple.com>
[macOS] Datalist dropdown scrollbar position does not match visible region
https://bugs.webkit.org/show_bug.cgi?id=214656
Reviewed by Wenson Hsieh.
* wtf/PlatformHave.h: Define HAVE_NSTABLEVIEWSTYLE.
2020-07-23 Brady Eidson <beidson@apple.com>
Add Gamepad tests that exercise the native frameworks
<rdar://problem/65343674> and https://bugs.webkit.org/show_bug.cgi?id=214188
Reviewed by Tim Horton.
* wtf/PlatformHave.h:
2020-07-23 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r264745.
https://bugs.webkit.org/show_bug.cgi?id=214681
Broke 3 web-platform-tests on iOS
Reverted changeset:
"iOS simulator does not support WebAssembly"
https://bugs.webkit.org/show_bug.cgi?id=191064
https://trac.webkit.org/changeset/264745
2020-07-22 Jer Noble <jer.noble@apple.com>
[Cocoa] Add feature flag for WebM & VP9
https://bugs.webkit.org/show_bug.cgi?id=214672
<rdar://problem/65959506>
Reviewed by Beth Dakin.
* wtf/PlatformEnableCocoa.h:
2020-07-22 Conrad Shultz <conrad_shultz@apple.com>
Update macOS Version macros
https://bugs.webkit.org/show_bug.cgi?id=214653
Reviewed by Tim Horton.
* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* wtf/PlatformHave.h:
2020-07-22 Keith Miller <keith_miller@apple.com>
iOS simulator does not support WebAssembly
https://bugs.webkit.org/show_bug.cgi?id=191064
Reviewed by Yusuke Suzuki.
Now that it seems we can JIT in the Simulator we should enable
WebAssembly there. This just means enabling FTL/B3 so WASM gets
enabled.
* wtf/PlatformEnable.h:
* wtf/PlatformEnableCocoa.h:
2020-07-22 Geoffrey Garen <ggaren@apple.com>
WTF::Function adoption should be explicit instead of implicit
https://bugs.webkit.org/show_bug.cgi?id=214654
Reviewed by Darin Adler.
* wtf/Function.h:
(WTF::Function<Out):
(WTF::adoptImpl): Added an adopt function for Functions and made the
adopting constructor private.
* wtf/cf/RunLoopCF.cpp:
(WTF::RunLoop::dispatch): Use new adopt function.
2020-07-22 Jer Noble <jer.noble@apple.com>
Unreviewed build fix after r264710; add a HAVE_AVPLAYER_VIDEORANGEOVERRIDE guard.
* wtf/PlatformHave.h:
2020-07-22 Geoffrey Garen <ggaren@apple.com>
JSRunLoopTimer should use WTF::RunLoop rather than custom CF code
https://bugs.webkit.org/show_bug.cgi?id=214102
Unreviewed, re-landing r264242 with crash fixed.
To support JSC using external locking around a RunLoop timer, we needed
to avoid modifying unsynchronized timer state while firing.
* wtf/cf/RunLoopCF.cpp:
(WTF::RunLoop::TimerBase::start):
2020-07-21 Eric Carlson <eric.carlson@apple.com>
Use AVRoutePickerView when available for choosing AirPlay devices
https://bugs.webkit.org/show_bug.cgi?id=213497
<rdar://problem/58610662>
Reviewed by Jer Noble.
* wtf/PlatformHave.h: Define HAVE_AVROUTEPICKERVIEW.
2020-07-20 Yusuke Suzuki <ysuzuki@apple.com>
[ECMA-402] Implement Intl.DisplayNames
https://bugs.webkit.org/show_bug.cgi?id=209779
Reviewed by Ross Kirsling.
* wtf/text/StringView.h:
2020-07-20 Adrian Perez de Castro <aperez@igalia.com>
Non unified build fixes, midsummer 2020 edition
https://bugs.webkit.org/show_bug.cgi?id=213616
Unreviewed build fix.
* wtf/text/StringParsingBuffer.h: Add missing inclusion of wtf/text/StringView.h,
and removed other now-unneeded header inclusions.
2020-07-19 Geoffrey Garen <ggaren@apple.com>
There should be only one RunLoop Timer class
https://bugs.webkit.org/show_bug.cgi?id=214340
Reviewed by Darin Adler.
RunLoop::Timer wins. RunLoopTimer loses.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/PlatformHave.h:
* wtf/PlatformMac.cmake: Remove RunLoopTimer.
* wtf/RunLoop.cpp:
(WTF::RunLoop::dispatchAfter): While we're here. let's make dispatchAfter
available on all platforms. We had cross-platform code, but it was
factored to be needlessly platform-specific.
* wtf/RunLoop.h: Added a version of dispatch() that accepts a
SchedulePairHashSet for Cocoa. Removed some indirection from timer
stuff, since it was confusing me. Consistently named all time intervals
"interval".
* wtf/RunLoopTimer.h: Removed.
* wtf/cf/RunLoopCF.cpp:
(WTF::createTimer): Factored out a helper function for dispatch() to use.
(WTF::RunLoop::dispatch): This function is the meat of the patch. It's
the only unique functionality that RunLoopTimer used to provide.
(WTF::RunLoop::TimerBase::start): Adopted helper function.
(WTF::RunLoop::runForDuration): Deleted.
(WTF::RunLoop::TimerBase::timerFired): Deleted.
* wtf/cf/RunLoopTimerCF.cpp: Removed.
* wtf/generic/RunLoopGeneric.cpp:
(WTF::RunLoop::dispatchAfter): Deleted. Now cross-platform.
* wtf/glib/RunLoopGLib.cpp:
(WTF::RunLoop::TimerBase::updateReadyTime):
(WTF::RunLoop::TimerBase::start):
(WTF::RunLoop::TimerBase::stop):
(WTF::DispatchAfterContext::DispatchAfterContext): Deleted.
(WTF::DispatchAfterContext::dispatch): Deleted.
(WTF::RunLoop::dispatchAfter): Deleted. Now cross-platform.
* wtf/win/RunLoopWin.cpp:
(WTF::RunLoop::TimerBase::start):
(WTF::RunLoop::dispatchAfter): Deleted. Now cross-platform.
2020-07-17 Sam Weinig <weinig@apple.com>
Remove final vestigates of SimpleColor
https://bugs.webkit.org/show_bug.cgi?id=214439
Reviewed by Simon Fraser.
* wtf/KeyValuePair.h:
(WTF::KeyValuePair::KeyValuePair):
Add overload of constructor that is not a template function to aid deduction
when using std::initializer_lists to contruct a HashMap.
2020-07-17 Fujii Hironori <Hironori.Fujii@sony.com>
Don't include <wtf/text/WTFString.h> in SVGParserUtilities.h
https://bugs.webkit.org/show_bug.cgi?id=214320
Reviewed by Darin Adler.
* wtf/Forward.h: Added foward declarations for template specializations of DefaultHash.
2020-07-17 Keith Miller <keith_miller@apple.com>
Fix 32-bit debug watchos build
https://bugs.webkit.org/show_bug.cgi?id=214480
Reviewed by Michael Saboff.
subtracting pointers produces a ptrdiff_t but on 32-bit that's the same
as an int. Since we were comparing that to an unsigned that triggered
the signed comparison warning, which broke the build.
* wtf/text/StringParsingBuffer.h:
2020-07-17 Truitt Savell <tsavell@apple.com>
Unreviewed, reverting r264482.
Part of an attempted fix for the build
Reverted changeset:
"Use AVRoutePickerView when available for choosing AirPlay
devices"
https://bugs.webkit.org/show_bug.cgi?id=213497
https://trac.webkit.org/changeset/264482
2020-07-16 Xabier Rodriguez Calvar <calvaris@igalia.com>
Rename createBoxPtr into adoptBoxPtr
https://bugs.webkit.org/show_bug.cgi?id=214171
Reviewed by Darin Adler.
* wtf/BoxPtr.h:
(WTF::adoptInBoxPtr):
2020-07-16 Per Arne Vollan <pvollan@apple.com>
XPC connection should be suspended before setting target queue
https://bugs.webkit.org/show_bug.cgi?id=214427
Reviewed by Darin Adler.
Declare function to suspend XPC connection.
* wtf/spi/darwin/XPCSPI.h:
2020-07-16 Fujii Hironori <Hironori.Fujii@sony.com>
[WTF] Remove the unnecessary inner class DefaultHash<T>::Hash
https://bugs.webkit.org/show_bug.cgi?id=214389
Reviewed by Darin Adler.
DefaultHash<T> doesn't need to have a inner struct Hash. This can
be a problem for forward declarations (Bug 214320 Comment 5).
* wtf/BitVector.h:
* wtf/Forward.h:
* wtf/HashFunctions.h:
(WTF::PairHash::hash):
(WTF::PairHash::equal):
(WTF::TupleHash::hash):
(WTF::TupleHash::equal):
* wtf/ListHashSet.h:
* wtf/LoggingHashMap.h:
* wtf/LoggingHashSet.h:
* wtf/MetaAllocatorPtr.h:
* wtf/ObjectIdentifier.h:
* wtf/OptionSetHash.h:
(WTF::DefaultHash<OptionSet<T>>::hash):
(WTF::DefaultHash<OptionSet<T>>::equal):
(WTF::DefaultHash<OptionSet<T>>::Hash::hash): Deleted.
(WTF::DefaultHash<OptionSet<T>>::Hash::equal): Deleted.
* wtf/Packed.h:
* wtf/RetainPtr.h:
* wtf/StackShot.h:
* wtf/URLHash.h:
* wtf/VectorHash.h:
(WTF::VectorHash::hash):
* wtf/text/AtomString.h:
* wtf/text/AtomStringHash.h:
* wtf/text/CString.h:
* wtf/text/StringHash.h:
* wtf/text/StringImpl.h:
* wtf/text/SymbolRegistry.h:
(WTF::DefaultHash<SymbolRegistryKey>::hash):
(WTF::DefaultHash<SymbolRegistryKey>::equal):
(WTF::DefaultHash<SymbolRegistryKey>::Hash::hash): Deleted.
(WTF::DefaultHash<SymbolRegistryKey>::Hash::equal): Deleted.
* wtf/text/WTFString.h:
2020-07-16 Eric Carlson <eric.carlson@apple.com>
Use AVRoutePickerView when available for choosing AirPlay devices
https://bugs.webkit.org/show_bug.cgi?id=213497
<rdar://problem/58610662>
Unreviewed build fix.
* wtf/PlatformHave.h: Define HAVE_AVROUTEPICKERVIEW.
2020-07-16 Jonathan Bedard <jbedard@apple.com>
[Big Sur] De-duplicate SPI
https://bugs.webkit.org/show_bug.cgi?id=214415
<rdar://problem/65678060>
Reviewed by Darin Adler.
* wtf/PlatformHave.h:
2020-07-16 Jonathan Bedard <jbedard@apple.com>
[Big Sur] Build on Seed 1
https://bugs.webkit.org/show_bug.cgi?id=214396
<rdar://problem/65644762>
Reviewed by Tim Horton.
* wtf/PlatformHave.h: Add HAVE(LARGE_CONTROL_SIZE).
2020-07-15 Saagar Jha <saagar@saagarjha.com>
Add some missing boilerplate to help fix build on macOS Big Sur
https://bugs.webkit.org/show_bug.cgi?id=214338
Reviewed by Darin Adler.
* wtf/PlatformHave.h: Add HAVE_LARGE_CONTROL_SIZE and enable it on Big Sur.
2020-07-15 Darin Adler <darin@apple.com>
Remove a few more uses of the terms black/white list
https://bugs.webkit.org/show_bug.cgi?id=214371
Reviewed by Alex Christensen.
* wtf/URLHelpers.cpp:
(WTF::URLHelpers::loadIDNAllowedScriptList): Renamed.
(WTF::URLHelpers::isLookalikeCharacter): Renamed.
(WTF::URLHelpers::addScriptToIDNAllowedScriptList): Renamed.
(WTF::URLHelpers::initializeDefaultIDNAllowedScriptList): Renamed.
(WTF::URLHelpers::allCharactersInAllowedIDNScriptList): Renamed.
(WTF::URLHelpers::mapHostName): Updated for name changes.
* wtf/URLHelpers.h: Renamed things.
* wtf/cocoa/NSURLExtras.mm:
(WTF::readIDNAllowedScriptListFile): Renamed.
(WTF::URLHelpers::loadIDNAllowedScriptList): Renamed. Also use a modern for
loop to simplify the code.
2020-07-15 Jim Mason <jmason@ibinx.com>
[WTF] Fix PackedAlignedPtr for X86_64 canonical addresses
https://bugs.webkit.org/show_bug.cgi?id=214142
Reviewed by Mark Lam
* wtf/Packed.h:
(WTF::PackedAlignedPtr::get const):
(WTF::PackedAlignedPtr::set):
2020-07-15 Brady Eidson <beidson@apple.com>
Resolve race between IOHIDManager and GameController framework.
<rdar://problem/65554490> and https://bugs.webkit.org/show_bug.cgi?id=214245
Reviewed by Tim Horton.
* wtf/PlatformHave.h:
2020-07-14 Alex Christensen <achristensen@webkit.org>
REGRESSION(r262341) URL::createCFURL should produce a CFURL that uses UTF-8 to decode its percent-encoded sequences
https://bugs.webkit.org/show_bug.cgi?id=214314
<rdar://problem/65079249>
Reviewed by Darin Adler.
r262341 made it so we usually pass kCFStringEncodingISOLatin1 into CFURLCreateAbsoluteURLWithBytes when creating a CFURLRef from a WTF::URL.
This is correct for the interpretation of the bytes to create a CFStringRef, and that is a change we want to make.
The encoding, however, is also stored with the CFURL and used later when interpreting percent-encoded sequences.
We want to use kCFStringEncodingUTF8 to make the interpretation of percent-encoded sequences the same as it used to be.
To avoid making a separate CString most of the time, use characters8() only for ASCII-only URLs, where UTF-8 and Latin1 are the same.
For all other URLs, we have to make a CString containing the UTF-8 representation of the string to get the percent-encoded sequences interpreted the same.
* wtf/cf/URLCF.cpp:
(WTF::URL::createCFURL const):
* wtf/cocoa/URLCocoa.mm:
(WTF::URL::createCFURL const):
2020-07-14 Jer Noble <jer.noble@apple.com>
Add support for parsing VP-style codec strings.
https://bugs.webkit.org/show_bug.cgi?id=214270
<rdar://problem/65500048>
Reviewed by Eric Carlson.
Add a variant of toIntegralType<> which returns an Optional. Since no existing callers of the
original toIntegralType fail to pass in the optional bool* parameter, make that parameter
non-optional, as it causes a conflict with the new Optional-returning version.
* wtf/text/StringToIntegerConversion.h:
(WTF::toIntegralType):
2020-07-13 Keith Miller <keith_miller@apple.com>
Clean up SourceProvider and add caller relative load script to jsc.cpp
https://bugs.webkit.org/show_bug.cgi?id=214205
Reviewed by Yusuke Suzuki.
Using a URL as a boolean in a conditional should be a compile
error. Currently, it "works" because it actually calls `operator
NSURL*()`... which is likely NOT what you wanted. Until we decide
what it means to have a URL in a conditional it will be a compile
error.
* wtf/URL.cpp:
(WTF::URL::fileSystemPath const):
* wtf/URL.h:
2020-07-12 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] String.protoytpe.toLocaleLowerCase's availableLocales HashSet is inefficient
https://bugs.webkit.org/show_bug.cgi?id=213158
Reviewed by Darin Adler.
Add characterAt method to ASCIILiteral.
* wtf/text/ASCIILiteral.h:
2020-07-12 Darin Adler <darin@apple.com>
Some further streamlining of Gradient handling code
https://bugs.webkit.org/show_bug.cgi?id=214239
Reviewed by Sam Weinig.
* wtf/Vector.h: Added an overload for insert analogous to the ones we already have
for append and uncheckedAppend, helpful for type deduction.
2020-07-12 Said Abou-Hallawa <sabouhallawa@apple.com>
[macOS]: A HEIF image, selected from the OpenPanel, should be converted to an accepted MIME type
https://bugs.webkit.org/show_bug.cgi?id=213347
<rdar://problem/57258464>
Reviewed by Darin Adler.
Allow a suffix to be included in the temporary file name. The goal is to
make it possible to create temporary image files with valid extensions.
* wtf/FileSystem.h:
(WTF::FileSystemImpl::openTemporaryFile):
* wtf/cocoa/FileSystemCocoa.mm:
(WTF::FileSystemImpl::openTemporaryFile):
* wtf/glib/FileSystemGlib.cpp:
(WTF::FileSystemImpl::openTemporaryFile):
* wtf/posix/FileSystemPOSIX.cpp:
(WTF::FileSystemImpl::openTemporaryFile):
* wtf/win/FileSystemWin.cpp:
(WTF::FileSystemImpl::openTemporaryFile):
2020-07-12 Rob Buis <rbuis@igalia.com>
Improve IPv6 detection when setting host/hostname
https://bugs.webkit.org/show_bug.cgi?id=214218
Reviewed by Darin Adler.
* wtf/URL.cpp:
(WTF::URL::setHost): do not bail out if ':' was found but we start
with a '[', since the host may be IPv6.
(WTF::URL::setHostAndPort): multiple colons are acceptable only in case of IPv6.
2020-07-11 Sam Weinig <weinig@apple.com> and Yusuke Suzuki <ysuzuki@apple.com>
Relanding "Make hasher work with tuple-like classes"
https://bugs.webkit.org/show_bug.cgi?id=214224
Reviewed by Darin Adler.
The original patch broke the internal build. And reverting patch (r264274) broke the build too.
This patch relands r264270 with `constexpr` => `inline constexpr` template variable fix.
* wtf/Hasher.h:
(WTF::add):
(WTF::addTupleLikeHelper):
(WTF::TypeCheckHelper<decltype): Deleted.
(WTF::addTupleHelper): Deleted.
Add support for tuple-like classes. These are classes that:
- Have defined specializations of std::tuple_size<> and std::tuple_element<>.
- And have either a member function named get<> or there exists a function get<>()
that takes the class as argument that can be looked up via ADL.
To avoid abiguity when hashing std::array, the add() overload enabled for containers
with a begin member functions also now checks that the container is not tuple-like.
The std::pair overload is no longer needed as it will use the tuple-like one now.
* wtf/OptionSet.h:
* wtf/StdLibExtras.h:
Move is_type_complete_v<> from OptionSet.h to StdLibExtras.h and rename to
adhere to WebKit style as IsTypeComplete<>.
2020-07-11 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r264270.
https://bugs.webkit.org/show_bug.cgi?id=214228
Broke the build
Reverted changeset:
"Make hasher work with tuple-like classes"
https://bugs.webkit.org/show_bug.cgi?id=214224
https://trac.webkit.org/changeset/264270
2020-07-11 Darin Adler <darin@apple.com>
Remove live ranges from AccessibilityObject.h, AccessibilityObjectInterface.h, AccessibilityRenderObject.h, AXIsolatedObject.h
https://bugs.webkit.org/show_bug.cgi?id=214215
Reviewed by Sam Weinig.
* wtf/cocoa/VectorCocoa.h: Added a new makeVector that takes a function.
Also updated createNSArray to use std::invoke.
2020-07-11 Sam Weinig <weinig@apple.com>
Make hasher work with tuple-like classes
https://bugs.webkit.org/show_bug.cgi?id=214224
Reviewed by Darin Adler.
* wtf/Hasher.h:
(WTF::add):
(WTF::addTupleLikeHelper):
(WTF::TypeCheckHelper<decltype): Deleted.
(WTF::addTupleHelper): Deleted.
Add support for tuple-like classes. These are classes that:
- Have defined specializations of std::tuple_size<> and std::tuple_element<>.
- And have either a member function named get<> or there exists a function get<>()
that takes the class as argument that can be looked up via ADL.
To avoid abiguity when hashing std::array, the add() overload enabled for containers
with a begin member functions also now checks that the container is not tuple-like.
The std::pair overload is no longer needed as it will use the tuple-like one now.
* wtf/OptionSet.h:
* wtf/StdLibExtras.h:
Move is_type_complete_v<> from OptionSet.h to StdLibExtras.h and rename to
adhere to WebKit style as IsTypeComplete<>.
2020-07-10 Brady Eidson <beidson@apple.com>
GameController.framework gamepads should support Home buttons.
<rdar://problem/63500696> and https://bugs.webkit.org/show_bug.cgi?id=212933
Reviewed by Tim Horton.
* wtf/PlatformHave.h:
2020-07-10 Xabier Rodriguez Calvar <calvaris@igalia.com>
[GStreamer][EME][OpenCDM] Implement OpenCDM support
https://bugs.webkit.org/show_bug.cgi?id=213550
Reviewed by Philippe Normand.
* wtf/PlatformEnable.h: Disable OPENCDM by default.
2020-07-09 Xabier Rodriguez Calvar <calvaris@igalia.com>
Simplify BoxPtr::create
https://bugs.webkit.org/show_bug.cgi?id=214144
Reviewed by Darin Adler.
* wtf/BoxPtr.h:
(WTF::createBoxPtr): Use the alias instead of the unrolled type.
2020-07-09 Per Arne Vollan <pvollan@apple.com>
[Cocoa] Update Launch Services database in the WebContent process from the Network process
https://bugs.webkit.org/show_bug.cgi?id=213794
Reviewed by Brent Fulgham.
Added HAVE define for determining if the class LSDatabaseContext is present.
* wtf/PlatformHave.h:
2020-07-09 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r264148.
https://bugs.webkit.org/show_bug.cgi?id=214136
Introduced layout test failures
Reverted changeset:
"[Cocoa] Update Launch Services database in the WebContent
process from the Network process"
https://bugs.webkit.org/show_bug.cgi?id=213794
https://trac.webkit.org/changeset/264148
2020-07-09 Xabier Rodriguez Calvar <calvaris@igalia.com>
[WTF] Implement new BoxPtr alias
https://bugs.webkit.org/show_bug.cgi?id=212379
Reviewed by Darin Adler.
Added BoxPtr.h that includes BoxPtr<T> as alias of
Box<std::unique_ptr<T>>. We discussed about this class on bugzilla
and we agreed on this alias being the best idea. Apart from the
alias I'm adding a couple of helpers like a create function and
the operator== and operator!=.
Tests: BoxPtr API tests added.
* WTF.xcodeproj/project.pbxproj:
* wtf/BoxPtr.h: Added.
(WTF::createBoxPtr):
(WTF::operator==):
(WTF::operator!=):
* wtf/CMakeLists.txt:
2020-07-08 Per Arne Vollan <pvollan@apple.com>
[Cocoa] Update Launch Services database in the WebContent process from the Network process
https://bugs.webkit.org/show_bug.cgi?id=213794
Reviewed by Brent Fulgham.
Added HAVE define for determining if the class LSDatabaseContext is present.
* wtf/PlatformHave.h:
2020-07-08 Per Arne Vollan <pvollan@apple.com>
[Cocoa] Make it possible to establish direct XPC connections between WebKit processes
https://bugs.webkit.org/show_bug.cgi?id=214079
Reviewed by Brent Fulgham.
Declare function to create a xpc endpoint, as well as a function to create a connection from an endpoint.
* wtf/spi/darwin/XPCSPI.h:
2020-07-08 Geoffrey Garen <ggaren@apple.com>
dyld: Symbol not found: __ZN3WTF19initializeThreadingEv - webkit MacOSX
https://bugs.webkit.org/show_bug.cgi?id=214034
Reviewed by Mark Lam.
* wtf/Threading.cpp:
(WTF::initializeThreading): Export the old symbol name for compatibility.
2020-07-07 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] WebProcess hangs when browsing GitHub
https://bugs.webkit.org/show_bug.cgi?id=213970
Reviewed by Sergio Villar Senin.
Use a lower priority for LayerFlushTimer and DisplayRefreshMonitorTimer. We were using a very high priority for
drawing with the idea of keeping a good rendering performance without being affected by other timers. The
problem is that animations can be controlled by timers, so we need to ensure that MainThreadSharedTimer has
higher priority than drawing.
* wtf/glib/RunLoopSourcePriority.h: Use 110 for LayerFlushTimer and DisplayRefreshMonitorTimer.
2020-07-06 Geoffrey Garen <ggaren@apple.com>
callOnMainThread should use the same queue as RunLoop::dispatch
https://bugs.webkit.org/show_bug.cgi?id=213830
Reviewed by Brady Eidson.
This should reduce flakiness in scheduled tasks.
There's no need to keep a separate queue anymore since both APIs have
the same semantics now.
* wtf/MainThread.cpp:
(WTF::callOnMainThread):
(WTF::functionQueue): Deleted.
(WTF::dispatchFunctionsFromMainThread): Deleted.
* wtf/MainThread.h:
* wtf/cocoa/MainThreadCocoa.mm:
(WTF::scheduleDispatchFunctionsOnMainThread): Deleted.
* wtf/generic/MainThreadGeneric.cpp:
(WTF::scheduleDispatchFunctionsOnMainThread): Deleted.
* wtf/win/MainThreadWin.cpp:
(WTF::scheduleDispatchFunctionsOnMainThread): Deleted.
2020-07-06 Michael Catanzaro <mcatanzaro@gnome.org>
Spams system logs with "Current memory footprint: 10 MB"
https://bugs.webkit.org/show_bug.cgi?id=213991
Reviewed by Darin Adler.
This particular log statement is too much spam in the system journal, since it prints
continuously under normal operating conditions. Let's limit it only to Apple platforms,
which have had RELEASE_LOG() for a long time and where this is presumably expected.
* wtf/MemoryPressureHandler.cpp:
(WTF::MemoryPressureHandler::measurementTimerFired):
2020-07-06 Sam Weinig <weinig@apple.com>
Compile-time enable (but leave disabled at runtime by default) date/time input types on macOS to allow testing of cross platform (e.g. DOM) aspects of the controls
https://bugs.webkit.org/show_bug.cgi?id=213949
Reviewed by Darin Adler.
* wtf/PlatformEnableCocoa.h:
Enable building date/time input types on all Cocoa ports.
2020-07-06 Geoffrey Garen <ggaren@apple.com>
RunLoop::dispatch should only call wakeUp when needed
https://bugs.webkit.org/show_bug.cgi?id=213705
Reviewed by Brady Eidson.
RunLoop::wakeUp is super expensive (at least on Darwin platforms). Back
when IndexedDB used RunLoop::dispatch, RunLoop::wakeUp accounted for 15%
of all database lookup time.
We can reduce the cost a bit by only scheduling a wakeUp when the queue
is empty.
* wtf/RunLoop.cpp:
(WTF::RunLoop::performWork): Take all the functions out of the pending
queue before we start executing them; that way, we can tell if a new
function has been added to the pending queue since we enetered
performWork.
(WTF::RunLoop::dispatch): Only call wakeUp if we need to.
* wtf/RunLoop.h:
2020-07-04 Darin Adler <darin@apple.com>
[Cocoa] Add almost everything from FeatureDefines.xcconfig to PlatformEnableCocoa.h
https://bugs.webkit.org/show_bug.cgi?id=213964
Reviewed by Sam Weinig.
Added logic that matches what FeatureDefines.xcconfig does for everything
except for ENABLE_EXPERIMENTAL_FEATURES.
Changed format so we mostly list platforms where we do not want to enable
a certain feature; also order it pretty consistently macOS, iOS, Mac Catalyst,
watchOS, then tvOS. This format highlights possible mistakes when not enabling
a feature on some platforms in an easier to understand way.
* wtf/PlatformEnableCocoa.h:
(ENABLE_AIRPLAY_PICKER): List platforms that do *not* enable this.
(ENABLE_APPLE_PAY): All except Mac Catalyst, watchOS, tvOS.
Not sure why disabled in Mac Catalyst, but replicates FeatureDefines.xcconfig.
(ENABLE_APPLE_PAY_REMOTE_UI): List platforms that do *not* enable this.
(ENABLE_AUTOCAPITALIZE): List platforms that do *not* enable this.
(ENABLE_AUTOCORRECT): List platforms that do *not* enable this.
(ENABLE_CONTENT_FILTERING): All except older watchOS simulator and tvOS.
(ENABLE_CORE_IMAGE_ACCELERATED_FILTER_RENDER): Re-sorted this.
(ENABLE_CSS_CONIC_GRADIENTS): All except older macOS and tvOS. The tvOS
exception seems questionable, so added a FIXME.
(ENABLE_DARK_MODE_CSS): All except watchOS and tvOS.
(ENABLE_DATA_INTERACTION): All except macOS, watchOS, and tvOS.
(ENABLE_DATA_DETECTION): All except Mac Catalyst, watchOS, and tvOS.
(ENABLE_EDITABLE_REGION): Only iOS.
(ENABLE_ENCRYPTED_MEDIA): All except older macOS and Mac Catalyst.
(ENABLE_FULLSCREEN_API): All except Mac Catalyst, watchOS, and tvOS.
(ENABLE_FULL_KEYBOARD_ACCESS): All except Mac Catalyst, watchOS, and tvOS.
(ENABLE_GAMEPAD): All except watchOS.
(ENABLE_INPUT_TYPE_DATE): All except macOS, Mac Catalyst, and tvOS.
(ENABLE_INPUT_TYPE_DATETIMELOCAL): Ditto.
(ENABLE_INPUT_TYPE_MONTH): Ditto.
(ENABLE_INPUT_TYPE_TIME): Ditto.
(ENABLE_INPUT_TYPE_WEEK): Ditto.
(ENABLE_MEDIA_CAPTURE): All except macOS.
(ENABLE_MEDIA_SOURCE): All except Mac Catalyst, watchOS, tvOS, and
all simulators.
(ENABLE_MEDIA_STREAM): All except Mac Catalyst, watchOS, and tvOS.
(ENABLE_NAVIGATOR_STANDALONE): All iOS family. (Considered writing as
all except macOS, but left like this to match some .cpp code for now.)
(ENABLE_OVERFLOW_SCROLLING_TOUCH): All iOS family.
(ENABLE_PICTURE_IN_PICTURE_API): All except Mac Catalyst, watchOS, and tvOS.
(ENABLE_SPEECH_SYNTHESIS): All except Mac Catalyst.
(ENABLE_REVEAL): All except older macOS, watchOS, and tvOS.
(ENABLE_SIGILL_CRASH_ANALYZER): All except macOS and watchOS.
(ENABLE_TAKE_UNBOUNDED_NETWORKING_ASSERTION): All except macOS, watchOS, and tvOS.
(ENABLE_VIDEO_PRESENTATION_MODE): All except simulators and tvOS.
(ENABLE_WEBGPU): All except older macOS, Mac Catalyst, and simulators.
(ENABLE_WEB_API_STATISTICS): Re-sorted this.
(ENABLE_WEB_AUTHN): All except Mac Catalyst, watchOS, and tvOS.
(ENABLE_WEB_RTC): All except Mac Catalyst, watchOS, and tvOS.
2020-07-04 Darin Adler <darin@apple.com>
[Cocoa] Remove all features from FeatureDefines.xcconfig that are already mentioned in PlatformEnableCocoa.h
https://bugs.webkit.org/show_bug.cgi?id=213962
Reviewed by Sam Weinig.
* wtf/PlatformEnableCocoa.h:
(ENABLE_DRAG_SUPPORT): Before, this was enabled for iOS, iOS simulator, and Mac Catalyst in the
FeatureDefines.xcconfig file, but then disabled for any other iOS family platform here, then enabled
by default in PlatformEnable.h, which covered Mac. Instead, disable here only for watchOS and tvOS,
which gives the same result in a more straightforward way.
(ENABLE_GEOLOCATION): Before, this was enabled for iOS, iOS simulator, Mac Catalyst, and Mac in the
FeatureDefines.xcconfig file, then enabled for any other iOS family platform here. Instead, just
enable here for all Cocoa platforms, which gives the same result in a more straightforward way.
2020-07-03 Darin Adler <darin@apple.com>
Make generate-unified-sources.sh not depend on features being listed in FEATURE_DEFINES environment variable
https://bugs.webkit.org/show_bug.cgi?id=212420
Reviewed by Don Olmstead.
* Scripts/generate-unified-source-bundles.rb: Removed the --feature-flags
command line option along with the code that implements it.
2020-07-03 Sam Weinig <weinig@apple.com>
Remove support for ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE
https://bugs.webkit.org/show_bug.cgi?id=213932
Reviewed by Darin Adler.
Removes support for non-standard <input type="datetime">, currently being
guarded by the macro ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE. This macro, was
added back in 2013 as a temporary measure to support some engines who shipped
support for <input type="datetime">. It is currently not enabled for any
ports so now seems like as good a time as any to remove it.
* wtf/PlatformEnable.h:
2020-07-03 Sam Weinig <weinig@apple.com>
Add "-Wliteral-conversion" warning to Xcode based builds and fix the issues it finds
https://bugs.webkit.org/show_bug.cgi?id=213931
Reviewed by Darin Adler.
* Configurations/Base.xcconfig:
Add -Wliteral-conversion.
2020-07-03 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r263882.
https://bugs.webkit.org/show_bug.cgi?id=213933
Broke the build
Reverted changeset:
"Make _WKWebsiteDataStoreConfiguration SPI for HSTS storage to
replace _WKProcessPoolConfiguration.hstsStorageDirectory"
https://bugs.webkit.org/show_bug.cgi?id=213048
https://trac.webkit.org/changeset/263882
2020-07-02 Alex Christensen <achristensen@webkit.org>
Make _WKWebsiteDataStoreConfiguration SPI for HSTS storage to replace _WKProcessPoolConfiguration.hstsStorageDirectory
https://bugs.webkit.org/show_bug.cgi?id=213048
Reviewed by Youenn Fablet.
* wtf/PlatformHave.h:
2020-07-02 Alex Christensen <achristensen@webkit.org>
Add testing infrastructure and SPI declaration for HTTP/2 ping
https://bugs.webkit.org/show_bug.cgi?id=213913
Reviewed by Jer Noble.
This is work towards rdar://problem/64495827
* wtf/PlatformHave.h:
2020-07-01 Tim Horton <timothy_horton@apple.com>
Upstream application accent color support
https://bugs.webkit.org/show_bug.cgi?id=213859
Reviewed by Wenson Hsieh.
* wtf/PlatformHave.h:
2020-07-01 Alexey Shvayka <shvaikalesh@gmail.com>
Use more efficient makeString() instead of StringBuilder
https://bugs.webkit.org/show_bug.cgi?id=213708
Reviewed by Sam Weinig.
Introduces StringTypeAdapter<std::tuple> overload, which enables using
makeString() instead of StringBuilder in more cases.
* wtf/text/StringConcatenate.h:
(WTF::StringTypeAdapter<std::tuple<StringTypes...>, void>): Added.
2020-06-30 Geoffrey Garen <ggaren@apple.com>
[Cocoa] [GTK] RunLoop::Timer::isActive() is incorrect for timers while they are firing
https://bugs.webkit.org/show_bug.cgi?id=213771
Reviewed by Darin Adler.
I noticed this because it triggered an assertion failure in
BackgroundProcessResponsivenessTimer::scheduleNextResponsivenessCheck().
In WebKit timer parlance "isActive()" means "will fire again", so a
one-shot timer should report inactive right when it fires. Otherwise,
there's no way to check if it needs to be rescheduled.
* wtf/cf/RunLoopCF.cpp:
(WTF::RunLoop::TimerBase::timerFired): For one-shot timers, stop our
timer before it fires, so that we know it is not active.
* wtf/glib/RunLoopGLib.cpp:
(WTF::RunLoop::TimerBase::TimerBase): For repeating timers, reschedule
our timer before it fires, so that we know it is active.
2020-06-30 Mark Lam <mark.lam@apple.com>
Add handling for a case of OOME in CSSTokenizer and CSSParser.
https://bugs.webkit.org/show_bug.cgi?id=213702
<rdar://problem/64808889>
Reviewed by Darin Adler.
1. Added FailureAction so that we can parameterize how we want to handle failures.
In this patch, we're only using this for allocation failures, but we could
technically apply this to other types of failures as well.
2. Apply FailureAction to many methods in Vector (and its super classes) so that
we can start de-duplicating code. Previously, we were always duplicating code
just to have a "try" version of the same method that reports the failure to
allocate instead of crashing. We can now parameterize all these methods on a
FailureAction template parameter instead, and avoid the code duplication.
This patch also reverses some of the existing code duplication.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/FailureAction.h: Added.
* wtf/Vector.h:
(WTF::VectorBufferBase::allocateBuffer):
(WTF::VectorBufferBase::tryAllocateBuffer):
(WTF::VectorBuffer::allocateBuffer):
(WTF::VectorBuffer::tryAllocateBuffer):
(WTF::Vector::reserveCapacity):
(WTF::Vector::tryReserveCapacity):
(WTF::Vector::reserveInitialCapacity):
(WTF::Vector::tryReserveInitialCapacity):
(WTF::Vector::append):
(WTF::Vector::tryAppend):
(WTF::Vector::constructAndAppend):
(WTF::Vector::tryConstructAndAppend):
(WTF::Vector::expandCapacity):
(WTF::Vector::resize):
(WTF::Vector::grow):
(WTF::Vector::reserveCapacity):
(WTF::Vector::reserveInitialCapacity):
(WTF::Vector::append):
(WTF::Vector::constructAndAppend):
(WTF::Vector::appendSlowCase):
(WTF::Vector::constructAndAppendSlowCase):
(WTF::Vector::appendVector):
(WTF::Vector::insert):
(WTF::Vector::tryExpandCapacity): Deleted.
(WTF::Vector::tryReserveCapacity): Deleted.
(WTF::Vector::tryAppend): Deleted.
(WTF::Vector::tryConstructAndAppend): Deleted.
(WTF::Vector::tryConstructAndAppendSlowCase): Deleted.
2020-06-30 Peng Liu <peng.liu6@apple.com>
Enable the support of FULLSCREEN_API in WebKitTestRunner
https://bugs.webkit.org/show_bug.cgi?id=213774
Reviewed by Youenn Fablet.
Replace the definition of ENABLE_FULLSCREEN_API in FeatureDefines.xcconfig with
the one in PlatformEnableCocoa.h. We have to do that because WebKitTestRunner
does not have a FeatureDefines.xcconfig but it uses "ENABLE(FULLSCREEN_API)"
to conditionally compile code to test the element fullscreen API.
WebKitTestRunner can use the macro defined in PlatformEnableCocoa.h.
* wtf/PlatformEnableCocoa.h:
2020-06-30 Alex Christensen <achristensen@webkit.org>
Remove WTF::MD5
https://bugs.webkit.org/show_bug.cgi?id=213766
Reviewed by Youenn Fablet.
It was only used for CURL's cache file name generation.
If you want to use a broken hash function, use SHA1.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/MD5.cpp: Removed.
* wtf/MD5.h: Removed.
2020-06-30 Andy Estes <aestes@apple.com>
[Xcode] Enable the "My Mac (Mac Catalyst)" destination in WebKit Xcode projects
https://bugs.webkit.org/show_bug.cgi?id=213740
Reviewed by Darin Adler.
* Configurations/Base.xcconfig: Set SUPPORTS_MACCATALYST to YES to tell Xcode that this
project supports building for Mac Catalyst.
2020-06-30 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r263724.
https://bugs.webkit.org/show_bug.cgi?id=213781
Reverted changeset:
"Make _WKWebsiteDataStoreConfiguration SPI for HSTS storage to
replace _WKProcessPoolConfiguration.hstsStorageDirectory"
https://bugs.webkit.org/show_bug.cgi?id=213048
https://trac.webkit.org/changeset/263724
2020-06-29 Geoffrey Garen <ggaren@apple.com>
Unreviewed, rolling out an accidental change from r263723.
* wtf/cf/RunLoopCF.cpp:
(WTF::RunLoop::TimerBase::timerFired):
2020-06-29 Alex Christensen <achristensen@webkit.org>
Make _WKWebsiteDataStoreConfiguration SPI for HSTS storage to replace _WKProcessPoolConfiguration.hstsStorageDirectory
https://bugs.webkit.org/show_bug.cgi?id=213048
Reviewed by Youenn Fablet.
* wtf/PlatformHave.h:
2020-06-29 Geoffrey Garen <ggaren@apple.com>
[GTK] [Win] Build callOnMainThread on WTF::RunLoop rather than on a timer
https://bugs.webkit.org/show_bug.cgi?id=213694
Reviewed by Carlos Garcia Campos.
As of https://bugs.webkit.org/show_bug.cgi?id=213063, Darwin platforms
use the RunLoop. Let's match them for consistency, and to delete some
code.
* wtf/generic/MainThreadGeneric.cpp:
(WTF::scheduleDispatchFunctionsOnMainThread):
(WTF::MainThreadDispatcher::MainThreadDispatcher): Deleted.
(WTF::MainThreadDispatcher::schedule): Deleted.
(WTF::MainThreadDispatcher::fired): Deleted.
* wtf/glib/RunLoopSourcePriority.h:
* wtf/win/MainThreadWin.cpp:
(WTF::initializeMainThreadPlatform):
(WTF::scheduleDispatchFunctionsOnMainThread):
(WTF::ThreadingWindowWndProc): Deleted.
2020-06-29 Guowei Yang <guowei_yang@apple.com>
Adding Experimental Feature Flags for CoreImage backed SVG/CSS Filters
https://bugs.webkit.org/show_bug.cgi?id=213578
Reviewed by Darin Adler, Simon Fraser, Myles C. Maxfield.
Preparing to implement CoreImage backed filter rendering
Needs Compiler guards and experimental feature guard.
* wtf/PlatformEnableCocoa.h: Added definition of a feature flag,
ENABLE_CORE_IMAGE_ACCELERATED_FILTER_RENDER
* wtf/PlatformUse.h: Added compiler guard #define USE_CORE_IMAGE 1
to indicate whether CoreImage code is visible to the compiler
2020-06-29 Tetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com>
Remove ENABLE_STREAMS_API compilation flag
https://bugs.webkit.org/show_bug.cgi?id=213728
Reviewed by Sam Weinig.
* wtf/PlatformEnable.h:
2020-06-29 Yusuke Suzuki <ysuzuki@apple.com>
[WTF] Add more StringView / ASCIILiteral helper functions and add ICUDeleter
https://bugs.webkit.org/show_bug.cgi?id=209774
Reviewed by Ross Kirsling and Darin Adler.
Add ICUDeleter for cleaner ICU object deletion.
Add ICU::majorVersion and ICU::minorVersion to switch the skeleton string in Intl.NumberFormat.
Add more features for ASCIILiteral.
This patch is part of https://bugs.webkit.org/show_bug.cgi?id=209774. I land it separately from
Intl.NumberFormat change to unlock the further Intl implementations using ICUDeleter.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/text/ASCIILiteral.h:
* wtf/text/StringView.cpp:
(WTF::codePointCompare):
* wtf/text/StringView.h:
(WTF::StringView::StringView):
* wtf/unicode/icu/ICUHelpers.cpp: Copied from Source/WTF/wtf/text/ASCIILiteral.h.
(WTF::ICU::version):
(WTF::ICU::majorVersion):
(WTF::ICU::minorVersion):
* wtf/unicode/icu/ICUHelpers.h:
(WTF::ICUDeleter::operator()):
2020-06-28 Geoffrey Garen <ggaren@apple.com>
Rename initializeThreading to initialize
https://bugs.webkit.org/show_bug.cgi?id=213674
Reviewed by Mark Lam.
Reasons:
(1) You need to call it even if you don't use threads.
(2) It initializes things unrelated to threads (like the PRNG).
(3) People seem to get confused about the relationship between
initializeThreading() and initializeMainThread(), and sometimes think
initializeThreading() is a superset. The opposite is true! I think the
confusion may come from "threading" being read as "all threading".
Some filenames still use the legacy name. We can fix that in post.
* benchmarks/ConditionSpeedTest.cpp:
(main):
* benchmarks/HashSetDFGReplay.cpp:
(main):
* benchmarks/LockFairnessTest.cpp:
(main):
* benchmarks/LockSpeedTest.cpp:
(main):
* wtf/MainThread.cpp:
(WTF::initializeMainThread):
* wtf/Threading.cpp:
(WTF::Thread::create):
(WTF::initialize):
(WTF::initializeThreading): Deleted.
* wtf/Threading.h:
(WTF::Thread::current):
2020-06-27 Sam Weinig <weinig@apple.com>
Improve assertions in StringParsingBuffer
https://bugs.webkit.org/show_bug.cgi?id=213633
Reviewed by Darin Adler.
* wtf/text/StringParsingBuffer.h:
Address additional feedback and improve the assertions by making them more
clear and avoid potential overflows.
2020-06-26 Geoffrey Garen <ggaren@apple.com>
Re-land r262863
https://bugs.webkit.org/show_bug.cgi?id=213654
Reviewed by Tadeu Zagallo.
r263575 should fix the crash we saw.
* wtf/cocoa/MainThreadCocoa.mm:
(WTF::initializeMainThreadPlatform):
(WTF::scheduleDispatchFunctionsOnMainThread):
(-[JSWTFMainThreadCaller call]): Deleted.
2020-06-26 Geoffrey Garen <ggaren@apple.com>
Initializing the main thread should initialize the main run loop
https://bugs.webkit.org/show_bug.cgi?id=213637
Reviewed by Anders Carlsson.
Previously, some code initialized one, some the other, and some both;
and some code tried to initialize more than once; and some code tried
to initialize in ways that would crash but luckily got pre-empted by
other code that had already initialized.
In addition to general confusion, this setup made it subtly high stakes
to call certain functions, like callOnMainThread or
RunLoop::main().dispatch(), because they might crash if the right
initialization had not been performed.
Let's fix that.
* wtf/MainThread.cpp:
(WTF::initializeMainThread): Removed defunct comment about
initializeMainThreadToProcessMainThread. Shrank scope of initializeKey.
* wtf/RunLoop.cpp:
(WTF::RunLoop::initializeMain): Don't call initializeMainThread anymore
because it calls us now. No need for a store fence since we run on the
main thread and we don't store anything.
(WTF::RunLoop::initializeWeb): Upgrade to RELEASE_ASSERT.
* wtf/RunLoop.h: Removed incorrect comment. (Fascinating to wonder when
it became incorrect.)
2020-06-25 Sam Weinig <weinig@apple.com>
Add a new templated string type to help write more idiomatic parsing code
https://bugs.webkit.org/show_bug.cgi?id=213588
Reviewed by Darin Adler.
Introduce StringParsingBuffer<CharType>, a new class in the String class family
designed to be used by parsing code. It's designed to be used with the helper
function, readCharactersForParsing, and for the user to write the parsing code
in a way that will work for both latin1 and UTF-16 inputs. Most usage will likely
follow something like the following form
{
...
auto parsedResult = readCharactersForParsing(stringishObjectToParse, [](auto parsingBuffer) {
while (parsingBuffer.hasCharactersRemaining()) {
if (*parsingBuffer == foo) {
...
}
}
...
return parsedResult
});
...
}
API tests added.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
Add StringParsingBuffer.h
* wtf/Forward.h:
Forward declare StringParsingBuffer.
* wtf/text/StringParsingBuffer.h:
Added.
2020-06-25 Tadeu Zagallo <tzagallo@apple.com>
WTF::callOnMainThread should not require the main runloop to be initialized
https://bugs.webkit.org/show_bug.cgi?id=213612
<rdar://problem/64446028>
Reviewed by Yusuke Suzuki.
When using JavaScriptCore as a framework, the WTF main runloop is never initialized. However,
the inspector uses CFString wrappers, which use `callOnMainThread` when deallocating the
underlying string. For now, we bring back the old `JSWTFMainThreadCaller` to ensure we have
a way of dispatching to the main thread, even when the main runloop hasn't been initialized.
* wtf/RunLoop.cpp:
(WTF::RunLoop::mainIfExists):
* wtf/RunLoop.h:
* wtf/cocoa/MainThreadCocoa.mm:
(-[JSWTFMainThreadCaller call]):
(WTF::initializeMainThreadPlatform):
(WTF::scheduleDispatchFunctionsOnMainThread):
2020-06-24 Umar Iqbal <uiqbal@apple.com>
We should resurrect the older patch that collects some statistics of web API calls
https://bugs.webkit.org/show_bug.cgi?id=213319
Reviewed by Brent Fulgham.
+ Enabled ENABLE_WEB_API_STATISTICS flag
* wtf/PlatformEnableCocoa.h:
2020-06-24 Geoffrey Garen <ggaren@apple.com>
Removed the 50ms rescheduling timeout from callOnMainThread
https://bugs.webkit.org/show_bug.cgi?id=213560
Reviewed by Anders Carlsson.
This is a step toward making the engine less flaky by unifying
callOnMainThread with RunLoop::dispatch.
The timeout was added in r40888 to avoid a hang under heavy postMessage
load. A few reasons this isn’t the right approach anymore:
(1) postMessage has migrated to EventLoop, which does its own
scheduling.
(2) postMessage does not use the application process RunLoop in Modern
WebKit.
(3) Delay is not a sufficient solution to a messaging hang — because
you’ll just OOM crash instead. The original author noted this problem
in bug 23705 but never resolved it; and we rediscovered it in r233111.
I verified manually that the r40888 version of
fast/workers/worker-timeout.html does not hang.
* wtf/MainThread.cpp:
(WTF::dispatchFunctionsFromMainThread):
2020-06-23 Geoffrey Garen <ggaren@apple.com>
Remove WTF::setMainThreadCallbacksPaused
https://bugs.webkit.org/show_bug.cgi?id=213112
Reviewed by Tim Horton.
setMainThreadCallbacksPaused pauses all uses of callOnMainThread. That
has too many side-effects. For example, you can scroll, but you can't
paint any large images (since they do async image decoding).
Meanwhile, setMainThreadCallbacksPaused doesn't pause RunLoop::dispatch.
So, other things don't get paused.
Let's just rely on suspending the ScriptExecutionContext and document
event queue. That should suspend JavaScript-visible stuff without
suspending engine-critical stuff.
* wtf/MainThread.cpp:
(WTF::dispatchFunctionsFromMainThread):
(WTF::setMainThreadCallbacksPaused): Deleted.
* wtf/MainThread.h:
2020-06-23 Chris Dumez <cdumez@apple.com>
Remove a lot of unnecessary calls to Ref::copyRef()
https://bugs.webkit.org/show_bug.cgi?id=213533
Reviewed by Darin Adler.
Remove a lot of unnecessary calls to Ref::copyRef() now that Ref is copyable.
* wtf/glib/SocketConnection.cpp:
(WTF::SocketConnection::waitForSocketWritability):
2020-06-23 Saam Barati <sbarati@apple.com>
Remove WKkIsTranslated once our bots are updated to the needed SDK
https://bugs.webkit.org/show_bug.cgi?id=213489
Reviewed by Tim Horton.
We can use the "sysctl.proc_translated" sysctl instead.
* WTF.xcodeproj/project.pbxproj:
* wtf/TranslatedProcess.cpp: Added.
(WTF::isX86BinaryRunningOnARM):
* wtf/TranslatedProcess.h:
(WTF::isX86BinaryRunningOnARM):
2020-06-23 Mark Lam <mark.lam@apple.com>
Handle string overflow in DFG graph dump while validating AI.
https://bugs.webkit.org/show_bug.cgi?id=213524
<rdar://problem/64635620>
Reviewed by Saam Barati.
* wtf/StringPrintStream.cpp:
(WTF::StringPrintStream::tryToString):
* wtf/StringPrintStream.h:
2020-06-22 Saam Barati <sbarati@apple.com>
Allow building JavaScriptCore Mac+arm64 in public SDK build
https://bugs.webkit.org/show_bug.cgi?id=213472
Reviewed by Sam Weinig.
* wtf/PlatformEnable.h:
* wtf/PlatformEnableCocoa.h:
* wtf/PlatformHave.h:
2020-06-22 Timothy Horton <timothy_horton@apple.com>
Fix the build
* wtf/TranslatedProcess.h:
(WTF::isX86BinaryRunningOnARM):
2020-06-22 Tim Horton <timothy_horton@apple.com>
Disable the JS JIT when running in a translated process
https://bugs.webkit.org/show_bug.cgi?id=213478
Reviewed by Saam Barati.
* wtf/PlatformHave.h:
* wtf/TranslatedProcess.h: Added.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
Add a helper function that can be used to determine that the current process
is being translated; currently the only case is an x86_64 process running on arm64e.
2020-06-22 Tim Horton <timothy_horton@apple.com>
Update macOS version macros
https://bugs.webkit.org/show_bug.cgi?id=213484
Reviewed by Alexey Proskuryakov.
* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
2020-06-22 Geoffrey Garen <ggaren@apple.com>
Unreviewed, re-landing r262904.
r263223 should fix the test flakiness we saw.
Re-landed changeset:
"[Cocoa] Build callOnMainThread on WTF::RunLoop rather than on
a timer"
https://bugs.webkit.org/show_bug.cgi?id=213063
https://trac.webkit.org/changeset/262904
2020-06-21 Yusuke Suzuki <ysuzuki@apple.com>
[WTF] Ensure ASCIILiteral is ASCII characters at compile time
https://bugs.webkit.org/show_bug.cgi?id=213449
Reviewed by Ross Kirsling.
The purpose of ASCIILiteral is ensure that this is compile-time (do not need to consider about ownership) ASCII characters.
By using `isASCII` and `ASSERT_UNDER_CONSTEXPR_CONTEXT`, we can make sure that this C string does not include non ASCII characters.
For example,
auto globalVariable = "ラーメン (Ramen in Japanese)"_s;
becomes compile error.
* wtf/ASCIICType.h:
(WTF::isASCII):
* wtf/text/ASCIILiteral.h:
(WTF::StringLiterals::operator _s):
2020-06-21 Yusuke Suzuki <ysuzuki@apple.com>
[WTF] URL should support dataLog
https://bugs.webkit.org/show_bug.cgi?id=213450
Reviewed by Mark Lam.
Add URL::dump(PrintStream&) to support `dataLog(url)` which is extremely useful for WTF / JSC developers.
* wtf/URL.cpp:
(WTF::URL::dump const):
* wtf/URL.h:
2020-06-19 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Check Gigacage usage before launching VM
https://bugs.webkit.org/show_bug.cgi?id=213410
Reviewed by Mark Lam.
* wtf/Gigacage.h:
(Gigacage::footprint):
(Gigacage::maxSize):
(Gigacage::size):
2020-06-19 Truitt Savell <tsavell@apple.com>
Unreviewed, reverting r263223.
Broke compositing/video/video-border-radius-clipping.html on
Mac release wk1
Reverted changeset:
"Unreviewed, re-landing r262904."
https://bugs.webkit.org/show_bug.cgi?id=213063
https://trac.webkit.org/changeset/263223
2020-06-19 Michael Catanzaro <mcatanzaro@gnome.org>
-Wsign-compare in isValidOptionSet
https://bugs.webkit.org/show_bug.cgi?id=213383
Reviewed by Darin Adler.
The OptionSet's StorageType is always unsigned, even if the enum's underlying value is not.
Match this in isValidOptionSet to avoid -Wsign-compare during validity checking.
* wtf/OptionSet.h:
(WTF::isValidOptionSet):
2020-06-19 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Unify "font:" CSS shorthand values between macOS and iOS family
https://bugs.webkit.org/show_bug.cgi?id=213332
<rdar://problem/64479189>
Reviewed by Tim Horton and Darin Adler.
All Cocoa platforms support kCTUIFontTextStyleTitle0 and kCTUIFontTextStyleTitle4.
* wtf/PlatformHave.h:
2020-06-18 Mark Lam <mark.lam@apple.com>
Unify Bitmap math loops in MarkedBlock::Handle::specializedSweep().
https://bugs.webkit.org/show_bug.cgi?id=213345
Reviewed by Robin Morisset and Saam Barati.
1. Removed Bitmap::words. Use Bitmap::numberOfWords instead.
2. Removed Bitmap::wordSize. Use Bitmap::bitsInWord instead.
3. Added a new Bitmap::words() method which returns the address of the underlying
bitmap storage as a Bitmap::Word*. This enables clients to do direct bit
manipulation on the Bitmap words if needed.
* wtf/Bitmap.h:
(WTF::WordType>::get const):
(WTF::WordType>::set):
(WTF::WordType>::testAndSet):
(WTF::WordType>::testAndClear):
(WTF::WordType>::concurrentTestAndSet):
(WTF::WordType>::concurrentTestAndClear):
(WTF::WordType>::clear):
(WTF::WordType>::invert):
(WTF::WordType>::nextPossiblyUnset const):
(WTF::WordType>::count const):
(WTF::WordType>::isEmpty const):
(WTF::WordType>::isFull const):
(WTF::WordType>::merge):
(WTF::WordType>::filter):
(WTF::WordType>::exclude):
(WTF::WordType>::concurrentFilter):
(WTF::WordType>::subsumes const):
(WTF::WordType>::forEachSetBit const):
(WTF::WordType>::findBit const):
(WTF::WordType>::mergeAndClear):
(WTF::WordType>::setAndClear):
(WTF::WordType>::setEachNthBit):
(WTF::= const):
(WTF::=):
(WTF::WordType>::hash const):
2020-06-18 Geoffrey Garen <ggaren@apple.com>
Unreviewed, re-landing r262904.
r263219 and r263175 should fix the test flakiness we saw.
Re-landed changeset:
"[Cocoa] Build callOnMainThread on WTF::RunLoop rather than on
a timer"
https://bugs.webkit.org/show_bug.cgi?id=213063
https://trac.webkit.org/changeset/262904
2020-06-18 David Kilzer <ddkilzer@apple.com>
[IPC hardening] OptionSet<> values should be validated
<https://webkit.org/b/213199>
<rdar://problem/64369963>
Reviewed by Anders Carlsson.
* wtf/OptionSet.h:
(WTF::isValidOptionSet): Add.
2020-06-17 Mark Lam <mark.lam@apple.com>
Replace JSC::FreeList linked list with a Bitmap.
https://bugs.webkit.org/show_bug.cgi?id=213071
Reviewed by Filip Pizlo.
1. Use countOfBits<> template to compute the number of bits.
2. Introduce log2() and log2Constexpr() utility functions.
3. Make Bitmap<>::forEachSetBit() a little bit more efficient: we don't need to
keep iterating if the bitmap word is already empty of bits.
* wtf/Bitmap.h:
(WTF::WordType>::forEachSetBit const):
* wtf/MathExtras.h:
(WTF::clzConstexpr):
(WTF::clz):
(WTF::ctzConstexpr):
(WTF::ctz):
(WTF::getMSBSet):
(WTF::getMSBSetConstexpr):
(WTF::log2):
(WTF::log2Constexpr):
2020-06-17 David Kilzer <ddkilzer@apple.com>
Replace OptionSetTraits/OptionSetValues with EnumTraits/EnumValues
<https://webkit.org/b/213264>
Reviewed by Brent Fulgham.
* wtf/OptionSet.h:
(WTF::isValidOptionSetEnum):
(WTF::maskRawValue):
- Replace OptionSetTraits<>/OptionSetValues<> with
EnumTraits<>/EnumValues<>.
2020-06-08 Andy Estes <aestes@apple.com>
[Apple Pay] Enable layout tests on more platforms
https://bugs.webkit.org/show_bug.cgi?id=212955
<rdar://problem/64174156>
Reviewed by Alex Christensen.
* wtf/PlatformEnableCocoa.h: Removed ENABLE_APPLE_PAY_INSTALLMENT_IDENTIFIERS,
ENABLE_APPLE_PAY_INSTALLMENT_ITEMS, ENABLE_APPLE_PAY_SESSION_V8,
ENABLE_APPLE_PAY_SESSION_V9, and ENABLE_APPLE_PAY_SESSION_V10.
* wtf/PlatformHave.h: Removed HAVE_PASSKIT_INSTALLMENT_IDENTIFIERS and corrected iOS version
checks for HAVE_PASSKIT_INSTALLMENTS.
2020-06-16 Michael Catanzaro <mcatanzaro@gnome.org>
Fix build with !HAVE(MACHINE_CONTEXT)
https://bugs.webkit.org/show_bug.cgi?id=213223
<rdar://problem/64390209>
Reviewed by Yusuke Suzuki.
In r263074, I messed up and broke the build with !HAVE(MACHINE_CONTEXT). Even though the
sole purpose of that commit was to fix !HAVE(MACHINE_CONTEXT), I must have somehow messed up
when testing my change.
Anyway, we can just create an empty PlatformRegisters object when HAVE(MACHINE_CONTEXT) is
false. At first, I was worried that passing an empty PlatformRegisters could be open to
misuse, but it's actually hard to misuse it because the only sensible thing you can do with
it is pass it to MachineContext, and you can't use MachineContext outside
HAVE(MACHINE_CONTEXT), so we should be good.
* wtf/threads/Signals.cpp:
(WTF::jscSignalHandler):
2020-06-16 Chris Dumez <cdumez@apple.com>
Stop calling userPreferredLanguages() in the UIProcess
https://bugs.webkit.org/show_bug.cgi?id=213214
<rdar://problem/64317593>
Reviewed by Per Arne Vollan.
Export WTF::languageDidChange() so we can call it from WebKit2.
* wtf/Language.h:
2020-06-16 Mark Lam <mark.lam@apple.com>
Add SIGABRT handler for non OS(DARWIN) builds to the jsc shell with the -s option.
https://bugs.webkit.org/show_bug.cgi?id=213200
Reviewed by Michael Catanzaro.
* wtf/threads/Signals.h:
(WTF::toSystemSignal):
(WTF::fromSystemSignal):
2020-06-15 Michael Catanzaro <mcatanzaro@gnome.org>
WTF signal machinery is guarded by #if USE(PTHREADS) && HAVE(MACHINE_CONTEXT) but does not use pthreads or machine context
https://bugs.webkit.org/show_bug.cgi?id=213223
Reviewed by Mark Lam.
Use #if OS(UNIX) instead.
* wtf/WTFConfig.h:
* wtf/threads/Signals.cpp:
* wtf/threads/Signals.h:
2020-06-15 Keith Miller <keith_miller@apple.com>
REGRESSION (r263045): TestWTF.Signals.SignalsWorkOnExit crashing
https://bugs.webkit.org/show_bug.cgi?id=213211
Reviewed by Mark Lam.
Don't call toMachMask on Signal::Usr as mach doesn't support user exceptions.
* wtf/threads/Signals.cpp:
(WTF::SignalHandlers::add):
2020-06-15 Michael Catanzaro <mcatanzaro@gnome.org>
Consistently use WTF_ATTRIBUTE_PRINTF in Assertions.[cpp,h]
https://bugs.webkit.org/show_bug.cgi?id=213204
Reviewed by Darin Adler.
Use WTF_ATTRIBUTE_PRINTF for all functions taking a printf format specifier. The first
argument should be the position of the format string itself (starting from 1), and the
second argument should be the position of the ... parameter pack, or 0 for functions that
take a va_list.
* wtf/Assertions.cpp:
* wtf/Assertions.h:
2020-06-15 Keith Miller <keith_miller@apple.com>
Unreviewed, build fix for build without mach exceptions.
* wtf/threads/Signals.cpp:
(WTF::SignalHandlers::add):
(WTF::addSignalHandler):
2020-06-15 Keith Miller <keith_miller@apple.com>
Signal handlers should have a two phase installation.
https://bugs.webkit.org/show_bug.cgi?id=213160
Reviewed by Mark Lam.
LLDB does not like it when we single step while there are mach exception
handlers installed because LLDB suspends all the non-active threads.
With Mach exception handlers installed, the OS will send a mach message
to our exception handler port, which is different than the active thread.
When this happens, the combination of LLDB and the process JSC is in effectively
deadlock.
Under our new approach, we go back to only telling the OS we care about
these exceptions late but lock down the function pointers early. This way
processes that benefit from our exception handler code are easier to debug.
* wtf/threads/Signals.cpp:
(WTF::addSignalHandler):
(WTF::activateSignalHandlersFor):
(WTF::installSignalHandler): Deleted.
* wtf/threads/Signals.h:
2020-06-15 Per Arne Vollan <pvollan@apple.com>
Pack bytes a little tighter in MemoryPressureHandler
https://bugs.webkit.org/show_bug.cgi?id=200392
Reviewed by Yusuke Suzuki.
Save a tiny bit of memory by packing member variables tighter in MemoryPressureHandler.
* wtf/MemoryPressureHandler.h:
2020-06-12 Keith Miller <keith_miller@apple.com>
Tests expecting a crash should use a signal handler in the JSC CLI process
https://bugs.webkit.org/show_bug.cgi?id=212479
Reviewed by Yusuke Suzuki.
Add signals for floating point exceptions and breakpoints. There's a
note for breakpoints that explains how using them in the same process
as lldb will cause badness. Fortunately, the only place I plan on using
the breakpoint handler is to check for tests where crashing is expected.
* wtf/threads/Signals.cpp:
(WTF::fromMachException):
(WTF::toMachMask):
* wtf/threads/Signals.h:
(WTF::toSystemSignal):
(WTF::fromSystemSignal):
2020-06-12 Jason Lawrence <lawrence.j@apple.com>
Unreviewed, reverting r262904.
This commit broke a test on Mac wk1 Debug.
Reverted changeset:
"[Cocoa] Build callOnMainThread on WTF::RunLoop rather than on
a timer"
https://bugs.webkit.org/show_bug.cgi?id=213063
https://trac.webkit.org/changeset/262904
2020-06-12 Adrian Perez de Castro <aperez@igalia.com>
Build is broken with EVENT_LOOP_TYPE=GLib
https://bugs.webkit.org/show_bug.cgi?id=212987
Reviewed by Konstantin Tokarev.
* wtf/CurrentTime.cpp: Make sure that <time.h> is included to get clock_gettime() and
friends defined when USE_GLIB is disabled.
* wtf/PlatformJSCOnly.cmake: Use FileSystemGLib instead of FileSystemPOSIX when
EVENT_LOOP_TYPE=GLib is set, add missing sources needed when ENABLE_REMOTE_INSPECTOR
is set.
* wtf/glib/RunLoopSourcePriority.h: Use the same list of priorities for WPE and JSCOnly.
2020-06-11 Alex Christensen <achristensen@webkit.org>
Re-enable download resume tests
https://bugs.webkit.org/show_bug.cgi?id=213098
<rdar://problem/63512518>
Reviewed by Geoffrey Garen.
Workaround is no longer needed because underlying bug has been fixed.
* wtf/PlatformHave.h:
2020-06-11 Jonathan Bedard <jbedard@apple.com>
WebKit: Make UIGestureRecognizer build for watchOS and tvOS
https://bugs.webkit.org/show_bug.cgi?id=213038
<rdar://problem/64217654>
Reviewed by Tim Horton.
* wtf/PlatformHave.h: Enable HAVE(UI_GESTURE_RECOGNIZER_MODIFIER_FLAGS) for watchOS and tvOS.
2020-06-11 David Kilzer <ddkilzer@apple.com>
[IPC] Adopt enum class for DragSourceAction
<https://webkit.org/b/212885>
<rdar://problem/64094134>
Reviewed by Darin Adler.
* wtf/OptionSet.h:
(WTF::OptionSet::hasExactlyOneBitSet const): Add.
- Move here from WebCore::ExactlyOneBitSet() in
Source/WebCore/page/EventHandler.cpp.
(WTF::OptionSet::toSingleValue const): Add.
- Use hasExactlyOneBitSet() to determine whether exactly one
enum bitmask value can be returned.
2020-06-11 Geoffrey Garen <ggaren@apple.com>
[Cocoa] Build callOnMainThread on WTF::RunLoop rather than on a timer
https://bugs.webkit.org/show_bug.cgi?id=213063
Reviewed by Anders Carlsson.
Always use the RunLoop API for main thread tasks.
Previously, callOnMainThread sometimes scheduled a timer and sometimes
used the RunLoop. (Ironically, the timer behavior was added in r55816
with the intention to establish a single point of execution. Now, it has
the opposite effect.)
I picked the RunLoop API rather than the timer API because it moves us
closer to universally applying the RunLoop speedup in
https://bugs.webkit.org/show_bug.cgi?id=202874. Also, it avoids
allocating a timer, which can be expensive.
* wtf/cocoa/MainThreadCocoa.mm:
(WTF::scheduleDispatchFunctionsOnMainThread): The webIfExists() check
is a superset of the isWebThread() check, so we can just remove the
isWebThread() check when scheduling tasks to the web thread.
(WTF::timerFired): Deleted.
(WTF::postTimer): Deleted.
2020-06-10 Geoffrey Garen <ggaren@apple.com>
Some style improvements to main thread code
https://bugs.webkit.org/show_bug.cgi?id=213051
Reviewed by Darin Adler.
* wtf/RunLoop.cpp:
(WTF::RunLoop::initializeMain): Renamed initializeMainRunLoop => initializeMain
to match the getter's name.
(WTF::RunLoop::initializeWeb): Samesies.
(WTF::RunLoop::webIfExists): Added an IfExists accessor for use in
scheduleDispatchFunctionsOnMainThread().
(WTF::RunLoop::initializeMainRunLoop): Deleted.
(WTF::RunLoop::initializeWebRunLoop): Deleted.
* wtf/RunLoop.h:
* wtf/cocoa/MainThreadCocoa.mm:
(WTF::scheduleDispatchFunctionsOnMainThread): Use RunLoop::webIfExists()
to check for the web thread run loop, since that's more explicit than
checking a pthread variable.
(WTF::isWebThread): Renamed mainThreadPthread => webThreadPthread because
it's the web thread. Changed style on globals to "s_" for consistency.
Removed mainThreadNSThread because it was unused.
(WTF::initializeApplicationUIThread):
(WTF::initializeWebThread):
(WTF::canCurrentThreadAccessThreadLocalData):
2020-06-10 Geoffrey Garen <ggaren@apple.com>
[Cocoa] Build callOnMainThread on WTF::RunLoop rather than on NSObject methods
https://bugs.webkit.org/show_bug.cgi?id=213043
Reviewed by Simon Fraser.
Original patch by Sihui Liu.
From https://bugs.webkit.org/show_bug.cgi?id=202874, this is the subset
of Sihui's patch that unifies some of RunLoop and callOnMainThread.
My goal is to simplify the code, and shrink the diff when testing
CFRunLoopSource1 in the future.
* wtf/RunLoop.cpp:
(WTF::RunLoop::initializeWebRunLoop):
(WTF::RunLoop::web):
* wtf/RunLoop.h:
* wtf/cocoa/MainThreadCocoa.mm:
(WTF::initializeMainThreadPlatform):
(WTF::scheduleDispatchFunctionsOnMainThread):
(WTF::initializeWebThread):
(-[JSWTFMainThreadCaller call]): Deleted.
2020-06-10 Jer Noble <jer.noble@apple.com>
Catalyst WebKit apps continue to play audio after quitting
https://bugs.webkit.org/show_bug.cgi?id=212981
<rdar://problem/57089471>
Reviewed by Chris Dumez.
Add the ability to call copyToVector() on a WeakHashSet. This requires two changes:
- A template specialization that returns a Vector<WeakPtr<T>> from copyToVector()
- A template specialization that calls calculateSize() rather than size() on the object
being iterated upon.
* wtf/WeakHashSet.h:
(WTF::copyToVector):
2020-06-09 Tim Horton <timothy_horton@apple.com>
Use os_log instead of asl_log
https://bugs.webkit.org/show_bug.cgi?id=213001
Reviewed by Saam Barati.
* WTF.xcodeproj/project.pbxproj:
* wtf/Assertions.cpp:
2020-06-09 Chris Dumez <cdumez@apple.com>
Use bridge cast in String(NSString *) constructor
https://bugs.webkit.org/show_bug.cgi?id=212989
Reviewed by Darin Adler.
Use bridge cast in String(NSString *) constructor instead of a reinterpret_cast as this
is the preferred way of converting a NS Type to a CF one.
* wtf/text/cocoa/StringCocoa.mm:
(WTF::String::String):
2020-06-09 Per Arne Vollan <pvollan@apple.com>
All platforms should enable CFPrefs read only mode in the WebContent process
https://bugs.webkit.org/show_bug.cgi?id=212910
Reviewed by Tim Horton.
In https://bugs.webkit.org/show_bug.cgi?id=212411, CFPrefs read only mode was adopted, but not all platforms were included.
* wtf/PlatformHave.h:
2020-06-09 Wenson Hsieh <wenson_hsieh@apple.com>
REGRESSION (r260820): [macCatalyst] Web process crashes when uploading a file
https://bugs.webkit.org/show_bug.cgi?id=212976
<rdar://problem/64033186>
Reviewed by Tim Horton.
Add `HAVE(FRONTBOARD_SYSTEM_APP_SERVICES)`.
* wtf/PlatformHave.h:
2020-06-08 Chris Fleizach <cfleizach@apple.com>
HAVE(ACCESSIBILITY_BUNDLES_PATH) is defined in terms of PLATFORM(IOS_FAMILY) but only checks the version of __IPHONE_OS_VERSION_MIN_REQUIRED
https://bugs.webkit.org/show_bug.cgi?id=212704
<rdar://problem/63931340>
Reviewed by Darin Adler.
Ensure that this works for all iOS familes.
* wtf/PlatformHave.h:
2020-06-08 Per Arne Vollan <pvollan@apple.com>
[Cocoa] Adopt read-only mode for preferences in the WebContent process
https://bugs.webkit.org/show_bug.cgi?id=212411
Reviewed by Darin Adler.
Change name of HAVE define to match SPI name.
* wtf/PlatformHave.h:
2020-06-08 Andy Estes <aestes@apple.com>
[Apple Pay] Remove -respondsToSelector: check before calling -[PKPaymentRequest setBoundInterfaceIdentifier:]
https://bugs.webkit.org/show_bug.cgi?id=212884
<rdar://problem/64090963>
Reviewed by Youenn Fablet.
* wtf/PlatformHave.h: On macOS, HAVE_PASSKIT_BOUND_INTERFACE_IDENTIFIER should be defined
starting in Catalina.
2020-06-08 Andy Estes <aestes@apple.com>
[Apple Pay] Remove ENABLE_APPLE_PAY_SETUP, ENABLE_APPLE_PAY_SESSION_V7, and HAVE_PASSKIT_PAYMENT_SETUP
https://bugs.webkit.org/show_bug.cgi?id=212883
<rdar://problem/64090763>
Reviewed by Youenn Fablet.
These macros evaluate to true whenever ENABLE(APPLE_PAY) is true on platforms supported by
trunk WebKit, so we can either remove them or replace them with ENABLE(APPLE_PAY).
* wtf/PlatformEnableCocoa.h:
* wtf/PlatformHave.h:
2020-06-08 youenn fablet <youenn@apple.com>
[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder
https://bugs.webkit.org/show_bug.cgi?id=206582
Reviewed by Eric Carlson.
* wtf/PlatformHave.h:
2020-06-07 Andy Estes <aestes@apple.com>
[Apple Pay] HAVE(PAYMENT_METHOD_BILLING_ADDRESS) should be true on iOS
https://bugs.webkit.org/show_bug.cgi?id=212877
<rdar://problem/64080998>
Reviewed by Sam Weinig.
* wtf/PlatformHave.h:
2020-06-07 Philippe Normand <pnormand@igalia.com>
Remove ENABLE_VIDEO_TRACK ifdef guards
https://bugs.webkit.org/show_bug.cgi?id=212568
Reviewed by Youenn Fablet.
* wtf/PlatformEnable.h: Remove ENABLE_VIDEO_TRACK, which is now enabled by
default under the ENABLE_VIDEO guard.
* wtf/PlatformEnableCocoa.h: Ditto.
2020-06-06 David Kilzer <ddkilzer@apple.com>
Use OptionSet<DragOperation> for mask values
<https://webkit.org/b/212605>
Reviewed by Darin Adler.
* wtf/OptionSet.h:
(WTF::OptionSet::OptionSet):
- Add constructor for OptionSet(Optional).
2020-06-05 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, reverting r262619, r262625, and r262641.
Caused mediarecorder layout test crashes.
Reverted changesets:
"[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder"
https://bugs.webkit.org/show_bug.cgi?id=206582
https://trac.webkit.org/changeset/262619
"[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder"
https://bugs.webkit.org/show_bug.cgi?id=206582
https://trac.webkit.org/changeset/262625
"Unreviewed, silence deprecation warning to fix build with
latest SDK."
https://trac.webkit.org/changeset/262641
2020-06-05 Per Arne Vollan <pvollan@apple.com>
[Cocoa] Adopt read-only mode for preferences in the WebContent process
https://bugs.webkit.org/show_bug.cgi?id=212411
Reviewed by Darin Adler.
Create HAVE define indicating support for read-only preference SPI.
* wtf/PlatformHave.h:
2020-06-05 youenn fablet <youenn@apple.com>
[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder
https://bugs.webkit.org/show_bug.cgi?id=206582
Reviewed by Eric Carlson.
* wtf/PlatformHave.h:
2020-06-04 Jonathan Bedard <jbedard@apple.com>
WTF: Exclude MachExceptions.defs from all embedded builds
https://bugs.webkit.org/show_bug.cgi?id=212796
Reviewed by Alexey Proskuryakov.
* Configurations/WTF.xcconfig:
2020-06-04 Wenson Hsieh <wenson_hsieh@apple.com>
[macOS] Add a way to override the contact AutoFill button image
https://bugs.webkit.org/show_bug.cgi?id=212775
<rdar://problem/60381452>
Reviewed by Tim Horton.
Rename `SYSTEM_ATTACHMENT_PLACEHOLDER_ICON` to `ALTERNATE_ICONS`.
* wtf/PlatformHave.h:
2020-06-04 Jacob Uphoff <jacob_uphoff@apple.com>
Unreviewed, reverting r262546.
This commit caused internal build failures
Reverted changeset:
"[Cocoa] Adopt read-only mode for preferences in the
WebContent process"
https://bugs.webkit.org/show_bug.cgi?id=212411
https://trac.webkit.org/changeset/262546
2020-06-04 Per Arne Vollan <pvollan@apple.com>
[Cocoa] Adopt read-only mode for preferences in the WebContent process
https://bugs.webkit.org/show_bug.cgi?id=212411
Reviewed by Darin Adler.
Create HAVE define indicating support for read-only preference SPI.
* wtf/PlatformHave.h:
2020-06-04 Tim Horton <timothy_horton@apple.com>
Work around broken system version macro
https://bugs.webkit.org/show_bug.cgi?id=212726
Reviewed by Dan Bernstein.
* Configurations/DebugRelease.xcconfig:
2020-06-04 Andy Estes <aestes@apple.com>
[watchOS] Re-enable content filtering in the simulator build
https://bugs.webkit.org/show_bug.cgi?id=212711
<rdar://problem/63938350>
Reviewed by Wenson Hsieh.
* wtf/PlatformHave.h:
2020-06-03 Andy Estes <aestes@apple.com>
[Apple Pay] Add new values for -apple-pay-button-type
https://bugs.webkit.org/show_bug.cgi?id=212684
<rdar://problem/63908535>
Reviewed by Anders Carlsson.
* wtf/PlatformEnableCocoa.h:
2020-06-01 Simon Fraser <simon.fraser@apple.com>
Add ENABLE(WHEEL_EVENT_REGIONS), enabled on macOS which is the only platform that needs wheel event regions for scrolling thread hit-testing
https://bugs.webkit.org/show_bug.cgi?id=212620
Reviewed by Tim Horton.
Surround code related to wheel event regions with ENABLE(WHEEL_EVENT_REGIONS).
Eventually we'll use this same code for touch event regions, and when we do, we
can rejigger the #ifdefs.
* wtf/PlatformEnable.h:
* wtf/PlatformEnableCocoa.h:
2020-06-02 Mark Lam <mark.lam@apple.com>
Change Gigacage::Config to use storage in WebConfig::g_config instead of its own.
https://bugs.webkit.org/show_bug.cgi?id=212585
<rdar://problem/63812487>
Reviewed by Yusuke Suzuki.
We now think of the various Config records as being allocated from parts of a
WebConfig::g_config buffer. WTF::Config will manage the mechanics of freezing
that buffer. And the JSC VM is still the determiner of if/when to freeze the
buffer, and it will do this at the end of the construction of the very first
VM instance (as before).
Gigacage::Config reserves space in WebConfig::g_config.
WTF::Config will honor that reservation and place itself after that.
JSC::Config will continue to place itself at WTF::Config::spaceForExtensions.
The upside of this approach this is that we can now share the same memory page
for all the Configs, and can freeze them in one go.
The downside is that g_gigacageConfig, g_wtfConfig, and g_jscConfig now have to
be macros. This results in some weirdness e.g. they are no longer qualified by
namespaces: referring to WTF::g_wtfConfig is now incorrect.
* wtf/Gigacage.h:
(Gigacage::disablingPrimitiveGigacageIsForbidden):
(Gigacage::isDisablingPrimitiveGigacageForbidden): Deleted.
(Gigacage::isPrimitiveGigacagePermanentlyEnabled): Deleted.
(Gigacage::canPrimitiveGigacageBeDisabled): Deleted.
* wtf/WTFConfig.cpp:
(WTF::Config::permanentlyFreeze):
* wtf/WTFConfig.h:
(): Deleted.
2020-06-01 Simon Fraser <simon.fraser@apple.com>
Add ENABLE(TOUCH_ACTION_REGIONS) to wrap code that's only relevant for platforms that consult touch-action for event handling
https://bugs.webkit.org/show_bug.cgi?id=212572
Reviewed by Andy Estes.
* wtf/PlatformEnable.h:
* wtf/PlatformEnableCocoa.h:
2020-05-31 Mark Lam <mark.lam@apple.com>
Change JSC::Config to use storage in WTF::Config instead of its own.
https://bugs.webkit.org/show_bug.cgi?id=212575
<rdar://problem/63796584>
Reviewed by Yusuke Suzuki.
* wtf/WTFConfig.h:
2020-05-30 Mark Lam <mark.lam@apple.com>
Rename Signal::BadAccess to Signal::AccessFault.
https://bugs.webkit.org/show_bug.cgi?id=212577
Reviewed by Yusuke Suzuki.
This is needed because GTK port's X11 has a #define for BadAccess (in include/X11/X.h):
#define BadAccess 10 /* depending on context:
- key/button already grabbed
- attempt to free an illegal
cmap entry
- attempt to store into a read-only
color map entry.
- attempt to modify the access control
list from other than the local host.
*/
As a result, this would break the GTK build when wtf/Signals.h is #include'd.
* wtf/threads/Signals.cpp:
(WTF::fromMachException):
(WTF::toMachMask):
(WTF::jscSignalHandler):
* wtf/threads/Signals.h:
(WTF::toSystemSignal):
(WTF::fromSystemSignal):
2020-05-29 Alex Christensen <achristensen@webkit.org>
Use correct encoding when converting a WTF::URL to CFURLRef
https://bugs.webkit.org/show_bug.cgi?id=212486
Reviewed by Darin Adler.
* wtf/cf/CFURLExtras.cpp:
(WTF::createCFURLFromBuffer):
* wtf/cf/CFURLExtras.h:
* wtf/cf/URLCF.cpp:
(WTF::URL::createCFURL const):
* wtf/cocoa/URLCocoa.mm:
(WTF::URL::createCFURL const):
2020-05-29 Brent Fulgham <bfulgham@apple.com>
[Cocoa] Improve logging quality for non-ephemeral sessions
https://bugs.webkit.org/show_bug.cgi?id=212551
<rdar://problem/62461099>
Reviewed by David Kilzer.
* wtf/PlatformHave.h: Add new feature check for CFNetwork convenience setter.
2020-05-29 Wenson Hsieh <wenson_hsieh@apple.com>
REGRESSION (r261812): editing/async-clipboard/clipboard-item-get-type-basic.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=212281
<rdar://problem/63554912>
Reviewed by Tim Horton.
Add a new `HAVE()` define.
* wtf/PlatformHave.h:
2020-05-27 Keith Miller <keith_miller@apple.com>
for-of should check the iterable is a JSArray for FastArray in DFG iterator_open
https://bugs.webkit.org/show_bug.cgi?id=212383
Reviewed by Saam Barati.
Optional should be able to copy/move constructor itself as long as <T> is
trivially copyable. This lets us copy Optionals into const globals without
global constructors.
* wtf/Optional.h:
(WTF::Optional::Optional):
(WTF::Optional::__NOEXCEPT_):
2020-05-27 Noam Rosenthal <noam@webkit.org>
Implement AccessKeyLabel attribute.
https://bugs.webkit.org/show_bug.cgi?id=72715
Reviewed by Darin Adler.
Added character names for upArrow/option, as they're needed for accessKeyLabel.
* wtf/unicode/CharacterNames.h:
2020-05-27 Saam Barati <sbarati@apple.com>
Improve comments about OS/PLATFORM(IOS) and friends
https://bugs.webkit.org/show_bug.cgi?id=212438
Reviewed by Tim Horton.
* wtf/PlatformLegacy.h:
* wtf/PlatformOS.h:
2020-05-27 David Kilzer <ddkilzer@apple.com>
Add OptionSetTraits<> and use with WebCore::DragDestinationAction
<https://webkit.org/b/212397>
Reviewed by Alex Christensen.
Add OptionSetTraits<> (similar to EnumTraits<>) to define all
valid values for a given enum type. This allows us to use that
bitmask with OptionSet<>::fromRaw() to clear undefined bits, and
to validate enum values used with the OptionSet<> constructors.
Note that the extra validation possible with OptionSetTraits<>
is enabled based on the existence of that type using the new
WTF::is_type_complete_v<> type trait. Other OptionSet<> enums
fall back to the original validation checks.
Finally, typename <T> is changed to <E> for OptionSet<> to
emphasize that it's an enum typename.
* wtf/OptionSet.h:
(WTF::is_type_complete_v): Add.
(WTF::OptionSetTraits): Add.
(WTF::OptionSetValues): Add.
(WTF::OptionSetValueChecker): Add.
(WTF::isValidOptionSetEnum): Add.
(WTF::maskRawValue): Add.
(WTF::OptionSet::Iterator::operator* const):
(WTF::OptionSet::fromRaw):
(WTF::OptionSet::OptionSet):
(WTF::OptionSet::contains const):
2020-05-27 Michael Catanzaro <mcatanzaro@gnome.org>
-Wdeprecated-copy caused by Bitmap copy assignment operator
https://bugs.webkit.org/show_bug.cgi?id=212421
Reviewed by Mark Lam.
This copy assignment operator is not needed, and causes warnings because we do not have a
corresponding copy constructor. We could add a copy constructor, but it's easiest to just
remove the copy assignment operator.
* wtf/Bitmap.h:
2020-05-26 Darin Adler <darin@apple.com>
Sort PlatformEnableCocoa.h and add definitions for the simple cases from FeatureDefines.xcconfig
https://bugs.webkit.org/show_bug.cgi?id=212389
Reviewed by Anders Carlsson.
Added more PlatformEnableCocoa.h; allowing us to later remove things from
FeatureDefines.xcconfig (patch forthcoming).
* wtf/PlatformEnableCocoa.h: Added definitions from FeatureDefines.xcconfig that
were simple, and that differ from the defaults in PlatformEnable.h. That includes
3D_TRANSFORMS, ACCESSIBILITY_ISOLATED_TREE (macOS >= 10.6), APPLICATION_MANIFEST,
ASYNC_SCROLLING, ATTACHMENT_ELEMENT, AVF_CAPTIONS, CACHE_PARTITIONING,
CSS_COMPOSITING, CSS_PAINTING_API, CSS_SCROLL_SNAP, CSS_SELECTORS_LEVEL4,
CSS_TRAILING_WORD, CSS_TYPED_OM, DATACUE_VALUE, DATALIST_ELEMENT, FILTERS_LEVEL_2,
GPU_PROCESS, INDEXED_DATABASE, INDEXED_DATABASE_IN_WORKERS, INSPECTOR_TELEMETRY,
INTERSECTION_OBSERVER, LAYOUT_FORMATTING_CONTEXT, LEGACY_CSS_VENDOR_PREFIXES,
LEGACY_CUSTOM_PROTOCOL_MANAGER, MEDIA_CONTROLS_SCRIPT, MEMORY_SAMPLER,
MOUSE_CURSOR_SCALE (macOS), NETWORK_CACHE_SPECULATIVE_REVALIDATION,
NETWORK_CACHE_STALE_WHILE_REVALIDATE, NOTIFICATIONS (macOS), PDFKIT_PLUGIN (macOS),
PERIODIC_MEMORY_MONITOR (macOS), PUBLIC_SUFFIX_LIST, RESIZE_OBSERVER,
RESOURCE_LOAD_STATISTICS, RUBBER_BANDING (macOS), SANDBOX_EXTENSIONS,
SERVER_PRECONNECT, SERVICE_CONTROLS (macOS), SHAREABLE_RESOURCE,
TELEPHONE_NUMBER_DETECTION, TEXT_AUTOSIZING, USERSELECT_ALL, USER_MESSAGE_HANDLERS,
VARIATION_FONTS, VIDEO, VIDEO_USES_ELEMENT_FULLSCREEN (macOS),
WEBDRIVER_KEYBOARD_INTERACTIONS, WEBDRIVER_MOUSE_INTERACTIONS (macOS),
WEBGL, WEBGL2, WEB_AUDIO, WEB_CRYPTO, and WIRELESS_PLAYBACK_TARGET. Sorted and
merged all the existing settings.
2020-05-26 Alex Christensen <achristensen@webkit.org>
UTF-8 encode strings of invalid URLs when converting WTF::URL to NSURL instead of truncating the UTF-16 encoding
https://bugs.webkit.org/show_bug.cgi?id=212393
<rdar://problem/63095503>
Reviewed by Tim Horton.
This only changes behavior in code that is marked as UNLIKELY because it can only be reached by invalid unicode URLs,
but it can be reached and should behave in a reasonable manner in those cases. This makes Safari behave more similarly
to Firefox in this case instead of doing something similar to no other browser.
* wtf/URL.cpp:
(WTF::copyASCII): Deleted.
(WTF::URL::copyToBuffer const): Deleted.
* wtf/URL.h:
* wtf/cf/URLCF.cpp:
(WTF::URL::createCFURL const):
* wtf/cocoa/URLCocoa.mm:
(WTF::URL::createCFURL const):
2020-05-26 Yoshiaki JITSUKAWA <yoshiaki.jitsukawa@sony.com>
[PlayStation] Disable LLINT_EMBEDDED_OPCODE_ID
https://bugs.webkit.org/show_bug.cgi?id=212387
Reviewed by Don Olmstead.
* wtf/CMakeLists.txt:
* wtf/PlatformEnable.h:
* wtf/PlatformEnablePlayStation.h: Added.
2020-05-26 Mark Lam <mark.lam@apple.com>
Enhance Bitmap::setEachNthBit() to also take an end index.
https://bugs.webkit.org/show_bug.cgi?id=212386
<rdar://problem/63643324>
Reviewed by Robin Morisset.
Previously, it was only taking the n interval, and the start index.
Also fixed isEmpty() and isFull() to return a bool instead of size_t.
* wtf/Bitmap.h:
(WTF::WordType>::isEmpty const):
(WTF::WordType>::isFull const):
(WTF::WordType>::setEachNthBit):
2020-05-26 Don Olmstead <don.olmstead@sony.com>
[CMake] Add static analyzers
https://bugs.webkit.org/show_bug.cgi?id=212280
Reviewed by David Kilzer.
Export headers from Plaform.h so include-what-you-use does not suggest they be
included directly. The headers being exported will #error when included outside of
Platform.h
* wtf/Platform.h:
2020-05-25 Alex Christensen <achristensen@webkit.org>
Expose more network metrics to WebCoreNSURLSession
https://bugs.webkit.org/show_bug.cgi?id=212359
<rdar://problem/62909440>
Reviewed by Darin Adler.
* wtf/PlatformHave.h:
2020-05-22 David Kilzer <ddkilzer@apple.com>
WTF::isValidEnum() has a typo in static_assert making it a tautological comparison
<https://webkit.org/b/212290>
Reviewed by Yusuke Suzuki.
* wtf/EnumTraits.h:
(WTF::isValidEnum): Use sizeof(std::underlying_type_t<E>)
instead of std::underlying_type_t<E>() to fix the bug.
2020-05-22 Chris Dumez <cdumez@apple.com>
RELEASE_ASSERT() that InitializeWebKit2() is getting called on the main thread
https://bugs.webkit.org/show_bug.cgi?id=212283
Reviewed by Alex Christensen.
* wtf/spi/darwin/dyldSPI.h:
2020-05-22 Andy Estes <aestes@apple.com>
[Apple Pay] Add new ApplePayInstallmentConfiguration members
https://bugs.webkit.org/show_bug.cgi?id=212160
<rdar://problem/60703650>
Reviewed by Alex Christensen.
* wtf/PlatformEnableCocoa.h: Defined ENABLE_APPLE_PAY_INSTALLMENT_IDENTIFIERS.
2020-05-21 Robin Morisset <rmorisset@apple.com>
Various compile-time boolean flags could/should be marked constexpr
https://bugs.webkit.org/show_bug.cgi?id=212244
Reviewed by Mark Lam.
* wtf/ParkingLot.cpp:
2020-05-20 Mark Lam <mark.lam@apple.com>
Add more Bitmap methods.
https://bugs.webkit.org/show_bug.cgi?id=212190
<rdar://problem/63481333>
Reviewed by Robin Morisset.
Specifically,
setEachNthBit - sets every Nth bit starting at a specified start bit
operator= - assignment
operator|= - bit or and assignment
operator&= - bit and and assignment
operator^= - bit xor and assignment
* wtf/Bitmap.h:
2020-05-21 Yoshiaki Jitsukawa <yoshiaki.jitsukawa@sony.com>
[PlayStation] Add minimal WKView API to enable TestWebKitAPI
https://bugs.webkit.org/show_bug.cgi?id=211868
Reviewed by Alex Christensen.
Enable TestWebKitAPI
* wtf/PlatformPlayStation.cmake:
Link libc as a system library.
2020-05-21 Wenson Hsieh <wenson_hsieh@apple.com>
Unreviewed, fix the iOS 13.4 build after r261978
Add a `HAVE()` macro to guard usages of _UIHoverEventRespondable.
* wtf/PlatformHave.h:
2020-05-20 Simon Fraser <simon.fraser@apple.com>
[macOS] Scrolling synchronization part 1: Have the scrolling thread wait half a frame for the main thread to complete the rendering update
https://bugs.webkit.org/show_bug.cgi?id=212168
Reviewed by Tim Horton.
Some new trace points for scrolling thread activity.
* wtf/SystemTracing.h:
2020-05-20 Tim Horton <timothy_horton@apple.com>
WKMouseGestureRecognizer should be implemented without using UIKit internals
https://bugs.webkit.org/show_bug.cgi?id=212173
<rdar://problem/61163726>
Reviewed by Wenson Hsieh.
* wtf/PlatformHave.h:
2020-05-20 Alex Christensen <achristensen@webkit.org>
Remove implicit URL->String conversion operators
https://bugs.webkit.org/show_bug.cgi?id=211033
Reviewed by Darin Adler.
These operators have been the cause of many subtle bugs related to type inference that are hard to see in the code,
as well as performance bugs where we unnecessarily re-parse parsed URLs.
After my recent cleanup this was easier than I thought it would be.
* wtf/URL.h:
(WTF::URL::operator const String& const): Deleted.
(WTF::URL::operator StringView const): Deleted.
(WTF::URL::operator NSString * const): Deleted.
2020-05-20 Antoine Quint <graouts@apple.com>
[Web Animations] Animation engine should not wake up every tick for steps timing functions
https://bugs.webkit.org/show_bug.cgi?id=212103
<rdar://problem/62737868>
Reviewed by Simon Fraser.
Allow Seconds to be divided or multiplied by a double with operands in any order.
* wtf/Seconds.h:
(WTF::operator*):
(WTF::operator/):
2020-05-20 Youenn Fablet <youenn@apple.com>
[Mac] Use preferedPixelBufferFormat for AVVideoCaptureSource
https://bugs.webkit.org/show_bug.cgi?id=212071
Reviewed by Eric Carlson.
* wtf/PlatformHave.h:
Add HAVE_DISPLAY_LAYER_BIPLANAR_SUPPORT macro.
2020-05-19 Adrian Perez de Castro <aperez@igalia.com>
WTF::LockedPrintStream should be final
https://bugs.webkit.org/show_bug.cgi?id=212107
Reviewed by Darin Adler.
* wtf/LockedPrintStream.h: Make class WTF::LockedPrintStream final.
2020-05-19 Mark Lam <mark.lam@apple.com>
Put PtrTagLookup data structures in Configs for freezing.
https://bugs.webkit.org/show_bug.cgi?id=212089
<rdar://problem/63401487>
Reviewed by Robin Morisset.
* wtf/PtrTag.cpp:
(WTF::tagForPtr):
(WTF::ptrTagName):
(WTF::registerPtrTagLookup):
* wtf/PtrTag.h:
(WTF::PtrTagLookup::initialize):
* wtf/WTFConfig.h:
2020-05-19 Mark Lam <mark.lam@apple.com>
Remove unnecessary debug logging from release builds.
https://bugs.webkit.org/show_bug.cgi?id=212084
<rdar://problem/63398704>
Reviewed by Saam Barati.
* wtf/PtrTag.h:
2020-05-18 Andy Estes <aestes@apple.com>
http/tests/ssl/applepay/ApplePayInstallmentConfiguration.https.html fails in public SDK builds
https://bugs.webkit.org/show_bug.cgi?id=212000
<rdar://problem/63323082>
Reviewed by Youenn Fablet.
* wtf/PlatformEnableCocoa.h:
* wtf/PlatformHave.h:
2020-05-18 Mark Lam <mark.lam@apple.com>
Implement a faster findBitInWord() using the hardware ctz instruction.
https://bugs.webkit.org/show_bug.cgi?id=212032
<rdar://problem/63348086>
Reviewed by Saam Barati.
Based on local microbenchmarking, both ARM64 and X86_64 shows a speed up of
28% - 95% faster than the loop.
The largest perf regressions for ctz vs the loop, are when finding 1 in a mostly
set word or finding 0 in a mostly cleared word. For example, on X86_64:
Find 1 in 0xffffffffffffffff: using loop 8.67 ms, using ctz 6.07 ms, delta 30.0%
Find 0 in 0x8000000000000000: using loop 9.01 ms, using ctz 6.54 ms, delta 28.1%
The largest perf progressions for ctz vs the loop, are the opposite: finding 1 in
a mostly cleared word, or finding a 0 in a mostly set word. For example, on X86_64:
Find 1 in 0x8000000000000000: using loop 91.4 ms, using ctz 6.48 ms, delta 92.9%
Find 0 in 0xffffffffffffffff: using loop 91.7 ms, using ctz 6.95 ms, delta 92.4%
TL;DR: the microbenchmark methodology used:
findBitInWord() takes:
a. word to scan
b. startIndex
c. endIndex
d. bool value to scan for, either 1 or 0.
1. Randomly select 1000 startIndex and endIndex pairs.
The endIndex is guaranteed to be >= startIndex.
2. Using a base word of 0xffffffffffffffff (or uint64_t) and 0xffffffff (for uint32_t),
shift left by 0 - N (where N is the number of bits in the word) to generate
N + 1 words for the test. This produces words with contiguous lengths of 1s
and 0s. We're choosing these words to deliberately measure the effects o
run lengths of 0s or 1s on the algorithm in use.
3. For each test word, call findBitInWord() with the start and end indexes chosen
in 1 for a 100 iterations.
4. Run (3) once to search for a true value, and once to search for a false value.
5. Print the results for each test word and value pair.
* wtf/BitVector.cpp:
* wtf/Bitmap.h:
* wtf/StdLibExtras.h:
(WTF::findBitInWord):
2020-05-18 Darin Adler <darin@apple.com>
Add iterator checking to ListHashSet
https://bugs.webkit.org/show_bug.cgi?id=211669
Reviewed by Anders Carlsson.
HashSet and HashMap have iterator checking in debug builds.
Add similar checking to ListHashSet, controlled by the same
macro, CHECK_HASHTABLE_ITERATORS. Use WeakPtr to make the
implementation simple.
* wtf/Forward.h: Update to add a second parameter to WeakPtr.
Also rearranged and tweaked the file a bug.
* wtf/ListHashSet.h: Make ListHashSet and ListHashSetNode derive
from CanMakeWeakPtr. Add m_weakSet and m_weakPosition members to
ListHashSetConstIterator, and assert their values at the appropriate
times so we will get a breakpoint or crash.
* wtf/WeakHashSet.h: Updated to add a Counter argument for testing.
* wtf/WeakPtr.h: Removed the DID_CREATE_WEAK_PTR_IMPL and
WILL_DESTROY_WEAK_PTR_IMPL macros, which didn't really work because
using them violated the C++ one-definition rule. Replaced with
a Counter argument, which defaults to EmptyCounter, which is inlines
that do nothing. This required some updates to the classes and
functions to make them work with a second argument.
2020-05-15 Alex Christensen <achristensen@webkit.org>
Make host parser fail on ^
https://bugs.webkit.org/show_bug.cgi?id=211901
Reviewed by Geoffrey Garen.
This matches the behavior of Chrome and Firefox, and now the specification!
I updated the URL wpt data, and this introduces new PASSes.
* wtf/URLParser.cpp:
(WTF::isC0Control):
(WTF::isForbiddenHostCodePoint):
2020-05-14 Wenson Hsieh <wenson_hsieh@apple.com>
[macOS] Update the placeholder icon image for attachment elements with progress="0"
https://bugs.webkit.org/show_bug.cgi?id=211898
<rdar://problem/63203900>
Reviewed by Timothy Hatcher.
Add a new flag for HAVE(SYSTEM_ATTACHMENT_PLACEHOLDER_ICON).
* wtf/PlatformHave.h:
2020-05-14 Chris Dumez <cdumez@apple.com>
Regression(r254856) Family Health iOS app is broken due to lack for WebSQL support
https://bugs.webkit.org/show_bug.cgi?id=211896
<rdar://problem/63025045>
Reviewed by Maciej Stachowiak.
* wtf/spi/darwin/dyldSPI.h:
2020-05-13 Ross Kirsling <ross.kirsling@sony.com>
[IWYU] Try removing redundant includes in WTF implementation files
https://bugs.webkit.org/show_bug.cgi?id=211821
Reviewed by Simon Fraser.
* wtf/Assertions.cpp:
* wtf/Bag.cpp:
* wtf/BitVector.cpp:
* wtf/ConcurrentBuffer.cpp:
* wtf/ConcurrentPtrHashSet.cpp:
* wtf/CrossThreadCopier.cpp:
* wtf/CurrentTime.cpp:
* wtf/DataLog.cpp:
* wtf/DateMath.cpp:
* wtf/FastBitVector.cpp:
* wtf/FastMalloc.cpp:
* wtf/FileSystem.cpp:
* wtf/Gigacage.cpp:
* wtf/HashTable.cpp:
* wtf/JSValueMalloc.cpp:
* wtf/Language.cpp:
* wtf/MainThread.cpp:
* wtf/MetaAllocator.cpp:
* wtf/MonotonicTime.cpp:
* wtf/NumberOfCores.cpp:
* wtf/OSLogPrintStream.cpp:
* wtf/ParallelHelperPool.cpp:
* wtf/ParkingLot.cpp:
* wtf/PrintStream.cpp:
* wtf/RAMSize.cpp:
* wtf/RandomDevice.cpp:
* wtf/RandomNumber.cpp:
* wtf/RefCountedArray.cpp:
* wtf/RefCountedLeakCounter.cpp:
* wtf/SegmentedVector.cpp:
* wtf/SmallPtrSet.cpp:
* wtf/StackBounds.cpp:
* wtf/ThreadGroup.cpp:
* wtf/Threading.cpp:
* wtf/TimeWithDynamicClockType.cpp:
* wtf/URL.cpp:
* wtf/URLParser.cpp:
* wtf/UUID.cpp:
* wtf/UniqueArray.cpp:
* wtf/Vector.cpp:
* wtf/WTFConfig.cpp:
* wtf/WallTime.cpp:
* wtf/WordLock.cpp:
* wtf/WorkQueue.cpp:
* wtf/WorkerPool.cpp:
* wtf/generic/WorkQueueGeneric.cpp:
* wtf/posix/OSAllocatorPOSIX.cpp:
* wtf/posix/ThreadingPOSIX.cpp:
* wtf/text/AtomString.cpp:
* wtf/text/AtomStringImpl.cpp:
* wtf/text/AtomStringTable.cpp:
* wtf/text/CString.cpp:
* wtf/text/StringBuffer.cpp:
* wtf/text/StringBuilder.cpp:
* wtf/text/StringImpl.cpp:
* wtf/text/StringView.cpp:
* wtf/text/TextBreakIterator.cpp:
* wtf/text/TextStream.cpp:
* wtf/text/WTFString.cpp:
* wtf/threads/Signals.cpp:
2020-05-13 Jer Noble <jer.noble@apple.com>
Replace isNullFunctionPointer with real weak-linking support
https://bugs.webkit.org/show_bug.cgi?id=211751
Reviewed by Sam Weinig.
Replace isNullFunctionPointer with a macro which explicitly marks symbols as weakly imported.
* wtf/darwin/WeakLinking.h:
(WTF::isNullFunctionPointer): Deleted.
2020-05-12 Mark Lam <mark.lam@apple.com>
catch_mach_exception_raise_state() should fail early if the faulting address is not of interest.
https://bugs.webkit.org/show_bug.cgi?id=211799
<rdar://problem/62939204>
Reviewed by Saam Barati.
* wtf/threads/Signals.cpp:
2020-05-12 Jer Noble <jer.noble@apple.com>
REGRESSION(r258314): 5% regression on Membuster5
https://bugs.webkit.org/show_bug.cgi?id=211803
<rdar://problem/60609824>
Reviewed by Darin Adler.
Disable HAVE(AVSAMPLEBUFFERVIDEOOUTPUT), as it caused a large regression in our Membuster5 benchmark.
* wtf/PlatformHave.h:
2020-05-12 Ross Kirsling <ross.kirsling@sony.com>
Fix existing usage of final/override/virtual in JSC and WTF
https://bugs.webkit.org/show_bug.cgi?id=211772
Reviewed by Darin Adler.
* wtf/Assertions.cpp:
* wtf/Expected.h:
* wtf/FilePrintStream.h:
* wtf/JSONValues.h:
* wtf/LockedPrintStream.h:
* wtf/OSLogPrintStream.h:
* wtf/ParallelHelperPool.cpp:
* wtf/RunLoop.h:
* wtf/SharedTask.h:
* wtf/StringPrintStream.h:
* wtf/WorkQueue.h:
* wtf/WorkerPool.cpp:
2020-05-11 Darin Adler <darin@apple.com>
Fix problems caught by replacing WTF::Optional with std::optional
https://bugs.webkit.org/show_bug.cgi?id=211703
Reviewed by Chris Dumez.
* wtf/URLHelpers.cpp:
(WTF::URLHelpers::mapHostName): Make URLDecodeFunction a function
pointer and use nullptr instead of trying to use Optional<> with
a function reference.
(WTF::URLHelpers::collectRangesThatNeedMapping): Ditto.
(WTF::URLHelpers::applyHostNameFunctionToMailToURLString): Ditto.
(WTF::URLHelpers::applyHostNameFunctionToURLString): Ditto.
(WTF::URLHelpers::mapHostNames): Ditto.
(WTF::URLHelpers::userVisibleURL): Ditto.
* wtf/URLHelpers.h: Ditto.
* wtf/cocoa/NSURLExtras.mm:
(WTF::decodeHostName): Pass nullptr for URLDecodeFunction.
2020-05-11 Yusuke Suzuki <ysuzuki@apple.com>
AtomString::init should temporarily disable checks via `isMainThread` due to WebThread's inconsistent state
https://bugs.webkit.org/show_bug.cgi?id=211754
Reviewed by Dean Jackson.
When starting WebThread via StartWebThread function, we have special period between the prologue of StartWebThread and spawning WebThread actually.
In this period, `isMainThread()` returns false even if this is called on the main thread since WebThread is now enabled and we are not taking a WebThread lock.
This causes assertion hits in MainThreadLazyNeverDestroyed initialization only in WebThread platforms.
This patch takes conservative approach to fix this assertion hits: just bypass these assertions since this should not be fired. We bypass assertions by using
constructWithoutAccessCheck, which intentionally skips `isMainThread()` check for construction. In non WebThread environment, we do not lose the assertion
coverage since we already have ASSERT(isUIThread()). And ASSERT(isUIThread()) ensures that this is called in system main thread in WebThread platforms.
Unfortunately, we have no mechanism to test this effectively. WK1 LayoutTests runner cannot show assertions since WK1 runners already initialize necessary
things somewhere before calling AtomString::init() in StartWebThread. This is the same in TestWebKitAPI. For now, I manually tested that assertion does not fire.
* wtf/NeverDestroyed.h:
(WTF::LazyNeverDestroyed::construct):
(WTF::LazyNeverDestroyed::constructWithoutAccessCheck):
(WTF::LazyNeverDestroyed::storagePointerWithoutAccessCheck const):
(WTF::LazyNeverDestroyed::storagePointer const):
* wtf/text/AtomString.cpp:
(WTF::AtomString::init):
2020-05-11 Basuke Suzuki <basuke.suzuki@sony.com>
[bmalloc][WTF] Add computing memory size implementation for FreeBSD
https://bugs.webkit.org/show_bug.cgi?id=211749
Reviewed by David Kilzer.
Share sysinfo(3) implementation with Linux and FreeBSD.
* wtf/RAMSize.cpp:
(WTF::computeRAMSize):
2020-05-11 Mark Lam <mark.lam@apple.com>
Introduce WTF::Config and put Signal.cpp's init-once globals in it.
https://bugs.webkit.org/show_bug.cgi?id=211729
<rdar://problem/62938878>
Reviewed by Keith Miller and Saam Barati.
1. Added WTF::Config for storing globals that effectively serve as constants i.e
we'll be initializing them before or during the first VM instantiation, but
should not have any reason to modify them later. The WTF::Config will be frozen
(along with JSC::Config) at the end of instantiating the first VM instance.
2. Added a Config::AssertNotFrozenScope RAII object to ensure that initialization
operations that should only be called at initialization time, will not be
called once the Config has been frozen.
3. Moved most of Signal.cpp's globals into WTF::Config. The only globals (or
statics) not moved are ones that cannot be moved because they require a
non-trivial default constructor (once_flag), or need to be modifiable
at runtime (e.g. Lock).
Instead of freezing the once_flag, we sanity check the call_once block with
the Config::AssertNotFrozenScope.
4. SignalHandler records are now allocated from arrays of SignalHandlerMemory in
the WTF::Config. The number of signal handlers we will ever install is always
finite. Hence, there's no reason to use a dynamic data structure like the
LocklessBag to hold it.
We introduce a SignalHandlers struct to manage these arrays (and all the other
Signal.cpp globals that we want to move to the WTF::Config). Amongst other
things, SignalHandlers provides the abstractions for:
a. allocating memory for the SignalHandler instances. See SignalHandlers::alloc().
b. iterating SignalHandler instances. See SignalHandlers::forEachHandler().
To maintain the synchronization properties of the LocklessBag,
SignalHandlers::alloc() uses a mutex. In practice, this mutex will never be
contended on because all signal handlers are now installed at initialization
time before any concurrency comes into play.
5. We now initialize activeThreads() eagerly via initializeThreading. In
production configurations, this does not matter because signal handler
installations will always trigger its initialization. However, in debugging
configurations, we may end up disabling the use of all signal handlers. As a
result, we need to do this eager initialization to ensure that it is done
before we freeze the WTF::Config.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/Threading.cpp:
(WTF::initializeThreading):
* wtf/WTFConfig.cpp: Added.
(WTF::Config::disableFreezingForTesting):
(WTF::Config::permanentlyFreeze):
* wtf/WTFConfig.h: Added.
(WTF::Config::configureForTesting):
(WTF::Config::AssertNotFrozenScope::~AssertNotFrozenScope):
* wtf/threads/Signals.cpp:
(WTF::SignalHandlers::alloc):
(WTF::SignalHandlers::forEachHandler const):
(WTF::startMachExceptionHandlerThread):
(WTF::handleSignalsWithMach):
(WTF::setExceptionPorts):
(WTF::activeThreads):
(WTF::installSignalHandler):
(WTF::jscSignalHandler):
(WTF::SignalHandlers::initialize):
* wtf/threads/Signals.h:
2020-05-11 David Kilzer <ddkilzer@apple.com>
[WTF] CStringBuffer::createUninitialized() should use Checked<size_t>
<https://webkit.org/b/211746>
<rdar://problem/62729848>
Reviewed by Darin Adler.
* wtf/text/CString.cpp:
(WTF::CStringBuffer::createUninitialized):
- Switch from RELEASE_ASSERT() to Checked<size_t>() for overflow
check. RELEASE_ASSERT() was using the wrong type, too.
2020-05-11 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, reverting r261440.
Caused 6 TestWTF.WTF failures
Reverted changeset:
"Add iterator checking to ListHashSet"
https://bugs.webkit.org/show_bug.cgi?id=211669
https://trac.webkit.org/changeset/261440
2020-05-11 Tetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com>
Use alias template for <type_traits> in WTF/wtf/TypeCast.h
https://bugs.webkit.org/show_bug.cgi?id=211714
Reviewed by Darin Adler.
* wtf/TypeCasts.h:
(WTF::TypeCastTraits::isOfType):
(WTF::is):
(WTF::downcast):
2020-05-10 Darin Adler <darin@apple.com>
Add copy constructor and assignment operator to Ref<>
https://bugs.webkit.org/show_bug.cgi?id=211705
Reviewed by Sam Weinig.
As recently discussed in some WebKit bug patch review, we think that Ref and RefPtr
should have the same design, except for whether the value can be null. Ref had a
more ambitious approach to avoiding reference count churn, requiring a
call to copyRef to make any copying explicit, partly by analogy with raw C
references, which also can't be copied (but they can't be moved either). We choose
to change Ref to match RefPtr and to take the risk of additional churn. This makes
it easier to use Ref in contexts like collection classes and structures. An
alternative would be to go the other direction, and make RefPtr require a call to
copyRef: seems like an obviously worse option.
* wtf/Ref.h: Add the copy constructor and assignment operator.
These follow a similar pattern to the move constructor and assignment operator.
Also add a deprecation comment before copyRef, which we will eventually remove.
2020-05-10 Tetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com>
Use alias template to define `match_constness_t` in Wtf/wtp/TypeCasts.h
https://bugs.webkit.org/show_bug.cgi?id=211698
Reviewed by Yusuke Suzuki.
* wtf/TypeCasts.h:
(WTF::downcast):
2020-05-10 Basuke Suzuki <basuke.suzuki@sony.com>
Add ENABLE_PERIODIC_MEMORY_MONITOR flag.
https://bugs.webkit.org/show_bug.cgi?id=211704
Reviewed by Yusuke Suzuki.
Define ENABLE_PERIODIC_MEMORY_MONITOR flags in specific platform file.
* wtf/PlatformEnable.h:
* wtf/PlatformEnableCocoa.h:
2020-05-10 Darin Adler <darin@apple.com>
Remove now-unneeded HAVE(CORE_VIDEO)
https://bugs.webkit.org/show_bug.cgi?id=211677
Reviewed by Dan Bernstein.
* wtf/PlatformHave.h: Remove HAVE_CORE_VIDEO.
2020-05-09 Darin Adler <darin@apple.com>
Delete some dead code in WorkQueueCocoa.cpp
https://bugs.webkit.org/show_bug.cgi?id=211676
Reviewed by Chris Dumez.
* wtf/cocoa/WorkQueueCocoa.cpp:
(WTF::targetQueueForQOSClass): Deleted.
2020-05-09 Darin Adler <darin@apple.com>
Add iterator checking to ListHashSet
https://bugs.webkit.org/show_bug.cgi?id=211669
Reviewed by Anders Carlsson.
HashSet and HashMap have iterator checking in debug builds.
Add similar checking to ListHashSet, controlled by the same
macro, CHECK_HASHTABLE_ITERATORS. Use WeakPtr to make the
implementation simple.
* wtf/ListHashSet.h: Make ListHashSet and ListHashSetNode derive
from CanMakeWeakPtr. Add m_weakSet and m_weakPosition members to
ListHashSetConstIterator, and assert their values at the appropriate
times so we will get a breakpoint or crash.
2020-05-08 Darin Adler <darin@apple.com>
Streamline MarkupAccumulator to improve efficiency a bit
https://bugs.webkit.org/show_bug.cgi?id=211656
Reviewed by Anders Carlsson.
* wtf/text/StringBuilder.cpp:
(WTF::StringBuilder::isAllASCII const): Added.
* wtf/text/StringBuilder.h: Added isAllASCII.
2020-05-09 David Quesada <david_quesada@apple.com>
Remove HAVE_UI_SCROLL_VIEW_INDICATOR_FLASHING_SPI
https://bugs.webkit.org/show_bug.cgi?id=211662
rdar://problem/63048713
Reviewed by Darin Adler.
* wtf/PlatformHave.h:
2020-05-08 Basuke Suzuki <basuke.suzuki@sony.com>
[WTF] Share Linux's MemoryPressureHandler among other Unix ports
https://bugs.webkit.org/show_bug.cgi?id=208955
Reviewed by Yusuke Suzuki.
Renamed MemoryPressureHandlerLinux to MemoryPressureHandlerUnix and added FreeBSD implementation
of memory status functions. Change PlayStation port to use it from generic implementation.
* wtf/MemoryPressureHandler.cpp:
(WTF::MemoryPressureHandler::MemoryPressureHandler):
* wtf/MemoryPressureHandler.h:
* wtf/PlatformGTK.cmake:
* wtf/PlatformJSCOnly.cmake:
* wtf/PlatformPlayStation.cmake:
* wtf/PlatformWPE.cmake:
* wtf/generic/MemoryFootprintGeneric.cpp:
(WTF::memoryFootprint):
* wtf/unix/MemoryPressureHandlerUnix.cpp: Renamed from Source\WTF\wtf\linux\MemoryPressureHandlerLinux.cpp.
(WTF::processMemoryUsage):
2020-05-08 Darin Adler <darin@apple.com>
Remove now-unneeded HAVE(AVFOUNDATION_LOADER_DELEGATE)
https://bugs.webkit.org/show_bug.cgi?id=211646
Reviewed by Eric Carlson.
* wtf/PlatformHave.h: Don't set HAVE_AVFOUNDATION_LOADER_DELEGATE.
2020-05-08 Don Olmstead <don.olmstead@sony.com>
[clang-tidy] Run modernize-use-nullptr over WTF
https://bugs.webkit.org/show_bug.cgi?id=211628
Reviewed by Yusuke Suzuki.
Use the fix option in clang-tidy to ensure nullptr is being used across WTF.
* wtf/Assertions.cpp:
* wtf/BumpPointerAllocator.h:
(WTF::BumpPointerPool::BumpPointerPool):
(WTF::BumpPointerPool::create):
(WTF::BumpPointerAllocator::BumpPointerAllocator):
* wtf/DataLog.cpp:
(WTF::setDataFile):
* wtf/DateMath.cpp:
(WTF::parseES5DatePortion):
(WTF::parseES5TimePortion):
* wtf/FastMalloc.cpp:
(WTF::fastZeroedMalloc):
(WTF::fastStrDup):
(WTF::tryFastZeroedMalloc):
(WTF::isFastMallocEnabled):
(WTF::fastMallocGoodSize):
(WTF::fastAlignedMalloc):
(WTF::tryFastAlignedMalloc):
(WTF::fastAlignedFree):
(WTF::tryFastMalloc):
(WTF::fastMalloc):
(WTF::tryFastCalloc):
(WTF::fastCalloc):
(WTF::fastFree):
(WTF::fastRealloc):
(WTF::tryFastRealloc):
(WTF::releaseFastMallocFreeMemory):
(WTF::releaseFastMallocFreeMemoryForThisThread):
(WTF::fastMallocStatistics):
(WTF::fastMallocSize):
(WTF::fastCommitAlignedMemory):
(WTF::fastDecommitAlignedMemory):
(WTF::fastEnableMiniMode):
(WTF::fastDisableScavenger):
(WTF::fastMallocDumpMallocStats):
(WTF::AvoidRecordingScope::avoidRecordingCount):
(WTF::AvoidRecordingScope::AvoidRecordingScope):
(WTF::AvoidRecordingScope::~AvoidRecordingScope):
(WTF::MallocCallTracker::MallocSiteData::MallocSiteData):
(WTF::MallocCallTracker::singleton):
(WTF::MallocCallTracker::MallocCallTracker):
(WTF::MallocCallTracker::recordMalloc):
(WTF::MallocCallTracker::recordRealloc):
(WTF::MallocCallTracker::recordFree):
(WTF::MallocCallTracker::dumpStats):
* wtf/HashTable.h:
(WTF::KeyTraits>::inlineLookup):
(WTF::KeyTraits>::lookupForWriting):
(WTF::KeyTraits>::fullLookupForWriting):
(WTF::KeyTraits>::add):
* wtf/MetaAllocator.cpp:
(WTF::MetaAllocator::findAndRemoveFreeSpace):
* wtf/ParallelJobsGeneric.cpp:
* wtf/RandomDevice.cpp:
(WTF::RandomDevice::cryptographicallyRandomValues):
* wtf/RawPointer.h:
(WTF::RawPointer::RawPointer):
* wtf/RedBlackTree.h:
* wtf/SHA1.cpp:
(WTF::SHA1::hexDigest):
* wtf/SchedulePair.h:
(WTF::SchedulePair::SchedulePair):
* wtf/StackTrace.cpp:
(WTFGetBacktrace):
(WTF::StackTrace::dump const):
* wtf/StringExtras.h:
(strnstr):
* wtf/Variant.h:
* wtf/Vector.h:
(WTF::VectorBufferBase::deallocateBuffer):
(WTF::VectorBufferBase::releaseBuffer):
(WTF::VectorBufferBase::VectorBufferBase):
* wtf/cf/CFURLExtras.cpp:
(WTF::createCFURLFromBuffer):
(WTF::getURLBytes):
* wtf/cf/CFURLExtras.h:
* wtf/cf/FileSystemCF.cpp:
(WTF::FileSystem::pathAsURL):
* wtf/dtoa/double-conversion.cc:
* wtf/dtoa/utils.h:
(WTF::double_conversion::BufferReference::BufferReference):
* wtf/text/CString.cpp:
(WTF::CString::mutableData):
* wtf/text/CString.h:
* wtf/text/StringBuffer.h:
(WTF::StringBuffer::release):
* wtf/text/StringImpl.cpp:
(WTF::StringImpl::createUninitializedInternal):
(WTF::StringImpl::reallocateInternal):
* wtf/text/StringImpl.h:
(WTF::StringImpl::constructInternal<LChar>):
(WTF::StringImpl::constructInternal<UChar>):
(WTF::StringImpl::characters<LChar> const):
(WTF::StringImpl::characters<UChar> const):
(WTF::find):
(WTF::reverseFindLineTerminator):
(WTF::reverseFind):
(WTF::equalIgnoringNullity):
(WTF::codePointCompare):
(WTF::isSpaceOrNewline):
(WTF::lengthOfNullTerminatedString):
(WTF::StringImplShape::StringImplShape):
(WTF::StringImpl::isolatedCopy const):
(WTF::StringImpl::isAllASCII const):
(WTF::StringImpl::isAllLatin1 const):
(WTF::isAllSpecialCharacters):
(WTF::isSpecialCharacter const):
(WTF::StringImpl::StringImpl):
(WTF::StringImpl::create8BitIfPossible):
(WTF::StringImpl::createSubstringSharingImpl):
(WTF::StringImpl::createFromLiteral):
(WTF::StringImpl::tryCreateUninitialized):
(WTF::StringImpl::adopt):
(WTF::StringImpl::cost const):
(WTF::StringImpl::costDuringGC):
(WTF::StringImpl::setIsAtom):
(WTF::StringImpl::setHash const):
(WTF::StringImpl::ref):
(WTF::StringImpl::deref):
(WTF::StringImpl::copyCharacters):
(WTF::StringImpl::at const):
(WTF::StringImpl::allocationSize):
(WTF::StringImpl::maxInternalLength):
(WTF::StringImpl::tailOffset):
(WTF::StringImpl::requiresCopy const):
(WTF::StringImpl::tailPointer const):
(WTF::StringImpl::tailPointer):
(WTF::StringImpl::substringBuffer const):
(WTF::StringImpl::substringBuffer):
(WTF::StringImpl::assertHashIsCorrect const):
(WTF::StringImpl::StaticStringImpl::StaticStringImpl):
(WTF::StringImpl::StaticStringImpl::operator StringImpl&):
(WTF::equalIgnoringASCIICase):
(WTF::startsWithLettersIgnoringASCIICase):
(WTF::equalLettersIgnoringASCIICase):
* wtf/text/TextBreakIterator.cpp:
(WTF::initializeIterator):
(WTF::setContextAwareTextForIterator):
(WTF::openLineBreakIterator):
* wtf/text/TextBreakIterator.h:
(WTF::LazyLineBreakIterator::get):
* wtf/text/WTFString.cpp:
(WTF::charactersToFloat):
* wtf/text/cf/StringImplCF.cpp:
(WTF::StringWrapperCFAllocator::allocate):
(WTF::StringWrapperCFAllocator::create):
(WTF::StringImpl::createCFString):
* wtf/text/icu/UTextProviderLatin1.cpp:
(WTF::uTextLatin1Clone):
(WTF::openLatin1ContextAwareUTextProvider):
* wtf/text/icu/UTextProviderUTF16.cpp:
(WTF::openUTF16ContextAwareUTextProvider):
* wtf/win/FileSystemWin.cpp:
(WTF::FileSystemImpl::makeAllDirectories):
(WTF::FileSystemImpl::storageDirectory):
(WTF::FileSystemImpl::openTemporaryFile):
(WTF::FileSystemImpl::openFile):
(WTF::FileSystemImpl::writeToFile):
(WTF::FileSystemImpl::readFromFile):
(WTF::FileSystemImpl::deleteNonEmptyDirectory):
* wtf/win/LanguageWin.cpp:
(WTF::localeInfo):
* wtf/win/MainThreadWin.cpp:
(WTF::initializeMainThreadPlatform):
* wtf/win/OSAllocatorWin.cpp:
(WTF::OSAllocator::reserveUncommitted):
(WTF::OSAllocator::reserveAndCommit):
* wtf/win/RunLoopWin.cpp:
(WTF::RunLoop::run):
(WTF::RunLoop::iterate):
(WTF::RunLoop::RunLoop):
(WTF::RunLoop::cycle):
(WTF::RunLoop::TimerBase::start):
* wtf/win/ThreadingWin.cpp:
(WTF::Thread::establishHandle):
2020-05-08 Darin Adler <darin@apple.com>
Make callBufferProducingFunction safer to use by adding a compile-time assertion
https://bugs.webkit.org/show_bug.cgi?id=211599
Reviewed by Ross Kirsling.
* wtf/unicode/icu/ICUHelpers.h:
(WTF::CallBufferProducingFunction::argumentTuple): Add a static_assert that
checks these are just simple types, aside from the Vector for the buffer.
This would have caught the UpconvertedCharacters problem fixed earlier today.
2020-05-08 Don Olmstead <don.olmstead@sony.com>
WTF headers should compile independently
https://bugs.webkit.org/show_bug.cgi?id=211608
Reviewed by Yusuke Suzuki.
When a WTF header is included on its own within a source file it should compile.
These issues were found when working on a tooling build for running static
analysis over WTF. Forward declarations were used whenever possible otherwise
an include was used.
Additionally fix some errors found by Clang 10.
* wtf/AggregateLogger.h:
* wtf/CallbackAggregator.h:
* wtf/Dominators.h:
* wtf/HashIterators.h:
* wtf/IndexSparseSet.h:
* wtf/LoggingHashMap.h:
* wtf/LoggingHashTraits.h:
* wtf/RunLoopTimer.h:
* wtf/Stopwatch.h:
* wtf/Threading.h:
* wtf/cf/RunLoopTimerCF.cpp:
* wtf/persistence/PersistentCoder.h:
* wtf/text/LineBreakIteratorPoolICU.h:
* wtf/text/NullTextBreakIterator.h:
* wtf/text/StringOperators.h:
* wtf/text/StringToIntegerConversion.h:
* wtf/text/cf/TextBreakIteratorCF.h:
* wtf/text/icu/TextBreakIteratorICU.h:
* wtf/text/win/WCharStringExtras.h:
2020-05-07 Don Olmstead <don.olmstead@sony.com>
Remove unused USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
https://bugs.webkit.org/show_bug.cgi?id=211582
Reviewed by Fujii Hironori.
After r261264 all ports implemented USE_REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR.
* wtf/PlatformUse.h:
2020-05-07 Mark Lam <mark.lam@apple.com>
Give the DFG and FTL WorkList threads more stack space on ASAN builds.
https://bugs.webkit.org/show_bug.cgi?id=211535
<rdar://problem/62947884>
Reviewed by Geoffrey Garen.
1. Add the ability to set the ThreadType for AutomaticThreads.
2. Give ThreadType::Compiler (which currently only used for the DFG anf FTL
WorkList threads) a larger stack for OS(DARWIN) on ASAN builds.
This is needed because ASAN is a memory hungry beast, and we want the ASAN
builds to get to exercise the same amount of code a regular build will (instead
of failing out early with a stack overflow error).
* wtf/AutomaticThread.cpp:
(WTF::AutomaticThread::AutomaticThread):
(WTF::AutomaticThread::start):
* wtf/AutomaticThread.h:
* wtf/Threading.cpp:
(WTF::stackSize):
* wtf/Threading.h:
2020-05-07 Mark Lam <mark.lam@apple.com>
Add stack checks to the DFG and FTL bytecode parser.
https://bugs.webkit.org/show_bug.cgi?id=211547
<rdar://problem/62958880>
Reviewed by Yusuke Suzuki.
Added a StackCheck::Scope RAII object to help verify that the default reserved
zone size is at least adequate for known work loads. If this the StackCheck::Scope
assertions fail, then we either need more stack checks, or the reserved zone size
needs to be increased.
Note that the assertions are usually only on in Debug builds. Ideally, we would
want to measure the reserved zone size with a Release build. To do that, we
can just set VERIFY_STACK_CHECK_RESERVED_ZONE_SIZE to 1 unconditionally in
StackCheck.h and rebuild.
* wtf/StackCheck.h:
(WTF::StackCheck::Scope::Scope):
(WTF::StackCheck::Scope::~Scope):
(WTF::StackCheck::Scope::isSafeToRecurse):
(WTF::StackCheck::StackCheck):
2020-05-06 Yoshiaki Jitsukawa <yoshiaki.jitsukawa@sony.com> and Fujii Hironori <Hironori.Fujii@sony.com>
[Win] Implement DisplayRefreshMonitor by using RunLoop::Timer
https://bugs.webkit.org/show_bug.cgi?id=211431
Reviewed by Don Olmstead.
USE_REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR is turned off only for Windows ports.
Turn it on, and add DisplayRefreshMonitorWin.
I'll remove USE_REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR macro in a follow-up patch.
* wtf/PlatformUse.h:
2020-05-06 Darin Adler <darin@apple.com>
Make a helper for the pattern of ICU functions that may need to be called twice to populate a buffer
https://bugs.webkit.org/show_bug.cgi?id=211499
Reviewed by Ross Kirsling.
This first cut version is ready to be used in most, but not all, of the places we use the
needsToGrowToProduceBuffer function. The places it is not right for yet are ones that have
special considerations because of null character termination or destinations that are
not a Vector. Later we can refine that further, if we like, and possibly use something
similar in call sites that use needsToGrowToProduceCString as well.
* wtf/unicode/icu/ICUHelpers.h:
(WTF::needsToGrowToProduceBuffer): Changed to constexpr, since we can.
(WTF::needsToGrowToProduceCString): Ditto.
(WTF::CallBufferProducingFunction::findVector): Added. Implementation detail
of callBufferProducingFunction.
(WTF::CallBufferProducingFunction::argumentTuple): Ditto.
(WTF::callBufferProducingFunction): Added.
2020-05-06 Alex Christensen <achristensen@webkit.org>
Reduce IPC overhead for message receiver name and message name to 2 bytes
https://bugs.webkit.org/show_bug.cgi?id=211112
Reviewed by Chris Dumez.
* wtf/EnumTraits.h:
2020-05-06 Darin Adler <darin@apple.com>
Remove now-unneeded USE(GRAMMAR_CHECKING)
https://bugs.webkit.org/show_bug.cgi?id=211452
Reviewed by Anders Carlsson.
* wtf/PlatformUse.h: Don't set USE_GRAMMAR_CHECKING.
2020-05-06 Devin Rousso <drousso@apple.com>
ASSERT_WITH_MESSAGE(m_isOwnedByMainThread == isMainThread()) when web inspecting
https://bugs.webkit.org/show_bug.cgi?id=203638
<rdar://problem/56761893>
Reviewed by Brian Burg.
* wtf/Stopwatch.h:
(WTF::Stopwatch::elapsedTime const): Added.
(WTF::Stopwatch::elapsedTimeSince const): Added.
(WTF::Stopwatch::elapsedTime): Deleted.
(WTF::Stopwatch::elapsedTimeSince): Deleted.
2020-05-06 Darin Adler <darin@apple.com>
Reduce HAVE(HOSTED_CORE_ANIMATION)
https://bugs.webkit.org/show_bug.cgi?id=211423
Reviewed by Anders Carlsson.
* wtf/PlatformHave.h: Simplified conditional to just PLATFORM(MAC)
for HOSTED_CORE_ANIMATION.
2020-05-05 Darin Adler <darin@apple.com>
Remove HAVE(AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT)
https://bugs.webkit.org/show_bug.cgi?id=211461
Reviewed by Eric Carlson.
* wtf/PlatformHave.h: Don't define HAVE_AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT.
2020-05-05 Mark Lam <mark.lam@apple.com>
Allow Bitmap to use up to a UCPURegister word size for internal bit storage.
https://bugs.webkit.org/show_bug.cgi?id=211328
<rdar://problem/62755865>
Reviewed by Yusuke Suzuki.
1. Moved the definition of CPURegister and UCPURegister down into WTF.
Added CPU(REGISTER64) and CPU(REGISTER32) for determining what size a CPU
general purpose register is.
2. Updated Bitmap so that it will automatically choose the minimal required
word size for the number of bits it needs to store. This means the Bitmap
can automatically choose a WordType from uint8_t up to UCPURegister.
Previously, the WordType is always uint32_t by default.
This should improve perf with use of Bitmap on 64-bit platforms. The size
optimization is necessary to prevent bloat on 64-bit platforms which would have
resulted if we simply set the default to always be UCPURegister.
3. Added a check in findRunOfZeros() for handling the edge case where the
requested runLength exceeds the bitmapSize.
4. Fixed a bug in count() that was unnecessarily casting the bits to unsigned
instead of just using the Bitmap WordType. As a result, when using a WordType
of uint64_t, it was discarding bits from the count.
5. Fixed invert() to leave the bits beyond bitmapSize untouched.
Fixed isFull() to ignore the bits beyond bitmapSize.
By fixing invert() to leave those bits as 0, isEmpty() and hash() will
continue to work. Otherwise, inverting those bits will cause isEmpty() to
always fail, and hash()'s result may be different for the same set of bit
values within bitmapSize.
isFull(), on the other hand, checks for set bits in the words. Since there
may be 0 valued bits beyond bitmapSize, isFull() needs to be fixed to ignore
those.
* WTF.xcodeproj/project.pbxproj:
* wtf/Bitmap.h:
(WTF::WordType>::invert):
(WTF::WordType>::findRunOfZeros const):
(WTF::WordType>::count const):
(WTF::WordType>::isFull const):
* wtf/CMakeLists.txt:
* wtf/PlatformCPU.h:
* wtf/PlatformUse.h:
* wtf/StdIntExtras.h: Copied from Source/WTF/wtf/StdIntExtras.h.
2020-05-05 Darin Adler <darin@apple.com>
Remove now-unneeded USE(COREMEDIA) and USE(VIDEOTOOLBOX)
https://bugs.webkit.org/show_bug.cgi?id=211437
Reviewed by Eric Carlson.
* wtf/PlatformUse.h: Don't set USE_COREMEDIA or USE_VIDEOTOOLBOX.
2020-05-05 Darin Adler <darin@apple.com>
Remove now-uneeded HAVE macros related to PDF
https://bugs.webkit.org/show_bug.cgi?id=211435
Reviewed by Anders Carlsson.
* wtf/PlatformHave.h: Remove HAVE_PDFHOSTVIEWCONTROLLER_SNAPSHOTTING,
always set for iOS, HAVE_LEGACY_PDF_SUPPORT, always set for all Cocoa
platforms, and HAVE_PDF_HOST_VIEW_CONTROLLER_WITH_BACKGROUND_COLOR,
always set for iOS family platforms.
2020-05-05 Darin Adler <darin@apple.com>
Remove now-unneeded HAVE(DISALLOWABLE_USER_INSTALLED_FONTS)
https://bugs.webkit.org/show_bug.cgi?id=211428
Reviewed by Anders Carlsson.
* wtf/PlatformHave.h: Don't define HAVE_DISALLOWABLE_USER_INSTALLED_FONTS.
2020-05-04 Darin Adler <darin@apple.com>
[Mac] Remove __MAC_OS_X_VERSION_MIN_REQUIRED checks for versions older than 10.14
https://bugs.webkit.org/show_bug.cgi?id=211420
Reviewed by Alex Christensen.
* WTF.xcodeproj/project.pbxproj: Removed DeprecatedSymbolsUsedBySafari.mm.
* wtf/PlatformEnableCocoa.h: Removed __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400.
* wtf/PlatformHave.h: Ditto. This leaves behind some cases of
"PLATFORM(MAC) || PLATFORM(IOS)" that should probably be turned on for watchOS
and tvOS too, eventually. Also "PLATFORM(MAC) || PLATFORM(IOS) || PLATFORM(MACCATALYST)".
* wtf/PlatformMac.cmake: Removed DeprecatedSymbolsUsedBySafari.mm.
* wtf/PlatformUse.h: Removed __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400.
* wtf/mac/DeprecatedSymbolsUsedBySafari.mm: Removed.
* wtf/spi/darwin/ProcessMemoryFootprint.h: Removed
__MAC_OS_X_VERSION_MIN_REQUIRED >= 101400.
2020-05-04 Darin Adler <darin@apple.com>
Remove now-unneeded HAVE(SANDBOX_ISSUE_MACH/READ_EXTENSION_TO_PROCESS_BY_AUDIT_TOKEN)
https://bugs.webkit.org/show_bug.cgi?id=211427
Reviewed by Alex Christensen.
* wtf/PlatformHave.h: Remove both macros mentioned in the title above.
* wtf/spi/darwin/SandboxSPI.h: Remove #if HAVE.
2020-05-04 Darin Adler <darin@apple.com>
Remove now-unneeded HAVE(AUTHORIZATION_STATUS_FOR_MEDIA_TYPE)
https://bugs.webkit.org/show_bug.cgi?id=211426
Reviewed by Alex Christensen.
* wtf/PlatformHave.h: Removed code to set HAVE_AUTHORIZATION_STATUS_FOR_MEDIA_TYPE,
which was doing so on all Cocoa platforms.
2020-05-04 Darin Adler <darin@apple.com>
Remove now-unneeded HAVE(ACCESSIBILITY_SUPPORT)
https://bugs.webkit.org/show_bug.cgi?id=211425
Reviewed by Alex Christensen.
* wtf/PlatformHave.h: Don't set HAVE_ACCESSIBILITY_SUPPORT. It was on for all
Cocoa platform builds.
2020-05-04 Darin Adler <darin@apple.com>
Remove now-unneeded HAVE(NETWORK_EXTENSION)
https://bugs.webkit.org/show_bug.cgi?id=211424
Reviewed by Alex Christensen.
* wtf/PlatformHave.h: Don't define HAVE_NETWORK_EXTENSION.
2020-05-04 Darin Adler <darin@apple.com>
Remove now-unneeded HAVE(SEC_TRUST_EVALUATE_WITH_ERROR)
https://bugs.webkit.org/show_bug.cgi?id=211429
Reviewed by Alex Christensen.
* wtf/PlatformHave.h: Don't set HAVE_SEC_TRUST_EVALUATE_WITH_ERROR.
2020-05-04 Darin Adler <darin@apple.com>
Remove unneeded USE(MEDIAREMOTE)
https://bugs.webkit.org/show_bug.cgi?id=211385
Reviewed by Eric Carlson.
* wtf/PlatformUse.h: Don't set USE_MEDIAREMOTE.
2020-05-04 Darin Adler <darin@apple.com>
Remove now-unneded HAVE(WINDOW_SERVER_OCCLUSION_NOTIFICATIONS)
https://bugs.webkit.org/show_bug.cgi?id=211380
Reviewed by Sam Weinig.
* wtf/PlatformHave.h: Don't define HAVE_WINDOW_SERVER_OCCLUSION_NOTIFICATIONS.
2020-05-04 Darin Adler <darin@apple.com>
Remove unused USE(COREAUDIO)
https://bugs.webkit.org/show_bug.cgi?id=211384
Reviewed by Alex Christensen.
* wtf/PlatformUse.h: Don't define USE_COREAUDIO.
2020-05-04 Darin Adler <darin@apple.com>
Remove now-unneeded HAVE(UI_REMOTE_VIEW)
https://bugs.webkit.org/show_bug.cgi?id=211382
Reviewed by Alex Christensen.
* wtf/PlatformHave.h: Remove code to define HAVE_UI_REMOTE_VIEW.
2020-05-04 Darin Adler <darin@apple.com>
Remove now-unneeded HAVE(MENU_CONTROLLER_SHOW_HIDE_API)
https://bugs.webkit.org/show_bug.cgi?id=211381
Reviewed by Alex Christensen.
* wtf/PlatformHave.h: Remove code to set HAVE_MENU_CONTROLLER_SHOW_HIDE_API.
2020-05-04 Darin Adler <darin@apple.com>
Remove now-unneeded HAVE(VOUCHERS)
https://bugs.webkit.org/show_bug.cgi?id=211379
Reviewed by Alex Christensen.
* wtf/PlatformHave.h: Remove definition of HAVE_VOUCHERS.
2020-05-04 Darin Adler <darin@apple.com>
Remove now-unneeded HAVE(MEDIA_PLAYER)
https://bugs.webkit.org/show_bug.cgi?id=211378
Reviewed by Alex Christensen.
* wtf/PlatformHave.h: Remove code that sets HAVE_MEDIA_PLAYER.
2020-05-04 Darin Adler <darin@apple.com>
Remove unused HAVE(STRINGS_H)
https://bugs.webkit.org/show_bug.cgi?id=211377
Reviewed by Alex Christensen.
* wtf/PlatformHave.h: Remove code to set HAVE_STRINGS_H.
2020-05-04 Darin Adler <darin@apple.com>
Remove no-longer-needed HAVE(UISCENE)
https://bugs.webkit.org/show_bug.cgi?id=211376
Reviewed by Chris Dumez.
* wtf/PlatformHave.h: Don't define HAVE_UISCENE any more.
It's always true for PLATFORM(IOS_FAMILY).
2020-05-03 Mark Lam <mark.lam@apple.com>
Remove some unused and broken functions in Bitmap.
https://bugs.webkit.org/show_bug.cgi?id=211368
Reviewed by Yusuke Suzuki.
Bitmap::operator[] never worked. There's currently no way to use it to read a
bit value. We also can't use it to set a bit value because it relies on
Bitmap::iterator::operator= to set the value. However, Bitmap::iterator stores
the Bitmap* as a const pointer, and Bitmap::iterator::operator= calls set() on
the const pointer. If we try to use operator[] to set a bit, we'll get a
compilation error.
This patch removes the 2 variants of Bitmap::operator[] and Bitmap::iterator::operator=.
* wtf/Bitmap.h:
(WTF::WordType>::operator): Deleted.
(WTF::WordType>::operator const const): Deleted.
2020-05-03 Rob Buis <rbuis@igalia.com>
atob() should not accept a vertical tab
https://bugs.webkit.org/show_bug.cgi?id=184529
Reviewed by Darin Adler.
Add an option to allow discarding of base64 decoding
when a vertical tab is encountered.
* wtf/text/Base64.cpp:
(WTF::base64DecodeInternal):
* wtf/text/Base64.h:
2020-05-02 Mark Lam <mark.lam@apple.com>
Gardening: rolling out r261050 and r261051.
https://bugs.webkit.org/show_bug.cgi?id=211328
<rdar://problem/62755865>
Not reviewed.
Appears to make editing/undo-manager/undo-manager-delete-stale-undo-items.html timeout always.
* WTF.xcodeproj/project.pbxproj:
* wtf/Bitmap.h:
* wtf/CMakeLists.txt:
* wtf/StdIntExtras.h: Removed.
2020-05-02 Mark Lam <mark.lam@apple.com>
[Follow up] Allow Bitmap to use up to a UCPURegister word size for internal bit storage.
https://bugs.webkit.org/show_bug.cgi?id=211328
<rdar://problem/62755865>
Not reviewed.
Landing file missed in last commit.
* wtf/StdIntExtras.h: Added.
2020-05-01 Mark Lam <mark.lam@apple.com>
Allow Bitmap to use up to a UCPURegister word size for internal bit storage.
https://bugs.webkit.org/show_bug.cgi?id=211328
<rdar://problem/62755865>
Reviewed by Yusuke Suzuki.
1. Moved the definition of CPURegister and UCPURegister down into WTF.
2. Updated Bitmap so that it will automatically choose the minimal required
word size for the number of bits it needs to store. This means the Bitmap
can automatically choose a WordType from uint8_t up to UCPURegister.
Previously, the WordType is always uint32_t by default.
This should improve perf with use of Bitmap on 64-bit platforms. The size
optimization is necessary to prevent bloat on 64-bit platforms which would have
resulted if we simply set the default to always be UCPURegister.
* WTF.xcodeproj/project.pbxproj:
* wtf/Bitmap.h:
* wtf/CMakeLists.txt:
* wtf/StdIntExtras.h: Added.
2020-05-01 Saam Barati <sbarati@apple.com>
Have a thread local cache for the Wasm LLInt bytecode buffer
https://bugs.webkit.org/show_bug.cgi?id=211317
Reviewed by Filip Pizlo and Mark Lam.
* wtf/Vector.h:
(WTF::Vector::sizeInBytes const):
2020-05-01 Don Olmstead <don.olmstead@sony.com>
[GTK] Add additional exports to support hidden visibility
https://bugs.webkit.org/show_bug.cgi?id=211246
Reviewed by Michael Catanzaro.
* wtf/ASCIICType.cpp:
* wtf/DateMath.h:
* wtf/FileSystem.h:
* wtf/PrintStream.h:
* wtf/RunLoop.h:
* wtf/glib/GLibUtilities.h:
* wtf/glib/GSocketMonitor.h:
* wtf/glib/SocketConnection.h:
(WTF::SocketConnection::isClosed const):
* wtf/linux/CurrentProcessMemoryStatus.h:
2020-05-01 Yusuke Suzuki <ysuzuki@apple.com>
Introduce MainThreadNeverDestroyed / MainThreadLazyNeverDestroyed
https://bugs.webkit.org/show_bug.cgi?id=211264
Reviewed by Mark Lam.
Since AtomString has thread-affinity, `static NeverDestroyed<const AtomString>` is basically only safe for the main-thread use.
We should ensure that this is only used in the main-thread. To do that, this patch introduces MainThreadNeverDestroyed and
MainThreadLazyNeverDestroyed. They are NeverDestroyed and LazyNeverDestroyed + main-thread assertions.
* wtf/Forward.h:
* wtf/NeverDestroyed.h:
(WTF::AnyThreadsAccessTraits::assertAccess):
(WTF::MainThreadAccessTraits::assertAccess):
(WTF::NeverDestroyed::NeverDestroyed):
(WTF::NeverDestroyed::storagePointer const):
(WTF::LazyNeverDestroyed::construct):
(WTF::LazyNeverDestroyed::storagePointer const):
(WTF::makeNeverDestroyed):
* wtf/text/AtomString.cpp:
* wtf/text/AtomString.h:
2020-05-01 Don Olmstead <don.olmstead@sony.com>
Use export macros on all platforms
https://bugs.webkit.org/show_bug.cgi?id=211293
Reviewed by Michael Catanzaro.
Always use export macros on all platforms. Remove USE_EXPORT_MACROS and always
define macros based on the platform. Allow overriding of WTF_EXPORT_PRIVATE otherwise
use the defaults.
Remove definition of WTF_HIDDEN_DECLARATION since its not used anywhere.
* wtf/ExportMacros.h:
* wtf/PlatformUse.h:
2020-04-30 Ross Kirsling <ross.kirsling@sony.com>
TriState should be an enum class and use "Indeterminate" instead of "Mixed"
https://bugs.webkit.org/show_bug.cgi?id=211268
Reviewed by Mark Lam.
The word "indeterminate" comes from boost::tribool.
A third state is generally not "mixed" but rather unknown.
* wtf/TriState.h:
2020-04-29 Fujii Hironori <Hironori.Fujii@sony.com>
[Win] Deadlock in WTF::Thread::didExit() while WebKitNetworkProcess.exe is exiting
https://bugs.webkit.org/show_bug.cgi?id=210955
Reviewed by Don Olmstead.
The thread_local object of the main thread is destructed after
Windows terminates other threads. If the terminated thread was
holding a mutex, trying to lock the mutex causes deadlock.
* wtf/win/ThreadingWin.cpp:
(WTF::Thread::ThreadHolder::~ThreadHolder): Do nothing if the
thread is the main thread.
2020-04-29 Jer Noble <jer.noble@apple.com>
[Mac] Adopt kMTSupportNotification_ShouldPlayHDRVideoChanged notification
https://bugs.webkit.org/show_bug.cgi?id=211028
<rdar://problem/61173289>
Reviewed by Aakash Jain.
Follow-up test failure fix; correct the debug/non-debug variants of SOFT_LINK_FRAMEWORK_FOR_SOURCE_WITH_EXPORT.
* wtf/win/SoftLinking.h:
2020-04-29 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r260650.
https://bugs.webkit.org/show_bug.cgi?id=211172
It is breaking internal bots (Requested by youenn on #webkit).
Reverted changeset:
"Call STDynamicActivityAttributionPublisher in the WebProcess"
https://bugs.webkit.org/show_bug.cgi?id=210772
https://trac.webkit.org/changeset/260650
2020-04-29 Devin Rousso <drousso@apple.com>
Web Inspector: Uncaught Exception: SyntaxError: Unexpected identifier 'E'. Expected either a closing ']' or a ',' following an array element.
https://bugs.webkit.org/show_bug.cgi?id=211163
Reviewed by Joseph Pecoraro.
* wtf/JSONValues.h:
* wtf/JSONValues.cpp:
(WTF::JSONImpl::appendDoubleQuotedString):
(WTF::JSONImpl::Value::escapeString): Added.
Pull out and expose the logic for escaping strings so it can be used elsewhere.
2020-04-29 Saam Barati <sbarati@apple.com>
U_STRING_NOT_TERMINATED_WARNING ICU must be handled when using the output buffer as a C string
https://bugs.webkit.org/show_bug.cgi?id=211142
<rdar://problem/62530860>
Reviewed by Darin Adler.
Most of our uses of ICU require us to produce a buffer of the correct
length. We often test if the first call to ICU API succeeds, and if it
doesn't, we grow to the required buffer size, and try again. However,
there are a few APIs that we use like this, except that they write their
output to a C string instead of a buffer.
In a couple scenarios when we were producing C strings, we were only testing
for the U_BUFFER_OVERFLOW_ERROR, instead of both U_BUFFER_OVERFLOW_ERROR and
U_STRING_NOT_TERMINATED_WARNING. This patch fixes those bugs. It also
introduces two new helper methods for testing error codes returned by ICU.
- The first is needsToGrowToProduceBuffer, which returns true if we need to
grow the buffer and re-call into ICU to get the result.
- The second is needsToGrowToProduceCString, which returns true if we need to
grow the buffer and re-call into ICU to produce a valid C string.
I've audited all uses of U_BUFFER_OVERFLOW_ERROR and converted them to use one
of the above helper methods instead.
The issues in our handling of U_STRING_NOT_TERMINATED_WARNING were caught on iOS JSC
tests in JSTests/stress/intl-datetimeformat.js
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/text/LineBreakIteratorPoolICU.h:
(WTF::LineBreakIteratorPool::makeLocaleWithBreakKeyword):
* wtf/text/StringView.cpp:
(WTF::normalizedNFC):
* wtf/unicode/icu/ICUHelpers.h: Added.
(WTF::needsToGrowToProduceCString):
(WTF::needsToGrowToProduceBuffer):
2020-04-29 Noam Rosenthal <noam@webkit.org>
Add StringView::isAllSpecialCharacters()
https://bugs.webkit.org/show_bug.cgi?id=211150
This enables checking for whitespace-only strings without allocating a StringImpl wrapper.
Reviewed by Darin Adler.
* wtf/text/StringView.h:
(WTF::isSpecialCharacter const):
2020-04-27 Ryan Haddad <ryanhaddad@apple.com>
[Cocoa] stop using out arguments for document attributes when converting to attributed strings
https://bugs.webkit.org/show_bug.cgi?id=211048
Unreviewed partial revert of r260739 to remove unexpected logging that broke Catalina-Release-WK2-Perf tests.
* wtf/cocoa/URLCocoa.mm:
(WTF::URL::createCFURL const):
2020-04-26 Darin Adler <darin@apple.com>
[Cocoa] stop using out arguments for document attributes when converting to attributed strings
https://bugs.webkit.org/show_bug.cgi?id=211048
Reviewed by Sam Weinig.
* wtf/cocoa/URLCocoa.mm:
(WTF::URL::createCFURL const): Use init instead of initWithString:@"". The two are
equivalent in more recent versions of Foundation.
2020-04-26 Yoshiaki Jitsukawa <yoshiaki.jitsukawa@sony.com>
[PlayStation] Enable TestWTF and TestWebCore
https://bugs.webkit.org/show_bug.cgi?id=208849
Reviewed by Don Olmstead.
* wtf/PlatformPlayStation.cmake:
Add WTF_CopySharedLibs() to install dependencies.
2020-04-26 Yusuke Suzuki <ysuzuki@apple.com>
Use `static Lock` instead of `static NeverDestroyed<Lock>`
https://bugs.webkit.org/show_bug.cgi?id=211036
Reviewed by Darin Adler.
Lock can be static-initialized since it has constexpr constructor. No need to use NeverDestroyed<Lock>.
* wtf/Logger.h:
(WTF::Logger::observerLock):
2020-04-26 Joonghun Park <jh718.park@samsung.com>
[WTF] Workaround gcc bug for unsigned bitfield related usual arithmetic conversions
https://bugs.webkit.org/show_bug.cgi?id=211044
Reviewed by Darin Adler.
* wtf/URL.cpp:
(WTF::URL::setHost):
(WTF::URL::setHostAndPort):
(WTF::URL::setUser):
(WTF::URL::setPassword):
2020-04-25 Joonghun Park <jh718.park@samsung.com>
Unreviewed. Remove the bulid warnings below since r260707.
warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]
* wtf/URL.cpp:
(WTF::URL::setHost):
(WTF::URL::setHostAndPort):
(WTF::URL::setUser):
(WTF::URL::setPassword):
2020-04-25 Darin Adler <darin@apple.com>
[Cocoa] Deal with another round of Xcode upgrade checks
https://bugs.webkit.org/show_bug.cgi?id=211027
Reviewed by Alexey Proskuryakov.
* WTF.xcodeproj/project.pbxproj: Bump the upgrade check version.
Add a harmless base localization; this project contains nothing localized.
2020-04-25 Alex Christensen <achristensen@webkit.org>
Prepare to remove automatic URL->String conversion operators
https://bugs.webkit.org/show_bug.cgi?id=211007
Reviewed by Darin Adler.
Too many bugs have been caused by the compiler finding a way to make a String from a URL without being visible in the code.
This does all the easy things to prepare to remove operator String& and operator NSString*.
The hard things will be done in the smaller patch that actually removes them.
* wtf/URL.cpp:
(WTF::URL::protocolIsJavaScript const):
* wtf/URL.h:
2020-04-25 Darin Adler <darin@apple.com>
Move URL to use StringView when returning substrings of the URL
https://bugs.webkit.org/show_bug.cgi?id=210431
Reviewed by Anders Carlsson.
* wtf/URL.cpp: Remove unused CharBuffer type. Remove UCharBuffer
type and write the type explicitly in the 3 places it's used.
Removed the invalidPortNumber constant, since we use Optional
instead of a special port number now.
(WTF::copyASCII): Remove unnecessary special case for empty string.
Tweaked coding style and comment a bit.
(WTF::URL::URL): Streamlined by getting rid of a local variable.
(WTF::shouldTrimFromURL): Tweaked coding style.
(WTF::URL::lastPathComponent const): Return a StringView.
Also, use the pathStart function for clarity.
(WTF::URL::port const): Use a StringView to call parseUInt16.
(WTF::URL::protocolHostAndPort const): Optimized to always allocate
the string in the right size rather than removing characters from it
after creating it.
(WTF::decodeEscapeSequence): Added. Factored out from the function
below to make it a little more readable.
(WTF::decodeEscapeSequencesFromParsedURL): Convert a null StringView
to a null String rather than an empty String, use a stack buffer and
the helper function above, and added some FIXME comments about
encoding handling.
(WTF::URL::user const): Simplified by calling encodedUser.
(WTF::URL::password const): Simplified by calling encodedPassword.
(WTF::URL::encodedUser const): Return a StringView.
(WTF::URL::encodedPassword const): Ditto. Also renamed from encodedPass.
(WTF::URL::fragmentIdentifier const): Ditto.
(WTF::URL::hasFragmentIdentifier const): Moved to header so it can
be inlined.
(WTF::URL::truncatedForUseAsBase const): Renamed from baseAsString.
This function is currently only used with local file URLs and it's
not perfectly clear to me precisely what it is for, hence the name
is not so great.
(WTF::URL::fileSystemPath const): Removed unneeded check for validity
since isLocalFile does that check. Removed unneeded typecast now that
path returns a StringView.
(WTF::defaultPortForProtocolMapForTesting): Deleted.
(WTF::ensureDefaultPortForProtocolMapForTesting): Deleted.
(WTF::registerDefaultPortForProtocolForTesting): Deleted.
(WTF::clearDefaultPortForProtocolMapForTesting): Deleted.
(WTF::defaultPortForProtocol): Deleted.
(WTF::isDefaultPortForProtocol): Deleted.
(WTF::protocolIsInternal): Rewrote to take a StringView. Before it
was written as a template that looked like it supported classes other
than String, but actually would crash if called on a StringView.
(WTF::URL::protocolIs const): Removed unneeded explicit cast to StringView.
(WTF::URL::query const): Return a StringView.
(WTF::URL::path const): Return a StringView, use the pathStart
function for clarity.
(WTF::URL::setProtocol): Use a toStringWithoutCopying to save some
work when making the protocol canonical. Call parse instead of
creating a URLParser here.
(WTF::URL::credentialsEnd const): Added. Helper for various functions
that manipulate the credentials section.
(WTF::URL::setHost): Take StringView. Streamlined the code by using
StringView::contains, by using makeString rather than StringBuilder,
and by calling parse instead of creating a URLParser here.
(WTF::URL::removePort): Deleted, since setPort takes an Optional now.
(WTF::URL::setPort): Take Optional<uint16_t>. Call parse instead of
creating a URLParser here.
(WTF::URL::removeHostAndPort): Deleted. Callers can pass a null
StringView to setHostAndPort instead.
(WTF::URL::setHostAndPort): Take StringView. Don't remove the old
host and port in the nomral case where we end up overwriting the entire
URL at the end of the function anyway. Use parseUInt16 instead of
toIntStrict to check port number for validity, which makes sure we will
reject port numbers larger than 65535. Use makeString instead of
StringBuilder and call parse rather than creating a URLParser here.
(WTF::parse): Added. Helper function for when we create a new string
and want to parse it as the new contents of the URL. Used in almost
every setter function.
(WTF::URL::remove): Added. Helper function for efficiently removing
a piece of the URL string and re-parsing. Used in many setter functions.
(WTF::URL::setUser): Take StringView. Use makeString instead of
StringBuilder, and parse and remove instead of creating a URLParser here.
(WTF::URL::setPassword): Renamed from setPass. Take StringView.
Use makeString instead of StringBuilder, and parse and remove instead of
creating a URLParser here.
(WTF::URL::removeCredientials): Added. Efficiently removes both the
user name and password if either is present.
(WTF::URL::setFragmentIdentifier): Use parse instead of creating
a URL parser here.
(WTF::URL::removeFragmentIdentifier): Removed unnecessary checks for
things already optimized by String::left. Could later consider merging
this in with setFragmentIdentifier, using a null vs. empty distinction,
but not doing that for now.
(WTF::URL::setQuery): Take StringView.
(WTF::URL::setPath): Take StringView.
(WTF::stringWithoutQueryOrFragmentIdentifier): Added.
(WTF::stringWithoutFragmentIdentifier): Added.
(WTF::equalIgnoringFragmentIdentifier): Simplified implementation by
using stringWithoutFragmentIdentifier.
(WTF::equalIgnoringQueryAndFragment): Deleted.
(WTF::hostsAreEqual): Deleted.
(WTF::URL::isMatchingDomain const): Take StringView.
(WTF::protocolIs): Take StringView.
(WTF::URL::protocolIs): Moved to inline in the header.
(WTF::URL::strippedForUseAsReferrer const): Rewrite for efficiency.
(WTF::protocolIsJavaScript): Moved to inline in the header.
(WTF::protocolIsInHTTPFamily): Take StringView.
(WTF::aboutBlankURL): Use ASCIILiteral.
(WTF::aboutSrcDocURL): Use ASCIILiteral.
(WTF::portAllowed): Removed 65535 as a blocked port; wasn't needed.
(WTF::mimeTypeFromDataURL): Take StringView.
(WTF::URL::stringCenterEllipsizedToLength const): Tweaked style.
(WTF::URL::fakeURLWithRelativePart): Take StringView.
(WTF::URL::fileURLWithFileSystemPath): Take StringView..
(WTF::URL::queryWithLeadingQuestionMark const): Added.
(WTF::URL::fragmentIdentifierWithLeadingNumberSign const): Added.
(WTF::URL::hostIsIPAddress): Tweak coding style.
* wtf/URL.h: Made URLTextEncoding destructor protected. Removed
unused forward declaration of URLHash structure. Use WTF_EXPORT_PRIVATE
on functions from URL rather than on the whole class, since the style
checker told me to do that. Moved some inline function bodies out of
the class definition for clarity and to keep the style checker happy.
Updated many arguemnts from String to StringView and return values for
substrings of the URL to StringView. Removed some unused functions and
some obsolete comments.
* wtf/cf/CFURLExtras.cpp:
(WTF::isCFURLSameOrigin): Use hasCredentials.
* wtf/text/StringView.cpp:
(WTF::StringView::endsWith const): Added.
(WTF::parseUInt16): Added.
(WTF::equalRespectingNullity): Added.
(WTF::StringView::contains const): Added overload that takes a
const char* so the call site doesn't have to convert it to a StringView.
* wtf/text/StringView.h: Updated for the additions above.
Also added a default start of 0 to the find function.
* wtf/text/WTFString.cpp:
(WTF::charactersToIntStrict): Removed unneeded explicit template argument.
(WTF::charactersToUIntStrict): Ditto.
(WTF::charactersToInt64Strict): Ditto.
(WTF::charactersToUInt64Strict): Ditto.
(WTF::charactersToIntPtrStrict): Ditto.
(WTF::charactersToInt): Ditto.
(WTF::charactersToUInt): Ditto.
(WTF::charactersToInt64): Ditto.
(WTF::charactersToUInt64): Ditto.
(WTF::charactersToIntPtr): Ditto.
2020-04-24 Yusuke Suzuki <ysuzuki@apple.com>
[WTF] allThreads registration is racy with allThreads unregistration
https://bugs.webkit.org/show_bug.cgi?id=210995
<rdar://problem/61609690>
Reviewed by Keith Miller.
There is a race between registering a thread to allThreads and unregistering a thread from allThreads.
1. Caller: A new thread is created, but not registering it to allThreads yet.
2. Thread: The thread is running.
3. Thread: The thread finishes its execution before the thread is registered into allThreads.
4. Thread: The thread unregisters itself from allThreads.
5. Caller: Registers the new thread to allThreads after it already finished its execution.
6. The thread is never removed from allThreads.
This patch adds m_didUnregisterFromAllThreads flag to Thread, and add the thread to allThreads only when this flag is false.
Covered by LayoutTests/inspector/cpu-profiler/threads.html.
* wtf/Threading.cpp:
(WTF::Thread::create):
(WTF::Thread::didExit):
* wtf/Threading.h:
(WTF::Thread::Thread):
2020-04-24 Alex Christensen <achristensen@webkit.org>
REGRESSION(260485) Payment requests don't do anything
https://bugs.webkit.org/show_bug.cgi?id=210997
<rdar://problem/62275343>
Reviewed by Darin Adler.
We were giving the PKPaymentRequest an NSArray<NSString *> instead of NSArray<NSURL *>.
This was a problem with all uses of createNSArray with Vector<URL>.
Now it's fixed with a test.
* wtf/URL.h:
* wtf/cocoa/URLCocoa.mm:
(WTF::makeNSArrayElement):
(WTF::makeVectorElement):
2020-04-24 Megan Gardner <megan_gardner@apple.com>
Make LEGACY_PDF_SUPPORT feature flag.
https://bugs.webkit.org/show_bug.cgi?id=210868
<rdar://problem/62199847>
Reviewed by Tim Horton.
* wtf/PlatformHave.h:
2020-04-24 Youenn Fablet <youenn@apple.com> and Luming Yin <luming_yin@apple.com>
Call STDynamicActivityAttributionPublisher in the WebProcess
https://bugs.webkit.org/show_bug.cgi?id=210772
<rdar://problem/62075201>
Reviewed by Geoffrey Garen.
* wtf/PlatformHave.h:
2020-04-23 Don Olmstead <don.olmstead@sony.com>
[CMake] CMAKE_BINARY_DIR should always be a PRIVATE include directory
https://bugs.webkit.org/show_bug.cgi?id=196717
Reviewed by Michael Catanzaro.
Remove public includes in WTF.
* wtf/CMakeLists.txt:
2020-04-22 Darin Adler <darin@apple.com>
[Cocoa] Build with UChar as char16_t even in builds that use Apple's internal SDK
https://bugs.webkit.org/show_bug.cgi?id=210845
Reviewed by Anders Carlsson.
* Configurations/Base.xcconfig: Move ICU-configuring macros to Platform.h.
* wtf/Platform.h: Set macros here. The file says not to put things like this in it,
but in practice this is the right place to put something that we need set consistently
for all the WebKit projects.
- U_HIDE_DEPRECATED_API, to make sure we don't use it by accident.
- U_SHOW_CPLUSPLUS_API=0, to make sure we don't use it by accident.
- UCHAR_TYPE=char16_t when compiling C++, which is the default on most platforms,
but not the default in Apple's internal SDK.
- U_DISABLE_RENAMING when building on Apple platforms, important so we can link
to an older version of ICU and still load with a newer version.
* wtf/URL.cpp:
(WTF::URL::hostAndPort const): Get rid of an obsolete cast to unsigned to work
around uint16_t not being treated as a number by makeString.
* wtf/URLHelpers.cpp: Rework to not use deprecated USCRIPT_CODE_LIMIT.
(WTF::URLHelpers::whiteListIDNScript): Added overloads.
(WTF::URLHelpers::initializeDefaultIDNScriptWhiteList): Use an array of
UScriptCode instead of an array of strings.
(WTF::URLHelpers::allCharactersInIDNScriptWhiteList): Updated for the above.
* wtf/cocoa/NSURLExtras.mm:
(WTF::decodePercentEscapes): Use createCFString instead of converting to NString
and then typecasting.
(WTF::URLByTruncatingOneCharacterBeforeComponent): Updated to use a constexpr
instead of a macro.
(WTF::dataForURLComponentType): Ditto.
(WTF::URLByRemovingComponentAndSubsequentCharacter): Ditto.
(WTF::originalURLData): Ditto.
2020-04-22 Claudio Saavedra <csaavedra@igalia.com>
[GTK4] Several fixes to GdkEvent APIs for GTK4
https://bugs.webkit.org/show_bug.cgi?id=210856
Reviewed by Carlos Garcia Campos.
* wtf/glib/GTypedefs.h: In GTK4 GdkEvent is a struct.
2020-04-21 Peng Liu <peng.liu6@apple.com>
Fix MACCATALYST build failures
https://bugs.webkit.org/show_bug.cgi?id=210815
Reviewed by Tim Horton.
* wtf/PlatformEnable.h:
2020-04-19 Darin Adler <darin@apple.com>
[Cocoa] Use createNSArray in many more places that build NSArray objects from C++ collections
https://bugs.webkit.org/show_bug.cgi?id=210702
Reviewed by Alex Christensen.
* wtf/cocoa/VectorCocoa.h: Improved the createNSArray function template:
1) Skip nil values. This matches what we do with Optional<> in makeVector and
was always my intention; apparently forgot to do it.
2) Instead of taking a const reference argument, take a forwarding reference
and use forwarding when passing collection elements to makeNSArrayElement
or the passed-in function. Can transfer ownership of collection elements
as they are transformed into array elements, which makes sense if the
Objective-C objects are wrappers that take ownership of what's wrapped.
3) Take any collection that works with std::size and a range-based for loop,
no longer requiring a size member function. Includes arrays.
4) Since this now intended for use on collections other than WTF::Vector,
added "using WTF::createNSArray" since argument-dependent lookup won't
find the function template in those cases.
2020-04-21 Fujii Hironori <Hironori.Fujii@sony.com>
[Win] Use generic WorkQueue instead of WorkQueueWin.cpp
https://bugs.webkit.org/show_bug.cgi?id=210785
Reviewed by Darin Adler.
WorkQueueWin was using random threads to execute dispatched
functions. This is not desired for IPC::Connection because it
needs to call CancelIo API in the same thread started aync
ReadFile operations.
Implemented RunLoop::dispatchAfter in RunLoopWin.cpp in order to
use generic WorkQueue.
* wtf/PlatformWin.cmake:
* wtf/RunLoop.h: Added DispatchTimer class for USE(WINDOWS_EVENT_LOOP).
(WTF::RunLoop::DispatchTimer::DispatchTimer):
(WTF::RunLoop::DispatchTimer::setFunction):
* wtf/WorkQueue.h: Removed code for USE(WINDOWS_EVENT_LOOP).
* wtf/win/RunLoopWin.cpp:
(WTF::RunLoop::dispatchAfter): Added.
* wtf/win/WorkQueueWin.cpp: Removed.
2020-04-21 Charlie Turner <cturner@igalia.com>
[Clang 10] Fix warning: definition of implicit copy assignment operator for 'PageBlock' is deprecated because it has a user-declared copy constructor
https://bugs.webkit.org/show_bug.cgi?id=210748
Reviewed by Adrian Perez de Castro.
Recent Clang's will issue a warning if you declare an explicit
copy construction, but leave the compiler to fill in an implicit
assignment operator. I think this is to catch cases where you do
something exciting in an assignment operator/copy constructor and
forget to do the same exciting thing in the other.
* wtf/PageAllocation.h: Import the base's constructor to avoid
defining our own identical one.
* wtf/PageBlock.h: Remove trivial constructor and replace with
member initializers. Remove copy constructor. This looks identical
to what the compiler would generate anyway.
2020-04-21 Claudio Saavedra <csaavedra@igalia.com>
[GTK4] Adapt to GtkIconTheme API changes
https://bugs.webkit.org/show_bug.cgi?id=210745
Reviewed by Adrian Perez de Castro.
* wtf/glib/GTypedefs.h: Remove unneeded GtkIconInfo definition.
2020-04-20 Timothy Horton <timothy_horton@apple.com>
Try to fix the build after r260407
* wtf/PlatformHave.h:
2020-04-20 Peng Liu <peng.liu6@apple.com>
Fix build failures when video fullscreen and picture-in-picture is disabled
https://bugs.webkit.org/show_bug.cgi?id=210777
Reviewed by Eric Carlson.
* wtf/PlatformEnable.h:
2020-04-20 Yusuke Suzuki <ysuzuki@apple.com>
Add document about WTF malloc-related macros
https://bugs.webkit.org/show_bug.cgi?id=208367
Reviewed by Anders Carlsson, Simon Fraser, and Darin Adler.
This adds document about WTF malloc-related macros since we have bunch of macros now.
* wtf/FastMalloc.h:
2020-04-20 Darin Adler <darin@apple.com>
REGRESSION (r253987): StringImpl::adopt(Vector&&) copies only half of the characters in the Vector when copying across malloc zones
https://bugs.webkit.org/show_bug.cgi?id=210736
Reviewed by Yusuke Suzuki.
* wtf/text/StringImpl.cpp:
(WTF::StringImpl::replace): Use copyCharacters instead of memcpy.
* wtf/text/StringImpl.h: Use std::is_same_v instead of std::is_same.
(WTF::StringImpl::StringImpl): Use copyCharacters instead of memcpy.
Also drop C-style cast to cast away const.
(WTF::StringImpl::adopt): Don't even try to adopt across malloc zones.
2020-04-20 Darin Adler <darin@apple.com>
Use #import instead of #include in Objective-C and don't use #pragma once
https://bugs.webkit.org/show_bug.cgi?id=210724
Reviewed by David Kilzer.
* wtf/cocoa/Entitlements.mm:
* wtf/cocoa/FileSystemCocoa.mm:
* wtf/cocoa/MainThreadCocoa.mm:
* wtf/cocoa/SystemTracingCocoa.cpp:
* wtf/mac/DeprecatedSymbolsUsedBySafari.mm:
* wtf/mac/SchedulePairMac.mm:
* wtf/text/cocoa/StringCocoa.mm:
* wtf/text/cocoa/TextStreamCocoa.mm:
More #import.
2020-04-19 Brady Eidson <beidson@apple.com>
Add WKScriptMessageHandler API that asynchronously responds with a promise.
rdar://problem/57243492 and https://bugs.webkit.org/show_bug.cgi?id=206398
Reviewed by Andy Estes.
* wtf/CompletionHandler.h:
(WTF::CompletionHandlerWithFinalizer<Out): Add a variant of CompletionHandler that allows for a Finalizer function
to handle cases where the Completion function hasn't been called at destruction time.
2020-04-19 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Enable BigInt
https://bugs.webkit.org/show_bug.cgi?id=210726
Reviewed by Mark Lam.
* wtf/PlatformUse.h:
2020-04-18 Robin Morisset <rmorisset@apple.com>
Support an inlined representation in JSValue of small BigInts ("BigInt32")
https://bugs.webkit.org/show_bug.cgi?id=206182
Reviewed by Yusuke Suzuki.
Add a USE(BIGINT32) flag.
* wtf/PlatformUse.h:
2020-04-18 Keith Miller <keith_miller@apple.com>
Redesign how we do for-of iteration for JSArrays
https://bugs.webkit.org/show_bug.cgi?id=175454
Reviewed by Filip Pizlo.
* wtf/EnumClassOperatorOverloads.h:
2020-04-18 Yusuke Suzuki <ysuzuki@apple.com>
[WTF] Move DataRef.h from WebCore to WTF to utilize it in JSC
https://bugs.webkit.org/show_bug.cgi?id=210689
Reviewed by Anders Carlsson.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/DataRef.h: Renamed from Source/WebCore/rendering/style/DataRef.h.
2020-04-17 Saam Barati <sbarati@apple.com>
GetTypedArrayByteOffset is broken on arm64e
https://bugs.webkit.org/show_bug.cgi?id=210631
Reviewed by Mark Lam.
* wtf/CagedPtr.h:
(WTF::CagedPtr::rawBits const):
2020-04-17 Peng Liu <peng.liu6@apple.com>
Cleanup the macros for video fullscreen and picture-in-picture
https://bugs.webkit.org/show_bug.cgi?id=210638
Reviewed by Eric Carlson.
Add macro ENABLE_VIDEO_PRESENTATION_MODE.
* wtf/PlatformEnable.h:
2020-04-17 Claudio Saavedra <csaavedra@igalia.com>
[GTK][WPE] Bump dependencies minimum required version in Platform.h
https://bugs.webkit.org/show_bug.cgi?id=210651
Reviewed by Adrian Perez de Castro.
Bring the minimum required version in Platform.h in sync with the actual
minimal required version. This ensures that deprecated APIs used bring up
compilation warnings.
* wtf/Platform.h:
2020-04-17 Per Arne Vollan <pvollan@apple.com>
[iOS] Deny iokit open access to graphics related classes
https://bugs.webkit.org/show_bug.cgi?id=210616
Reviewed by Darin Adler.
* wtf/spi/darwin/SandboxSPI.h:
2020-04-17 Youenn Fablet <youenn@apple.com>
Make use of WeakHashSet for MediaStreamTrackPrivate and RealtimeMediaSource observers
https://bugs.webkit.org/show_bug.cgi?id=210492
Reviewed by Geoffrey Garen.
* wtf/WeakHashSet.h:
2020-04-16 Daniel Bates <dabates@apple.com>
Clean up VectorCocoa createNSArray overloads and add documentation for createNSArray taking a map function
https://bugs.webkit.org/show_bug.cgi?id=210610
Reviewed by Darin Adler.
Remove unnecessary local variable. Rename "map" type in createNSArray function for clarity
and add documentation for createNSArray function that takes a map function.
I was tempted, but decided not to write the createNSArray function that does not take a
map function in terms of the one that did. With the "right" optimization settings the
compiler should emit the same code, but I didn't verify this. So, I didn't do it.
While I am here, update makeVector() to call shrinkToFit() to reduce the memory footprint
of the returned vector should it end of having less entries, due to filtering, than its
initial capacity.
* wtf/cocoa/VectorCocoa.h:
(WTF::createNSArray): See above description.
(WTF::makeVector): Shrink to fit before returning the vector. See above for more details.
2020-04-16 Daniel Bates <dabates@apple.com>
Move -_requestTextInputContextsInRect to WKContentView to simplify implementation
https://bugs.webkit.org/show_bug.cgi?id=210398
<rdar://problem/61656931>
Reviewed by Darin Adler.
Add a convenience function to create an NSArray from a WTF::Vector with a transform function.
The tranform function can either return a RetainPtr or an id.
* wtf/cocoa/VectorCocoa.h:
(WTF::createNSArray): Added.
2020-04-16 Eric Carlson <eric.carlson@apple.com>
[macOS] Update ScreenTime as playback state changes
https://bugs.webkit.org/show_bug.cgi?id=210518
<rdar://problem/61181092>
Reviewed by Jer Noble.
Define HAVE_MEDIA_USAGE_FRAMEWORK and ENABLE_MEDIA_USAGE
* wtf/PlatformEnableCocoa.h:
* wtf/PlatformHave.h:
2020-04-16 Alberto Garcia <berto@igalia.com>
Unreviewed, set CeilingOnPageSize for MIPS64
This fixes a build failure ("Must set CeilingOnPageSize in
PageBlock.h").
* wtf/PageBlock.h:
2020-04-15 Chris Dumez <cdumez@apple.com>
[IPC Hardening] MachMessage::messageSize() should use checked arithmetic
https://bugs.webkit.org/show_bug.cgi?id=210567
<rdar://problem/61734355>
Reviewed by Geoffrey Garen.
Add operator / to CheckedArithmetic for convenience.
* wtf/CheckedArithmetic.h:
(WTF::safeDivide):
(WTF::Checked::operator/=):
(WTF::operator/):
2020-04-15 Robin Morisset <rmorisset@apple.com>
Flaky Test: fetch/fetch-worker-crash.html
https://bugs.webkit.org/show_bug.cgi?id=187257
<rdar://problem/48527526>
Reviewed by Yusuke Suzuki.
Make startMachExceptionHandlerThread visible so that we can make sure it is called whenever initializing JSC.
* wtf/threads/Signals.cpp:
(WTF::startMachExceptionHandlerThread):
* wtf/threads/Signals.h:
2020-04-14 Peng Liu <peng.liu6@apple.com>
Adopt interface AVAudioRoutingArbiter for Mac
https://bugs.webkit.org/show_bug.cgi?id=210167
Reviewed by Eric Carlson.
Add macro HAVE_AVAUDIO_ROUTING_ARBITER.
* wtf/PlatformHave.h:
2020-04-13 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r260052.
https://bugs.webkit.org/show_bug.cgi?id=210479
Breaks iOS tests, needs more work (Requested by smfr on
#webkit).
Reverted changeset:
"Add ENABLE_CUSTOM_SCROLLBARS and define it for macOS and for
non-Cocoa platforms"
https://bugs.webkit.org/show_bug.cgi?id=210460
https://trac.webkit.org/changeset/260052
2020-04-13 David Kilzer <ddkilzer@apple.com>
Replace use of Checked<size_t, RecordOverflow> with CheckedSize
<https://webkit.org/b/210461>
Reviewed by Mark Lam.
* wtf/FastMalloc.cpp:
(WTF::tryFastCalloc):
* wtf/Gigacage.cpp:
(Gigacage::tryMallocArray):
* wtf/glib/SocketConnection.cpp:
(WTF::SocketConnection::sendMessage):
2020-04-13 Simon Fraser <simon.fraser@apple.com>
Add ENABLE_CUSTOM_SCROLLBARS and define it for macOS and for non-Cocoa platforms
https://bugs.webkit.org/show_bug.cgi?id=210460
Reviewed by Tim Horton.
Define ENABLE_CUSTOM_SCROLLBARS for PLATFORM(MAC) and other non-Cocoa platforms.
* wtf/PlatformEnable.h:
* wtf/PlatformEnableCocoa.h:
2020-04-13 David Kilzer <ddkilzer@apple.com>
Fix clang static analyzer warnings about unused instance variables in WebIconDatabase, WKView
<https://webkit.org/b/210427>
Reviewed by Alex Christensen.
* wtf/Compiler.h:
(WK_UNUSED_INSTANCE_VARIABLE): Add.
2020-04-13 Joonghun Park <jh718.park@samsung.com>
Unreviewed. Remove redundant move in return statement.
Return statement already returns rvalue,
so we don't need move here.
This patch removes the build warning below since r259922.
warning: redundant move in return statement [-Wredundant-move]
* wtf/persistence/PersistentCoders.cpp:
(WTF::Persistence::Coder<CString>::decode):
(WTF::Persistence::decodeStringText):
(WTF::Persistence::Coder<SHA1::Digest>::decode):
* wtf/persistence/PersistentCoders.h:
2020-04-12 Mark Lam <mark.lam@apple.com>
Enable the ability to build the ASM LLInt for ARMv7k.
https://bugs.webkit.org/show_bug.cgi?id=210412
Reviewed by Sam Weinig.
Remove some old code that forces the ENABLE(C_LOOP) to be true if ENABLE(JIT) is
false. These 2 options used to be mutually exclusive, but is no more. Now, we
allow platforms to choose to build the ASM LLInt instead even if ENABLE(JIT) is
false.
* wtf/PlatformEnable.h:
2020-04-12 Darin Adler <darin@apple.com>
[Cocoa] Minor tweaks to code to get locale strings to remove one-time-initialization booleans
https://bugs.webkit.org/show_bug.cgi?id=210410
Reviewed by Sam Weinig.
* wtf/text/cocoa/TextBreakIteratorInternalICUCocoa.cpp:
(WTF::textBreakLocalePreference): Use auto, and no need to explicitly mark this inline.
(WTF::topLanguagePreference): Use auto.
(WTF::localeIDInBuffer): Renamed from getLocale. Changed to return a std::array and to
handle failure cases afterward rather than by initializing beforehand.
(WTF::getSearchLocale): Deleted.
(WTF::currentSearchLocaleID): Using "static const auto", wrote this in a straightforward
and compact way, using localeIDInBuffer and topLanguagePreference.
(WTF::textBreakLocale): Renamed from getTextBreakLocale and changed to return a
RetainPtr<CFStringRef>.
(WTF::currentTextBreakLocaleID): Using "static const auto", wrote this in a straightforward
and compact way, using localeIDInBuffer and textBreakLocale.
2020-04-12 David Kilzer <ddkilzer@apple.com>
Follow-up: WTF::Persistence::Coder and WTF::Persistence::Decoder should use WARN_UNUSED_RETURN
<https://webkit.org/b/210238>
<rdar://problem/61491575>
Changes based on feedback from Alex Christensen and Darin Adler:
- Remove WARN_UNUSED_RETURN from methods returning Optional<>.
- Place WARN_UNUSED_RETURN consistently before the return type.
* wtf/persistence/PersistentDecoder.h:
2020-04-10 Alex Christensen <achristensen@webkit.org>
PersistentCoders should use modern decoding syntax
https://bugs.webkit.org/show_bug.cgi?id=207497
Reviewed by Darin Adler.
This paves the way for more serialized types that do not have a default constructor.
* wtf/persistence/PersistentCoder.h:
(WTF::Persistence::Coder::encode):
(WTF::Persistence::Coder::decode):
* wtf/persistence/PersistentCoders.cpp:
(WTF::Persistence::Coder<AtomString>::decode):
(WTF::Persistence::Coder<CString>::decode):
(WTF::Persistence::decodeStringText):
(WTF::Persistence::Coder<String>::decode):
(WTF::Persistence::Coder<SHA1::Digest>::decode):
* wtf/persistence/PersistentCoders.h:
(WTF::Persistence::Coder<Optional<T>>::decode):
(WTF::Persistence::Coder<Seconds>::decode):
(WTF::Persistence::Coder<WallTime>::decode):
* wtf/persistence/PersistentDecoder.cpp:
(WTF::Persistence::Decoder::decodeNumber):
(WTF::Persistence::Decoder::operator>>):
(WTF::Persistence::Decoder::decode): Deleted.
* wtf/persistence/PersistentDecoder.h:
(WTF::Persistence::Decoder::operator>>):
(WTF::Persistence::Decoder::decode): Deleted.
(WTF::Persistence::Decoder::decodeEnum): Deleted.
* wtf/persistence/PersistentEncoder.h:
(WTF::Persistence::Encoder::operator<<):
(WTF::Persistence::Encoder::encode): Deleted.
(WTF::Persistence::Encoder::encodeEnum): Deleted.
2020-04-10 David Kilzer <ddkilzer@apple.com>
Follow-up: Add WARN_UNUSED_RETURN to decode methods in Source/WTF
<https://webkit.org/b/210323>
<rdar://problem/61565764>
Changes based on feedback from Alex Christensen and Darin Adler:
- Remove WARN_UNUSED_RETURN from methods returning Optional<>.
- Place WARN_UNUSED_RETURN consistently before the return type.
* wtf/MediaTime.h:
* wtf/MonotonicTime.h:
* wtf/ObjectIdentifier.h:
(WTF::ObjectIdentifier::decode):
* wtf/Seconds.h:
* wtf/URL.h:
2020-04-10 Alicia Boya García <aboya@igalia.com>
[WTF] DataMutex: Add runUnlocked()
https://bugs.webkit.org/show_bug.cgi?id=209811
Reviewed by Xabier Rodriguez-Calvar.
This patch introduces a runUnlocked() method in WTF::DataMutex::LockedWrapper
to run a lambda function without the lock. This is intended to be used for
small sections of the code that need to be unlocked, in cases where using
scoping would prove non-ergonomic or where running the unlocked section is only
necessary or desired when a certain condition is met -- something that cannot
be done with C++ scoping.
Safety mechanisms are provided. First, because this is used with a lambda, all
variables to be used in the unlocked section have to be specified in the
capture (global capture is possible but not recommended to simplify analysis).
Second, additional checks have been added to DataMutex to detect unlocked
accesses among other conditions. This will detect among other things naive
access to protected members by means of capturing the LockedWrapper by
reference.
* wtf/DataMutex.h:
(WTF::OwnerAwareLockAdapter::lock):
(WTF::OwnerAwareLockAdapter::unlock):
(WTF::OwnerAwareLockAdapter::tryLock):
(WTF::OwnerAwareLockAdapter::isLocked const):
(WTF::DataMutex::LockedWrapper::operator->):
(WTF::DataMutex::LockedWrapper::operator*):
(WTF::DataMutex::LockedWrapper::mutex):
(WTF::DataMutex::LockedWrapper::lockHolder):
(WTF::DataMutex::LockedWrapper::runUnlocked):
2020-04-10 David Kilzer <ddkilzer@apple.com>
Add WARN_UNUSED_RETURN to decode methods in Source/WTF
<https://webkit.org/b/210323>
<rdar://problem/61565764>
Reviewed by Darin Adler.
* wtf/MediaTime.h:
* wtf/MonotonicTime.h:
* wtf/ObjectIdentifier.h:
(WTF::ObjectIdentifier::decode):
* wtf/Seconds.h:
* wtf/URL.h:
* wtf/persistence/PersistentCoder.h:
(WTF::Persistence::Coder::decode):
2020-04-08 Darin Adler <darin@apple.com>
[Cocoa] Simplify NSArray, NSDictionary, and NSNumber idioms throughout WebKit
https://bugs.webkit.org/show_bug.cgi?id=210138
Reviewed by Alex Christensen.
* WTF.xcodeproj/project.pbxproj: Added VectorCocoa.h.
* wtf/PlatformMac.cmake: Ditto.
* wtf/cocoa/NSURLExtras.mm: Removed unneeded include.
* wtf/cocoa/URLCocoa.mm: Ditto.
* wtf/cocoa/VectorCocoa.h: Added. Contains createNSArray and makeVector
function templates for converting NSArray to and from Vector.
* wtf/text/WTFString.h: Added makeNSArrayElement and makeVectorElement
functions, making createNSArray and makeVector compatible with String.
* wtf/text/cocoa/StringCocoa.mm:
(WTF::makeNSArrayElement): Added.
(WTF::makeVectorElement): Added.
2020-04-09 David Kilzer <ddkilzer@apple.com>
Add using WTF::isInBounds to CheckedArithmetic.h
<https://webkit.org/b/210299>
Reviewed by Darin Adler.
* wtf/CheckedArithmetic.h:
- Add `using WTF::isInBounds` statement so this function may be
used unprefixed outside the WTF project.
2020-04-09 David Kilzer <ddkilzer@apple.com>
WTF::Persistence::Coder and WTF::Persistence::Decoder should use WARN_UNUSED_RETURN
<https://webkit.org/b/210238>
<rdar://problem/61491575>
Reviewed by Darin Adler.
* wtf/persistence/PersistentCoders.cpp:
(WTF::Persistence::decodeStringText):
- Add WARN_UNUSED_RETURN.
* wtf/persistence/PersistentCoders.h:
(WTF::Persistence::Coder<Optional<T>>::decode):
(WTF::Persistence::Coder<Seconds>::decode):
(WTF::Persistence::Coder<WallTime>::decode):
- Add WARN_UNUSED_RETURN.
- Add missing return value check for
decode.decodeFixedLengthData().
* wtf/persistence/PersistentDecoder.h:
(WTF::Persistence::Decoder::decode):
(WTF::Persistence::Decoder::decodeEnum):
(WTF::Persistence::Decoder::bufferIsLargeEnoughToContain const):
- Add WARN_UNUSED_RETURN.
2020-04-09 David Kilzer <ddkilzer@apple.com>
Follow-up: WTF::Persistence::VectorCoder and IPC::VectorArgumentCoder should do bounds checking without crashing
<https://webkit.org/b/210227>
<rdar://problem/60832243>
Reviewed by Alex Christensen.
* wtf/persistence/PersistentCoders.h:
(WTF::Persistence::VectorCoder::decode):
- Replace safeCast<size_t> with isInBounds<size_t> so that we
don't crash if `decodedSize` is too big. Instead we fail
decoding by returning early.
- Revert checked arithemtic for multiplication since
bufferIsLargeEnoughToContain<T(size) already did this check
for us.
2020-04-09 Mark Lam <mark.lam@apple.com>
Implement a more efficient tagCFunction() tool.
https://bugs.webkit.org/show_bug.cgi?id=210254
Reviewed by Keith Miller.
The current tagCFunctionPtr() tool does some extra work that is not needed if
we are tagging a known function and not a potentially arbitrary pointer. For
example,
1. it doesn't need to do a null check.
2. it doesn't need to authenticate the function address.
3. The RELEASE_ASSERT used to enforce that authentication can also go away.
We should only use tagCFunction() (instead of tagCFunctionPtr()) if we know for
certain that we're operating on a C/C++ function, and not some arbitrary pointer.
* wtf/PtrTag.h:
(WTF::tagCFunction):
2020-04-08 David Kilzer <ddkilzer@apple.com>
WTF::Persistence::VectorCoder and IPC::VectorArgumentCoder should use checked arithmetic
<https://webkit.org/b/210227>
<rdar://problem/60832243>
Reviewed by Alex Christensen.
* wtf/persistence/PersistentCoders.h:
(WTF::Persistence::VectorCoder::decode):
- Use checked arithemtic for multiplication.
2020-04-08 Chris Dumez <cdumez@apple.com>
querySelector("#\u0000") should match an element with ID U+FFFD
https://bugs.webkit.org/show_bug.cgi?id=210119
Reviewed by Darin Adler.
* wtf/text/StringImpl.cpp:
(WTF::StringImpl::replace):
Slightly optimize the 16-bit code path of StringImpl::replace(). Since we know
there is no character match from indexes 0 to i, we can simply use memcpy for
this range.
2020-04-08 Ross Kirsling <ross.kirsling@sony.com>
Remove ENABLE_INTL define
https://bugs.webkit.org/show_bug.cgi?id=210164
Reviewed by Darin Adler.
AppleWin (and, following suit, FTW) was the only upstream platform turning ENABLE_INTL off;
now that their headers have been upgraded to ICU 62, this define can be removed entirely.
Going forward, we thus assume JSC has an Intl object and can simply runtime-guard any new features added to it.
* wtf/PlatformEnable.h:
* wtf/PlatformEnableCocoa.h:
2020-04-08 Adrian Perez de Castro <aperez@igalia.com>
[GTK4] Make PAL::systemBeep() work
https://bugs.webkit.org/show_bug.cgi?id=210158
Reviewed by Carlos Garcia Campos.
* wtf/Platform.h: Define a value for GDK_VERSION_MIN_REQUIRED suitable for GTK4.
2020-04-08 Tim Horton <timothy_horton@apple.com>
Rearrange and simplify some JSC feature flags
https://bugs.webkit.org/show_bug.cgi?id=210152
Reviewed by Saam Barati.
* wtf/PlatformEnableCocoa.h:
* wtf/PlatformHave.h:
* wtf/PlatformUse.h:
2020-04-08 Philippe Normand <pnormand@igalia.com>
[GTK][WPE] Release logs are unconditionally filling the journal
https://bugs.webkit.org/show_bug.cgi?id=209421
Reviewed by Carlos Alberto Lopez Perez.
* wtf/Assertions.h: Don't send logs to systemd for disabled log channels.
* wtf/Logger.h:
(WTF::Logger::willLog const): Ditto.
2020-04-07 Chris Dumez <cdumez@apple.com>
Merge DependencyAssertion into ProcessAssertion
https://bugs.webkit.org/show_bug.cgi?id=210076
Reviewed by Alex Christensen.
* wtf/PlatformHave.h:
2020-04-07 Saam Barati <sbarati@apple.com>
RAMification should have a way of gathering vmmaps for each test at the end of each run
https://bugs.webkit.org/show_bug.cgi?id=210060
Reviewed by Yusuke Suzuki.
* wtf/FastMalloc.cpp:
(WTF::fastDisableScavenger):
* wtf/FastMalloc.h:
2020-04-06 Ross Kirsling <ross.kirsling@sony.com>
Update minimum ICU version to 60.2
https://bugs.webkit.org/show_bug.cgi?id=209694
Reviewed by Darin Adler.
This patch has two immediate motivations:
1. To properly introduce a minimum ICU version for WebKit as a whole
(responding to a pain point identified in bug 209579)
2. To support the development of ECMA-402 Intl API features, which JSC is quite behind on
(and which often boil down to exposing ICU functionality to JavaScript)
* icu/LICENSE:
* icu/README:
* icu/unicode/:
Update ICU headers to major version 62, the version included in macOS Mojave.
* wtf/text/AtomString.h:
* wtf/text/WTFString.h:
Remove obsoleted compile-time version checks.
* wtf/text/cocoa/StringCocoa.mm:
(WTF::String::String):
* wtf/text/cocoa/StringViewCocoa.mm:
(WTF::StringView::createNSString const):
(WTF::StringView::createNSStringWithoutCopying const):
Manually convert between UChar and UniChar/unichar where needed.
2020-04-06 Saam Barati <sbarati@apple.com>
Implement 1GB of executable memory on arm64
https://bugs.webkit.org/show_bug.cgi?id=208490
<rdar://problem/60797127>
Reviewed by Keith Miller.
* wtf/MetaAllocator.cpp:
(WTF::MetaAllocatorTracker::notify):
(WTF::MetaAllocatorTracker::release):
(WTF::MetaAllocator::release):
(WTF::MetaAllocatorHandle::MetaAllocatorHandle):
(WTF::MetaAllocatorHandle::~MetaAllocatorHandle):
(WTF::MetaAllocatorHandle::shrink):
(WTF::MetaAllocator::MetaAllocator):
(WTF::MetaAllocator::allocate):
(WTF::MetaAllocator::currentStatistics):
* wtf/MetaAllocator.h:
(WTF::MetaAllocatorTracker::find):
(WTF::MetaAllocator::allocate):
(WTF::MetaAllocator::currentStatistics):
(WTF::MetaAllocator::getLock): Deleted.
* wtf/MetaAllocatorHandle.h:
(WTF::MetaAllocatorHandle::allocator):
(WTF::MetaAllocatorHandle::isManaged): Deleted.
(WTF::MetaAllocatorHandle::ownerUID): Deleted.
* wtf/PlatformEnable.h:
* wtf/RedBlackTree.h:
* wtf/StdLibExtras.h:
(WTF::constructFixedSizeArrayWithArgumentsImpl):
(WTF::constructFixedSizeArrayWithArguments):
2020-04-04 Darin Adler <darin@apple.com>
Stop using live ranges in DocumentMarkerController
https://bugs.webkit.org/show_bug.cgi?id=209985
Reviewed by Antti Koivisto.
* wtf/RetainPtr.h: Define "id" here when compiling non-ObjC so it's easier to use
RetainPtr<id> in any header file. Lets us stop doing this many other places.
Harmless when not needed.
2020-04-04 Fujii Hironori <Hironori.Fujii@sony.com>
[Clang 10] Fix -Wimplicit-int-float-conversion compilation warnings in WTF
https://bugs.webkit.org/show_bug.cgi?id=209955
Reviewed by Darin Adler.
Clang 10 reports a compilation warning for int to float
conversions losing the precision. The warning is often reported
for code converting a floating point value to an integer value.
For example:
> Optional<int> positive_float_to_int(float f) {
> if (f > INT_MAX)
> return nullopt;
> return static_cast<int>(f);
> }
INT_MAX is implicitly converted float, but float can't keep the
precision of such large value. And, C++ spec doesn't specify
whether it would be rounded up or down. Above code should be
rewritten to:
> Optional<int> positive_float_to_int(float f) {
> if (f >= pow(2, 31))
> return nullopt;
> return static_cast<int>(f);
> }
Instead of using pow, this change added a template variable
maxPlusOne<T>.
* wtf/MathExtras.h:
(powerOfTwo): Added.
(doubleToInteger): Added.
(maxPlusOne): Added.
* wtf/MediaTime.cpp:
(WTF::MediaTime::createWithFloat):
(WTF::MediaTime::createWithDouble):
2020-04-03 David Kilzer <ddkilzer@apple.com>
[Xcode] Replace ASAN_OTHER_CFLAGS and ASAN_OTHER_CPLUSPLUSFLAGS with $(inherited)
<https://webkit.org/b/209963>
<rdar://problem/61257504>
Reviewed by Alexey Proskuryakov.
* Configurations/Base.xcconfig:
- Remove ASAN_OTHER_CFLAGS, ASAN_OTHER_CPLUSPLUSFLAGS and
ASAN_OTHER_LDFLAGS.
2020-04-02 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r259390.
https://bugs.webkit.org/show_bug.cgi?id=209944
It broke WinCairo builds (Requested by fujihiro on #webkit).
Reverted changeset:
"Enable offlineasm debug annotations for GCC"
https://bugs.webkit.org/show_bug.cgi?id=207119
https://trac.webkit.org/changeset/259390
2020-04-02 Chris Dumez <cdumez@apple.com>
[iOS] Replace UIKit background task with a RunningBoard FinishTaskInterruptable assertion
https://bugs.webkit.org/show_bug.cgi?id=209825
<rdar://problem/61118503>
Reviewed by Geoffrey Garen.
Add build-time flag for WebKit-specific assertion in RunningBoard.
* wtf/PlatformHave.h:
2020-04-02 Keith Rollin <krollin@apple.com>
Address static analysis warning in DataLog.cpp: Value stored to 'pathCharactersAvailable' is never read
https://bugs.webkit.org/show_bug.cgi?id=202153
<rdar://problem/55671845>
Reviewed by David Kilzer.
Bug 168914 introduced some code that will initialize a variable to
zero, but then never use that variable afterwards. Address this by
removing the assignment.
* wtf/DataLog.cpp:
(WTF::setDataFile):
2020-03-31 Michael Catanzaro <mcatanzaro@gnome.org>
Update check for aarch64
https://bugs.webkit.org/show_bug.cgi?id=209322
Reviewed by Mark Lam.
CPU(ARM64) is used on Linux, so checking to avoid Apple platforms doesn't make much sense.
The comment implying that this is an Apple architecture also no longer makes sense.
* wtf/PlatformCPU.h:
2020-03-31 Sihui Liu <sihui_liu@apple.com>
IndexedDB: destroy WebIDBServer when session is removed in network process
https://bugs.webkit.org/show_bug.cgi?id=209606
<rdar://problem/59310081>
Reviewed by Geoffrey Garen.
Add function to kill CrossThreadTaskHandler and make thread finish. Also add a callback to be called before
thread finishes.
* wtf/CrossThreadTaskHandler.cpp:
(WTF::CrossThreadTaskHandler::CrossThreadTaskHandler):
(WTF::CrossThreadTaskHandler::setCompletionCallback):
(WTF::CrossThreadTaskHandler::kill):
* wtf/CrossThreadTaskHandler.h:
2020-03-30 David Kilzer <ddkilzer@apple.com>
Fix "Dead nested assignment" static analyzer warning in monthFromDayInYear()
<https://webkit.org/b/209718>
Reviewed by Alex Christensen.
* wtf/DateMath.h:
(WTF::monthFromDayInYear): Change the last check so it doesn't
assign a value to `step`, thus avoiding the warning.
2020-03-28 Simon Fraser <simon.fraser@apple.com>
Add a ScrollLatching log channel and improve some logging functionality
https://bugs.webkit.org/show_bug.cgi?id=209706
Reviewed by Darin Adler, David Kilzer.
* wtf/text/TextStream.h:
(WTF::ValueOrNull::ValueOrNull):
(WTF::operator<<):
2020-03-27 Simon Fraser <simon.fraser@apple.com>
Define ENABLE_WHEEL_EVENT_LATCHING and use it to wrap wheel event latching code
https://bugs.webkit.org/show_bug.cgi?id=209693
Reviewed by Zalan Bujtas.
Define ENABLE_WHEEL_EVENT_LATCHING for macOS.
* wtf/PlatformEnable.h:
2020-03-27 Michael Catanzaro <mcatanzaro@gnome.org>
REGRESSION(r258857): Broke aarch64 JSCOnly CI
https://bugs.webkit.org/show_bug.cgi?id=209670
Reviewed by Carlos Alberto Lopez Perez.
Change aarch64 to use 4 KB rather than 64 KB as the ceiling on page size.
This change is definitely incorrect, because it will break our internal aarch64 CI that uses
64 KB pages. But maybe it will fix the public aarch64 CI bot that is using 4 KB pages?
Further investigation is required, because 64 KB should have been a safe value for all
platforms, but first step is to commit this and see what happens.
* wtf/PageBlock.h:
2020-03-26 Michael Catanzaro <mcatanzaro@gnome.org>
Fix various compiler warnings
https://bugs.webkit.org/show_bug.cgi?id=209438
Reviewed by Darin Adler.
Suppress -Wclass-memaccess warning. ConcurrentBuffer is documented to support types that are
bit-copyable but not copy-constructable. This is strange, but who am I to question it?
* wtf/ConcurrentBuffer.h:
2020-03-25 Christopher Reid <chris.reid@sony.com>
[PlayStation] Specify a 16 KB minimum page size
https://bugs.webkit.org/show_bug.cgi?id=209566
Reviewed by Ross Kirsling.
* wtf/PageBlock.h:
2020-03-25 Sihui Liu <sihui_liu@apple.com>
Remove unused suspend functions in CrossThreadTaskHandler
https://bugs.webkit.org/show_bug.cgi?id=209553
Reviewed by Geoffrey Garen.
* wtf/CrossThreadTaskHandler.cpp:
(WTF::CrossThreadTaskHandler::taskRunLoop):
(WTF::CrossThreadTaskHandler::suspendAndWait): Deleted.
(WTF::CrossThreadTaskHandler::resume): Deleted.
* wtf/CrossThreadTaskHandler.h:
2020-03-24 Per Arne Vollan <pvollan@apple.com>
[Cocoa] Fix launch time regression with CF prefs direct mode enabled
https://bugs.webkit.org/show_bug.cgi?id=209244
Reviewed by Darin Adler.
Re-enable CF prefs direct mode.
* wtf/PlatformEnable.h:
* wtf/PlatformEnableCocoa.h:
2020-03-24 Per Arne Vollan <pvollan@apple.com>
[Cocoa] Deny access to database mapping service
https://bugs.webkit.org/show_bug.cgi?id=209339
<rdar://problem/56966010>
Reviewed by Brent Fulgham.
Disable the use of UTTypeRecord swizzling, since this is not needed with the new approach
of denying the database mapping service in this patch.
* wtf/PlatformUse.h:
2020-03-23 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r258891.
https://bugs.webkit.org/show_bug.cgi?id=209459
Introduced layout test failures (Requested by perarne on
#webkit).
Reverted changeset:
"[Cocoa] Deny access to database mapping service"
https://bugs.webkit.org/show_bug.cgi?id=209339
https://trac.webkit.org/changeset/258891
2020-03-23 Per Arne Vollan <pvollan@apple.com>
[Cocoa] Deny access to database mapping service
https://bugs.webkit.org/show_bug.cgi?id=209339
<rdar://problem/56966010>
Reviewed by Brent Fulgham.
Disable the use of UTTypeRecord swizzling, since this is not needed with the new approach
of denying the database mapping service in this patch.
* wtf/PlatformUse.h:
2020-03-23 John Wilander <wilander@apple.com>
Add the capability to change all of a website's cookies to SameSite=Strict
https://bugs.webkit.org/show_bug.cgi?id=209369
<rdar://problem/60710690>
Reviewed by Alex Christensen and David Kilzer.
* wtf/PlatformHave.h:
Adds HAVE_CFNETWORK_SAMESITE_COOKIE_API for macOS Catalina and up,
iOS 13 and up, Catalyst, watchOS, and Apple TV.
2020-03-23 youenn fablet <youenn@apple.com>
Rename blankURL to aboutBlankURL
https://bugs.webkit.org/show_bug.cgi?id=209344
Reviewed by Darin Adler.
Rename blankURL to aboutBlankURL and allow using it without WTF:: prefix.
* wtf/URL.cpp:
(WTF::aboutBlankURL):
(WTF::blankURL): Deleted.
* wtf/URL.h:
2020-03-23 Rob Buis <rbuis@igalia.com>
XMLHttpRequest: getAllResponseHeaders() sorting
https://bugs.webkit.org/show_bug.cgi?id=200565
Reviewed by Darin Adler.
Add a new manipulator that can efficiently convert
Strings to lower or upper ASCII.
* wtf/text/StringConcatenate.h:
(WTF::lowercase):
(WTF::uppercase):
* wtf/text/StringView.cpp:
(WTF::getCharactersWithASCIICaseInternal):
(WTF::StringView::getCharactersWithASCIICase const):
* wtf/text/StringView.h:
2020-03-23 Antoine Quint <graouts@apple.com>
DocumentTimeline / CSSTransition objects are leaking on CNN.com
https://bugs.webkit.org/show_bug.cgi?id=208069
<rdar://problem/59680143>
Reviewed by Darin Adler.
Integrating post-commit review feedback from Darin.
* wtf/ListHashSet.h:
(WTF::=):
2020-03-23 Michael Catanzaro <mcatanzaro@gnome.org>
REGRESSION(r249808): [GTK] Crash in JSC Config::permanentlyFreeze() on architecture ppc64el
https://bugs.webkit.org/show_bug.cgi?id=209236
Reviewed by Mark Lam.
Add new CeilingOnPageSize constants, for use in JSC, in order to centralize our compile-time
page size guessing into one place. Improve the implementation of pageSize() to
RELEASE_ASSERT() when CeilingOnPageSize is wrong, so we can detect and fix it if so. (It
will be even easier to detect if we change RELEASE_ASSERT_WITH_MESSAGE() to actually print
its message in release builds.) Change pageSize() to use sysconf(_SC_PAGESIZE), which is
specified by POSIX, instead of getpagesize(), which is nonstandard.
* wtf/PageBlock.cpp:
(WTF::systemPageSize):
(WTF::pageSize):
* wtf/PageBlock.h:
2020-03-23 Jacob Uphoff <jacob_uphoff@apple.com>
Unreviewed, reverting r258803.
This revision caused many layout tests and 10 API tests to
start failing/crashing
Reverted changeset:
"[Cocoa] Deny access to database mapping service"
https://bugs.webkit.org/show_bug.cgi?id=209339
https://trac.webkit.org/changeset/258803
2020-03-23 youenn fablet <youenn@apple.com>
StringView::startsWith and String::startsWith do not treat null strings the same
https://bugs.webkit.org/show_bug.cgi?id=209273
Reviewed by Darin Adler.
Align StringImpl with StringView and make startsWith return true if prefix is null.
* wtf/text/StringImpl.cpp:
(WTF::StringImpl::startsWith const):
2020-03-22 Antoine Quint <graouts@apple.com>
DocumentTimeline / CSSTransition objects are leaking on CNN.com
https://bugs.webkit.org/show_bug.cgi?id=208069
<rdar://problem/59680143>
Reviewed by Simon Fraser, Geoffrey Garen and Darin Adler.
If a CSSAnimation is set on an element using the `animation-name` CSS property, and later removed, it will leak due to the ListHashSet<RefPtr<CSSAnimation>>
(aka CSSAnimationCollection) member on ElementAnimationRareData being replaced to the new list, but the old list not being cleared from its members.
We fix the ListHashSet assignment operator to use swap ensuring previously held items are cleared.
* wtf/ListHashSet.h:
(WTF::=):
2020-03-20 Per Arne Vollan <pvollan@apple.com>
[Cocoa] Deny access to database mapping service
https://bugs.webkit.org/show_bug.cgi?id=209339
<rdar://problem/56966010>
Reviewed by Brent Fulgham.
Disable the use of UTTypeRecord swizzling, since this is not needed with the new approach
of denying the database mapping service in this patch.
* wtf/PlatformUse.h:
2020-03-20 Oliver Hunt <oliver@nerget,com>
Add correct annotations to block isa pointer
https://bugs.webkit.org/show_bug.cgi?id=209355
<rdar://problem/60431606>
Reviewed by Keith Miller.
Trivial definition update.
* wtf/BlockPtr.h:
(WTF::BlockPtr<R):
2020-03-20 Tim Horton <timothy_horton@apple.com>
Upstream a variety of Cocoa-platform HAVE and ENABLE macros
https://bugs.webkit.org/show_bug.cgi?id=209307
Reviewed by Andy Estes.
* wtf/PlatformEnableCocoa.h:
* wtf/PlatformHave.h:
2020-03-20 youenn fablet <youenn@apple.com>
Add routines to check about:blank and about:srcdoc URLs
https://bugs.webkit.org/show_bug.cgi?id=209174
Reviewed by Alex Christensen.
* wtf/URL.cpp:
(WTF::aboutSrcDocURL):
(WTF::URL::isAboutBlank const):
(WTF::URL::isAboutSrcDoc const):
* wtf/URL.h:
2020-03-20 Jacob Uphoff <jacob_uphoff@apple.com>
Unreviewed, reverting r258748.
This commit broke the Catalina build
Reverted changeset:
"Upstream a variety of Cocoa-platform HAVE and ENABLE macros"
https://bugs.webkit.org/show_bug.cgi?id=209307
https://trac.webkit.org/changeset/258748
2020-03-19 Tim Horton <timothy_horton@apple.com>
Upstream a variety of Cocoa-platform HAVE and ENABLE macros
https://bugs.webkit.org/show_bug.cgi?id=209307
Reviewed by Andy Estes.
* wtf/PlatformEnableCocoa.h:
* wtf/PlatformHave.h:
2020-03-19 Tim Horton <timothy_horton@apple.com>
Upstream the definition of HAVE_READ_ONLY_SYSTEM_VOLUME
https://bugs.webkit.org/show_bug.cgi?id=209305
Reviewed by Andy Estes.
* wtf/PlatformHave.h:
2020-03-19 Tim Horton <timothy_horton@apple.com>
Implement support for cursor interactions on iPad
https://bugs.webkit.org/show_bug.cgi?id=209268
Reviewed by Darin Adler.
* wtf/PlatformEnableCocoa.h:
Don't disable the contextmenu event on iOS anymore.
* wtf/PlatformHave.h:
Rename HAVE_HOVER_GESTURE_RECOGNIZER to HAVE_UIKIT_WITH_MOUSE_SUPPORT.
Add HAVE_UI_CURSOR_INTERACTION.
Enable HAVE_UI_PARALLAX_TRANSITION_GESTURE_RECOGNIZER on iOS.
2020-03-19 Charlie Turner <cturner@igalia.com>
Fix many warnings with Clang 7.0 on GTK x86-64 in Debug.
https://bugs.webkit.org/show_bug.cgi?id=209146
Reviewed by Darin Adler.
* wtf/LoggerHelper.h: When the RELEASE_LOG is disabled, avoid warning
spam about unused channel names. Call sites often create locals for
the channel name outside of RELEASE_LOG ifdef's, which cause many
unused variable warnings.
2020-03-19 Philippe Normand <pnormand@igalia.com>
[GTK][WPE] Unreviewed, build fixes after r258547 when disabling release logging support
* wtf/Logger.h:
(WTF::Logger::logAlwaysVerbose const):
2020-03-19 youenn fablet <youenn@apple.com>
Make URL::path() return a StringView
https://bugs.webkit.org/show_bug.cgi?id=209173
Reviewed by Alex Christensen.
* wtf/URL.cpp:
(WTF::URL::path const):
* wtf/URL.h:
* wtf/text/StringView.h:
(WTF::startsWithLettersIgnoringASCIICase):
Add an overload for StringView.
2020-03-18 Peng Liu <peng.liu6@apple.com>
The value of [AVPlayerViewController isPictureInPicturePossible] is NO in the first attempt to enter PiP
https://bugs.webkit.org/show_bug.cgi?id=204979
Reviewed by Jer Noble.
A follow-up patch to fix build failures.
* wtf/PlatformHave.h:
2020-03-18 Myles C. Maxfield <mmaxfield@apple.com>
REGRESSION(r254389): Cordova throws an exception because it expects a hyphen inside navigator.locale
https://bugs.webkit.org/show_bug.cgi?id=208969
<rdar://problem/59845517>
Reviewed by Darin Adler.
We want to thwart fingerprinting by minimizing the list of locales, but we also don't want to break existing apps.
We can achieve both by a linked-on-or-after check.
* wtf/cocoa/LanguageCocoa.mm:
(WTF::canMinimizeLanguages):
2020-03-17 Alex Christensen <achristensen@webkit.org>
REGRESSION(r254856) Add exception for window.openDatabase to not masquerade as undefined in currently shipping Jesus Calling Devotional app
https://bugs.webkit.org/show_bug.cgi?id=209160
<rdar://problem/60297073>
Reviewed by Geoff Garen.
* wtf/spi/darwin/dyldSPI.h:
2020-03-17 Per Arne Vollan <pvollan@apple.com>
[Cocoa] Disable CF prefs direct mode
https://bugs.webkit.org/show_bug.cgi?id=209166
<rdar://problem/60517387>
Reviewed by Brent Fulgham.
Revert <https://trac.webkit.org/changeset/258064> by disabling the CF prefs direct mode feature,
since it caused performance regressions.
* wtf/PlatformEnable.h:
2020-03-17 Philippe Normand <pnormand@igalia.com>
RELEASE_LOG should not be Cocoa specific
https://bugs.webkit.org/show_bug.cgi?id=195182
Reviewed by Konstantin Tokarev.
Add sd-journal logging support and wrap the os_log calls with the USE(OS_LOG) guard.
* wtf/Assertions.cpp:
* wtf/Assertions.h:
* wtf/Logger.h:
(WTF::Logger::log):
* wtf/MemoryPressureHandler.cpp:
(WTF::toString):
* wtf/PlatformGTK.cmake:
* wtf/PlatformWPE.cmake:
* wtf/RefCountedLeakCounter.cpp:
2020-03-16 Keith Miller <keith_miller@apple.com>
JavaScript identifier grammar supports unescaped astral symbols, but JSC doesn’t
https://bugs.webkit.org/show_bug.cgi?id=208998
Reviewed by Michael Saboff.
* wtf/text/WTFString.cpp:
(WTF::String::fromCodePoint):
* wtf/text/WTFString.h:
2020-03-15 Yusuke Suzuki <ysuzuki@apple.com>
Should not use variable-length-array (VLA)
https://bugs.webkit.org/show_bug.cgi?id=209043
Reviewed by Mark Lam.
* Configurations/Base.xcconfig:
* wtf/UUID.cpp:
(WTF::bootSessionUUIDString):
2020-03-13 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Push applicationSDKVersion() down from WebCore into WTF
https://bugs.webkit.org/show_bug.cgi?id=209030
Reviewed by Simon Fraser.
* WTF.xcodeproj/project.pbxproj:
* wtf/PlatformMac.cmake:
* wtf/cocoa/RuntimeApplicationChecksCocoa.cpp: Added.
* wtf/cocoa/RuntimeApplicationChecksCocoa.h: Added.
(WTF::applicationSDKVersionOverride):
(WTF::setApplicationSDKVersion):
(WTF::applicationSDKVersion):
2020-03-11 Jer Noble <jer.noble@apple.com>
Adopt AVSampleBufferVideoOutput
https://bugs.webkit.org/show_bug.cgi?id=208951
Reviewed by Eric Carlson.
* wtf/PlatformHave.h:
2020-03-11 Jer Noble <jer.noble@apple.com>
[EME] Issue an "encrypted" event when a new encrypted initialization segment is encountered
https://bugs.webkit.org/show_bug.cgi?id=208923
Reviewed by Eric Carlson.
* wtf/LoggerHelper.h:
(WTF::LoggerHelper::childLogIdentifier): Made static.
2020-03-11 Per Arne Vollan <pvollan@apple.com>
[macOS] Crash under WebKit::WebProcessPool::platformInitialize()
https://bugs.webkit.org/show_bug.cgi?id=208945
Reviewed by Brent Fulgham.
Add macro to optionally soft link library.
* wtf/cocoa/SoftLinking.h:
2020-03-11 Alex Christensen <achristensen@webkit.org>
Enable safe browsing warnings in Mac Catalyst WebKit
https://bugs.webkit.org/show_bug.cgi?id=208944
<rdar://problem/58854302>
Reviewed by Tim Horton.
* wtf/PlatformHave.h:
2020-03-09 Megan Gardner <megan_gardner@apple.com>
Build Fix
https://bugs.webkit.org/show_bug.cgi?id=208838
Reviewed by Tim Horton.
* wtf/PlatformHave.h:
2020-03-09 Don Olmstead <don.olmstead@sony.com>
Remove obsolete feature flags
https://bugs.webkit.org/show_bug.cgi?id=208830
Reviewed by Alex Christensen.
Remove ENABLE_CUSTOM_SCHEME_HANDLER as it is unused in source.
* wtf/PlatformEnable.h:
2020-03-08 Brady Eidson <beidson@apple.com>
Remember completed subranges during incremental PDF loading.
https://bugs.webkit.org/show_bug.cgi?id=208785
Reviewed by Tim Horton.
* wtf/Range.h: Don't include the typical 'using WTF::Range' as that makes it almost impossible
to use in the stack at WebCore or higher (Because of WebCore::Range)
2020-03-08 Per Arne Vollan <pvollan@apple.com>
Unreviewed build fix.
* wtf/PlatformUse.h:
2020-03-08 Per Arne Vollan <pvollan@apple.com>
[iOS] Mapping to UTI from tag and tag class should be performed in the UI process
https://bugs.webkit.org/show_bug.cgi?id=208783
Reviewed by Brent Fulgham.
* wtf/PlatformUse.h:
2020-03-08 Wenson Hsieh <wenson_hsieh@apple.com>
Lazily generate CGPaths for some simple types of paths, such as arcs and lines
https://bugs.webkit.org/show_bug.cgi?id=208464
<rdar://problem/59963226>
Reviewed by Daniel Bates, Darin Adler and Tim Horton.
Add a feature flag for INLINE_PATH_DATA. This feature flag exists to ensure that we can avoid having
m_inlineData on Path in ports that don't implement the necessary facilities for inline path data yet, since it
would just end up being wasted memory.
* wtf/PlatformEnable.h:
2020-03-07 Daniel Bates <dabates@apple.com>
[iOS] Implement support for dictation alternatives
https://bugs.webkit.org/show_bug.cgi?id=208720
<rdar://problem/58540114>
Reviewed by Wenson Hsieh.
Part 5
Enable USE_DICTATION_ALTERNATIVES on iOS.
* wtf/PlatformUse.h:
2020-03-05 Sam Weinig <weinig@apple.com>
Move JavaScriptCore related feature defines from FeatureDefines.xcconfig to PlatformEnableCocoa.h
https://bugs.webkit.org/show_bug.cgi?id=207436
<rdar://problem/59296762>
Reviewed by Darin Adler.
* wtf/PlatformEnable.h:
Add default values for ENABLE_FAST_JIT_PERMISSIONS and ENABLE_SEPARATED_WX_HEAP.
* wtf/PlatformEnableCocoa.h:
Added ENABLE_FAST_JIT_PERMISSIONS and ENABLE_INTL (from FeatureDefines.xcconfig), ENABLE_SEPARATED_WX_HEAP
(from PlatformEnable.h) and ENABLE_FTL_JIT (from both FeatureDefines.xcconfig and PlatformEnable.h).
2020-03-06 Per Arne Vollan <pvollan@apple.com>
[Cocoa] Re-enable CFPrefs direct mode
https://bugs.webkit.org/show_bug.cgi?id=208690
Reviewed by Brent Fulgham.
* wtf/PlatformEnable.h:
2020-03-06 Peng Liu <peng.liu6@apple.com>
Use the feature flags mechanism to give default feature preference values
https://bugs.webkit.org/show_bug.cgi?id=208607
Reviewed by Youenn Fablet.
ENABLE_GPU_PROCESS_FOR_WEBRTC is removed because we will use the feature flags
mechanism to give the default preference regarding the WebRTC in GPU process feature.
This patch also adds macro HAVE_SYSTEM_FEATURE_FLAGS.
* wtf/PlatformEnable.h:
* wtf/PlatformEnableCocoa.h:
* wtf/PlatformHave.h:
2020-03-05 Darin Adler <darin@apple.com>
Improve some media code
https://bugs.webkit.org/show_bug.cgi?id=208322
Reviewed by Anders Carlsson.
* wtf/WeakPtr.h:
(WTF::WeakPtr::operator! const): Added.
2020-03-05 Jer Noble <jer.noble@apple.com>
[GPUP] Implement RemoteAudioSession
https://bugs.webkit.org/show_bug.cgi?id=208583
Reviewed by Alex Christensen.
Add UniqueRef to the list of forward-declared template types.
* wtf/Forward.h:
2020-03-04 Mark Lam <mark.lam@apple.com>
Handle an out of memory error while constructing the BytecodeGenerator.
https://bugs.webkit.org/show_bug.cgi?id=208622
<rdar://problem/59341136>
Reviewed by Saam Barati.
* wtf/CagedUniquePtr.h:
(WTF::CagedUniquePtr::tryCreate):
2020-03-04 Brady Eidson <beidson@apple.com>
Lay initial groundwork for new PDF loading model
https://bugs.webkit.org/show_bug.cgi?id=208599
Reviewed by Alex Christensen.
* wtf/PlatformHave.h:
2020-03-04 Wenson Hsieh <wenson_hsieh@apple.com>
Add system trace points around display list replay
https://bugs.webkit.org/show_bug.cgi?id=208616
Reviewed by Simon Fraser.
Add DisplayListReplayStart and DisplayListReplayEnd.
* wtf/SystemTracing.h:
2020-03-04 Per Arne Vollan <pvollan@apple.com>
[Cocoa] Add enable flag to disable direct mode for preferences
https://bugs.webkit.org/show_bug.cgi?id=208588
Reviewed by Brent Fulgham.
* wtf/PlatformEnable.h:
2020-03-03 Megan Gardner <megan_gardner@apple.com>
Build Fix
https://bugs.webkit.org/show_bug.cgi?id=208530
Reviewed by Wenson Hsieh.
* wtf/PlatformHave.h:
2020-03-03 Jiten Mehta <jmehta@apple.com>
Adopt HTTP Alternative Services Storage
https://bugs.webkit.org/show_bug.cgi?id=208387
Reviewed by Alex Christensen.
* wtf/PlatformHave.h:
2020-03-03 youenn fablet <youenn@apple.com>
Rename USE(GPU_PROCESS) to ENABLE(GPU_PROCESS_FOR_WEBRTC)
https://bugs.webkit.org/show_bug.cgi?id=208505
Reviewed by Eric Carlson.
Rename macro since the name is misleading.
Disable GPU_PROCESS_FOR_WEBRTC for iOS except simulator for now.
* wtf/PlatformEnable.h:
* wtf/PlatformEnableCocoa.h:
* wtf/PlatformUse.h:
2020-03-02 Ben Nham <nham@apple.com>
Add performance probes for HTML parsing
https://bugs.webkit.org/show_bug.cgi?id=208271
Reviewed by Daniel Bates.
This adds probes that show which lines of HTML are have been parsed.
* wtf/SystemTracing.h:
2020-03-02 Ben Nham <nham@apple.com>
[WTF] Add signpost API
https://bugs.webkit.org/show_bug.cgi?id=208395
Reviewed by Alex Christensen.
We want to start using os_signpost instead of kdebug_trace when emitting performance events,
because it is usually cheaper (doesn't require a system call unless the log buffer is full)
and allows for richer tracepoints (allows for logging strings as well as integers).
To facilitate this, this moves the os_signpost wrappers in NetworkDataTaskCocoa to
WTF. Since signposts can contain sensitive strings (like URLs), currently we only enable
them on Apple-internal devices when an environment variable is set.
* WTF.xcodeproj/project.pbxproj:
* wtf/PlatformMac.cmake:
* wtf/SystemTracing.h:
* wtf/cocoa/SystemTracingCocoa.cpp: Added.
(WTFSignpostsEnabled):
(WTFSignpostLogHandle):
* wtf/spi/darwin/OSVariantSPI.h: Renamed from Source/WebCore/PAL/pal/spi/cocoa/OSVariantSPI.h.
2020-03-02 Alan Coon <alancoon@apple.com>
Add new Mac target numbers
https://bugs.webkit.org/show_bug.cgi?id=208398
Reviewed by Alexey Proskuryakov.
* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
2020-03-02 Megan Gardner <megan_gardner@apple.com>
Add date/time style to macCatalyst
https://bugs.webkit.org/show_bug.cgi?id=208456
Reviewed by Wenson Hsieh.
* wtf/PlatformHave.h:
2020-03-02 Paulo Matos <pmatos@igalia.com>
Fix JSC 32bit alignment increase gcc warning
https://bugs.webkit.org/show_bug.cgi?id=208445
Reviewed by Yusuke Suzuki.
Use reinterpret_cast_ptr<>() instead of reinterpret_cast<>() to
avoid GCC warning about increase in alignment requirement for cast
target type.
* wtf/HashTable.h:
(WTF::HashTable::tableSize const):
(WTF::HashTable::setTableSize const):
(WTF::HashTable::tableSizeMask const):
(WTF::HashTable::setTableSizeMask):
(WTF::HashTable::keyCount const):
(WTF::HashTable::setKeyCount const):
(WTF::HashTable::deletedCount const):
(WTF::HashTable::setDeletedCount const):
(WTF::KeyTraits>::allocateTable):
(WTF::KeyTraits>::deallocateTable):
2020-03-02 youenn fablet <youenn@apple.com>
Enable capture in GPUProcess by default for recent platforms only
https://bugs.webkit.org/show_bug.cgi?id=208437
Reviewed by Eric Carlson.
* wtf/PlatformUse.h:
Introduce USE(GPU_PROCESS)
2020-02-29 Yusuke Suzuki <ysuzuki@apple.com>
Remove std::lock_guard
https://bugs.webkit.org/show_bug.cgi?id=206451
Reviewed by Anders Carlsson.
Remove use of std::lock_guard. This is deprecated in C++17.
1. For particularly low-level usage (like, bmalloc, std::mutex), use std::scoped_lock.
2. For the other purpose, use holdLock.
* benchmarks/ConditionSpeedTest.cpp:
* wtf/CryptographicallyRandomNumber.cpp:
* wtf/HashTable.cpp:
(WTF::HashTableStats::recordCollisionAtCount):
(WTF::HashTableStats::dumpStats):
* wtf/HashTable.h:
(WTF::KeyTraits>::invalidateIterators):
(WTF::addIterator):
(WTF::removeIterator):
* wtf/Language.cpp:
(WTF::userPreferredLanguages):
* wtf/MainThread.cpp:
(WTF::dispatchFunctionsFromMainThread):
(WTF::callOnMainThread):
(WTF::callOnMainAndWait):
* wtf/StackStats.cpp:
(WTF::StackStats::CheckPoint::CheckPoint):
(WTF::StackStats::CheckPoint::~CheckPoint):
(WTF::StackStats::probe):
(WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint):
(WTF::StackStats::LayoutCheckPoint::~LayoutCheckPoint):
* wtf/WordLock.cpp:
(WTF::WordLock::unlockSlow):
* wtf/cf/LanguageCF.cpp:
(WTF::languagePreferencesDidChange):
(WTF::platformUserPreferredLanguages):
* wtf/text/StringView.cpp:
(WTF::StringView::invalidate):
(WTF::StringView::adoptUnderlyingString):
(WTF::StringView::setUnderlyingString):
* wtf/unicode/icu/CollatorICU.cpp:
(WTF::Collator::Collator):
(WTF::Collator::~Collator):
* wtf/win/LanguageWin.cpp:
(WTF::platformLanguage):
2020-02-28 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] BuiltinNames' HashMap should be small
https://bugs.webkit.org/show_bug.cgi?id=208404
Reviewed by Mark Lam.
* wtf/text/AtomStringImpl.cpp:
(WTF::HashTranslatorCharBuffer::HashTranslatorCharBuffer): Deleted.
* wtf/text/StringImpl.h:
(WTF::HashTranslatorCharBuffer::HashTranslatorCharBuffer):
2020-02-27 Basuke Suzuki <basuke.suzuki@sony.com>
[WinCairo] Fix RemoteInspector reconnect issue
https://bugs.webkit.org/show_bug.cgi?id=208256
Reviewed by Devin Rousso.
Added wakeupCallback to RunLoop. In case of RunLook::iterate, we need to wake up worker thread
when RunLoop is waking up.
* wtf/RunLoop.h:
* wtf/generic/RunLoopGeneric.cpp:
(WTF::RunLoop::setWakeUpCallback):
(WTF::RunLoop::wakeUp):
* wtf/win/RunLoopWin.cpp:
(WTF::RunLoop::setWakeUpCallback):
(WTF::RunLoop::wakeUp):
2020-02-27 Simon Fraser <simon.fraser@apple.com>
Add ENABLE(SCROLLING_THREAD) and use it to turn off some code we don't need for iOS
https://bugs.webkit.org/show_bug.cgi?id=208282
Reviewed by Tim Horton.
Define ENABLE_SCROLLING_THREAD PLATFORM(MAC) and USE(NICOSIA).
* wtf/PlatformEnable.h:
* wtf/PlatformEnableCocoa.h:
2020-02-26 Don Olmstead <don.olmstead@sony.com>
Allow setting of stack sizes for threads
https://bugs.webkit.org/show_bug.cgi?id=208223
Reviewed by Yusuke Suzuki.
Introduce ThreadType which is used internally to specify a stack size for a particular
type of thread. Platforms can make their own decisions on what the stack size should be
based on their own observations. Additionally a default stack size can be specified
by defining DEFAULT_THREAD_STACK_SIZE_IN_KB if the default stack for a platform is
insufficient in all cases, or when investigating the stack size for tuning.
Both the pthread and Windows thread implementations are modified to set the stack size
if provided.
* wtf/Threading.cpp:
(WTF::stackSize):
(WTF::Thread::create):
* wtf/Threading.h:
* wtf/posix/ThreadingPOSIX.cpp:
(WTF::Thread::establishHandle):
* wtf/win/ThreadingWin.cpp:
(WTF::Thread::establishHandle):
2020-02-26 Christopher Reid <chris.reid@sony.com>
[Win] Implement NetworkCache::Data by using FileSystem::MappedFileData
https://bugs.webkit.org/show_bug.cgi?id=197684
<rdar://problem/59467397>
Reviewed by Yusuke Suzuki.
* wtf/FileSystem.cpp:
* wtf/FileSystem.h:
Added FileAccessPermission flag when opening files.
Remove default argument for the listDirectory filter since the defaut
String() filter doesn't match all files on Mac and Windows.
Added FileOpenMode::ReadWrite to be used with ReadWrite MappedFileData.
Added failIfFileExists flag to openFile.
* wtf/glib/FileSystemGlib.cpp:
* wtf/posix/FileSystemPOSIX.cpp:
Added (S_IRUSR | S_IWUSR) file open modes.
* wtf/win/FileSystemWin.cpp:
Implement getVolumeFreeSpace since some of the tests use it when toggling cache.
* wtf/win/PathWalker.cpp:
2020-02-25 Devin Rousso <drousso@apple.com>
Web Inspector: safari app extension isolated worlds and injected files use the extension's identifier instead of its name
https://bugs.webkit.org/show_bug.cgi?id=206911
<rdar://problem/58026635>
Reviewed by Brian Burg.
* wtf/HashSet.h:
(WTF::HashSet::reserveInitialCapacity): Added.
2020-02-25 Justin Michaud <justin_michaud@apple.com>
Inline Cache delete by id/val
https://bugs.webkit.org/show_bug.cgi?id=207522
Reviewed by Keith Miller and Filip Pizlo.
* wtf/Spectrum.h:
(WTF::Spectrum::add):
(WTF::Spectrum::get const):
(WTF::Spectrum::buildList const):
(WTF::Spectrum::clear):
(WTF::Spectrum::removeIf):
(WTF::Spectrum::begin): Deleted.
(WTF::Spectrum::end): Deleted.
2020-02-25 Philippe Normand <pnormand@igalia.com>
[WPE] Enable BACKTRACE_SYMBOLS
https://bugs.webkit.org/show_bug.cgi?id=208187
Reviewed by Žan Doberšek.
* wtf/PlatformHave.h: Enable backtrace_symbols, to be combined
with dladdr() the stacktrace dumps will be improved.
2020-02-25 Saam Barati <sbarati@apple.com>
Update stale comment about PackedAlignedPtr
https://bugs.webkit.org/show_bug.cgi?id=208176
Reviewed by Yusuke Suzuki.
The comment was stale since cells aren't guaranteed anymore to be
aligned on 16 byte boundaries because of the GCs precise allocations.
* wtf/Packed.h:
2020-02-25 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Stop using gtk foreign drawing API to style form controls
https://bugs.webkit.org/show_bug.cgi?id=208129
Reviewed by Adrian Perez de Castro.
Enable USE_NEW_THEME for the GTK port.
* wtf/PlatformUse.h:
2020-02-25 Philippe Normand <pnormand@igalia.com>
[Linux] StackTrace symbols are not demangled
https://bugs.webkit.org/show_bug.cgi?id=207933
Reviewed by Yusuke Suzuki.
Demangle symbols provided by backtrace_symbols.
* wtf/StackTrace.cpp:
(WTF::StackTrace::dump const):
2020-02-24 Yusuke Suzuki <ysuzuki@apple.com>
[WTF] Add tests for CompactRefPtrTuple
https://bugs.webkit.org/show_bug.cgi?id=208172
Reviewed by Darin Adler.
Include Noncopyable.h.
* wtf/CompactRefPtrTuple.h:
2020-02-24 Yusuke Suzuki <ysuzuki@apple.com>
[WTF] Attach WARN_UNUSED_RETURN to makeScopeExit and fix existing wrong usage
https://bugs.webkit.org/show_bug.cgi?id=208162
Reviewed by Robin Morisset.
We should hold ScopeExit to call destructor when we exit from the scope actually.
Putting WARN_UNUSED_RETURN to fix existing misuse.
* wtf/Scope.h:
2020-02-23 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Shrink Structure
https://bugs.webkit.org/show_bug.cgi?id=207827
Reviewed by Saam Barati.
Make CompactPointerTuple usable for storing 16 bits data.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/CompactPointerTuple.h:
* wtf/CompactRefPtrTuple.h: Added.
* wtf/text/StringImpl.h:
* wtf/text/SymbolImpl.h:
(WTF::SymbolImpl::hashForSymbol const):
(WTF::SymbolImpl::SymbolImpl):
2020-02-21 Antti Koivisto <antti@apple.com>
REGRESSION(r257072): MotionMark | Mac | -10%
https://bugs.webkit.org/show_bug.cgi?id=208054
<rdar://problem/59664582>
Reviewed by Geoffrey Garen.
With rAF and slow scripts, suspended functions may pile up in RunLoop because every cycle does a rendering update.
* wtf/RunLoop.cpp:
(WTF::RunLoop::performWork):
(WTF::RunLoop::suspendFunctionDispatchForCurrentCycle):
Don't suspend if there are already pending suspended functions.
* wtf/RunLoop.h:
2020-02-20 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthn] Replace DeviceIdentity.framework
https://bugs.webkit.org/show_bug.cgi?id=207985
<rdar://problem/59369223>
Reviewed by Brent Fulgham.
* wtf/PlatformHave.h:
2020-02-20 Eric Liang <ericliang@apple.com>
AX: Adopt _AXSCopyPathForAccessibilityBundle for WebKit
https://bugs.webkit.org/show_bug.cgi?id=207828
Use the _AXSCopyPathForAccessibilityBundle new API. Updated the required SDK version.
Reviewed by Darin Adler.
* wtf/PlatformHave.h:
2020-02-20 Antti Koivisto <antti@apple.com>
Unreviewed comment fix.
* wtf/RunLoop.cpp:
(WTF::RunLoop::suspendFunctionDispatchForCurrentCycle):
Words by Simon.
2020-02-20 Antti Koivisto <antti@apple.com>
[macOS] Disable RunLoop function dispatch when there is a pending rendering update
https://bugs.webkit.org/show_bug.cgi?id=207931
Reviewed by Geoffrey Garen.
* wtf/RunLoop.cpp:
(WTF::RunLoop::performWork):
Simplify the code by factoring it into a single loop.
Bail out if the runloop is initially suspended or if it becomes suspended by function execution.
Clear the suspended state so it last a single cycle only.
(WTF::RunLoop::suspendFunctionDispatchForCurrentCycle):
Set the suspended state and wake up the runloop to guarantee the state is cleared.
* wtf/RunLoop.h:
2020-02-18 Keith Miller <keith_miller@apple.com>
Add an os_log PrintStream
https://bugs.webkit.org/show_bug.cgi?id=207898
Reviewed by Mark Lam.
When debugging on iOS writing to a file can be hard (thanks
Sandboxing!) so logging our dataLogs to os_log would make things
easier. This patch adds a new subclass of PrintStream,
OSLogPrintStream, that converts our file writes to
os_log. Unfortunately, os_log doesn't buffer writes so
OSLogPrintStream needs to do its own buffering. e.g. if you call
`dataLogLn("some text with a ", number, " and a ", string);`
os_log will log that as 5 separate logs.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/DataLog.cpp:
(WTF::setDataFile):
* wtf/DataLog.h:
* wtf/OSLogPrintStream.cpp: Added.
(WTF::OSLogPrintStream::OSLogPrintStream):
(WTF::OSLogPrintStream::~OSLogPrintStream):
(WTF::OSLogPrintStream::open):
(WTF::OSLogPrintStream::vprintf):
* wtf/OSLogPrintStream.h: Copied from Source/WTF/wtf/DataLog.h.
* wtf/PrintStream.cpp:
(WTF::printExpectedCStringHelper):
(WTF::printInternal):
* wtf/text/CString.cpp:
(WTF::CString::grow):
* wtf/text/CString.h:
2020-02-18 Simon Fraser <simon.fraser@apple.com>
Move from "layer flush" terminology to "rendering update"
https://bugs.webkit.org/show_bug.cgi?id=207870
Reviewed by Tim Horton.
* wtf/SystemTracing.h:
2020-02-17 Chris Dumez <cdumez@apple.com>
[WK2][Cocoa] Implement in-WebProcess cookie cache to avoid sync IPC for document.cookie in most cases
https://bugs.webkit.org/show_bug.cgi?id=207593
<rdar://problem/56027027>
Reviewed by Antti Koivisto.
Add build time flags for new feature.
* wtf/PlatformEnable.h:
* wtf/PlatformHave.h:
2020-02-17 Tim Horton <timothy_horton@apple.com>
Add and adopt HAVE(LOOKUP_GESTURE_RECOGNIZER)
https://bugs.webkit.org/show_bug.cgi?id=207876
Reviewed by Wenson Hsieh.
* wtf/PlatformHave.h:
For symmetry's sake, introduce a HAVE for this gesture.
2020-02-17 Mark Lam <mark.lam@apple.com>
getVTablePointer() should return a const void*.
https://bugs.webkit.org/show_bug.cgi?id=207871
<rdar://problem/59525721>
Reviewed by Yusuke Suzuki.
* wtf/PointerPreparations.h:
(WTF::getVTablePointer):
2020-02-17 Dean Jackson <dino@apple.com>
[WebGL] Enable ANGLE by default for Cocoa platforms
https://bugs.webkit.org/show_bug.cgi?id=205483
rdar://56925821
Reviewed by Simon Fraser.
* wtf/Platform.h:
2020-02-17 Peng Liu <peng.liu6@apple.com>
Fix check-webkit-style errors related to AVFoundationSPI.h
https://bugs.webkit.org/show_bug.cgi?id=207834
Reviewed by Eric Carlson.
Add HAVE_VIDEO_PERFORMANCE_METRICS and USE_AV_SAMPLE_BUFFER_DISPLAY_LAYER to fix check-webkit-style errors.
* wtf/PlatformHave.h:
* wtf/PlatformUse.h:
2020-02-17 Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
a lot gcc warnings because of %{public}s format specifier
https://bugs.webkit.org/show_bug.cgi?id=207478
Reviewed by Darin Adler.
Add PUBLIC_LOG_STRING macro which is defined depending on if
os_log()[1] is used or rather old printf().
OS Logging processes format specifiers for privacy matters, for
example dynamic strings, which demands %{public}s. But these
specifiers are not valid for printf().
Calls to logging with this specifier, if they are not Mac/Darwing
exclusive, use this new macro to avoid gcc warnings.
1. https://developer.apple.com/documentation/os/logging?language=objc
* wtf/Assertions.h:
* wtf/MemoryPressureHandler.cpp:
(WTF::MemoryPressureHandler::ReliefLogger::logMemoryUsageChange):
2020-02-17 Antti Koivisto <antti@apple.com>
[macOS] Add trace points for layer flush runloop observer
https://bugs.webkit.org/show_bug.cgi?id=207837
Reviewed by Sam Weinig.
* wtf/SystemTracing.h:
2020-02-17 Don Olmstead <don.olmstead@sony.com>
[CMake] Use builtin targets
https://bugs.webkit.org/show_bug.cgi?id=205166
Reviewed by Darin Adler.
* wtf/PlatformGTK.cmake:
* wtf/PlatformJSCOnly.cmake:
* wtf/PlatformPlayStation.cmake:
* wtf/PlatformWPE.cmake:
2020-02-16 Fujii Hironori <Hironori.Fujii@sony.com>
Remove remaining WTF_EXPORT and WTF_IMPORT by replacing them with WTF_EXPORT_DECLARATION and WTF_IMPORT_DECLARATION
https://bugs.webkit.org/show_bug.cgi?id=207746
Reviewed by Don Olmstead.
I removed WTF_EXPORT from function declarations in r256420 (Bug 207453).
WTF_EXPORT is still used mostly in *ExportMacros.h. However, there is no
difference between WTF_EXPORT and WTF_EXPORT_DECLARATION.
Removed WTF_EXPORT and WTF_IMPORT by replacing them with
WTF_EXPORT_DECLARATION and WTF_IMPORT_DECLARATION
Removed unused WTF_HIDDEN.
Defined WTF_EXPORT_DECLARATION, WTF_IMPORT_DECLARATION and WTF_HIDDEN_DECLARATION empty
in case of !USE(EXPORT_MACROS) to simplify *ExportMacros.h.
* wtf/ExportMacros.h:
2020-02-14 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r256633.
https://bugs.webkit.org/show_bug.cgi?id=207807
4% memory regression in new Membuster, possibly some leaking
in WebKit Malloc? (Requested by yusukesuzuki on #webkit).
Reverted changeset:
"[Win] Implement NetworkCache::Data by using
FileSystem::MappedFileData"
https://bugs.webkit.org/show_bug.cgi?id=197684
https://trac.webkit.org/changeset/256633
2020-02-14 Christopher Reid <chris.reid@sony.com>
[Win] Implement NetworkCache::Data by using FileSystem::MappedFileData
https://bugs.webkit.org/show_bug.cgi?id=197684
Reviewed by Fujii Hironori.
* wtf/FileSystem.cpp:
* wtf/FileSystem.h:
Added FileAccessPermission flag when opening files.
Remove default argument for the listDirectory filter since the defaut
String() filter doesn't match all files on Mac and Windows.
* wtf/glib/FileSystemGlib.cpp:
* wtf/posix/FileSystemPOSIX.cpp:
Added (S_IRUSR | S_IWUSR) file open modes.
* wtf/win/FileSystemWin.cpp:
Implement getVolumeFreeSpace since some of the tests use it when toggling cache.
* wtf/win/PathWalker.cpp:
2020-02-14 Alex Christensen <achristensen@webkit.org>
Allow UIDNAInfo.errors from uidna_nameToUnicode that would not cause URL parsing failures
https://bugs.webkit.org/show_bug.cgi?id=207360
<rdar://problem/57825317>
Reviewed by Ryosuke Niwa.
* wtf/URLHelpers.cpp:
(WTF::URLHelpers::mapHostName):
2020-02-12 Said Abou-Hallawa <sabouhallawa@apple.com>
WebP image format is not supported
https://bugs.webkit.org/show_bug.cgi?id=192672
Reviewed by Youenn Fablet.
Introduce HAVE(WEBP) for macOS and iOS.
* wtf/PlatformHave.h:
2020-02-12 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Compact JITCodeMap by storing BytecodeIndex and CodeLocation separately
https://bugs.webkit.org/show_bug.cgi?id=207673
Reviewed by Mark Lam.
* wtf/MallocPtr.h:
2020-02-12 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r256010.
Introduced ASan crashes
Reverted changeset:
"[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder"
https://bugs.webkit.org/show_bug.cgi?id=206582
https://trac.webkit.org/changeset/r256010
2020-02-12 Yusuke Suzuki <ysuzuki@apple.com>
Shrink CachedResource
https://bugs.webkit.org/show_bug.cgi?id=207618
Reviewed by Mark Lam.
* wtf/Markable.h:
(WTF::Markable::asOptional const): Add helper method to get Optional easily from Markable.
* wtf/ObjectIdentifier.h:
(WTF::ObjectIdentifier::MarkableTraits::isEmptyValue):
(WTF::ObjectIdentifier::MarkableTraits::emptyValue):
(WTF::ObjectIdentifier::ObjectIdentifier): Add MarkableTraits for ObjectIdentifier.
2020-02-12 Simon Fraser <simon.fraser@apple.com>
Remove CSS_DEVICE_ADAPTATION
https://bugs.webkit.org/show_bug.cgi?id=203479
Reviewed by Tim Horton.
CSS Working Group resolved to remove @viewport <https://github.com/w3c/csswg-drafts/issues/4766>,
so remove the code.
* wtf/PlatformEnable.h:
2020-02-11 Fujii Hironori <Hironori.Fujii@sony.com>
Fix declarations marked by wrong export macros (WEBCORE_EXPORT and WTF_EXPORT)
https://bugs.webkit.org/show_bug.cgi?id=207453
Reviewed by Ross Kirsling.
Export macros are prone to be misused because thier definitions
are identical for POSIX ports. They can be used interchangeably on
such ports.
WTF should use WTF_EXPORT_PRIVATE instead of WTF_EXPORT.
* wtf/HexNumber.h:
* wtf/Language.h:
* wtf/Logger.h:
* wtf/ProcessPrivilege.h:
* wtf/cocoa/CrashReporter.h:
* wtf/cocoa/Entitlements.h:
* wtf/text/LineEnding.h:
* wtf/text/TextBreakIterator.h:
* wtf/text/icu/UTextProviderLatin1.h:
Replaced WTF_EXPORT with WTF_EXPORT_PRIVATE.
2020-02-11 Eric Carlson <eric.carlson@apple.com>
Support in-band VTT captions when loading media in the GPU Process
https://bugs.webkit.org/show_bug.cgi?id=207467
<rdar://problem/59312749>
Reviewed by Jer Noble.
* wtf/LoggerHelper.h:
(WTF::LoggerHelper::childLogIdentifier const):
2020-02-10 Yusuke Suzuki <ysuzuki@apple.com>
Unreviewed, speculative build fix on watchOS simulator
https://bugs.webkit.org/show_bug.cgi?id=207183
* wtf/HashTable.h:
(WTF::HashTableCapacityForSize::capacityForSize):
2020-02-10 Yusuke Suzuki <ysuzuki@apple.com>
Unreviewed, fix build failure on watchOS simulator
https://bugs.webkit.org/show_bug.cgi?id=207183
* wtf/HashTable.h:
(WTF::HashTableCapacityForSize::capacityForSize):
2020-02-10 Daniel Bates <dabates@apple.com>
Disallow setting base URL to a data or JavaScript URL
https://bugs.webkit.org/show_bug.cgi?id=207136
Reviewed by Brent Fulgham.
Add some more macro definitions.
* wtf/spi/darwin/dyldSPI.h:
2020-02-10 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r256091.
Broke internal builds
Reverted changeset:
"Move trivial definitions from FeatureDefines.xcconfig to
PlatformEnableCocoa.h"
https://bugs.webkit.org/show_bug.cgi?id=207155
https://trac.webkit.org/changeset/256091
2020-02-10 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r256103.
This patch is blocking the rollout of r256091
Reverted changeset:
"Move JavaScriptCore related feature defines from
FeatureDefines.xcconfig to PlatformEnableCocoa.h"
https://bugs.webkit.org/show_bug.cgi?id=207436
https://trac.webkit.org/changeset/256103
2020-02-09 Keith Rollin <krollin@apple.com>
Re-enable LTO for ARM builds
https://bugs.webkit.org/show_bug.cgi?id=207402
<rdar://problem/49190767>
Reviewed by Sam Weinig.
Bug 190758 re-enabled LTO for Production builds for x86-family CPUs.
Enabling it for ARM was left out due to a compiler issue. That issue
has been fixed, and so now we can re-enable LTO for ARM.
* Configurations/Base.xcconfig:
2020-02-08 Sam Weinig <weinig@apple.com>
Move JavaScriptCore related feature defines from FeatureDefines.xcconfig to PlatformEnableCocoa.h
https://bugs.webkit.org/show_bug.cgi?id=207436
Reviewed by Tim Horton.
* wtf/PlatformEnable.h:
Add default values for ENABLE_FAST_JIT_PERMISSIONS and ENABLE_SEPARATED_WX_HEAP.
* wtf/PlatformEnableCocoa.h:
Added ENABLE_FAST_JIT_PERMISSIONS (from FeatureDefines.xcconfig), ENABLE_SEPARATED_WX_HEAP
(from PlatformEnable.h) and ENABLE_FTL_JIT (from both FeatureDefines.xcconfig and PlatformEnable.h).
2020-02-08 Sam Weinig <weinig@apple.com>
Migrate definition of USE_PLATFORM_REGISTERS_WITH_PROFILE to PlatformUse.h
https://bugs.webkit.org/show_bug.cgi?id=207428
Reviewed by Tim Horton.
* wtf/PlatformUse.h:
Move definition of USE_PLATFORM_REGISTERS_WITH_PROFILE from AdditionalFeatureDefines.h, where
it did not belong.
2020-02-08 Yusuke Suzuki <ysuzuki@apple.com>
[WTF] Try using 75% load factor for HashTable
https://bugs.webkit.org/show_bug.cgi?id=207183
Reviewed by Mark Lam.
We know that hash-table is one of the most memory consuming part in WebKit.
By analyzing many production hash-table implementations[1], I found that many
of them are using 75% load-factor while our one is 50%.
This patch changes the load-factor from 50% to 75%. But we pick 75% only for
small tables which capacity is <= 1024 based on collected data by micro-benchmarking.
The collected data is telling that longer probe-length affects on performance if table
size gets larger.
[1]: LLVM DenseMap, Abseil's, rust's, and so on.
* wtf/HashTable.h:
(WTF::HashTableCapacityForSize::shouldExpand):
(WTF::HashTableCapacityForSize::capacityForSize):
(WTF::HashTable::shouldExpand const):
(WTF::KeyTraits>::computeBestTableSize):
2020-02-08 Sam Weinig <weinig@apple.com>
Move trivial definitions from FeatureDefines.xcconfig to PlatformEnableCocoa.h
https://bugs.webkit.org/show_bug.cgi?id=207155
Reviewed by Tim Horton.
Move all trivial definitions (just ENABLE_FOO = ENABLE_FOO; or ENABLE_BAR = ;)
from the FeatureDefines.xcconfigs to PlatformEnableCocoa.h, ensuring each one
also has a default value in PlatformEnable.h
ENABLE_INSPECTOR_TELEMETRY, ENABLE_TEXT_AUTOSIZING, ENABLE_WEBGL, ENABLE_METER_ELEMENT,
ENABLE_VIDEO_TRACK, ENABLE_WEB_AUDIO and ENABLE_CURSOR_VISIBILITY are all now always
set to 1 for Cocoa (if not defined already), as this was already the case via the xcconfig.
* wtf/PlatformEnable.h:
* wtf/PlatformEnableCocoa.h:
2020-02-07 Alex Christensen <achristensen@webkit.org>
Harden HashTable IPC decoders
https://bugs.webkit.org/show_bug.cgi?id=207415
Reviewed by Chris Dumez.
* wtf/HashCountedSet.h:
2020-02-07 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r256051.
Broke internal builds.
Reverted changeset:
"Move trivial definitions from FeatureDefines.xcconfig to
PlatformEnableCocoa.h"
https://bugs.webkit.org/show_bug.cgi?id=207155
https://trac.webkit.org/changeset/256051
2020-02-07 Stephan Szabo <stephan.szabo@sony.com>
[Win] Two FileSystem API tests fail
https://bugs.webkit.org/show_bug.cgi?id=207388
Reviewed by Don Olmstead.
* wtf/win/FileSystemWin.cpp:
Make getFinalPathName return dos path rather than nt volume path.
Change createSymbolicLink return to match CreateSymbolicLinkW
Have directoryName strip trailing slashes.
2020-02-03 Sam Weinig <weinig@apple.com>
Move trivial definitions from FeatureDefines.xcconfig to PlatformEnableCocoa.h
https://bugs.webkit.org/show_bug.cgi?id=207155
Reviewed by Tim Horton.
Move all trivial definitions (just ENABLE_FOO = ENABLE_FOO; or ENABLE_BAR = ;)
from the FeatureDefines.xcconfigs to PlatformEnableCocoa.h, ensuring each one
also has a default value in PlatformEnable.h
ENABLE_INSPECTOR_TELEMETRY, ENABLE_TEXT_AUTOSIZING, ENABLE_WEBGL, ENABLE_METER_ELEMENT,
ENABLE_VIDEO_TRACK, ENABLE_WEB_AUDIO and ENABLE_CURSOR_VISIBILITY are all now always
set to 1 for Cocoa (if not defined already), as this was already the case via the xcconfig.
* wtf/PlatformEnable.h:
* wtf/PlatformEnableCocoa.h:
2020-02-07 youenn fablet <youenn@apple.com>
Mandate UUID version 4 for mDNS ICE candidates
https://bugs.webkit.org/show_bug.cgi?id=207329
<rdar://problem/59221606>
Address post-commit comments from Darin by using isASCIIHexDigit.
Unreviewed.
* wtf/UUID.cpp:
(WTF::isVersion4UUID):
(WTF::isHexadecimalCharacter): Deleted.
2020-02-07 youenn fablet <youenn@apple.com>
Mandate UUID version 4 for mDNS ICE candidates
https://bugs.webkit.org/show_bug.cgi?id=207329
Reviewed by Alex Christensen.
Add a routine to validate version 4 UUID.
* wtf/UUID.cpp:
(WTF::isHexadecimalCharacter):
(WTF::isVersion4UUID):
* wtf/UUID.h:
2020-02-07 Yusuke Suzuki <ysuzuki@apple.com>
Unreviewed, revert 75% load-factor because of JetStream2/string-unpack-code-SP regression
https://bugs.webkit.org/show_bug.cgi?id=207183
* wtf/HashTable.h:
(WTF::HashTable::shouldExpand const):
(WTF::KeyTraits>::computeBestTableSize):
(WTF::HashTable::shouldExpand): Deleted.
(WTF::HashTableCapacityForSize::capacityForSize): Deleted.
2020-02-07 youenn fablet <youenn@apple.com>
[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder
https://bugs.webkit.org/show_bug.cgi?id=206582
Reviewed by Eric Carlson.
* wtf/PlatformHave.h:
2020-02-06 Mark Lam <mark.lam@apple.com>
Add a comment in StringView::setUnderlyingString(const StringView&) for clarification.
https://bugs.webkit.org/show_bug.cgi?id=207368
<rdar://problem/59211075>
Reviewed by Keith Miller.
Every time I read this code, I have to re-deduce why this code is thread safe.
So, I'm just going to add a comment to document it.
* wtf/text/StringView.cpp:
(WTF::StringView::setUnderlyingString):
2020-02-06 Myles C. Maxfield <mmaxfield@apple.com>
REGRESSION(r254534): 1-3% regression on PLT
https://bugs.webkit.org/show_bug.cgi?id=207244
<rdar://problem/58821709>
Reviewed by Simon Fraser.
CTFontTransformGlyphsWithLanguage() is only acceptable on certain OSes.
* wtf/PlatformHave.h:
2020-02-06 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r255910, r255970, and r255972.
https://bugs.webkit.org/show_bug.cgi?id=207345
Broke internal builds (Requested by ryanhaddad on #webkit).
Reverted changesets:
"[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder"
https://bugs.webkit.org/show_bug.cgi?id=206582
https://trac.webkit.org/changeset/255910
"[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder"
https://bugs.webkit.org/show_bug.cgi?id=206582
https://trac.webkit.org/changeset/255970
"[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder"
https://bugs.webkit.org/show_bug.cgi?id=206582
https://trac.webkit.org/changeset/255972
2020-02-06 Ryan Haddad <ryanhaddad@apple.com>
[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder
https://bugs.webkit.org/show_bug.cgi?id=206582
Unreviewed internal build fix attempt.
* wtf/PlatformHave.h: Fix copy / paste error.
2020-02-06 Ryan Haddad <ryanhaddad@apple.com>
[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder
https://bugs.webkit.org/show_bug.cgi?id=206582
Unreviewed internal build fix attempt.
* wtf/PlatformHave.h:
2020-02-06 youenn fablet <youenn@apple.com>
[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder
https://bugs.webkit.org/show_bug.cgi?id=206582
Reviewed by Eric Carlson.
* wtf/PlatformHave.h:
2020-02-05 Don Olmstead <don.olmstead@sony.com>
[PlayStation] Build a shared JavaScriptCore
https://bugs.webkit.org/show_bug.cgi?id=198446
Reviewed by Fujii Hironori.
Add bmalloc definition when compiling WTF. Remove LanguageUnix.cpp since
LanguagePlayStation.cpp is present which results in duplicate symbol definitions.
* wtf/PlatformPlayStation.cmake:
2020-02-05 Yusuke Suzuki <ysuzuki@apple.com>
[WTF] Try using 75% load factor for HashTable
https://bugs.webkit.org/show_bug.cgi?id=207183
Reviewed by Mark Lam.
We know that hash-table is one of the most memory consuming part in WebKit.
By analyzing many production hash-table implementations[1], I found that many
of them are using 75% load-factor while our one is 50%.
A/B test shows that 75% load-factor is performance-neutral in Speedometer2 and
JetStream2, while it offers 2~% improvement in Membuster. This means that we are
wasting too much memory for no-performance-improvement.
This patch changes the load-factor from 50% to 75%.
[1]: LLVM DenseMap, Abseil's, rust's, and so on.
* wtf/HashTable.h:
(WTF::HashTable::shouldExpand):
(WTF::HashTable::shouldExpand const):
(WTF::HashTableCapacityForSize::capacityForSize):
(WTF::KeyTraits>::computeBestTableSize):
2020-02-05 Per Arne Vollan <pvollan@apple.com>
[iOS] Do not create sandbox reports when the UI process cannot issue extensions to diagnostics service
https://bugs.webkit.org/show_bug.cgi?id=207279
<rdar://problem/59030957>
Reviewed by Brent Fulgham.
Add flag which avoids generating sandbox reports.
* wtf/spi/darwin/SandboxSPI.h:
2020-02-05 Alex Christensen <achristensen@webkit.org>
Make WKWebView._negotiatedLegacyTLS accurate when loading main resouorce from network or cache
https://bugs.webkit.org/show_bug.cgi?id=207207
Reviewed by Chris Dumez.
* wtf/persistence/PersistentDecoder.cpp:
(WTF::Persistence::Decoder::decode):
* wtf/persistence/PersistentDecoder.h:
* wtf/persistence/PersistentEncoder.cpp:
(WTF::Persistence::Encoder::encode):
* wtf/persistence/PersistentEncoder.h:
2020-02-05 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r255818.
https://bugs.webkit.org/show_bug.cgi?id=207270
It is breaking some Mac builds (Requested by youenn on
#webkit).
Reverted changeset:
"[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder"
https://bugs.webkit.org/show_bug.cgi?id=206582
https://trac.webkit.org/changeset/255818
2020-02-05 youenn fablet <youenn@apple.com>
[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder
https://bugs.webkit.org/show_bug.cgi?id=206582
Reviewed by Eric Carlson.
* wtf/PlatformHave.h:
2020-02-04 Adrian Perez de Castro <aperez@igalia.com>
Non-unified build fixes early February 2020 edition
https://bugs.webkit.org/show_bug.cgi?id=207227
Reviewed by Don Olmstead.
* wtf/SingleRootGraph.h: Add missing inclusion of wtf/StringPrintStream.h
2020-02-04 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Introduce UnlinkedCodeBlockGenerator and reduce sizeof(UnlinkedCodeBlock)
https://bugs.webkit.org/show_bug.cgi?id=207087
Reviewed by Tadeu Zagallo.
Add more useful methods for RefCountedArray.
* wtf/RefCountedArray.h:
(WTF::RefCountedArray::operator=):
(WTF::RefCountedArray::isEmpty const):
(WTF::RefCountedArray::front):
(WTF::RefCountedArray::front const):
(WTF::RefCountedArray::last):
(WTF::RefCountedArray::last const):
2020-02-03 Alex Christensen <achristensen@webkit.org>
Reduce size of HashMap and HashSet
https://bugs.webkit.org/show_bug.cgi?id=207138
Reviewed by Yusuke Suzuki.
This reduces sizeof(HashMap) and sizeof(HashSet) from 24 to 8 on 64-bit systems.
I measured that the overwhelming majority of HashMaps and HashSets never see more than 0 elements,
so I moved the table metadata (tableSize, tableSizeMask, keyCount, deletedCount) to inside the
dynamically allocated memory. This makes another branch in size() for non-empty tables
and an additional read and write when rehashing in exchange for fewer writes in the constructor
and increased cache locality of everything that uses HashMap and HashSet, which is basically everything.
* wtf/HashTable.h:
(WTF::HashTable::~HashTable):
(WTF::HashTable::end):
(WTF::HashTable::end const):
(WTF::HashTable::random):
(WTF::HashTable::size const):
(WTF::HashTable::capacity const):
(WTF::HashTable::isEmpty const):
(WTF::HashTable::reserveInitialCapacity):
(WTF::HashTable::shouldExpand const):
(WTF::HashTable::mustRehashInPlace const):
(WTF::HashTable::shouldShrink const):
(WTF::HashTable::shrink):
(WTF::HashTable::makeIterator):
(WTF::HashTable::makeConstIterator const):
(WTF::HashTable::makeKnownGoodIterator):
(WTF::HashTable::makeKnownGoodConstIterator const):
(WTF::HashTable::tableSize const):
(WTF::HashTable::setTableSize const):
(WTF::HashTable::tableSizeMask const):
(WTF::HashTable::setTableSizeMask):
(WTF::HashTable::keyCount const):
(WTF::HashTable::setKeyCount const):
(WTF::HashTable::deletedCount const):
(WTF::HashTable::setDeletedCount const):
(WTF::KeyTraits>::HashTable):
(WTF::KeyTraits>::inlineLookup):
(WTF::KeyTraits>::lookupForWriting):
(WTF::KeyTraits>::fullLookupForWriting):
(WTF::KeyTraits>::addUniqueForInitialization):
(WTF::KeyTraits>::add):
(WTF::KeyTraits>::addPassingHashCode):
(WTF::KeyTraits>::remove):
(WTF::KeyTraits>::removeIf):
(WTF::KeyTraits>::allocateTable):
(WTF::KeyTraits>::deallocateTable):
(WTF::KeyTraits>::expand):
(WTF::KeyTraits>::shrinkToBestSize):
(WTF::KeyTraits>::deleteReleasedWeakBuckets):
(WTF::KeyTraits>::rehash):
(WTF::KeyTraits>::clear):
(WTF::KeyTraits>::swap):
(WTF::KeyTraits>::checkTableConsistencyExceptSize const):
2020-02-03 Sam Weinig <weinig@apple.com>
Start splitting platform specific overrides of default enable behavior into their own files
https://bugs.webkit.org/show_bug.cgi?id=207105
Reviewed by Dean Jackson.
Splits out platform specific overrides of default enable behavior into separate files,
starting with one for all of the Cocoa related ports, one for Apple's Windows port, and
one for the WinCario port.
The rule is now that all ENABLE_* macros should have a default defined in PlatformEnable.h,
but platforms are allowed to override it via their PlatformEnable*.h file. For now, I manually
ensured that all the defines in PlatformEnableCocoa.h, PlatformEnableWinApple.h and PlatformEnableWinCairo.h
also had defaults in PlatformEnable.h, but going forward this needs be validated either through
some sort of macro-based validation, through the style checker or something else.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/PlatformEnable.h:
* wtf/PlatformEnableCocoa.h: Copied from Source/WTF/wtf/PlatformEnable.h.
* wtf/PlatformEnableWinApple.h: Copied from Source/WTF/wtf/PlatformEnable.h.
* wtf/PlatformEnableWinCairo.h: Copied from Source/WTF/wtf/PlatformEnable.h.
2020-01-31 Don Olmstead <don.olmstead@sony.com>
[CMake] Add _PRIVATE_LIBRARIES to framework
https://bugs.webkit.org/show_bug.cgi?id=207004
Reviewed by Konstantin Tokarev.
Move uses of PRIVATE within _LIBRARIES to _PRIVATE_LIBRARIES. Any _LIBRARIES appended
afterwards will have that visibility set erroneously.
* wtf/PlatformFTW.cmake:
2020-01-30 Conrad Shultz <conrad_shultz@apple.com>
`FALLTHROUGH` macro isn't properly defined when building Objective-C files using Clang
https://bugs.webkit.org/show_bug.cgi?id=206637
Reviewed by Darin Adler.
Allow the `FALLTHROUGH` macro to be defined properly when building with either GCC
or Clang.
* wtf/Compiler.h:
2020-01-30 Yusuke Suzuki <ysuzuki@apple.com>
[WTF] Remove PackedIntVector
https://bugs.webkit.org/show_bug.cgi?id=207018
Reviewed by Mark Lam.
Simply removing PackedIntVector since (1) nobody uses it, (2) it is somewhat broken (like, size()), and (3) its implementation is not so efficient.
If we want to have this feature, we can recreate it.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/PackedIntVector.h: Removed.
2020-01-30 Jonathan Bedard <jbedard@apple.com>
PAL: Remove old iOS version macros
https://bugs.webkit.org/show_bug.cgi?id=206905
Reviewed by Darin Adler.
* wtf/PlatformHave.h: Add HAVE(NSPROGRESS_PUBLISHING_SPI).
2020-01-28 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Should use light theme unless website declares support for dark themes in color-schemes property
https://bugs.webkit.org/show_bug.cgi?id=197947
Reviewed by Michael Catanzaro.
Do not define HAVE_OS_DARK_MODE_SUPPORT for the GTK port.
* wtf/PlatformHave.h:
2020-01-28 Jonathan Bedard <jbedard@apple.com>
WebCore: Guard uneven corners in rounded rectangles
https://bugs.webkit.org/show_bug.cgi?id=206838
Reviewed by Darin Adler.
* wtf/PlatformHave.h: Add HAVE(CG_PATH_UNEVEN_CORNERS_ROUNDEDRECT).
2020-01-27 Jonathan Bedard <jbedard@apple.com>
WebCore: Remove iOS 11 macros from RenderThemeIOS.mm
https://bugs.webkit.org/show_bug.cgi?id=206787
Reviewed by Darin Adler.
* wtf/PlatformHave.h: Add HAVE(SYSTEM_FONT_STYLE_TITLE_0) and HAVE(SYSTEM_FONT_STYLE_TITLE_4).
2020-01-27 Jonathan Bedard <jbedard@apple.com>
Fix OpenSource iphoneos arm64e build
https://bugs.webkit.org/show_bug.cgi?id=206703
Reviewed by Yusuke Suzuki.
* wtf/PlatformUse.h: Add USE(DARWIN_REGISTER_MACROS) check.
2020-01-27 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r255159.
Broke the watchOS build.
Reverted changeset:
"Fix OpenSource iphoneos arm64e build"
https://bugs.webkit.org/show_bug.cgi?id=206703
https://trac.webkit.org/changeset/255159
2020-01-27 Jonathan Bedard <jbedard@apple.com>
Fix OpenSource iphoneos arm64e build
https://bugs.webkit.org/show_bug.cgi?id=206703
Reviewed by Yusuke Suzuki.
* wtf/PlatformUse.h: Add USE(DARWIN_REGISTER_MACROS) check.
2020-01-27 Mark Lam <mark.lam@apple.com>
Make getVTablePointer() an inline function to be compliant with WebKit style guidelines.
https://bugs.webkit.org/show_bug.cgi?id=206816
Reviewed by Darin Adler.
Convert getVTablePointer() from a macro into an inline template function. This
makes the naming compliant with WebKit style guidelines.
* wtf/PointerPreparations.h:
(WTF::getVTablePointer):
2020-01-25 Brady Eidson <beidson@apple.com>
Make ContentWorlds be identified by an ObjectIdentifier instead of a uint64_t
https://bugs.webkit.org/show_bug.cgi?id=206784
Reviewed by Alex Christensen.
* wtf/ObjectIdentifier.h:
(WTF::ObjectIdentifier::generate):
(WTF::ObjectIdentifier::generateThreadSafe):
(WTF::ObjectIdentifier::enableGenerationProtection): To allow restricting generating an identifier to the UIProcess.
2020-01-25 Mark Lam <mark.lam@apple.com>
Introduce a getVTablePointer() utility function.
https://bugs.webkit.org/show_bug.cgi?id=206804
<rdar://problem/58872290>
Reviewed by Yusuke Suzuki and Oliver Hunt.
With getVTablePointer(), we can abstract away how we get a vtable function pointer
without assuming the way it is signed for ARM64E. With this, we can remove the
WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION macro which assumes how a vtable function
pointer is signed.
* wtf/PointerPreparations.h:
2020-01-25 Mark Lam <mark.lam@apple.com>
Add some tests for dynamically allocated StaticStringImpls.
https://bugs.webkit.org/show_bug.cgi?id=206802
Reviewed by Darin Adler.
Removed some unnecessary explicit specialization of the charactersAreAllASCII()
template function.
* wtf/text/StringImpl.cpp:
(WTF::StringImpl::createFromLiteral):
(WTF::StringImpl::createStaticStringImpl):
2020-01-24 Mark Lam <mark.lam@apple.com>
Move singleton Intl string locales out of JSGlobalObject.
https://bugs.webkit.org/show_bug.cgi?id=206791
<rdar://problem/58889037>
Reviewed by Yusuke Suzuki.
Fix a bug in StringImpl::createStaticStringImpl(): I forgot to set its hash value
when I introduced it. StaticStringImpls require that its hash code be set ahead
of time, and cannot be mutated at runtime. See the comment in the definition of
StaticStringImpl in StringImpl.h.
* wtf/text/StringImpl.cpp:
(WTF::StringImpl::createStaticStringImpl):
2020-01-24 Mark Lam <mark.lam@apple.com>
IntlObject's cached strings should be immortal and safe for concurrent access.
https://bugs.webkit.org/show_bug.cgi?id=206779
<rdar://problem/58831763>
Reviewed by Yusuke Suzuki.
Add a factory for creating a dynamically allocated StaticStringImpl.
Note: StaticStringImpl is guaranteed to have the same shape as StringImpl.
The only difference is that s_refCountFlagIsStaticString is set on the refCount
for StaticStringImpl. Since the client will use the StaticStringImpl as a
StringImpl, we implement the factory by using StringImpl::createInternal() for
simplicity, and set the s_refCountFlagIsStaticString flag thereafter.
* wtf/text/StringImpl.cpp:
(WTF::StringImpl::createStaticStringImpl):
* wtf/text/StringImpl.h:
2020-01-24 Keith Rollin <krollin@apple.com>
Fix internal Apple builds after r254411
https://bugs.webkit.org/show_bug.cgi?id=206723
<rdar://problem/58844735>
Reviewed by Maciej Stachowiak.
The default Xcode build configuration has changed between macOS 10.13
and macOS 10.15, such that references to some frameworks when bulding
for the latter don't work when building for the former. Fix this by
explicitly adding support for the desired build location rather than
assuming such support will be provided for us.
* Configurations/WTF.xcconfig:
2020-01-24 Jonathan Bedard <jbedard@apple.com>
WTF: Remove old iOS version macros
https://bugs.webkit.org/show_bug.cgi?id=206634
<rdar://problem/58818561>
Reviewed by Darin Adler.
* wtf/PlatformEnable.h: Remove iOS 12 version macro.
* wtf/PlatformHave.h: Ditto.
* wtf/PlatformUse.h: Ditto.
2020-01-22 Darin Adler <darin@apple.com>
Remove some unneeded definitions from Platform.h family headers
https://bugs.webkit.org/show_bug.cgi?id=206642
Reviewed by Eric Carlson.
* wtf/PlatformEnable.h:
Removed ENABLE_RESPECT_EXIF_ORIENTATION because it was unused.
* wtf/PlatformHave.h:
Removed HAVE_PASSKIT_API_TYPE because it is now unused.
Removed HAVE_MERGESORT because it was unused.
Removed HAVE_AVFOUNDATION_VIDEO_OUTPUT because it is now unused.
Removed HAVE_AVFOUNDATION_MEDIA_SELECTION_GROUP because it is now unused.
Removed HAVE_CFNETWORK_WITH_CONTENT_ENCODING_SNIFFING_OVERRIDE because it was unused.
* wtf/PlatformUse.h:
Removed USE_ARENA_ALLOC_ALIGNMENT_INTEGER because it was unused.
Removed USE_NETWORK_CFDATA_ARRAY_CALLBACK because it is now unused.
2020-01-22 Eric Carlson <eric.carlson@apple.com>
uniqueLogIdentifier() should generate a unique identifiers
https://bugs.webkit.org/show_bug.cgi?id=206612
Reviewed by Brent Fulgham.
* wtf/LoggerHelper.h:
(WTF::LoggerHelper::uniqueLogIdentifier):
2020-01-22 Sam Weinig <weinig@apple.com>
Remove unused enable macro ENABLE_JIT_CONSTANT_BLINDING
https://bugs.webkit.org/show_bug.cgi?id=206415
Reviewed by Anders Carlsson.
* wtf/PlatformEnable.h:
ENABLE_JIT_CONSTANT_BLINDING is not used anywhere in WebKit so can be removed.
2020-01-22 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] DateMath should accept more ISO-8601 timezone designators even if they are not included in ECMA262 to produce expected results in the wild code
https://bugs.webkit.org/show_bug.cgi?id=160287
Reviewed by Ross Kirsling.
While ECMA262[1] always requires ":" in a timezone designator between hours and minutes (like, "hh:mm"),
ISO-8601 can accept additional forms, "+hh" and "+hhmm". This patch relaxes our Date parsing to accept this
type of timezone designators so that we can accept wider forms of date time formats. This addition does not
break the existing parsing rules since '+-' prefix can clarify that following sequences are timezones.
[1]: https://tc39.es/ecma262/#sec-date-time-string-format
[2]: https://en.wikipedia.org/wiki/ISO_8601#Time_zone_designators
* wtf/DateMath.cpp:
(WTF::parseES5TimePortion):
(WTF::parseES5DateFromNullTerminatedCharacters):
2020-01-21 Ross Kirsling <ross.kirsling@sony.com>
[JSC] Date parse logic should be less redundant
https://bugs.webkit.org/show_bug.cgi?id=206560
Reviewed by Darin Adler.
* wtf/DateMath.cpp:
(WTF::parseDateFromNullTerminatedCharacters):
* wtf/DateMath.h:
Align function signature with parseES5DateFromNullTerminatedCharacters.
Namely, drop the integer out param and flip the boolean one.
2020-01-21 Yusuke Suzuki <ysuzuki@apple.com>
[WTF] AtomStringTable should be small
https://bugs.webkit.org/show_bug.cgi?id=206400
Reviewed by Sam Weinig.
AtomStringTable is the largest hashtable typically. It takes more
than 256KB per WebProcess (sometimes, it took 1MB or more).
This patch leverages PackedPtr to compact it from 8 bytes per entry
to 6 bytes per entry.
While this is still large, we should investigate how to compact C++
pointers in 4 bytes[1] to shrink memory footprint, since WebKit
memory is used by Vector and HashTable fulfilled with pointers.
[1]: https://bugs.webkit.org/show_bug.cgi?id=206469
* wtf/DumbPtrTraits.h:
(WTF::DumbPtrTraits::hashTableDeletedValue):
(WTF::DumbPtrTraits::isHashTableDeletedValue):
* wtf/Forward.h:
* wtf/HashTraits.h:
* wtf/Packed.h:
(WTF::Packed<T::Packed):
(WTF::Packed<T::isHashTableDeletedValue const):
(WTF::GetPtrHelper<PackedPtr<T>>::getPtr):
(WTF::PackedPtrTraits::hashTableDeletedValue):
(WTF::PackedPtrTraits::isHashTableDeletedValue):
(WTF::alignof): Deleted.
* wtf/Ref.h:
(WTF::Ref::Ref):
(WTF::Ref::isHashTableDeletedValue const):
(WTF::Ref::hashTableDeletedValue): Deleted.
* wtf/RefPtr.h:
(WTF::RefPtr::RefPtr):
(WTF::RefPtr::isHashTableDeletedValue const):
(WTF::RefPtr::hashTableDeletedValue): Deleted.
* wtf/text/AtomStringImpl.cpp:
(WTF::addToStringTable):
(WTF::CStringTranslator::equal):
(WTF::CStringTranslator::translate):
(WTF::UCharBufferTranslator::equal):
(WTF::UCharBufferTranslator::translate):
(WTF::HashAndUTF8CharactersTranslator::equal):
(WTF::HashAndUTF8CharactersTranslator::translate):
(WTF::SubstringTranslator::translate):
(WTF::SubstringTranslator8::equal):
(WTF::SubstringTranslator16::equal):
(WTF::LCharBufferTranslator::equal):
(WTF::LCharBufferTranslator::translate):
(WTF::BufferFromStaticDataTranslator::equal):
(WTF::BufferFromStaticDataTranslator::translate):
(WTF::AtomStringImpl::addSlowCase):
(WTF::AtomStringImpl::remove):
(WTF::AtomStringImpl::lookUpSlowCase):
(WTF::AtomStringImpl::lookUp):
* wtf/text/AtomStringTable.cpp:
(WTF::AtomStringTable::~AtomStringTable):
* wtf/text/AtomStringTable.h:
(WTF::AtomStringTable::table):
(): Deleted.
* wtf/text/StringHash.h:
(WTF::StringHash::hash):
(WTF::StringHash::equal):
(WTF::ASCIICaseInsensitiveHash::hash):
(WTF::ASCIICaseInsensitiveHash::equal):
* wtf/text/StringImpl.h:
2020-01-17 Sam Weinig <weinig@apple.com>
Platform.h is out of control Part 8: Macros are used inconsistently
https://bugs.webkit.org/show_bug.cgi?id=206425
Reviewed by Darin Adler.
Start addressing FIXMEs added to Platform.h (and helper files) during previous
cleanup work.
- Renames WTF_CPU_EFFECTIVE_ADDRESS_WIDTH to WTF_OS_CONSTANT_EFFECTIVE_ADDRESS_WIDTH,
making it available via new macro OS_CONSTANT(...), and syncs bmalloc redefinition.
- Renames:
USE_LLINT_EMBEDDED_OPCODE_ID to ENABLE_LLINT_EMBEDDED_OPCODE_ID
USE_UDIS86 to ENABLE_UDIS86
USE_ARM64_DISASSEMBLER to ENABLE_ARM64_DISASSEMBLER
Enable is more appropriate here as these enable functionality within webkit.
- Removes undefs that are no longer needed due to only defining the macro once now.
- Removes dead defined(__LP64__) check after PLATFORM(MAC) macOS is always 64-bit these
days.
* wtf/Packed.h:
(WTF::alignof):
* wtf/Platform.h:
* wtf/PlatformEnable.h:
* wtf/PlatformOS.h:
* wtf/WTFAssertions.cpp:
* wtf/text/StringCommon.h:
2020-01-20 David Kilzer <ddkilzer@apple.com>
Fix missing header guards and clean up empty files in bmalloc, WTF, JavaScriptCore
<https://webkit.org/b/206481>
Reviewed by Darin Adler.
* wtf/cocoa/Entitlements.h:
* wtf/win/PathWalker.h:
- Add #pragma once.
2020-01-19 Claudio Saavedra <csaavedra@igalia.com>
[GTK] Remove usage of deprecated GTimeVal
https://bugs.webkit.org/show_bug.cgi?id=206358
Reviewed by Žan Doberšek.
Use g_get_real_time() directly instead of deprecated and unsafe API.
* wtf/CurrentTime.cpp:
(WTF::currentTime):
2020-01-16 Keith Miller <keith_miller@apple.com>
Reland bytecode checkpoints since bugs have been fixed
https://bugs.webkit.org/show_bug.cgi?id=206361
Unreviewed, reland.
The watch bugs have been fixed by https://trac.webkit.org/changeset/254674
* WTF.xcodeproj/project.pbxproj:
* wtf/Bitmap.h:
(WTF::WordType>::invert):
(WTF::WordType>::operator):
(WTF::WordType>::operator const const):
* wtf/CMakeLists.txt:
* wtf/EnumClassOperatorOverloads.h: Added.
* wtf/FastBitVector.h:
(WTF::FastBitReference::operator bool const):
(WTF::FastBitReference::operator|=):
(WTF::FastBitReference::operator&=):
(WTF::FastBitVector::fill):
(WTF::FastBitVector::grow):
* wtf/UnalignedAccess.h:
(WTF::unalignedLoad):
(WTF::unalignedStore):
2020-01-16 Tim Horton <timothy_horton@apple.com>
Fix the build after r254701
<rdar://problem/58667355>
* wtf/Platform.h:
* wtf/PlatformEnable.h:
AdditionalFeatureDefines has to come first.
2020-01-16 Sam Weinig <weinig@apple.com>
Platform.h is out of control Part 7: Split calling convention macro definitions out of Platform.h and into a new PlatformCallingConventions.h
https://bugs.webkit.org/show_bug.cgi?id=206377
Reviewed by Anders Carlsson.
As a another step towards cleaning up Platform.h, split out all the calling convention
macros into their own file.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
Add new header.
* wtf/Platform.h:
* wtf/PlatformCPU.h:
* wtf/PlatformEnable.h:
* wtf/PlatformHave.h:
* wtf/PlatformLegacy.h:
* wtf/PlatformOS.h:
* wtf/PlatformUse.h:
Unify indirect inclusion guard.
* wtf/PlatformCallingConventions.h: Copied from Source/WTF/wtf/Platform.h.
2020-01-16 Robin Morisset <rmorisset@apple.com>
Use dataLogIf more regularly
https://bugs.webkit.org/show_bug.cgi?id=206332
Reviewed by Keith Miller.
* wtf/DataLog.h:
(WTF::dataLog): Marked NEVER_INLINE, since it should never be perf-sensitive
2020-01-16 Sam Weinig <weinig@apple.com>
Platform.h is out of control Part 6: Split USE_* macro definitions out of Platform.h and into a new PlatformUse.h
https://bugs.webkit.org/show_bug.cgi?id=206354
Reviewed by Dan Bernstein.
As a another step towards cleaning up Platform.h, split out all the legacy platform
macros into their own file.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
Add new file.
* wtf/Platform.h: In addition to removing all the USE_* macros, consolidate
all the sub-includes at the top.
* wtf/PlatformEnable.h: Moved ASSERT_ENABLED here from Platform.h,
as it makes more sense here. Eventually should be renamed ro ENABLE_ASSERT
for consistency.
* wtf/PlatformUse.h: Copied from Source/WTF/wtf/Platform.h.
2020-01-16 Per Arne Vollan <pvollan@apple.com>
[Win] Fix AppleWin build
https://bugs.webkit.org/show_bug.cgi?id=206299
Reviewed by Brent Fulgham.
Build internal builds with VS2019.
* WTF.vcxproj/WTF.proj:
2020-01-15 Sam Weinig <weinig@apple.com>
Platform.h is out of control Part 5: Split HAVE_* macro definitions out of Platform.h and into a new PlatformHave.h
https://bugs.webkit.org/show_bug.cgi?id=206307
Reviewed by Anders Carlsson.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/Platform.h:
* wtf/PlatformHave.h: Copied from Source/WTF/wtf/Platform.h.
2020-01-15 Keith Miller <keith_miller@apple.com>
Revert bytecode checkpoints since it breaks watch
https://bugs.webkit.org/show_bug.cgi?id=206301
Unreviewed, revert.
2020-01-14 Sam Weinig <weinig@apple.com>
Platform.h is out of control Part 4: Split PLATFORM_* macro definitions out of Platform.h and into a new PlatformLegacy.h
https://bugs.webkit.org/show_bug.cgi?id=206272
Reviewed by Anders Carlsson.
As a another step towards cleaning up Platform.h, split out all the legacy platform
macros into their own file.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/Platform.h:
* wtf/PlatformLegacy.h: Copied from Source/WTF/wtf/Platform.h.
2020-01-14 Sam Weinig <weinig@apple.com>
Plaform.h helper files should have a consistent naming scheme
https://bugs.webkit.org/show_bug.cgi?id=206240
Reviewed by Dean Jackson.
Rename Plaform.h helper files to use the prefix "Platform" consistently.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/CPU.h: Removed.
* wtf/FeatureDefines.h: Removed.
* wtf/OS.h: Removed.
* wtf/Platform.h:
* wtf/PlatformCPU.h: Copied from Source/WTF/wtf/CPU.h.
* wtf/PlatformEnable.h: Copied from Source/WTF/wtf/FeatureDefines.h.
* wtf/PlatformOS.h: Copied from Source/WTF/wtf/OS.h.
2020-01-14 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Glyph lookup should be language-sensitive (specifically between Yiddish and Hebrew)
https://bugs.webkit.org/show_bug.cgi?id=77568
<rdar://problem/14649193>
Reviewed by Simon Fraser.
* wtf/Platform.h:
2020-01-13 Darin Adler <darin@apple.com>
Use even more "shortest form" formatting, and less "fixed precision" and "fixed width"
https://bugs.webkit.org/show_bug.cgi?id=198918
Reviewed by Sam Weinig.
* wtf/Logger.h:
(WTF::LogArgument::toString): Log floating point numbers as shortest form instead of fixed precision.
* wtf/MediaTime.cpp:
(WTF::MediaTime::toString const): Convert time to string as shortest form instead of fixed precision.
Also use multiple-argument append for great simplicity and clarity.
2020-01-14 Alicia Boya García <aboya@igalia.com>
[WTF] Make MediaTime constructor constexpr
https://bugs.webkit.org/show_bug.cgi?id=206036
Reviewed by Adrian Perez de Castro.
https://bugs.webkit.org/show_bug.cgi?id=205723 allowed to declare
MediaTime variables as static inside functions without needing a
global destructor.
It did not eliminate the call to the MediaTime constructor on runtime
though. This wasn't a problem for static variables inside functions,
as the compiler adds a guard variable to call the constructor the
first time the function is called.
On the other hand, for variables defined outside of the scope of the
function, for them to be initialized the MediaTime constructor would
have to be called at runtime from a global constructor, something
we're trying to avoid and which generates an error in clang.
But again, MediaTime is a simple class with only integral values, we
shouldn't need a runtime function call to initialize it!
This patch makes the MediaTime constructor constexpr so that we don't
need runtime initialization for static MediaTime variables. This
allows us to declare them outside functions and enables the compiler
to generate code without guard variables when static MediaTime
variables are declared inside functions.
A test has been added accessing a global const static MediaTime. The
build should not produce any error stating the need for a global
constructor.
* wtf/MediaTime.cpp:
* wtf/MediaTime.h:
(WTF::MediaTime::MediaTime):
2020-01-14 David Kilzer <ddkilzer@apple.com>
Enable -Wconditional-uninitialized in bmalloc, WTF, JavaScriptCore
<https://webkit.org/b/206190>
<rdar://problem/58540387>
Reviewed by Mark Lam.
* Configurations/Base.xcconfig:
(WARNING_CFLAGS): Add -Wconditional-uninitialized.
2020-01-13 Sam Weinig <weinig@apple.com>
Platform.h is out of control Part 3: Move all ENABLE_* macros definitions in FeatureDefines.h
https://bugs.webkit.org/show_bug.cgi?id=206139
Reviewed by Anders Carlsson.
- Moves all remaining ENABLE_* defines out of Platform.h and into FeatureDefines.h
- Moves most, USE_UDIS86 and USE_ARM64_DISASSEMBLER are tangled up in the JIT definitions
still, HAVE_* and USE_* defines out of FeatureDefines.h and into Platform.h
- Where straigthforward, convert macro definitions into a canonical 3 line entry of the
form:
#if !defined(MACRO_NAME) && (<CONDITIONS HERE>)
#define MACRO_NAME 1
#endif
There is rarely (if ever) a resone to undefine or define one of these platform related
macros to 0 as the usage macros (e.g. HAVE(...), ENABLE(...), etc.) handle undefined as 0.
- Added a guard so that FeatureDefines.h can't be included directly, and must be included via
Platform.h. This is necessary as it depends heavily on macros defined in Platform.h
- Added numerous FIXMEs detailing follow up cleaning.
* wtf/FeatureDefines.h:
* wtf/Platform.h:
2020-01-12 Sam Weinig <weinig@apple.com>
Platform.h is out of control Part 2: Split WTF_OS_* macro definitions out of Platform.h and into a new OS.h
https://bugs.webkit.org/show_bug.cgi?id=206138
Reviewed by Anders Carlsson.
As a another step towards cleaning up Platform.h, split out OS related
macros into their own file.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/OS.h: Copied from Source/WTF/wtf/Platform.h.
* wtf/Platform.h:
2020-01-11 Myles C. Maxfield <mmaxfield@apple.com>
REGRESSION(r185816): In the Hong Kong locale, navigator.language reports it's in the Taiwan locale
https://bugs.webkit.org/show_bug.cgi?id=200043
Unreviewed.
Fix build.
* wtf/cocoa/LanguageCocoa.mm:
(WTF::canMinimizeLanguages):
2020-01-11 Myles C. Maxfield <mmaxfield@apple.com>
REGRESSION(r185816): In the Hong Kong locale, navigator.language reports it's in the Taiwan locale
https://bugs.webkit.org/show_bug.cgi?id=200043
Unreviewed.
Addressing additional review comments.
* wtf/cocoa/LanguageCocoa.mm:
(WTF::canMinimizeLanguages):
2020-01-11 Myles C. Maxfield <mmaxfield@apple.com>
Fix internal Apple builds after r254389
https://bugs.webkit.org/show_bug.cgi?id=206135
Rubber stamped by Zalan Bujtas.
* wtf/spi/cocoa/NSLocaleSPI.h:
2020-01-11 Sam Weinig <weinig@apple.com>
Platform.h is out of control Part 1: Split WTF_CPU_* macro definitions out of Platform.h and into a new CPU.h
https://bugs.webkit.org/show_bug.cgi?id=206124
Reviewed by Anders Carlsson.
As a step towards cleaning up Platform.h, split out CPU related
macros into their own file.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/CPU.h: Copied from Source/WTF/wtf/Platform.h.
* wtf/Platform.h:
2020-01-10 Dean Jackson <dino@apple.com>
[WebGL] Clarify USE_OPENGL_ES_3
https://bugs.webkit.org/show_bug.cgi?id=206081
<rdar://problem/58486798>
Reviewed by Simon Fraser.
Make it clear that USE_ANGLE | USE_OPENGL | USE_OPENGL_ES are exclusive,
and that the availability of OpenGL ES 3 is a separate query.
* wtf/Platform.h:
2020-01-11 Yusuke Suzuki <ysuzuki@apple.com>
Unreviewed, fix RunLoopGeneric's RunLoop::cycle
* wtf/generic/RunLoopGeneric.cpp:
(WTF::RunLoop::cycle):
2020-01-10 Myles C. Maxfield <mmaxfield@apple.com>
REGRESSION(r185816): In the Hong Kong locale, navigator.language reports it's in the Taiwan locale
https://bugs.webkit.org/show_bug.cgi?id=200043
<rdar://problem/44119496>
Reviewed by Dean Jackson.
We ask the system for the current locale using CFLocaleCopyPreferredLanguages(), and then round-trip
it through CFBundleGetLocalizationInfoForLocalization() / CFBundleCopyLocalizationForLocalizationInfo().
This was to work around the fact that CFLocaleCopyPreferredLanguages() previously didn't report BCP47
language codes. However, that round-tripping was introducing errors, such as "zh-Hant-HK" was getting
turned into "zh-Hant-TW" which is clearly wrong. The CFBundle functions were never supposed to be used
in this way.
Instead, we can use CFLocaleCreateCanonicalLanguageIdentifierFromString() which is intended to
canonicalize locale identifiers, and does return BCP47 language codes. However, this function preserves
more fingerprinting entropy than the old code path, so we pass the input through new NSLocale SPI to
minimize the entropy revealed.
* WTF.xcodeproj/project.pbxproj:
* wtf/Language.h:
* wtf/Platform.h:
* wtf/PlatformMac.cmake:
* wtf/cf/LanguageCF.cpp:
(WTF::httpStyleLanguageCode):
(WTF::platformUserPreferredLanguages):
* wtf/cocoa/LanguageCocoa.mm: Added.
(WTF::minimizedLanguagesFromLanguages):
* wtf/spi/cocoa/NSLocaleSPI.h: Added.
2020-01-10 Simon Fraser <simon.fraser@apple.com>
Introduce ENABLE_META_VIEWPORT and use it in some WK2 code
https://bugs.webkit.org/show_bug.cgi?id=206091
Reviewed by Tim Horton.
Define ENABLE_META_VIEWPORT for iOS.
* wtf/FeatureDefines.h:
2020-01-09 Tim Horton <timothy_horton@apple.com>
Adopt TARGET_OS_MACCATALYST in more places
https://bugs.webkit.org/show_bug.cgi?id=206040
<rdar://problem/57127108>
Reviewed by Simon Fraser.
* wtf/Platform.h:
2020-01-09 Simon Fraser <simon.fraser@apple.com>
Add ENABLE_UI_SIDE_COMPOSITING and use it in a few places
https://bugs.webkit.org/show_bug.cgi?id=205982
Reviewed by Jon Lee.
Add a #define ENABLE_UI_SIDE_COMPOSITING for Cocoa platforms. Minor comment cleanup, and
move the duplicate ENABLE_ASYNC_SCROLLING from iOS and macOS sections into the Cocoa section.
* wtf/FeatureDefines.h:
2020-01-08 Yusuke Suzuki <ysuzuki@apple.com>
Reduce binary size by purging C++ type information in Objective-C fields and parameters
https://bugs.webkit.org/show_bug.cgi?id=205905
Reviewed by Saam Barati.
Objective-C has reflection mechanisms. This means that fields, methods, and their types
need to hold its string representations in binary even if we are using release build.
While typical Objective-C class does not have large size of type names, C++ struct / class
has very large one, and putting them in Objective-C method names, parameter types, or fields
makes binary size very large.
Interesting thing is that type information is gathered when parameter is a C++ pointer, reference,
or value. And it gathers one-level deep information from this pointer etc. This means that, if
we use RefPtr<T>, collected type information is the one of RefPtr, not one of T. So it becomes significantly
smaller.
This patch introduces NakedRef<T>. This is similar to Ref while it does not have any ownership. So it
is just a wrapper around T&. We already have NakedPtr<T>. And use NakedRef<T> / NakedPtr<T> instead
of T& and T* if,
1. T is C++ class.
2. T* / T& is in Objective-C fields or parameter types (including a return type).
Then, these type information is one of NakedRef<T> / NakedPtr<T> instead of T, and we can reduce binary size.
This patch saves 600~KB in binary size.
Note the following things.
1. If we use `__attribute__((objc_direct))`, `__attribute__((objc_direct_members))`, possibly, we can completely remove these
metadata without using NakedRef / NakedPtr[1]. However, this is not available for our supporting platforms now (including
pre-Catalina OSes). This NakedRef / NakedPtr technique can reduce binary without waiting for it.
2. Reverting NakedRef / NakedPtr to usual reference / pointer is fairly easy since it is well typed. Once `__attribute__((objc_direct))`
becomes available in our platforms, we can consider it. But using NakedRef / NakedPtr is harmless.
[1]: https://github.com/llvm/llvm-project/commit/d4e1ba3fa9dfec2613bdcc7db0b58dea490c56b1
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/NakedRef.h: Added.
(WTF::NakedRef::NakedRef):
(WTF::NakedRef::operator-> const):
(WTF::NakedRef::get const):
(WTF::NakedRef::operator T& const):
(WTF::NakedRef::operator! const):
(WTF::=):
(WTF::NakedRef<T>::swap):
(WTF::swap):
2020-01-08 Alicia Boya García <aboya@igalia.com>
[WTF] Allow MediaTime static constants
https://bugs.webkit.org/show_bug.cgi?id=205723
Reviewed by Darin Adler.
Despite all its convenience methods, at its core MediaTime is a rather
trivial class with only integral members. Despite this, since it had a
destructor declared, this made the class non-trivially destructible
even if the implementation was empty, and therefore clang did not
allow to use it for static variables unless done in form of a pointer.
By removing the destructor this restriction is lifted and we don't
need heap allocations for static MediaTime objects.
Previous usages of heap allocation for static MediaTime objects have
been rewritten to take advantage of this. Test coverage is provided by
successful compilation without [-Werror,-Wexit-time-destructors]
errors and existing tests.
* wtf/MediaTime.cpp:
(WTF::MediaTime::zeroTime):
(WTF::MediaTime::invalidTime):
(WTF::MediaTime::positiveInfiniteTime):
(WTF::MediaTime::negativeInfiniteTime):
(WTF::MediaTime::indefiniteTime):
(WTF::MediaTime::~MediaTime): Deleted.
* wtf/MediaTime.h:
2020-01-07 Said Abou-Hallawa <sabouhallawa@apple.com>
Implement css3-images image-orientation
https://bugs.webkit.org/show_bug.cgi?id=89052
Reviewed by Simon Fraser.
Remove the ENABLE_CSS_IMAGE_ORIENTATION feature flag.
* wtf/FeatureDefines.h:
2020-01-07 Simon Fraser <simon.fraser@apple.com>
Add some more Animations logging
https://bugs.webkit.org/show_bug.cgi?id=205890
Reviewed by Dean Jackson.
Make Seconds TextStream-loggable, and make Markable<> loggable.
* wtf/Seconds.cpp:
(WTF::operator<<):
* wtf/Seconds.h:
* wtf/text/TextStream.h:
(WTF::operator<<):
2020-01-07 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK][WPE] Add API to set purpose and hints of active editable element to input methods
https://bugs.webkit.org/show_bug.cgi?id=205605
Reviewed by Žan Doberšek.
Split ENABLE_IOS_AUTOCORRECT_AND_AUTOCAPITALIZE and remove the IOS prefix.
* wtf/FeatureDefines.h:
2020-01-06 Don Olmstead <don.olmstead@sony.com>
Rename GraphicsContext3D to GraphicsContextGL
https://bugs.webkit.org/show_bug.cgi?id=205778
<rdar://problem/58327597>
Reviewed by Ross Kirsling.
Define USE_OPENGL_3 for Mac and USE_OPENGL_ES_3 for iOS. Use CMake config for
Windows and WebGL.
* wtf/Platform.h:
2020-01-06 Mark Lam <mark.lam@apple.com>
Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED.
https://bugs.webkit.org/show_bug.cgi?id=205776
Reviewed by Saam Barati.
This patch did the following changes:
1. Replaced ASSERT_DISABLED with ASSERT_ENABLED. This change does away
with the need for the double negative !ASSERT_DISABLED test that is commonly
used all over the code, thereby improving code readability.
In Assertions.h, there is also BACKTRACE_DISABLED, ASSERT_MSG_DISABLED,
ASSERT_ARG_DISABLED, FATAL_DISABLED, ERROR_DISABLED, LOG_DISABLED, and
RELEASE_LOG_DISABLED. We should replace those with ..._ENABLED equivalents
as well. We'll do that in another patch. For now, they are left as is to
minimize the size of this patch.
See https://bugs.webkit.org/show_bug.cgi?id=205780.
2. Fixed some code was guarded with "#ifndef NDEBUG" that should actually be
guarded by "#if ASSERT_ENABLED" instead.
3. In cases where the change is minimal, we move some code around so that we can
test for "#if ASSERT_ENABLED" instead of "#if !ASSERT_ENABLED".
* wtf/Assertions.h:
* wtf/AutomaticThread.cpp:
(WTF::AutomaticThread::start):
* wtf/BitVector.h:
* wtf/BlockObjCExceptions.mm:
(ReportBlockedObjCException):
* wtf/BloomFilter.h:
* wtf/CallbackAggregator.h:
(WTF::CallbackAggregator::CallbackAggregator):
* wtf/CheckedArithmetic.h:
(WTF::observesOverflow<AssertNoOverflow>):
* wtf/CheckedBoolean.h:
(CheckedBoolean::CheckedBoolean):
(CheckedBoolean::operator bool):
* wtf/CompletionHandler.h:
(WTF::CompletionHandler<Out):
* wtf/DateMath.cpp:
(WTF::initializeDates):
* wtf/Gigacage.cpp:
(Gigacage::tryAllocateZeroedVirtualPages):
* wtf/HashTable.h:
(WTF::KeyTraits>::checkKey):
(WTF::KeyTraits>::checkTableConsistencyExceptSize const):
* wtf/LoggerHelper.h:
* wtf/NaturalLoops.h:
(WTF::NaturalLoops::headerOf const):
* wtf/NeverDestroyed.h:
(WTF::LazyNeverDestroyed::construct):
* wtf/OptionSet.h:
(WTF::OptionSet::OptionSet):
* wtf/Platform.h:
* wtf/PtrTag.h:
* wtf/RefCounted.h:
(WTF::RefCountedBase::disableThreadingChecks):
(WTF::RefCountedBase::enableThreadingChecksGlobally):
(WTF::RefCountedBase::RefCountedBase):
(WTF::RefCountedBase::applyRefDerefThreadingCheck const):
* wtf/SingleRootGraph.h:
(WTF::SingleRootGraph::assertIsConsistent const):
* wtf/SizeLimits.cpp:
* wtf/StackBounds.h:
(WTF::StackBounds::checkConsistency const):
* wtf/URLParser.cpp:
(WTF::URLParser::URLParser):
(WTF::URLParser::domainToASCII):
* wtf/ValueCheck.h:
* wtf/Vector.h:
(WTF::Malloc>::checkConsistency):
* wtf/WeakHashSet.h:
* wtf/WeakPtr.h:
(WTF::WeakPtrImpl::WeakPtrImpl):
(WTF::WeakPtrFactory::WeakPtrFactory):
* wtf/text/AtomStringImpl.cpp:
* wtf/text/AtomStringImpl.h:
* wtf/text/StringBuilder.cpp:
(WTF::StringBuilder::reifyString const):
* wtf/text/StringBuilder.h:
* wtf/text/StringCommon.h:
(WTF::hasPrefixWithLettersIgnoringASCIICaseCommon):
* wtf/text/StringHasher.h:
(WTF::StringHasher::addCharacters):
* wtf/text/StringImpl.h:
* wtf/text/SymbolImpl.h:
* wtf/text/UniquedStringImpl.h:
2020-01-05 Dean Jackson <dino@apple.com>
Rename GraphicsContext3D to GraphicsContextGL
https://bugs.webkit.org/show_bug.cgi?id=205778
<rdar://problem/58327597>
Reviewed by Sam Weinig.
Rename all the GraphicsContext3D things to GraphicsContextGL
(includes Extensions3D and GRAPHICS_CONTEXT_3D).
GraphicsContext3DBase now becomes GraphicsContextGL.
GraphicsContext3D is now GraphicsContextGLOpenGL (since it represents
the OpenGL implementation of the API).
* wtf/FeatureDefines.h:
* wtf/Platform.h:
2020-01-05 Sam Weinig <weinig@apple.com>
Further simplify StringBuilder usage by standardizing hex formating to a single hex() function
https://bugs.webkit.org/show_bug.cgi?id=205759
Reviewed by Dean Jackson.
Removes appendByteAsHex, appendUnsignedAsHex and appendUnsignedAsHexFixedSize with the
following mappings:
appendByteAsHex(value, builder, case)
-> builder.append(hex(static_cast<unsigned char>(value), 2, case))
appendUnsignedAsHex(value, builder, case)
-> builder.append(hex(value, case))
appendUnsignedAsHexFixedSize(value, builder, size, case)
-> builder.append(hex(value, size, case))
Adds new API test for HexNumber.cpp
* wtf/HexNumber.h:
(WTF::appendByteAsHex): Deleted.
(WTF::appendUnsignedAsHex): Deleted.
(WTF::appendUnsignedAsHexFixedSize): Deleted.
Remove now unused helper functions.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::encodeForFileName):
Replace appendByteAsHex with direct use of hex(x, 2). The static_cast is needed
since there was an implicit down cast when appendByteAsHex was used.
* wtf/Logger.cpp:
(WTF::Logger::LogSiteIdentifier::toString const):
(WTF::>::toString):
* wtf/UUID.cpp:
(WTF::createCanonicalUUIDString):
Replace appendUnsignedAsHex/appendUnsignedAsHexFixedSize with hex(). Use makeString()
rather StringBuilder to simplify things further.
* wtf/text/WTFString.cpp:
(asciiDebug):
Replace appendUnsignedAsHexFixedSize with append(hex()).
2020-01-05 Ross Kirsling <ross.kirsling@sony.com>
JavaScript: Invalid date parse for ISO 8601 strings when no timezone given
https://bugs.webkit.org/show_bug.cgi?id=89071
Reviewed by Darin Adler.
* wtf/DateMath.cpp:
(WTF::parseES5TimePortion):
(WTF::parseES5DateFromNullTerminatedCharacters):
* wtf/DateMath.h:
Add an out param to tell JSC whether we still need to do a local time adjustment.
2020-01-03 Dean Jackson <dino@apple.com>
[WebGL] Enable ANGLE by default for Cocoa platforms (except simulator)
https://bugs.webkit.org/show_bug.cgi?id=205483
<rdar://problem/58097701>
Reverting this from trunk (was r253926) due to the number of
flakey tests and failures.
* wtf/Platform.h:
2020-01-03 Simon Fraser <simon.fraser@apple.com>
Add some shared schemes to the WebKit.xcworkspace
https://bugs.webkit.org/show_bug.cgi?id=205698
Reviewed by Tim Horton.
Make WebKit.xcworkspace show the following schemes by default:
All Source
All Tools
WTF
JavaScriptCore
WebCore
WebKit
WebKitLegacy
DumpRenderTree
WebKitTestRunner
TestWebKitAPI
MiniBrowser
MobileMiniBrowser.
Also remove the MobileMiniBrowserUITests scheme.
* WTF.xcodeproj/xcshareddata/xcschemes/WTF.xcscheme: Copied from Tools/MobileMiniBrowser/MobileMiniBrowser.xcodeproj/xcshareddata/xcschemes/MobileMiniBrowserUITests.xcscheme.
2020-01-02 Yusuke Suzuki <ysuzuki@apple.com> and Simon Fraser <simon.fraser@apple.com>
Experiment: create lots of different malloc zones for easier accounting of memory use
https://bugs.webkit.org/show_bug.cgi?id=186422
Reviewed by Saam Barati.
This patch introduces ENABLE(MALLOC_HEAP_BREAKDOWN). If this is enabled, we allocate malloc_zone per malloc kind.
This offers the way to investigate the usage of memory per kind by using vmmap, like the following.
VIRTUAL RESIDENT DIRTY SWAPPED ALLOCATION BYTES DIRTY+SWAP REGION
MALLOC ZONE SIZE SIZE SIZE SIZE COUNT ALLOCATED FRAG SIZE % FRAG COUNT
=========== ======= ========= ========= ========= ========= ========= ========= ====== ======
StringImpl_0x116efd000 188.0M 69.3M 30.9M 0K 139456 18.0M 12.9M 42% 34
DefaultMallocZone_0x10f487000 176.0M 53.9M 14.1M 0K 115956 9955K 4497K 32% 22
Vector_0x116eff000 162.0M 56.3M 55.3M 0K 140715 17.3M 37.9M 69% 36
MetadataTable_0x11843b000 152.0M 17.5M 17.5M 0K 14200 2353K 15.2M 87% 26
WebKit Using System Malloc_0x114cbe000 150.0M 31.6M 21.8M 0K 87422 16.7M 5278K 24% 23
InstructionStream_0x118469000 150.0M 5764K 5764K 0K 14470 4688K 1076K 19% 24
AssemblerData_0x117ee6000 150.0M 1928K 1928K 0K 1 16 1928K 100% 24
To achieve this goal without making very large change, we put a template type in various containers.
For example, Vector will take Malloc parameter (the default one is FastMalloc allocator). If ENABLE(MALLOC_HEAP_BREAKDOWN) is enabled, we change this to
specific VectorMalloc allocator, and vmmap can show memory usage of this allocator. This patch also supports malloc_zone per IsoHeap. So we can see memory
allocation per IsoHeap in vmmap.
To use this feature, we need to flip two compile time flags, ENABLE(MALLOC_HEAP_BREAKDOWN) in WTF and BENABLE_MALLOC_HEAP_BREAKDOWN in bmalloc.
And use `vmmap $PID` to dump malloc zones. To allocate objects of a class with a specific malloc-zone, use WTF_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(HeapIdentifier) for the class,
and define allocator by DECLARE_ALLOCATOR_WITH_HEAP_IDENTIFIER(HeapIdentifier) in a header and DEFINE_ALLOCATOR_WITH_HEAP_IDENTIFIER(HeapIdentifier) in a cpp file.
This patch also introduce callstack collector for malloc. Vector, HashMap etc. are used to allocate various things, but the above malloc_zone feature only tells thing like "Vector
takes XXX MB memory". But what we want to know in this case is what Vector is consuming memory. We collect StackShot for each malloc call, and combine these information to tell
which callsite is consuming much memory, which tell us that what Vector is consuming memory.
* WTF.xcodeproj/project.pbxproj:
* wtf/Bag.cpp: Copied from Source/JavaScriptCore/parser/SourceProviderCache.cpp.
* wtf/Bag.h:
(WTF::Private::BagNode::BagNode): Deleted.
* wtf/BitVector.cpp:
(WTF::BitVector::OutOfLineBits::create):
(WTF::BitVector::OutOfLineBits::destroy):
* wtf/CMakeLists.txt:
* wtf/ConcurrentBuffer.cpp: Copied from Source/JavaScriptCore/parser/SourceProviderCache.cpp.
* wtf/ConcurrentBuffer.h:
* wtf/DebugHeap.cpp: Copied from Source/JavaScriptCore/runtime/CachePayload.cpp.
(WTF::DebugHeap::DebugHeap):
(WTF::DebugHeap::malloc):
(WTF::DebugHeap::calloc):
(WTF::DebugHeap::memalign):
(WTF::DebugHeap::realloc):
(WTF::DebugHeap::free):
* wtf/DebugHeap.h: Added.
* wtf/FastBitVector.cpp:
(WTF::FastBitVectorWordOwner::setEqualsSlow):
(WTF::FastBitVectorWordOwner::resizeSlow):
* wtf/FastBitVector.h:
(WTF::FastBitVectorWordOwner::~FastBitVectorWordOwner):
* wtf/FastMalloc.cpp:
(WTF::fastMallocDumpMallocStats):
(WTF::AvoidRecordingScope::AvoidRecordingScope):
(WTF::AvoidRecordingScope::~AvoidRecordingScope):
(WTF::MallocCallTracker::MallocSiteData::MallocSiteData):
(WTF::MallocCallTracker::singleton):
(WTF::MallocCallTracker::MallocCallTracker):
(WTF::MallocCallTracker::recordMalloc):
(WTF::MallocCallTracker::recordRealloc):
(WTF::MallocCallTracker::recordFree):
(WTF::MallocCallTracker::dumpStats):
(WTF::fastMalloc):
(WTF::fastRealloc):
(WTF::fastFree):
(WTF::fastAlignedMalloc):
(WTF::tryFastAlignedMalloc):
(WTF::fastAlignedFree):
* wtf/FastMalloc.h:
(WTF::FastMalloc::zeroedMalloc):
(WTF::FastMalloc::tryZeroedMalloc):
* wtf/Forward.h:
* wtf/HashTable.cpp:
* wtf/HashTable.h:
(WTF::KeyTraits>::allocateTable):
(WTF::KeyTraits>::deallocateTable):
(WTF::KeyTraits>::rehash):
* wtf/MallocPtr.h:
(WTF::MallocPtr::MallocPtr):
(WTF::MallocPtr::malloc):
(WTF::MallocPtr::zeroedMalloc):
(WTF::MallocPtr::tryMalloc):
(WTF::MallocPtr::tryZeroedMalloc):
(WTF::adoptMallocPtr):
* wtf/MetaAllocator.cpp:
(WTF::MetaAllocator::allocFreeSpaceNode):
(WTF::MetaAllocator::freeFreeSpaceNode):
* wtf/MetaAllocatorHandle.h:
* wtf/Platform.h:
* wtf/RefCountedArray.cpp: Copied from Source/JavaScriptCore/bytecode/InstructionStream.cpp.
* wtf/RefCountedArray.h:
(WTF::RefCountedArray::RefCountedArray):
(WTF::RefCountedArray::~RefCountedArray):
(WTF::RefCountedArray::assign):
* wtf/SegmentedVector.cpp: Copied from Source/JavaScriptCore/bytecode/InstructionStream.cpp.
* wtf/SegmentedVector.h:
* wtf/SmallPtrSet.cpp: Copied from Source/JavaScriptCore/bytecode/InstructionStream.cpp.
* wtf/SmallPtrSet.h:
(WTF::SmallPtrSet::~SmallPtrSet):
(WTF::SmallPtrSet::grow):
* wtf/UniqueArray.cpp: Copied from Source/JavaScriptCore/bytecode/InstructionStream.cpp.
* wtf/UniqueArray.h:
(WTF::UniqueArrayFree::operator() const):
(WTF::UniqueArrayFree<T::operator() const):
* wtf/Vector.cpp: Copied from Source/JavaScriptCore/bytecode/InstructionStream.cpp.
* wtf/Vector.h:
(WTF::VectorBufferBase::allocateBuffer):
(WTF::VectorBufferBase::tryAllocateBuffer):
(WTF::VectorBufferBase::reallocateBuffer):
(WTF::VectorBufferBase::deallocateBuffer):
(WTF::VectorBufferBase::releaseBuffer):
(WTF::VectorBuffer::releaseBuffer):
(WTF::Vector::swap):
(WTF::Malloc>::Vector):
(WTF::=):
(WTF::Malloc>::contains const):
(WTF::Malloc>::findMatching const):
(WTF::Malloc>::find const):
(WTF::Malloc>::reverseFind const):
(WTF::Malloc>::appendIfNotContains):
(WTF::Malloc>::fill):
(WTF::Malloc>::appendRange):
(WTF::Malloc>::expandCapacity):
(WTF::Malloc>::tryExpandCapacity):
(WTF::Malloc>::resize):
(WTF::Malloc>::resizeToFit):
(WTF::Malloc>::shrink):
(WTF::Malloc>::grow):
(WTF::Malloc>::asanSetInitialBufferSizeTo):
(WTF::Malloc>::asanSetBufferSizeToFullCapacity):
(WTF::Malloc>::asanBufferSizeWillChangeTo):
(WTF::Malloc>::reserveCapacity):
(WTF::Malloc>::tryReserveCapacity):
(WTF::Malloc>::reserveInitialCapacity):
(WTF::Malloc>::shrinkCapacity):
(WTF::Malloc>::append):
(WTF::Malloc>::tryAppend):
(WTF::Malloc>::constructAndAppend):
(WTF::Malloc>::tryConstructAndAppend):
(WTF::Malloc>::appendSlowCase):
(WTF::Malloc>::constructAndAppendSlowCase):
(WTF::Malloc>::tryConstructAndAppendSlowCase):
(WTF::Malloc>::uncheckedAppend):
(WTF::Malloc>::uncheckedConstructAndAppend):
(WTF::Malloc>::appendVector):
(WTF::Malloc>::insert):
(WTF::Malloc>::insertVector):
(WTF::Malloc>::remove):
(WTF::Malloc>::removeFirst):
(WTF::Malloc>::removeFirstMatching):
(WTF::Malloc>::removeAll):
(WTF::Malloc>::removeAllMatching):
(WTF::Malloc>::reverse):
(WTF::Malloc>::map const):
(WTF::Malloc>::releaseBuffer):
(WTF::Malloc>::checkConsistency):
(WTF::swap):
(WTF::operator==):
(WTF::operator!=):
(WTF::Malloc>::isolatedCopy const):
(WTF::removeRepeatedElements):
(WTF::minCapacity>::Vector): Deleted.
(WTF::minCapacity>::contains const): Deleted.
(WTF::minCapacity>::findMatching const): Deleted.
(WTF::minCapacity>::find const): Deleted.
(WTF::minCapacity>::reverseFind const): Deleted.
(WTF::minCapacity>::appendIfNotContains): Deleted.
(WTF::minCapacity>::fill): Deleted.
(WTF::minCapacity>::appendRange): Deleted.
(WTF::minCapacity>::expandCapacity): Deleted.
(WTF::minCapacity>::tryExpandCapacity): Deleted.
(WTF::minCapacity>::resize): Deleted.
(WTF::minCapacity>::resizeToFit): Deleted.
(WTF::minCapacity>::shrink): Deleted.
(WTF::minCapacity>::grow): Deleted.
(WTF::minCapacity>::asanSetInitialBufferSizeTo): Deleted.
(WTF::minCapacity>::asanSetBufferSizeToFullCapacity): Deleted.
(WTF::minCapacity>::asanBufferSizeWillChangeTo): Deleted.
(WTF::minCapacity>::reserveCapacity): Deleted.
(WTF::minCapacity>::tryReserveCapacity): Deleted.
(WTF::minCapacity>::reserveInitialCapacity): Deleted.
(WTF::minCapacity>::shrinkCapacity): Deleted.
(WTF::minCapacity>::append): Deleted.
(WTF::minCapacity>::tryAppend): Deleted.
(WTF::minCapacity>::constructAndAppend): Deleted.
(WTF::minCapacity>::tryConstructAndAppend): Deleted.
(WTF::minCapacity>::appendSlowCase): Deleted.
(WTF::minCapacity>::constructAndAppendSlowCase): Deleted.
(WTF::minCapacity>::tryConstructAndAppendSlowCase): Deleted.
(WTF::minCapacity>::uncheckedAppend): Deleted.
(WTF::minCapacity>::uncheckedConstructAndAppend): Deleted.
(WTF::minCapacity>::appendVector): Deleted.
(WTF::minCapacity>::insert): Deleted.
(WTF::minCapacity>::insertVector): Deleted.
(WTF::minCapacity>::remove): Deleted.
(WTF::minCapacity>::removeFirst): Deleted.
(WTF::minCapacity>::removeFirstMatching): Deleted.
(WTF::minCapacity>::removeAll): Deleted.
(WTF::minCapacity>::removeAllMatching): Deleted.
(WTF::minCapacity>::reverse): Deleted.
(WTF::minCapacity>::map const): Deleted.
(WTF::minCapacity>::releaseBuffer): Deleted.
(WTF::minCapacity>::checkConsistency): Deleted.
(WTF::minCapacity>::isolatedCopy const): Deleted.
* wtf/text/CString.cpp:
(WTF::CStringBuffer::createUninitialized):
* wtf/text/CString.h:
* wtf/text/StringBuffer.cpp: Copied from Source/JavaScriptCore/bytecode/InstructionStream.cpp.
* wtf/text/StringBuffer.h:
(WTF::StringBuffer::StringBuffer):
(WTF::StringBuffer::~StringBuffer):
(WTF::StringBuffer::resize):
(WTF::StringBuffer::release):
* wtf/text/StringImpl.cpp:
(WTF::StringImpl::~StringImpl):
(WTF::StringImpl::destroy):
(WTF::StringImpl::createUninitializedInternalNonEmpty):
(WTF::StringImpl::reallocateInternal):
* wtf/text/StringImpl.h:
(WTF::StringImpl::StringImpl):
(WTF::StringImpl::createSubstringSharingImpl):
(WTF::StringImpl::tryCreateUninitialized):
(WTF::StringImpl::adopt):
* wtf/text/cf/StringImplCF.cpp:
(WTF::StringWrapperCFAllocator::allocate):
(WTF::StringWrapperCFAllocator::reallocate):
(WTF::StringWrapperCFAllocator::deallocate):
2020-01-02 Dean Jackson <dino@apple.com>
REGRESSION(r253926): Crash at libANGLE-shared.dylib: gl::LogMessage::~LogMessage
https://bugs.webkit.org/show_bug.cgi?id=205690
rdar://58279401
Reviewed by Eric Carlson.
Only enable ANGLE for iOS hardware while we investigate this fatal error.
* wtf/Platform.h:
2020-01-02 Sam Weinig <weinig@apple.com>
Simplify StringBuilder API/align with makeString by removing appendFixed* functions and using FormatNumber struct instead
https://bugs.webkit.org/show_bug.cgi?id=205671
Reviewed by Alex Christensen.
In an ongoing attempt to simplify the StringBuilder interface and unify it's functionality with makeString,
this change removes appendFixedPrecisionNumber() and appendFixedWidthNumber(), replacing their uses
with direct calls to append(), using a FormattedNumber object to direct it to the appropriate StringTypeAdapter.
* wtf/text/StringBuilder.h:
* wtf/text/StringBuilder.cpp:
(WTF::StringBuilder::appendFixedPrecisionNumber): Deleted.
(WTF::StringBuilder::appendFixedWidthNumber): Deleted.
Remove StringBuilder::appendFixedPrecisionNumber() and StringBuilder::appendFixedWidthNumber(). The same functionality
is available and more flexible by passing FormattedNumbers to the variadic append() function.
* wtf/text/TextStream.cpp:
(WTF::TextStream::operator<<):
* wtf/MediaTime.cpp:
(WTF::MediaTime::toString const):
Replace all uses of builder.appendFixedPrecisionNumber(...) with builder.append(FormattedNumber::fixedPrecision(...))
and builder.appendFixedWidthNumber(...) with with builder.append(FormattedNumber::fixedWidth(...))
2019-12-20 Darin Adler <darin@apple.com>
Tidy a bit of StringBuilder usage
https://bugs.webkit.org/show_bug.cgi?id=205509
Reviewed by Sam Weinig.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::decodeFromFilename): Fix misleading variable name "hexDigit"
for result of decoding "%+XXXX"; what's decoded is a character, not a hex digit.
* wtf/HexNumber.h: Remove unused appendUnsignedAsHexFixedSize function for
destinations other than StringBuilder. Don't need it at this time, could add
it later if we ever decide we do.
* wtf/text/StringBuilder.h:
(WTF::StringBuilder::appendSubstring): Improved logic in appendSubstring so it
will handle even absurd values for offset and length correctly, and added a
default length of "infinity" just like in String::substring.
* wtf/text/StringImpl.cpp:
(WTF::StringImpl::convertToLowercaseWithoutLocale): Use isASCII.
(WTF::StringImpl::convertToLowercaseWithoutLocaleStartingAtFailingIndex8Bit): Ditto.
* wtf/text/WTFString.cpp:
(asciiDebug): Use StringBuilder to build the string; this was the one place that
used appendUnsignedAsHexFixedSize on something else, and there is no need.
2019-12-30 youenn fablet <youenn@apple.com>
Ignore URL host for schemes that are not using host information
https://bugs.webkit.org/show_bug.cgi?id=205157
<rdar://problem/57825963>
Reviewed by Darin Adler.
* wtf/URL.cpp:
(WTF::URL::removeHostAndPort):
* wtf/URL.h:
2019-12-25 Dean Jackson <dino@apple.com>
[WebGL] Enable ANGLE by default for Cocoa platforms (except simulator)
https://bugs.webkit.org/show_bug.cgi?id=205483
rdar://56925821
Reviewed by Simon Fraser.
Turn USE_ANGLE on for Cocoa, with the exception of the simulator.
* wtf/Platform.h:
2019-12-24 Eric Carlson <eric.carlson@apple.com>
[Media in GPU process] Enable media player proxy logging
https://bugs.webkit.org/show_bug.cgi?id=205557
<rdar://problem/58160932>
Reviewed by Youenn Fablet.
* wtf/Logger.h:
(WTF::Logger::willLog const): Minor optimization: don't check m_enabled unnecessarily.
2019-12-23 Keith Miller <keith_miller@apple.com>
DFG/FTL should be able to exit to the middle of a bytecode
https://bugs.webkit.org/show_bug.cgi?id=205232
Reviewed by Saam Barati.
* WTF.xcodeproj/project.pbxproj:
* wtf/Bitmap.h:
(WTF::WordType>::invert):
(WTF::WordType>::operator):
(WTF::WordType>::operator const const):
* wtf/CMakeLists.txt:
* wtf/EnumClassOperatorOverloads.h: Added.
* wtf/FastBitVector.h:
(WTF::FastBitReference::operator bool const):
(WTF::FastBitReference::operator|=):
(WTF::FastBitReference::operator&=):
(WTF::FastBitVector::fill):
(WTF::FastBitVector::grow):
* wtf/UnalignedAccess.h:
(WTF::unalignedLoad):
(WTF::unalignedStore):
2019-12-21 Antti Koivisto <antti@apple.com>
Move Vector HashTraits to HashTraits.h to fix GCC build
https://bugs.webkit.org/show_bug.cgi?id=205540
Reviewed by Zalan Bujtas.
GCC is stricter than LLVM with partial specializations
Error: partial specialization of struct WTF::HashTraits<WTF::Vector<U, otherCapacity, WTF::CrashOnOverflow, 16> >
after instantiation of struct WTF::HashTraits<WTF::Vector<WTF::String> >
* wtf/HashTraits.h:
* wtf/VectorHash.h:
2019-12-20 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r253820.
Broke Mac testing
Reverted changeset:
"Invalidate only affected elements after media query
evaluation changes"
https://bugs.webkit.org/show_bug.cgi?id=205392
https://trac.webkit.org/changeset/253820
2019-12-20 Antti Koivisto <antti@apple.com>
Invalidate only affected elements after media query evaluation changes
https://bugs.webkit.org/show_bug.cgi?id=205392
Reviewed by Zalan Bujtas.
Fix GCC build error
Error: partial specialization of ‘struct WTF::HashTraits<WTF::Vector<U, otherCapacity, WTF::CrashOnOverflow, 16> >’
after instantiation of ‘struct WTF::HashTraits<WTF::Vector<WTF::String> >’
* wtf/HashTraits.h:
* wtf/VectorHash.h:
Move to HashTraits to HashTraits.h so it gets specialized before any instantiation.
2019-12-19 Antti Koivisto <antti@apple.com>
Allow Vectors as hash keys
https://bugs.webkit.org/show_bug.cgi?id=205449
Reviewed by Geoff Garen.
Add traits to allow Vectors of hashable types to act as hash keys.
* WTF.xcodeproj/project.pbxproj:
* wtf/Vector.h:
(WTF::Vector::Vector):
(WTF::Vector::~Vector):
(WTF::Vector::isHashTableDeletedValue const):
Use m_size = numeric_limits::max() as the deleted value.
* wtf/VectorHash.h: Added.
(WTF::VectorHash::hash):
(WTF::VectorHash::equal):
Add traits. Empty Vector is the empty value.
2019-12-19 Jer Noble <jer.noble@apple.com>
Safely iterate observers in languageDidChange()
https://bugs.webkit.org/show_bug.cgi?id=205452
<rdar://problem/57937765>
Reviewed by Eric Carlson.
Use the "copyToVector() then verify each item is still in the original
map" pattern to safely iterate over the observerMap().
* wtf/Language.cpp:
(WTF::languageDidChange):
2019-12-18 Yusuke Suzuki <ysuzuki@apple.com>
Unreviewed, build fix after r253730
https://bugs.webkit.org/show_bug.cgi?id=204398
Thread::destructTLS is always required in POSIX environments
* wtf/Threading.h:
2019-12-18 Fujii Hironori <Hironori.Fujii@sony.com>
[Win] Use thread_local to hold Ref<WTF::Thread> in the thread rather than using FLS
https://bugs.webkit.org/show_bug.cgi?id=204398
Reviewed by Yusuke Suzuki.
Use thread_local which is faster than FLS.
* wtf/Threading.cpp:
(WTF::initializeThreading):
* wtf/Threading.h:
(WTF::Thread::current):
* wtf/ThreadingPrimitives.h: Deleted threadSpecificKeyCreate and
related functions which aren't used now in Windows port. Deleted
THREAD_SPECIFIC_CALL macro which isn't used now.
* wtf/win/ThreadingWin.cpp: Added a thread_local variable s_threadHolder.
(WTF::Thread::ThreadHolder::~ThreadHolder): Added.
(WTF::Thread::currentMayBeNull):
(WTF::Thread::initializeTLS): Store a reference of Thread into s_threadHolder.
(WTF::Thread::initializeTLSKey): Deleted.
(WTF::Thread::destructTLS): Deleted.
2019-12-18 Ben Nham <nham@apple.com>
Add network loading signposts
https://bugs.webkit.org/show_bug.cgi?id=204822
<rdar://problem/57608824>
Reviewed by Alex Christensen.
This adds os_signposts related to network loads to aid in debugging networking performance
issues. Since URLs are logged in the signposts, this capability is only enabled on Apple
internal builds when an environment variable is set.
* wtf/Platform.h:
Add HAVE_OS_SIGNPOST.
2019-12-17 Myles C. Maxfield <mmaxfield@apple.com>
[iOS] Update to use CTFontCreateForCharactersWithLanguageAndOption()
https://bugs.webkit.org/show_bug.cgi?id=205310
Reviewed by Simon Fraser.
All our bots are on the appropriate OS version.
* wtf/Platform.h:
2019-12-17 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] 8Bit JSRopeString can contain 16Bit string in its rope
https://bugs.webkit.org/show_bug.cgi?id=205323
Reviewed by Mark Lam.
* wtf/text/StringImpl.h:
(WTF::StringImpl::copyCharacters):
2019-12-17 Tim Horton <timothy_horton@apple.com>
macCatalyst: Cursor should update on mouse movement and style change
https://bugs.webkit.org/show_bug.cgi?id=205317
<rdar://problem/46793696>
Reviewed by Anders Carlsson.
* wtf/FeatureDefines.h:
Make ENABLE_CURSOR_SUPPORT true on iOS, for macCatalyst. This results
in it being true everywhere, so remove it.
Add a new ENABLE_CUSTOM_CURSOR_SUPPORT, indicating whether we support
custom bitmap cursors. It covers the subset of ENABLE_CURSOR_SUPPORT
code that we still don't support in macCatalyst.
* wtf/Platform.h:
Add HAVE_HISERVICES (true on macOS but not macCatalyst) and
HAVE_NSCURSOR (true on macOS and macCatalyst but not e.g. iOS).
2019-12-16 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Remove ArrayBufferNeuteringWatchpointSet
https://bugs.webkit.org/show_bug.cgi?id=205194
Reviewed by Saam Barati.
This patch adds PackedRef and PackedRefPtr. They are Ref and RefPtr, but its internal pointer is packed.
So we can represent them in 6 bytes with 1 byte alignment.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/Packed.h:
(WTF::alignof):
* wtf/PackedRef.h: Copied from Source/JavaScriptCore/runtime/ArrayBufferNeuteringWatchpointSet.h.
* wtf/PackedRefPtr.h: Renamed from Source/JavaScriptCore/runtime/ArrayBufferNeuteringWatchpointSet.h.
* wtf/RefPtr.h:
(WTF::RefPtr::operator UnspecifiedBoolType const):
(WTF::RefPtr::unspecifiedBoolTypeInstance const):
2019-12-13 Saam Barati <sbarati@apple.com>
Add a Heap::finalize function that takes WTF::Function<void()>
https://bugs.webkit.org/show_bug.cgi?id=205211
Reviewed by Geoffrey Garen.
* wtf/Function.h:
(WTF::Function<Out):
2019-12-13 Per Arne Vollan <pvollan@apple.com>
[iOS] Deny mach lookup access to "*.apple-extension-service" in the WebContent process
https://bugs.webkit.org/show_bug.cgi?id=205134
<rdar://problem/56984257>
Reviewed by Brent Fulgham.
Add enum value for the XPC service name filter type.
* wtf/spi/darwin/SandboxSPI.h:
2019-12-09 Fujii Hironori <Hironori.Fujii@sony.com>
[MSVC] writeNumberToBufferUnsigned is unsafe for bool type
https://bugs.webkit.org/show_bug.cgi?id=204873
Reviewed by Darin Adler.
MSVC reports warning for using / operator for bool type.
> warning C4804: '/': unsafe use of type 'bool' in operation
And, 'bool' isn't expected to be serialized as '0' or '1'. 'bool' isn't supported.
* wtf/text/IntegerToStringConversion.h: Added a static_assert to ensure UnsignedIntegerType isn't bool.
2019-07-13 Darin Adler <darin@apple.com>
Streamline PODIntervalTree code and remove ValueToString
https://bugs.webkit.org/show_bug.cgi?id=199782
Reviewed by Anders Carlsson.
* WTF.xcodeproj/project.pbxproj: Remove ValueToString.h.
* wtf/CMakeLists.txt: Ditto.
* wtf/MediaTime.cpp:
(WTF::operator<<): Implement debug-only TextStream serialization
based on toJSONString.
* wtf/MediaTime.h: Ditto.
* wtf/text/ValueToString.h: Removed.
2019-12-06 Zan Dobersek <zdobersek@igalia.com>
[GTK][WPE] Use bmalloc's memory footprint API for JSC heap growth management
https://bugs.webkit.org/show_bug.cgi?id=204576
Reviewed by Saam Barati.
Add the new USE_BMALLOC_MEMORY_FOOTPRINT_API, enabled for the iOS-family
ports and the Linux ports, as long as system malloc enforcement is
disabled and bmalloc is subsequently built and used. The flag is used in
JavaScriptCore to enable usage of bmalloc's memory footprint API for
JSC heap growth control.
* wtf/Platform.h:
2019-12-05 Chris Dumez <cdumez@apple.com>
[IPC] Fail ObjectIdentifier decoding if the decoded integer is not a valid ID
https://bugs.webkit.org/show_bug.cgi?id=204921
<rdar://problem/57677747>
Reviewed by Ryosuke Niwa.
* wtf/ObjectIdentifier.h:
(WTF::ObjectIdentifier::decode):
2019-12-03 Sunny He <sunny_he@apple.com>
Enable security assertions on all ASAN builds
https://bugs.webkit.org/show_bug.cgi?id=204802
Reviewed by Ryosuke Niwa.
* wtf/FeatureDefines.h:
2019-12-03 Christopher Reid <chris.reid@sony.com>
Regular expression hangs in Safari only
https://bugs.webkit.org/show_bug.cgi?id=202882
<rdar://problem/56236654>
Reviewed by Yusuke Suzuki.
BumpPointerPool::ensureCapacityCrossPool can cause an infinite loop
if multiple large pools are deallocated and a new capacity does not
fit in the deallocated pools. BumpPointerPool should try using
more pools if the next one isn't large enough.
* wtf/BumpPointerAllocator.h:
(WTF::BumpPointerPool::ensureCapacityCrossPool):
2019-11-28 Fujii Hironori <Hironori.Fujii@sony.com>
Remove ENABLE_KEYBOARD_CODE_ATTRIBUTE and ENABLE_KEYBOARD_KEY_ATTRIBUTE macros
https://bugs.webkit.org/show_bug.cgi?id=204666
Reviewed by Ross Kirsling and Don Olmstead.
* wtf/FeatureDefines.h:
2019-11-25 Fujii Hironori <Hironori.Fujii@sony.com>
[Win] Update KeyboardEvent as per the latest specification
https://bugs.webkit.org/show_bug.cgi?id=202183
Reviewed by Ross Kirsling.
* wtf/FeatureDefines.h:
2019-11-25 Fujii Hironori <Hironori.Fujii@sony.com>
Add DefaultHash<OptionSet<T>> and HashTrait<OptionSet<T>> specializations
https://bugs.webkit.org/show_bug.cgi?id=204562
Reviewed by Daniel Bates.
* WTF.xcodeproj/project.pbxproj: Added OptionSetHash.h
* wtf/CMakeLists.txt: Ditto.
* wtf/OptionSet.h: Made StorageType public, and use C++14 types.
* wtf/OptionSetHash.h: Added.
(WTF::DefaultHash<OptionSet<T>>::Hash::hash):
(WTF::DefaultHash<OptionSet<T>>::Hash::equal):
(WTF::HashTraits<OptionSet<T>>::emptyValue):
(WTF::HashTraits<OptionSet<T>>::constructDeletedValue):
(WTF::HashTraits<OptionSet<T>>::isDeletedValue):
2019-11-25 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(r252770): [GTK][WPE] Remote inspector no longer works if debugger is in a different kind of system
https://bugs.webkit.org/show_bug.cgi?id=204572
Reviewed by Žan Doberšek.
This patch adds the following changes:
- Use uint32_t instead of size_t to store the body size in the message header, because size_t has a different
size in 32 and 64 bit platforms.
- Use htonl/ntohl to write/read the body size in the header.
- Add a flags byte to the header to include the message byte order. The sender always uses the host byter order
and the receiver does the byte swapping if needed.
* wtf/glib/SocketConnection.cpp:
(WTF::messageIsByteSwapped):
(WTF::SocketConnection::readMessage):
(WTF::SocketConnection::sendMessage):
2019-11-25 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(r252770): [GTK][WPE] Remote inspector broken in debug builds after r252770
https://bugs.webkit.org/show_bug.cgi?id=204569
Reviewed by Žan Doberšek.
We need to call relaxAdoptionRequirement() in SocketConnection constructor because we are taking a reference for
the read monitor lambda.
* wtf/glib/SocketConnection.cpp:
(WTF::SocketConnection::SocketConnection):
2019-11-25 Fujii Hironori <Hironori.Fujii@sony.com>
Ran sort-Xcode-project-file.
Unreviewed.
* WTF.xcodeproj/project.pbxproj:
2019-11-23 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Try to fix the GTK WebDriver tests in the bots after r252770
They are failing in the bots because g_variant_new_from_data() is failing due to the given data not being
properly aligned for the type being loaded. This is not a problem since GLib 2.60 that checks the alignment and
reallocates the buffer in aligned memory only if needed. For previous versions we need to ensure the memory we
pass to g_variant_new_from_data() is aligned.
* wtf/glib/SocketConnection.cpp:
(WTF::SocketConnection::readMessage):
2019-11-22 Brent Fulgham <bfulgham@apple.com>
Unreviewed FTW build fix after r252687.
* wtf/PlatformFTW.cmake:
2019-11-22 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK][WPE] RemoteInspector: use sockets instead of DBus
https://bugs.webkit.org/show_bug.cgi?id=204503
Reviewed by Žan Doberšek.
Add SocketConnection class.
* wtf/PlatformGTK.cmake:
* wtf/PlatformWPE.cmake:
* wtf/glib/GSocketMonitor.cpp: Renamed from Source/WebKit/Platform/IPC/glib/GSocketMonitor.cpp.
(WTF::GSocketMonitor::start):
* wtf/glib/GSocketMonitor.h: Renamed from Source/WebKit/Platform/IPC/glib/GSocketMonitor.h.
(WTF::GSocketMonitor::isActive const):
* wtf/glib/GTypedefs.h:
* wtf/glib/GUniquePtr.h:
* wtf/glib/SocketConnection.cpp: Added.
(WTF::SocketConnection::SocketConnection):
(WTF::SocketConnection::~SocketConnection):
(WTF::SocketConnection::read):
(WTF::SocketConnection::readMessage):
(WTF::SocketConnection::sendMessage):
(WTF::SocketConnection::write):
(WTF::SocketConnection::waitForSocketWritability):
(WTF::SocketConnection::close):
(WTF::SocketConnection::didClose):
* wtf/glib/SocketConnection.h: Added.
(WTF::SocketConnection::create):
(WTF::SocketConnection::isClosed const):
2019-11-21 Yusuke Suzuki <ysuzuki@apple.com>
Unreviewed, rolling in again, regression is not caused by it
https://bugs.webkit.org/show_bug.cgi?id=202471
* wtf/text/StringCommon.h:
(WTF::findCommon):
2019-11-21 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r252683 and r252721.
https://bugs.webkit.org/show_bug.cgi?id=204475
13% regression in JetStream2/prepack-wtb (Requested by
yusukesuzuki on #webkit).
Reverted changesets:
"Implement String.prototype.replaceAll"
https://bugs.webkit.org/show_bug.cgi?id=202471
https://trac.webkit.org/changeset/252683
"Unreviewed, address Darin's feedback on r252683."
https://trac.webkit.org/changeset/252721
2019-11-21 Tuomas Karkkainen <tuomas.webkit@apple.com>
add ASSERT_NOT_REACHED_WITH_MESSAGE and RELEASE_ASSERT_NOT_REACHED_WITH_MESSAGE
https://bugs.webkit.org/show_bug.cgi?id=204445
Reviewed by Antti Koivisto.
Add assertions that combine ASSERT_NOT_REACHED and ASSERT_WITH_MESSAGE.
* wtf/Assertions.h:
2019-11-20 Ross Kirsling <ross.kirsling@sony.com>
Unreviewed, address Darin's feedback on r252683.
* wtf/text/StringCommon.h:
(WTF::findCommon):
2019-11-20 ChangSeok Oh <changseok@webkit.org>
[GTK] Add ANGLE backend to GTK port
https://bugs.webkit.org/show_bug.cgi?id=199060
Reviewed by Žan Doberšek.
The GTK port uses TEXTURE_MAPPER that has a gl context for accelerated rendering,
and ANGLE has an egl context for WebGL. We want to make both live together
so an exception is made where TEXTURE_MAPPER is enabled.
* wtf/Platform.h:
2019-11-20 Fujii Hironori <Hironori.Fujii@sony.com>
[Win] Implement WTF::ThreadSpecific in WTF::Thread
https://bugs.webkit.org/show_bug.cgi?id=204341
Reviewed by Brent Fulgham and Yusuke Suzuki.
Thread::destructTLS had a tricky code to defer destroying
WTF::Thread in TLS in order to ensure WTF::Thread is destructed
after other ThreadSpecific are destructed, which is a part of
cause of nasty hanging issue in the process termination (Bug 204192).
This change implements WTF::ThreadSpecific in WTF::Thread by
adding a new class Thread::SpecificStorage to manage TLS. Simplify
Thread::destructTLS. Remove threadMapMutex in ThreadingWin.cpp
* wtf/PlatformWin.cmake:
* wtf/ThreadSpecific.h:
(WTF::canBeGCThread>::ThreadSpecific):
(WTF::canBeGCThread>::get):
(WTF::canBeGCThread>::setInTLS):
(WTF::canBeGCThread>::destroy):
(WTF::canBeGCThread>::~ThreadSpecific): Deleted.
* wtf/Threading.h:
(WTF::Thread::specificStorage):
(WTF::Thread::current):
* wtf/win/ThreadSpecificWin.cpp: Removed.
* wtf/win/ThreadingWin.cpp:
(WTF::Thread::initializeTLSKey):
(WTF::Thread::initializeTLS):
(WTF::Thread::destructTLS):
(WTF::Thread::SpecificStorage::allocateKey):
(WTF::Thread::SpecificStorage::get):
(WTF::Thread::SpecificStorage::set):
(WTF::Thread::SpecificStorage::destroySlots):
(): Deleted.
(WTF::Thread::currentDying): Deleted.
(WTF::Thread::get): Deleted.
2019-11-19 Ross Kirsling <ross.kirsling@sony.com>
Implement String.prototype.replaceAll
https://bugs.webkit.org/show_bug.cgi?id=202471
Reviewed by Yusuke Suzuki.
* wtf/text/StringCommon.h:
(WTF::findCommon):
Fix logic: "start > length" early out should come before "empty search string" early out.
2019-11-19 Yusuke Suzuki <ysuzuki@apple.com>
[IndexedDB] IndexedDB's threading assertion should respect Web thread
https://bugs.webkit.org/show_bug.cgi?id=204346
Reviewed by Daniel Bates.
* wtf/MainThread.cpp:
(WTF::canCurrentThreadAccessThreadLocalData):
(WTF::canAccessThreadLocalDataForThread): Deleted.
* wtf/MainThread.h:
* wtf/cocoa/MainThreadCocoa.mm:
(WTF::canCurrentThreadAccessThreadLocalData):
(WTF::canAccessThreadLocalDataForThread): Deleted.
2019-11-18 Fujii Hironori <Hironori.Fujii@sony.com>
Remove self-defined C++14 features in StdLibExtras.h
https://bugs.webkit.org/show_bug.cgi?id=204220
Reviewed by Ross Kirsling.
Remove std::conjunction, std::in_place_t and std::make_unique definitions.
Remove unsued std::clz.
* wtf/StdLibExtras.h:
(std::make_unique): Deleted.
(std::exchange): Deleted.
(std::clz): Deleted.
2019-11-18 Alex Christensen <achristensen@webkit.org>
Use SecTrustEvaluateWithError instead of SecTrustEvaluate where available
https://bugs.webkit.org/show_bug.cgi?id=204159
<rdar://problem/45894288>
Reviewed by Darin Adler.
* wtf/Platform.h:
2019-11-15 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Remove index-masking on ScopedArguments and put it in IsoSubspace
https://bugs.webkit.org/show_bug.cgi?id=204269
Reviewed by Saam Barati.
* wtf/MathExtras.h:
(WTF::computeIndexingMask): Deleted.
(WTF::preciseIndexMaskShiftForSize): Deleted.
(WTF::preciseIndexMaskShift): Deleted.
(WTF::opaque): Deleted.
(WTF::preciseIndexMaskPtr): Deleted.
2019-11-14 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] BlockDirectory's bits should be compact
https://bugs.webkit.org/show_bug.cgi?id=204149
Reviewed by Robin Morisset.
* wtf/FastBitVector.h:
(WTF::fastBitVectorArrayLength):
(WTF::FastBitVectorImpl::unsafeWords):
(WTF::FastBitVectorImpl::unsafeWords const):
(WTF::FastBitReference::FastBitReference):
(WTF::FastBitReference::operator bool const):
(WTF::FastBitReference::operator=):
(WTF::FastBitVector::at):
(WTF::FastBitVector::operator[]):
(WTF::FastBitVector::BitReference::BitReference): Deleted.
(WTF::FastBitVector::BitReference::operator bool const): Deleted.
(WTF::FastBitVector::BitReference::operator=): Deleted.
2019-11-11 Ross Kirsling <ross.kirsling@sony.com>
UTC offset for Samoa is miscalculated when !HAVE(TIMEGM)
https://bugs.webkit.org/show_bug.cgi?id=204032
Reviewed by Yusuke Suzuki.
We have code assuming that the world's time zones haven't changed in the past decade,
but Samoa changed from UTC-11 to UTC+13 at the beginning of 2012.
(Note: "Samoa" here means the Independent State of Samoa (Pacific/Apia) and not American Samoa (Pacific/Samoa).
See https://en.wikipedia.org/wiki/Time_in_Samoa for more information.)
* wtf/DateMath.cpp:
(WTF::calculateUTCOffset):
Update "canned date" from 2009 to 2019.
2019-11-07 Mark Lam <mark.lam@apple.com>
Add a stack overflow check in Yarr::ByteCompiler::emitDisjunction().
https://bugs.webkit.org/show_bug.cgi?id=203936
<rdar://problem/56624724>
Reviewed by Saam Barati.
1. Add a StackCheck utility class so that we don't have to keep reinventing this
every time we need to add stack checking somewhere.
2. Rename some arguments and constants in StackBounds to be more descriptive of
what they actually are.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/StackBounds.h:
(WTF::StackBounds::recursionLimit const):
* wtf/StackCheck.h: Added.
(WTF::StackCheck::StackCheck):
(WTF::StackCheck::isSafeToRecurse):
2019-11-06 Mark Lam <mark.lam@apple.com>
Remove remnants of support code for an upwards growing stack.
https://bugs.webkit.org/show_bug.cgi?id=203942
Reviewed by Yusuke Suzuki.
We haven't supported an upwards growing stack in years, and a lot of code has
since been written specifically with only a downwards growing stack in mind (e.g.
the LLInt, the JITs). Also, all our currently supported platforms use a downward
growing stack.
We should remove the remnants of support code for an upwards growing stack. The
presence of that code is deceptive in that it conveys support for an upwards
growing stack where this hasn't been the case in years.
* wtf/StackBounds.cpp:
(WTF::StackBounds::newThreadStackBounds):
(WTF::StackBounds::currentThreadStackBoundsInternal):
(WTF::StackBounds::stackDirection): Deleted.
(WTF::testStackDirection2): Deleted.
(WTF::testStackDirection): Deleted.
* wtf/StackBounds.h:
(WTF::StackBounds::size const):
(WTF::StackBounds::contains const):
(WTF::StackBounds::recursionLimit const):
(WTF::StackBounds::StackBounds):
(WTF::StackBounds::isGrowingDownwards const):
(WTF::StackBounds::checkConsistency const):
(WTF::StackBounds::isGrowingDownward const): Deleted.
* wtf/StackStats.cpp:
(WTF::StackStats::CheckPoint::CheckPoint):
(WTF::StackStats::CheckPoint::~CheckPoint):
(WTF::StackStats::probe):
(WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint):
2019-11-05 Mark Lam <mark.lam@apple.com>
WTF::RunLoop should not depend on isMainThread() idiom.
https://bugs.webkit.org/show_bug.cgi?id=203873
<rdar://problem/56524251>
Reviewed by Saam Barati, Ryosuke Niwa, and Devin Rousso.
The isMainThread() idiom is only meaningful for WebCore. It is less meaningful
for JSC since a VM instance can be entered from multiple threads, as long as only
one thread enters it at any time. Hence, the concept of a main thread doesn't
make sense at the JSC level.
Since r251036, we started using a WTF::String to represent the RunLoop mode.
This caused problems for JSC clients when USE(CF) since it necessitated the use of
StringWrapperCFAllocator to track the life cycle of the CFStringRef generated from
the WTF::String.
To fix this problem, we should restore the original behavior of using CFStringRefs
as the RunLoop mode token.
* wtf/RunLoop.h:
(WTF::RunLoop::cycle): Deleted.
* wtf/cf/RunLoopCF.cpp:
(WTF::RunLoop::cycle):
* wtf/generic/RunLoopGeneric.cpp:
(WTF::RunLoop::cycle):
* wtf/glib/RunLoopGLib.cpp:
(WTF::RunLoop::cycle):
* wtf/win/RunLoopWin.cpp:
(WTF::RunLoop::cycle):
2019-11-05 Tuomas Karkkainen <tuomas.webkit@apple.com>
Add definitions of ANSI colors for colorful log output
https://bugs.webkit.org/show_bug.cgi?id=203805
Reviewed by Saam Barati.
* WTF.xcodeproj/project.pbxproj:
* wtf/AnsiColors.h: Added.
* wtf/CMakeLists.txt:
2019-11-05 Tuomas Karkkainen <tuomas.webkit@apple.com>
move CrashReporterClientSPI.h and parts of WKCrashReporter to WTF so it can be used in JavaScriptCore
https://bugs.webkit.org/show_bug.cgi?id=203803
Reviewed by Saam Barati.
* WTF.xcodeproj/project.pbxproj:
* wtf/PlatformMac.cmake:
* wtf/cocoa/CrashReporter.cpp: Added.
(WTF::setCrashLogMessage):
* wtf/cocoa/CrashReporter.h: Added.
* wtf/spi/cocoa/CrashReporterClientSPI.h: Renamed from Source/WebKit/Platform/spi/Cocoa/CrashReporterClientSPI.h.
2019-11-02 Devin Rousso <drousso@apple.com>
Web Inspector: Add diagnostic logging for frontend feature usage
https://bugs.webkit.org/show_bug.cgi?id=203579
<rdar://problem/56717410>
Reviewed by Brian Burg.
Original patch by Matt Baker <mattbaker@apple.com>.
* wtf/FeatureDefines.h:
Add `ENABLE_INSPECTOR_TELEMETRY`, which is only enabled for macOS.
2019-11-01 Devin Rousso <drousso@apple.com>
Web Inspector: Timelines: add a timeline that shows information about any recorded CSS animation/transition
https://bugs.webkit.org/show_bug.cgi?id=203651
<rdar://problem/56128726>
Reviewed by Brian Burg.
* wtf/Markable.h:
(WTF::operator==):
(WTF::operator!=):
Add extra utility operators.
2019-10-31 Tim Horton <timothy_horton@apple.com>
Turn on IOSurface support in the iOS Simulator
https://bugs.webkit.org/show_bug.cgi?id=203026
<rdar://problem/56320993>
Reviewed by Simon Fraser.
* wtf/Platform.h:
Turn on HAVE(IOSURFACE) and USE(IOSURFACE_CANVAS_BACKING_STORE) in the simulator.
Add HAVE(IOSURFACE_COREIMAGE_SUPPORT).
2019-10-31 Jer Noble <jer.noble@apple.com>
[EME] Batch multiple key requests into one request and response
https://bugs.webkit.org/show_bug.cgi?id=203580
<rdar://problem/54853345>
Reviewed by Eric Carlson.
Support appending an r-value reference Vector to another.
* wtf/Vector.h:
(WTF::minCapacity>::appendVector):
2019-10-31 Alex Christensen <achristensen@webkit.org>
Remove unneeded HAVE_TIMINGDATAOPTIONS
https://bugs.webkit.org/show_bug.cgi?id=202990
Reviewed by Brady Eidson.
* wtf/Platform.h:
2019-10-31 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] DateMath should have TimeClipped version
https://bugs.webkit.org/show_bug.cgi?id=203550
Reviewed by Saam Barati.
We found that our Date constructor is slow because GregorianDateTime calculation takes so long.
We are doing many `fmod`, floating division, `floor` etc. These operations, in particular `fmod`, takes
very long time. As a result, 30% of JetStream2/date-format-xparb is taken by `fmod` function.
But since we are performance timeClip operation, double value in DateInstance is always Int52. We should
have integer version of GregorianDateTime calculation which avoids many unnecessary fmod etc.
While integer division is truncate-to-zero, many Date calculation requires `floor(value / xxx)`. For now,
we use integer fast path only when the value is Int52 and positive.
We see 10~ % improvement in JetStream2/date-format-xparb-SP (from 201 to 239).
* wtf/DateMath.cpp:
(WTF::isLeapYear): Deleted.
(WTF::daysInYear): Deleted.
(WTF::daysFrom1970ToYear): Deleted.
(WTF::msToDays): Deleted.
(WTF::msToYear): Deleted.
(WTF::dayInYear): Deleted.
(WTF::msToMinutes): Deleted.
(WTF::msToHours): Deleted.
(WTF::monthFromDayInYear): Deleted.
(WTF::checkMonth): Deleted.
(WTF::dayInMonthFromDayInYear): Deleted.
(WTF::dateToDaysFrom1970): Deleted.
(WTF::timeClip): Deleted.
* wtf/DateMath.h:
(WTF::TimeClippedPositiveMilliseconds::TimeClippedPositiveMilliseconds):
(WTF::TimeClippedPositiveMilliseconds::value const):
(WTF::TimeClippedPositiveMilliseconds::asDouble const):
(WTF::timeClip):
(WTF::daysFrom1970ToYear):
(WTF::daysFrom1970ToYearTimeClippedPositive):
(WTF::isLeapYear):
(WTF::daysInYear):
(WTF::msToDays):
(WTF::dayInYear):
(WTF::dateToDaysFrom1970):
(WTF::msToYear):
(WTF::msToMinutes):
(WTF::msToHours):
(WTF::msToSeconds):
(WTF::msToWeekDay):
(WTF::monthFromDayInYear):
(WTF::dayInMonthFromDayInYear):
* wtf/GregorianDateTime.cpp:
(WTF::GregorianDateTime::GregorianDateTime):
* wtf/GregorianDateTime.h:
2019-10-30 Alex Christensen <achristensen@webkit.org>
Prevent Mac CMake build from bit rotting
https://bugs.webkit.org/show_bug.cgi?id=203647
Reviewed by Tim Horton.
* wtf/PlatformMac.cmake:
2019-10-30 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Date functions should have intrinsic
https://bugs.webkit.org/show_bug.cgi?id=202187
Reviewed by Keith Miller.
* wtf/DateMath.h:
* wtf/GregorianDateTime.cpp:
(WTF::GregorianDateTime::setToCurrentLocalTime):
* wtf/GregorianDateTime.h:
2019-10-30 Per Arne Vollan <pvollan@apple.com>
It should be possible to create a mach sandbox extension for the WebContent process before the audit token is known
https://bugs.webkit.org/show_bug.cgi?id=203618
Reviewed by Brent Fulgham.
Added SPI to create mach extension without PID or audit token.
* wtf/spi/darwin/SandboxSPI.h:
2019-10-30 Daniel Bates <dabates@apple.com>
Add pretty printer for CompactPointerTuple
https://bugs.webkit.org/show_bug.cgi?id=203495
Reviewed by Jer Noble.
#include <wtf/FastMalloc.h> for the definition of WTF_MAKE_FAST_ALLOCATED.
* wtf/CompactPointerTuple.h:
2019-10-29 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Add fast path for String#localeCompare
https://bugs.webkit.org/show_bug.cgi?id=202676
Reviewed by Mark Lam.
* wtf/text/StringView.h:
(WTF::StringView::isAllASCII const):
2019-10-26 Chris Lord <clord@igalia.com>
Put OffscreenCanvas behind a build flag
https://bugs.webkit.org/show_bug.cgi?id=203146
Reviewed by Ryosuke Niwa.
* wtf/FeatureDefines.h:
2019-10-25 Andy Estes <aestes@apple.com>
[Quick Look] Move the QLPreviewConverter delegate into PreviewConverter and vend a C++ client interface
https://bugs.webkit.org/show_bug.cgi?id=203396
Reviewed by Alex Christensen.
* wtf/FeatureDefines.h: Defined ENABLE_PREVIEW_CONVERTER.
2019-10-23 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Figure out missing prepareCallOperation
https://bugs.webkit.org/show_bug.cgi?id=203285
Reviewed by Mark Lam.
Enable USE(BUILTIN_FRAME_ADDRESS) regardless of platform is the compilers and architectures match.
* wtf/Platform.h:
2019-10-23 Tim Horton <timothy_horton@apple.com>
macCatalyst: Should dispatch contextmenu event on right click
https://bugs.webkit.org/show_bug.cgi?id=203316
<rdar://problem/54617376>
Reviewed by Wenson Hsieh.
* wtf/FeatureDefines.h:
2019-10-23 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r251261.
This broke multiple tests
Reverted changeset:
"Using version 1 CFRunloopSource for faster task dispatch"
https://bugs.webkit.org/show_bug.cgi?id=202874
https://trac.webkit.org/changeset/251261
2019-10-23 Myles C. Maxfield <mmaxfield@apple.com>
[iOS] Remove Hiragino Sans site-specific quirk for Yahoo Japan
https://bugs.webkit.org/show_bug.cgi?id=203345
Reviewed by Simon Fraser.
* wtf/Platform.h:
2019-10-22 Yusuke Suzuki <ysuzuki@apple.com>
Make `JSGlobalObject*` threading change more stabilized by adding tests and assertions
https://bugs.webkit.org/show_bug.cgi?id=203274
Reviewed by Saam Barati.
* wtf/Platform.h:
2019-10-22 Antti Koivisto <antti@apple.com>
operator==(Vector, Vector) should work with different inline capacities
https://bugs.webkit.org/show_bug.cgi?id=203245
Reviewed by Alex Christensen.
Also allow different overflow behavior and minimum capacity.
* wtf/Vector.h:
(WTF::operator==):
(WTF::operator!=):
2019-10-22 Rob Buis <rbuis@igalia.com>
https://bugs.webkit.org/show_bug.cgi?id=169667
URL: protocol setter needs to be more restrictive around file
Reviewed by Alex Christensen.
Restrict setting protocol to "file" as indictaed in the spec [1].
Test: imported/w3c/web-platform-tests/url/url-setters.html
[1] https://url.spec.whatwg.org/#scheme-state steps 2.1.3 and 2.1.4.
* wtf/URL.cpp:
(WTF::URL::setProtocol):
2019-10-21 Tim Horton <timothy_horton@apple.com>
macCatalyst: Swipe navigation gestures do not work
https://bugs.webkit.org/show_bug.cgi?id=203205
<rdar://problem/54617473>
Reviewed by Wenson Hsieh.
* wtf/Platform.h:
Add a new HAVE.
2019-10-20 Mark Lam <mark.lam@apple.com>
Remove all uses of untagCodePtr in debugging code.
https://bugs.webkit.org/show_bug.cgi?id=203188
<rdar://problem/56453043>
Reviewed by Yusuke Suzuki.
We want the ability to always assert on failure to authenticate in untagCodePtr
(though we don't currently do that yet).
* wtf/PtrTag.cpp:
(WTF::tagForPtr):
* wtf/PtrTag.h:
(WTF::retagCodePtrImpl):
(WTF::tagCFunctionPtrImpl):
(WTF::untagCFunctionPtrImpl):
(WTF::assertIsCFunctionPtr):
(WTF::isTaggedWith):
2019-10-19 Simon Fraser <simon.fraser@apple.com>
Add support to TextStream for dumping HashMap<> and HashSet<>
https://bugs.webkit.org/show_bug.cgi?id=202969
Reviewed by Dean Jackson.
Make it possible to output HashMap<> and HashSet<> to TextStream,
so long as key and value types are streamable. Also implement operator<<(char)
so that chars show as ASCII, rather than numbers.
* wtf/text/TextStream.cpp:
(WTF::TextStream::operator<<):
* wtf/text/TextStream.h:
(WTF::operator<<):
2019-10-18 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Make ConcurrentJSLock Lock even if ENABLE_CONCURRENT_JS=OFF
https://bugs.webkit.org/show_bug.cgi?id=202892
Reviewed by Mark Lam.
BaselineJIT also has concurrent compiler. ENABLE(CONCURRENT_JS) should not rely on ENABLE(DFG_JIT).
It should rely on ENABLE(JIT) instead.
* wtf/Platform.h:
2019-10-17 Mark Lam <mark.lam@apple.com>
Use constexpr in more places and remove some unnecessary external linkage.
https://bugs.webkit.org/show_bug.cgi?id=203115
Reviewed by Yusuke Suzuki.
Also removed unused lockSpinLimit in Threading.h.
* wtf/MD5.h:
* wtf/SHA1.h:
* wtf/StackBounds.h:
* wtf/Threading.h:
2019-10-17 Sihui Liu <sihui_liu@apple.com>
Using version 1 CFRunloopSource for faster task dispatch
https://bugs.webkit.org/show_bug.cgi?id=202874
Reviewed by Geoffrey Garen.
We used CFRunLoopWakeUp to wake up runloop to process source, which seems to be slow according to profiling. To
avoid calling CFRunLoopWakeUp, we should use version 1 CFRunloopSource instead of version 0. This patch brings
about 15% speedup for test PerformanceTests/IndexedDB/basic/objectstore-get.html.
* wtf/RunLoop.cpp:
(WTF::RunLoop::initializeWebRunLoop):
(WTF::RunLoop::web):
* wtf/RunLoop.h:
* wtf/cf/RunLoopCF.cpp:
(WTF::RunLoop::performWork):
(WTF::RunLoop::RunLoop):
(WTF::RunLoop::~RunLoop):
(WTF::RunLoop::wakeUp):
* wtf/cocoa/MainThreadCocoa.mm:
(WTF::initializeMainThreadPlatform):
(WTF::scheduleDispatchFunctionsOnMainThread):
(WTF::initializeWebThread):
(-[JSWTFMainThreadCaller call]): Deleted.
2019-10-16 Wenson Hsieh <wenson_hsieh@apple.com>
Unreviewed, fix the internal macOS 10.13 and 10.14 builds after r251171
* wtf/Platform.h: Add a HAVE() macro for AXClientType, which is only available on macOS 10.15+ SDKs.
2019-10-15 Chris Dumez <cdumez@apple.com>
[macOS] Simplify main thread initialization
https://bugs.webkit.org/show_bug.cgi?id=203001
Reviewed by Geoff Garen.
Simplify main thread initialization on macOS by always using pthread main as main thread.
The complexity is now isolated to the USE(WEB_THREAD) code path.
This patch also adds a debug assertion in WTF::initializeWebThreadPlatform() to make sure
it gets called on the actual main thread. In release, it will log a fault message indicating
it was called on the wrong thread.
* wtf/MainThread.cpp:
* wtf/MainThread.h:
* wtf/RefCounted.h:
(WTF::RefCountedBase::RefCountedBase):
(WTF::RefCountedBase::applyRefDerefThreadingCheck const):
* wtf/cocoa/MainThreadCocoa.mm:
(WTF::initializeMainThreadPlatform):
(WTF::scheduleDispatchFunctionsOnMainThread):
(WTF::initializeWebThreadPlatform):
(WTF::canAccessThreadLocalDataForThread):
(WTF::isMainThread):
* wtf/generic/MainThreadGeneric.cpp:
* wtf/text/cf/StringImplCF.cpp:
(WTF::StringImpl::createCFString):
* wtf/win/MainThreadWin.cpp:
2019-10-14 Tim Horton <timothy_horton@apple.com>
Unify sources for bindings more densely
https://bugs.webkit.org/show_bug.cgi?id=202918
Reviewed by Simon Fraser.
* Scripts/generate-unified-source-bundles.rb:
Add an option to separate and more densely unify sources that match
a given glob pattern.
2019-10-14 Keith Rollin <krollin@apple.com>
Remove some support for < iOS 13
https://bugs.webkit.org/show_bug.cgi?id=202820
<rdar://problem/56164838>
Reviewed by Anders Carlsson.
Remove some support for iOS versions less than 13.0.
Update conditionals that reference __IPHONE_OS_VERSION_MIN_REQUIRED
and __IPHONE_OS_VERSION_MAX_ALLOWED, assuming that they both have
values >= 130000. This means that expressions like
"__IPHONE_OS_VERSION_MIN_REQUIRED < 101300" are always False and
"__IPHONE_OS_VERSION_MIN_REQUIRED >= 101300" are always True.
This removal is part of a series of patches effecting the removal of
dead code for old versions of iOS. This particular pass involves
changes in which Devin Rousso was involved. These changes are isolated
from other similar changes in order to facilitate the reviewing
process.
* wtf/Platform.h:
2019-10-14 Alex Christensen <achristensen@webkit.org>
REGRESSION: [iOS 13?] TestWebKitAPI.SharedBufferTest.tryCreateArrayBufferLargeSegments is failing
https://bugs.webkit.org/show_bug.cgi?id=201902
Reviewed by Ryosuke Niwa.
* wtf/Vector.h:
The code introduced in r108153 to workaround a warning when building Chrome was causing us to use uninitialized memory
when we create a Vector with the size_t/{signed,unsigned}char constructor with a constexpr size_t.
This was the cause of bug 201902 and bug 201620 which only manifested themselves in release builds with some compilers.
2019-10-14 Per Arne Vollan <pvollan@apple.com>
[macOS] Sandbox extensions should be created with audit tokens, not PIDs
https://bugs.webkit.org/show_bug.cgi?id=201828
Reviewed by Brent Fulgham.
Remove HAVE macro for issuing sandbox extension by PID, and fix version checks for the HAVE
macros related to issuing sandbox extensions by audit token. Remove SPI for creating
extensions by PID, and add SPI for creating mach extension by audit token. Also remove an
unneeded flag.
* wtf/Platform.h:
* wtf/spi/darwin/SandboxSPI.h:
2019-10-08 Ryosuke Niwa <rniwa@webkit.org>
Make WebInspector's remote debug EventLoop code into RunLoop
https://bugs.webkit.org/show_bug.cgi?id=202716
Reviewed by Joseph Pecoraro.
This patch merges WebInspector's EventLoop code into RunLoop as a static function.
* wtf/RunLoop.h:
(WTF::RunLoop::cycle):
* wtf/cf/RunLoopCF.cpp:
(WTF::RunLoop::cycle): Added.
* wtf/generic/RunLoopGeneric.cpp:
(WTF::RunLoop::cycle): Added.
* wtf/glib/RunLoopGLib.cpp:
(WTF::RunLoop::cycle): Added.
* wtf/win/RunLoopWin.cpp:
(WTF::RunLoop::cycle): Added.
2019-10-10 Ryosuke Niwa <rniwa@webkit.org>
Make it safe to store a ThreadSafeRefCounted object in Ref & RefPtr safe inside its destructor
https://bugs.webkit.org/show_bug.cgi?id=201576
Reviewed by Geoffrey Garen and Mark Lam.
This patch leaves m_refCount 1 inside the last deref call to ThreadSafeRefCounted
so that storing an instance of this object in Ref or RefPtr would not trigger a recursive delete.
Note: this patch does not try to fix a race condition by which another thread tries to ref()
this object after the "last" call to deref had happened since such a code would ref() this object
long after it had been removed (UAF), nor some code calling deref() before calling ref() inside
a destructor since there is no way to defend against unpaired calls to ref() & deref() like that.
Also added m_deletionHasBegun like RefCounted.
* wtf/ThreadSafeRefCounted.h:
(WTF::ThreadSafeRefCountedBase::ref const):
(WTF::ThreadSafeRefCountedBase::hasOneRef const):
(WTF::ThreadSafeRefCountedBase::derefBase const):
2019-10-11 Alex Christensen <achristensen@webkit.org>
Only use CFNetwork SPI for metrics where needed
https://bugs.webkit.org/show_bug.cgi?id=202825
Reviewed by Joseph Pecoraro.
* wtf/Platform.h:
2019-10-11 Keith Rollin <krollin@apple.com>
Remove some support for < iOS 13
https://bugs.webkit.org/show_bug.cgi?id=202819
<rdar://problem/56164233>
Reviewed by Anders Carlsson.
Remove some support for iOS versions less than 13.0.
Update conditionals that reference __IPHONE_OS_VERSION_MIN_REQUIRED
and __IPHONE_OS_VERSION_MAX_ALLOWED, assuming that they both have
values >= 130000. This means that expressions like
"__IPHONE_OS_VERSION_MIN_REQUIRED < 101300" are always False and
"__IPHONE_OS_VERSION_MIN_REQUIRED >= 101300" are always True.
This removal is part of a series of patches effecting the removal of
dead code for old versions of iOS. This particular pass involves
changes in which Jiewen Tan was involved. These changes are isolated
from other similar changes in order to facilitate the reviewing
process.
* wtf/Platform.h:
2019-10-11 Jonathan Bedard <jbedard@apple.com>
Unreviewed, rolling out r250945.
Broke 18 Debug API tests
Reverted changeset:
"Add support for CompactPointerTuple<..., OptionSet<...>>"
https://bugs.webkit.org/show_bug.cgi?id=201316
https://trac.webkit.org/changeset/250945
2019-10-11 Xabier Rodriguez Calvar <calvaris@igalia.com>
MediaTime pretty printer can print if time is invalid
https://bugs.webkit.org/show_bug.cgi?id=202735
Reviewed by Eric Carlson.
* wtf/MediaTime.cpp:
(WTF::MediaTime::toString const): Append ", invalid" if isInvalid().
(WTF::MediaTime::toJSONObject const): Set boolean invalid to true
when invalid.
2019-10-09 Keith Rollin <krollin@apple.com>
Remove some support for < iOS 13
https://bugs.webkit.org/show_bug.cgi?id=202371
<rdar://problem/55853960>
Reviewed by Youenn Fablet.
Remove some support for iOS versions less than 13.0.
Update conditionals that reference __IPHONE_OS_VERSION_MIN_REQUIRED
and __IPHONE_OS_VERSION_MAX_ALLOWED, assuming that they both have
values >= 130000. This means that expressions like
"__IPHONE_OS_VERSION_MIN_REQUIRED < 101300" are always False and
"__IPHONE_OS_VERSION_MIN_REQUIRED >= 101300" are always True.
This removal is part of a series of patches effecting the removal of
dead code for old versions of iOS. This particular pass involves
changes in which Dean Jackson was involved. These changes are isolated
from other similar changes in order to facilitate the reviewing
process.
* wtf/FeatureDefines.h:
* wtf/Platform.h:
2019-10-09 Daniel Bates <dabates@apple.com>
Add support for CompactPointerTuple<..., OptionSet<...>>
https://bugs.webkit.org/show_bug.cgi?id=201316
Reviewed by Yusuke Suzuki.
Support using an OptionSet<> for the byte value portion of a CompactPointerTuple so that
you can encode both a pointer and 8-bit bitmask in a type-safe way. Another benefit of
supporting OptionSet<> is that we have a LLDB pretty-printer for it so this makes it easy
to see the set flags in such a CompactPointerTuple.
* wtf/CompactPointerTuple.h:
2019-10-09 Russell Epstein <repstein@apple.com>
Unreviewed, rolling out r250930.
Broke watchOS Builds
Reverted changeset:
"Add support for CompactPointerTuple<..., OptionSet<...>>"
https://bugs.webkit.org/show_bug.cgi?id=201316
https://trac.webkit.org/changeset/250930
2019-10-09 Daniel Bates <dabates@apple.com>
Add support for CompactPointerTuple<..., OptionSet<...>>
https://bugs.webkit.org/show_bug.cgi?id=201316
Reviewed by Yusuke Suzuki.
Support using an OptionSet<> for the byte value portion of a CompactPointerTuple so that
you can encode both a pointer and 8-bit bitmask in a type-safe way. Another benefit of
supporting OptionSet<> is that we have a LLDB pretty-printer for it so this makes it easy
to see the set flags in such a CompactPointerTuple.
* wtf/CompactPointerTuple.h:
2019-10-08 Robin Morisset <rmorisset@apple.com>
dataLogIf should be ALWAYS_INLINE
https://bugs.webkit.org/show_bug.cgi?id=202703
Reviewed by Saam Barati.
We often have the following pattern:
```
static constexpr bool verbose = false;
...
dataLogLnIf(verbose, "Something is happening");
```
To make sure that these are always properly eliminated I'd like to make dataLogIf/dataLogLnIf ALWAYS_INLINE.
We may as well mark the branch as UNLIKELY too, for the cases where the condition comes from Options::verboseSomething() and is only known at runtime.
* wtf/DataLog.h:
(WTF::dataLogIf):
(WTF::dataLogLnIf):
2019-10-07 Alexey Proskuryakov <ap@apple.com>
Build failure in WebHTMLView.mm with the public SDK (Xcode 11 and Mojave)
https://bugs.webkit.org/show_bug.cgi?id=199705
Patch by Dan Bernstein and Kenneth Russell.
Reviewed by Alexey Proskuryakov.
* wtf/Platform.h: Added HAVE_SUBVIEWS_IVAR_DECLARED_BY_SDK.
2019-10-04 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r250762.
https://bugs.webkit.org/show_bug.cgi?id=202609
Broke JSC tests by breaking refCount check in
DropAllLocks::DropAllLocks (Requested by rniwa on #webkit).
Reverted changeset:
"Make a ThreadSafeRefCounted object safe to ref & deref inside
its destructor"
https://bugs.webkit.org/show_bug.cgi?id=201576
https://trac.webkit.org/changeset/250762
2019-10-04 Ryosuke Niwa <rniwa@webkit.org>
Build fix for macOS Catalina.
* wtf/spi/darwin/SandboxSPI.h:
2019-10-04 Ryosuke Niwa <rniwa@webkit.org>
Make a ThreadSafeRefCounted object safe to ref & deref inside its destructor
https://bugs.webkit.org/show_bug.cgi?id=201576
Reviewed by Geoffrey Garen.
This patch leaves m_refCount 1 inside the last deref call to ThreadSafeRefCounted
such that ref'ing and deref'ing it again inside its destructor would never try
to double delete the object.
Also added m_deletionHasBegun like RefCounted.
* wtf/ThreadSafeRefCounted.h:
(WTF::ThreadSafeRefCountedBase::ref const):
(WTF::ThreadSafeRefCountedBase::hasOneRef const):
(WTF::ThreadSafeRefCountedBase::derefBase const):
2019-10-04 Heiko Becker <heirecka@exherbo.org>
Fix build with icu 65.1
https://bugs.webkit.org/show_bug.cgi?id=202600
Reviewed by Konstantin Tokarev.
* wtf/URLHelpers.cpp:
(WTF::URLHelpers::allCharactersInIDNScriptWhiteList):
2019-10-04 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r250583.
Broke multiple internal API tests
Reverted changeset:
"[JSC] Place VM* in TLS"
https://bugs.webkit.org/show_bug.cgi?id=202391
https://trac.webkit.org/changeset/250583
2019-10-03 Keith Rollin <krollin@apple.com>
Remove some support for < iOS 13
https://bugs.webkit.org/show_bug.cgi?id=202549
<rdar://problem/55967232>
Reviewed by Alex Christensen.
Remove some support for iOS versions less than 13.0.
Update conditionals that reference __IPHONE_OS_VERSION_MIN_REQUIRED
and __IPHONE_OS_VERSION_MAX_ALLOWED, assuming that they both have
values >= 130000. This means that expressions like
"__IPHONE_OS_VERSION_MIN_REQUIRED < 101300" are always False and
"__IPHONE_OS_VERSION_MIN_REQUIRED >= 101300" are always True.
This removal is part of a series of patches effecting the removal of
dead code for old versions of iOS. This particular pass involves
changes in which Michael Saboff was involved. These changes are
isolated from other similar changes in order to facilitate the
reviewing process.
* wtf/spi/darwin/ProcessMemoryFootprint.h:
2019-10-03 Per Arne Vollan <pvollan@apple.com>
REGRESSION(249649): Unable to open local files in MiniBrowser on macOS
https://bugs.webkit.org/show_bug.cgi?id=201798
Reviewed by Brent Fulgham.
Add HAVE_AUDIT_TOKEN and SANDBOX_ISSUE_READ_EXTENSION_TO_PROCESS_BY_AUDIT_TOKEN defines.
* wtf/Platform.h:
2019-10-02 Myles C. Maxfield <mmaxfield@apple.com>
REGRESSION (r245672): <select> dropdown with text-rendering: optimizeLegibility freezes Safari
https://bugs.webkit.org/show_bug.cgi?id=202198
Reviewed by Tim Horton.
* wtf/Platform.h:
2019-10-02 Mark Lam <mark.lam@apple.com>
DoubleToStringConverter::ToExponential() should null terminate its string.
https://bugs.webkit.org/show_bug.cgi?id=202492
<rdar://problem/55907708>
Reviewed by Filip Pizlo.
* wtf/dtoa/double-conversion.cc:
- DoubleToStringConverter::DoubleToAscii() always produces a null terminated
string. Fixed the padding loop in DoubleToStringConverter::ToExponential()
that follows it to also keep the null terminator.
* wtf/dtoa/utils.h:
(WTF::double_conversion::StringBuilder::AddSubstring):
- An assertion in here was using strlen() which indicates that it expects a null
terminator in the incoming string. However, this requirement is too restrictive.
The code does not actually depend on the string having a null terminator, only
that a null terminator does not manifest before the nth character. Changed
the assertion to use strnlen() instead to reflect this.
2019-10-02 Zan Dobersek <zdobersek@igalia.com>
[Nicosia] Enable async scrolling at build-time for Nicosia-using ports
https://bugs.webkit.org/show_bug.cgi?id=202397
Reviewed by Carlos Garcia Campos.
* wtf/Platform.h:
Flip ENABLE_KINETIC_SCROLLING to 1 also for PlayStation and WPE ports
when ASYNC_SCROLLING is enabled.
2019-10-01 Jonathan Bedard <jbedard@apple.com>
WebKitTestRunner: Many tests timeout on macOS Catalina
https://bugs.webkit.org/show_bug.cgi?id=201616
<rdar://problem/55200897>
Reviewed by Alexey Proskuryakov.
* wtf/Platform.h: USE_SOURCE_APPLICATION_AUDIT_DATA should only be enabled on
builds which allow restricted entitlements.
2019-10-01 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Place VM* in TLS
https://bugs.webkit.org/show_bug.cgi?id=202391
Reviewed by Mark Lam.
Changed FastTLS's key name from WTF_GC_TLC_KEY to WTF_VM_KEY.
* wtf/FastTLS.h:
2019-10-01 Keith Rollin <krollin@apple.com>
Remove some support for < iOS 13
https://bugs.webkit.org/show_bug.cgi?id=202386
<rdar://problem/55863017>
Reviewed by Eric Carlson.
Remove some support for iOS versions less than 13.0.
Update conditionals that reference __IPHONE_OS_VERSION_MIN_REQUIRED
and __IPHONE_OS_VERSION_MAX_ALLOWED, assuming that they both have
values >= 130000. This means that expressions like
"__IPHONE_OS_VERSION_MIN_REQUIRED < 101300" are always False and
"__IPHONE_OS_VERSION_MIN_REQUIRED >= 101300" are always True.
This removal is part of a series of patches effecting the removal of
dead code for old versions of iOS. This particular pass involves
changes in which Jer Noble was involved. These changes are isolated
from other similar changes in order to facilitate the reviewing
process.
* wtf/Platform.h:
2019-09-30 Alex Christensen <achristensen@webkit.org>
Resurrect Mac CMake build
https://bugs.webkit.org/show_bug.cgi?id=202384
Rubber-stamped by Tim Horton.
* wtf/PlatformMac.cmake:
2019-09-30 Mark Lam <mark.lam@apple.com>
Add some assertions to convertUTF8ToUTF16().
https://bugs.webkit.org/show_bug.cgi?id=202356
<rdar://problem/52846813>
Reviewed by Filip Pizlo.
* wtf/unicode/UTF8Conversion.cpp:
(WTF::Unicode::convertUTF8ToUTF16):
2019-09-30 Guillaume Emont <guijemont@igalia.com>
Don't try to use backtrace() on MIPS
https://bugs.webkit.org/show_bug.cgi?id=202196
Reviewed by Carlos Garcia Campos.
backtrace() on mips seems to always return 1 on mips/glibc (I tried
with buildroot, debian stable and debian testing, with and without
libunwind), which renders it useless and breaks a RELEASE_ASSERT in
StackTrace::captureStackTrace().
* wtf/Platform.h:
2019-09-29 Keith Rollin <krollin@apple.com>
Address static analysis warning in ParkingLot.cpp: Access to field 'size' results in a dereference of a null pointer
https://bugs.webkit.org/show_bug.cgi?id=202154
<rdar://problem/55672103>
Reviewed by Brent Fulgham.
Static analysis reports the following:
.../OpenSource/Source/WTF/wtf/ParkingLot.cpp:376:30: warning: Access to field 'size' results in a dereference of a null pointer (loaded from variable 'oldHashtable')
RELEASE_ASSERT(newSize > oldHashtable->size);
^~~~~~~~~~~~~~~~~~
This warning arises because earlier code checks to see if oldHashtable
is NULL, leading the static analyzer to think that it *could* be NULL.
However, even earlier code actually ensures that oldHashtable will not
be NULL. Address this by removing the NULL check, and back it up with
an ASSERT to ensure that it's not NULL.
* wtf/ParkingLot.cpp:
2019-09-26 Alexey Shvayka <shvaikalesh@gmail.com>
toExponential, toFixed, and toPrecision should allow arguments up to 100
https://bugs.webkit.org/show_bug.cgi?id=199163
Reviewed by Ross Kirsling.
Increase size of NumberToStringBuffer: <21 digits> + decimal point + <100 digits> + null char = 123.
Increase kMaxFixedDigitsAfterPoint to make Number.prototype.toFixed work with arguments up to 100.
Also update other constants to their correct values.
* wtf/dtoa.h:
* wtf/dtoa/double-conversion.cc:
* wtf/dtoa/double-conversion.h:
2019-09-25 Keith Rollin <krollin@apple.com>
Address static analysis warning in UTextProviderLatin1.cpp: Array access results in a null pointer dereference
https://bugs.webkit.org/show_bug.cgi?id=202155
<rdar://problem/55672422>
Reviewed by Geoffrey Garen.
Xcode's static analysis reports:
.../OpenSource/Source/WTF/wtf/text/icu/UTextProviderLatin1.cpp:185:22: warning: Array access (from variable 'dest') results in a null pointer dereference
dest[length] = 0;
~~~~ ^
This error is due to an earlier "if" statement that caused the static
analyzer to infer that "dest" could be NULL. It turns out that that
previous check was in error, in that it tested for "!dest" when it
should have tested for "dest". So this patch fixes that.
Even with that error fixed, the static analyzer will still infer that
"dest" could be NULL at the point shown above. Therefore, add a "dest"
test just before the assignment.
* wtf/text/icu/UTextProviderLatin1.cpp:
(WTF::uTextLatin1Extract):
2019-09-25 Wenson Hsieh <wenson_hsieh@apple.com>
[iPadOS] [DataActivation] Focus moves away after focusing input fields on www.att.com
https://bugs.webkit.org/show_bug.cgi?id=202167
<rdar://problem/55185021>
Reviewed by Tim Horton.
Declare DYLD_IOS_VERSION_13_2.
* wtf/spi/darwin/dyldSPI.h:
2019-09-24 Keith Rollin <krollin@apple.com>
Coalesce or remove PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
https://bugs.webkit.org/show_bug.cgi?id=202119
<rdar://problem/55638792>
Reviewed by Alex Christensen.
After refactoring and other code evolution, some platform checks have
ended up looking like PLATFORM(MAC) || PLATFORM(IOS_FAMILY) (or
vice-versa). These can be converted into the equivalent
PLATFORM(COCOA). Where the instance occurs in a Cocoa-only file, the
check can be removed altogether (along with any "#else" branches).
* wtf/Platform.h:
* wtf/text/TextBreakIterator.h:
2019-09-21 David Kilzer <ddkilzer@apple.com>
clang-tidy: Fix unnecessary copy/ref churn of for loop variables in WTF/JavaScriptCore
<https://webkit.org/b/202069>
Reviewed by Mark Lam.
Fix unwanted copying/ref churn of loop variables by making them
const references.
* wtf/AggregateLogger.h:
(WTF::AggregateLogger::log const):
2019-09-20 Keith Rollin <krollin@apple.com>
Remove some support for < iOS 13
https://bugs.webkit.org/show_bug.cgi?id=201967
<rdar://problem/55504738>
Reviewed by Andy Estes.
Remove some support for iOS versions less than 13.0.
Update conditionals that reference __IPHONE_OS_VERSION_MIN_REQUIRED
and __IPHONE_OS_VERSION_MAX_ALLOWED, assuming that they both have
values >= 130000. This means that expressions like
"__IPHONE_OS_VERSION_MIN_REQUIRED < 101300" are always False and
"__IPHONE_OS_VERSION_MIN_REQUIRED >= 101300" are always True.
After version checks have been removed, there are some cases where the
preprocessor conditional looks like "#if PLATFORM(MAC) ||
PLATFORM(IOS_FAMILY)". These can be collapsed into "#if
PLATFORM(COCOA)". This additional cleanup will be performed in a
subsequent patch.
This removal is part of a series of patches effecting the removal of
dead code for old versions of iOS. This particular pass involves
changes in which Andy Estes was involved. These changes are isolated
from other similar changes in order to facilitate the reviewing
process.
* wtf/FeatureDefines.h:
2019-09-20 Keith Rollin <krollin@apple.com>
Remove some support for < iOS 13
https://bugs.webkit.org/show_bug.cgi?id=201973
<rdar://problem/55506966>
Reviewed by Alex Christensen.
Remove some support for iOS versions less than 13.0.
Update conditionals that reference __IPHONE_OS_VERSION_MIN_REQUIRED
and __IPHONE_OS_VERSION_MAX_ALLOWED, assuming that they both have
values >= 130000. This means that expressions like
"__IPHONE_OS_VERSION_MIN_REQUIRED < 101300" are always False and
"__IPHONE_OS_VERSION_MIN_REQUIRED >= 101300" are always True.
This removal is part of a series of patches effecting the removal of
dead code for old versions of iOS. This particular pass involves
changes in which Chris Dumez was involved. These changes are isolated
from other similar changes in order to facilitate the reviewing
process.
* wtf/FeatureDefines.h:
2019-09-20 Paulo Matos <pmatos@igalia.com>
Implement memory monitoring functions for Linux OS
https://bugs.webkit.org/show_bug.cgi?id=200391
Reviewed by Žan Doberšek.
* wtf/PlatformGTK.cmake:
* wtf/PlatformJSCOnly.cmake:
* wtf/PlatformWPE.cmake:
* wtf/linux/ProcessMemoryFootprint.h: Added.
(ProcessMemoryFootprint::now):
(ProcessMemoryFootprint::resetPeak):
2019-09-20 Libor Bukata <libor.bukata@oracle.com>
UI process crash when using callOnMainThread() after the main thread dispatcher has been destroyed
https://bugs.webkit.org/show_bug.cgi?id=197266
Reviewed by Carlos Garcia Campos.
* wtf/generic/MainThreadGeneric.cpp:
(WTF::scheduleDispatchFunctionsOnMainThread):
2019-09-17 Mark Lam <mark.lam@apple.com>
Use constexpr instead of const in symbol definitions that are obviously constexpr.
https://bugs.webkit.org/show_bug.cgi?id=201879
Rubber-stamped by Joseph Pecoraro.
* wtf/Assertions.cpp:
* wtf/AutomaticThread.cpp:
* wtf/BitVector.h:
* wtf/Bitmap.h:
* wtf/BloomFilter.h:
* wtf/Brigand.h:
* wtf/CheckedArithmetic.h:
* wtf/CrossThreadCopier.h:
* wtf/CurrentTime.cpp:
* wtf/DataLog.cpp:
* wtf/DateMath.cpp:
(WTF::daysFrom1970ToYear):
* wtf/DeferrableRefCounted.h:
* wtf/GetPtr.h:
* wtf/HashFunctions.h:
* wtf/HashMap.h:
* wtf/HashTable.h:
* wtf/HashTraits.h:
* wtf/JSONValues.cpp:
* wtf/JSONValues.h:
* wtf/ListHashSet.h:
* wtf/Lock.h:
* wtf/LockAlgorithm.h:
* wtf/LockAlgorithmInlines.h:
(WTF::Hooks>::lockSlow):
* wtf/Logger.h:
* wtf/LoggerHelper.h:
(WTF::LoggerHelper::childLogIdentifier const):
* wtf/MainThread.cpp:
* wtf/MetaAllocatorPtr.h:
* wtf/MonotonicTime.h:
* wtf/NaturalLoops.h:
(WTF::NaturalLoops::NaturalLoops):
* wtf/ObjectIdentifier.h:
* wtf/RAMSize.cpp:
* wtf/Ref.h:
* wtf/RefPtr.h:
* wtf/RetainPtr.h:
* wtf/SchedulePair.h:
* wtf/StackShot.h:
* wtf/StdLibExtras.h:
* wtf/TinyPtrSet.h:
* wtf/URL.cpp:
* wtf/URLHash.h:
* wtf/URLParser.cpp:
(WTF::URLParser::defaultPortForProtocol):
* wtf/Vector.h:
* wtf/VectorTraits.h:
* wtf/WallTime.h:
* wtf/WeakHashSet.h:
* wtf/WordLock.h:
* wtf/cocoa/CPUTimeCocoa.cpp:
* wtf/cocoa/MemoryPressureHandlerCocoa.mm:
* wtf/persistence/PersistentDecoder.h:
* wtf/persistence/PersistentEncoder.h:
* wtf/text/AtomStringHash.h:
* wtf/text/CString.h:
* wtf/text/StringBuilder.cpp:
(WTF::expandedCapacity):
* wtf/text/StringHash.h:
* wtf/text/StringImpl.h:
* wtf/text/StringToIntegerConversion.h:
(WTF::toIntegralType):
* wtf/text/SymbolRegistry.h:
* wtf/text/TextStream.cpp:
(WTF::hasFractions):
* wtf/text/WTFString.h:
* wtf/text/cocoa/TextBreakIteratorInternalICUCocoa.cpp:
2019-09-16 Alex Christensen <achristensen@webkit.org>
Remove "gopher" from list of special schemes in URLParser
https://bugs.webkit.org/show_bug.cgi?id=201852
Reviewed by Simon Fraser.
There is little meaningful content on gopher servers, and WebKit does not actually support gopher.
This makes WebKit match the behavior of Gecko and goes along with a change proposed at
https://github.com/whatwg/url/issues/342
* wtf/URLParser.cpp:
(WTF::URLParser::defaultPortForProtocol):
(WTF::scheme):
(WTF::URLParser::copyURLPartsUntil):
(WTF::URLParser::parse):
2019-09-14 Yusuke Suzuki <ysuzuki@apple.com>
Retire x86 32bit JIT support
https://bugs.webkit.org/show_bug.cgi?id=201790
Reviewed by Mark Lam.
* wtf/Platform.h:
2019-09-13 Jonathan Bedard <jbedard@apple.com>
iOS 13: Some SPI targets 13.1
https://bugs.webkit.org/show_bug.cgi?id=201777
Reviewed by Alexey Proskuryakov.
* wtf/Platform.h:
2019-09-12 Mark Lam <mark.lam@apple.com>
Harden JSC against the abuse of runtime options.
https://bugs.webkit.org/show_bug.cgi?id=201597
<rdar://problem/55167068>
Reviewed by Filip Pizlo.
Add a source file that was missing so that Xcode can search its contents too.
* WTF.xcodeproj/project.pbxproj:
2019-09-09 Tim Horton <timothy_horton@apple.com>
Clarify some macCatalyst feature flags
https://bugs.webkit.org/show_bug.cgi?id=201619
<rdar://problem/54615618>
Reviewed by Megan Gardner.
* wtf/Platform.h:
We prefer specific flags over platform checks.
2019-09-07 David Quesada <david_quesada@apple.com>
REGRESSION(r248533): Unable to use WTF::RefCounted when building in a debug configuration against a non-debug WebKit
https://bugs.webkit.org/show_bug.cgi?id=201585
rdar://problem/55153369
Reviewed by Chris Dumez.
Export WTF::RefCountedBase::areThreadingChecksEnabledGlobally regardless of whether or not assertions
are enabled for the WTF being built. This allows WebKit-based projects to use RefCounted for their own
objects in a debug configuration without requiring a debug build of WebKit.
* wtf/RefCounted.cpp:
* wtf/RefCounted.h:
2019-09-07 Mark Lam <mark.lam@apple.com>
performJITMemcpy() source buffer should not be in the Gigacage.
https://bugs.webkit.org/show_bug.cgi?id=201577
<rdar://problem/55142606>
Reviewed by Michael Saboff.
* wtf/Gigacage.h:
(Gigacage::contains):
2019-09-06 Mark Lam <mark.lam@apple.com>
Harden protection of the Gigacage Config parameters.
https://bugs.webkit.org/show_bug.cgi?id=201570
<rdar://problem/55134229>
Reviewed by Saam Barati.
Just renaming some function names here.
* wtf/Gigacage.h:
(Gigacage::forbidDisablingPrimitiveGigacage):
(Gigacage::isDisablingPrimitiveGigacageForbidden):
(Gigacage::disableDisablingPrimitiveGigacageIfShouldBeEnabled): Deleted.
(Gigacage::isDisablingPrimitiveGigacageDisabled): Deleted.
2019-09-05 Mark Lam <mark.lam@apple.com>
Refactor the Gigacage code to require less pointer casting.
https://bugs.webkit.org/show_bug.cgi?id=201521
Reviewed by Saam Barati.
Remove some unneeded stubs in WTF Gigacage.h.
* wtf/Gigacage.cpp:
* wtf/Gigacage.h:
(Gigacage::name):
(Gigacage::isEnabled):
(Gigacage::basePtr): Deleted.
(Gigacage::basePtrs): Deleted.
2019-08-30 Alex Christensen <achristensen@webkit.org>
Remove HAVE_CFNETWORK_WITH_AUTO_ADDED_HTTP_HEADER_SUPPRESSION_SUPPORT conditional
https://bugs.webkit.org/show_bug.cgi?id=201280
Reviewed by Youenn Fablet.
* wtf/Platform.h:
2019-08-30 Alex Christensen <achristensen@webkit.org>
Remove HAVE_CFNETWORK_WITH_IGNORE_HSTS conditional
https://bugs.webkit.org/show_bug.cgi?id=201279
Reviewed by Darin Adler.
* wtf/Platform.h:
2019-08-30 Alex Christensen <achristensen@webkit.org>
Fix non-iOS iOS-family and catalyst builds after r249019
https://bugs.webkit.org/show_bug.cgi?id=200945
* wtf/Platform.h:
State that they have tls_protocol_version_t
2019-08-30 Simon Fraser <simon.fraser@apple.com>
Add system tracing points for compositing updates, and touch-event dispatching
https://bugs.webkit.org/show_bug.cgi?id=201327
Reviewed by Alex Christensen.
* wtf/SystemTracing.h:
2019-08-30 Keith Rollin <krollin@apple.com>
Remove AppKitCompatibilityDeclarations.h
https://bugs.webkit.org/show_bug.cgi?id=201283
<rdar://problem/54822042>
Reviewed by Alexey Proskuryakov.
The two copies of these files -- on in WTF, one in MiniBrowser -- are
empty and can be removed.
* WTF.xcodeproj/project.pbxproj:
* wtf/PlatformMac.cmake:
* wtf/mac/AppKitCompatibilityDeclarations.h: Removed.
2019-08-29 Keith Rollin <krollin@apple.com>
Remove HAVE_PASSKIT_GRANULAR_ERRORS conditional
https://bugs.webkit.org/show_bug.cgi?id=201278
<rdar://problem/54821052>
Reviewed by Alex Christensen.
HAVE_PASSKIT_GRANULAR_ERRORS is always True, so remove the conditional
tests, keeping the True branches and removing the False branches.
* wtf/FeatureDefines.h:
2019-08-29 Keith Rollin <krollin@apple.com>
Update .xcconfig symbols to reflect the current set of past and future product versions.
https://bugs.webkit.org/show_bug.cgi?id=200720
<rdar://problem/54305032>
Reviewed by Alex Christensen.
Remove version symbols related to old OS's we no longer support,
ensure that version symbols are defined for OS's we do support.
* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
2019-08-29 Keith Rollin <krollin@apple.com>
Remove 32-bit macOS support
https://bugs.webkit.org/show_bug.cgi?id=201282
<rdar://problem/54821667>
Reviewed by Anders Carlsson.
WebKit doesn’t support 32-bit Mac any more, so remove checks and code
for that platform.
* wtf/Platform.h:
2019-08-29 Chris Dumez <cdumez@apple.com>
CompletionHandler default constructor does not initialize `m_wasConstructedOnMainThread`
https://bugs.webkit.org/show_bug.cgi?id=201249
Reviewed by Joseph Pecoraro and Alex Christensen.
* wtf/CompletionHandler.h:
(WTF::CompletionHandler<Out):
2019-08-29 Chris Dumez <cdumez@apple.com>
Crash when mach_port_deallocate() returns KERN_INVALID_NAME
https://bugs.webkit.org/show_bug.cgi?id=201248
<rdar://problem/54813890>
Reviewed by Alex Christensen.
* wtf/cocoa/MachSendRight.cpp:
(WTF::deallocateSendRightSafely):
2019-08-25 Fujii Hironori <Hironori.Fujii@sony.com>
Regression(r248533) Assertion hit in isMainThread() for some clients using WTF because the main thread is not initialized
https://bugs.webkit.org/show_bug.cgi?id=201083
<rdar://problem/54651993>
Unreviewed build fox for Windows.
* wtf/win/MainThreadWin.cpp:
(WTF::isMainThreadInitialized): Added.
2019-08-23 Jiewen Tan <jiewen_tan@apple.com>
Unreviewed, build fix after r249059
* wtf/Platform.h:
Make HAVE_NEAR_FIELD available only on iOS 13+ and macOS Catalina+.
2019-08-23 Chris Dumez <cdumez@apple.com>
Regression(r248533) Assertion hit in isMainThread() for some clients using WTF because the main thread is not initialized
https://bugs.webkit.org/show_bug.cgi?id=201083
Reviewed by Alex Christensen.
An assertion is hit in isMainThread() for some clients using WTF because the main thread is not initialized, since r248533.
Clients can work around this by calling WTF::initializeMainThread() before using WTF but it seems unfortunate to force them
to do so. I propose we disable the assertion until the main thread is initialized.
* wtf/MainThread.h:
* wtf/RefCounted.h:
(WTF::RefCountedBase::RefCountedBase):
(WTF::RefCountedBase::applyRefDerefThreadingCheck const):
* wtf/cocoa/MainThreadCocoa.mm:
(WTF::isMainThreadInitialized):
* wtf/generic/MainThreadGeneric.cpp:
(WTF::isMainThreadInitialized):
2019-08-21 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthn] Support NFC authenticators for iOS
https://bugs.webkit.org/show_bug.cgi?id=188624
<rdar://problem/43354214>
Reviewed by Chris Dumez.
* wtf/Platform.h:
Add a feature flag for NearField.
2019-08-22 Andy Estes <aestes@apple.com>
[watchOS] Disable Content Filtering in the simulator build
https://bugs.webkit.org/show_bug.cgi?id=201047
Reviewed by Tim Horton.
* wtf/Platform.h:
2019-08-22 Keith Rollin <krollin@apple.com>
Remove support for tvOS < 13.0
https://bugs.webkit.org/show_bug.cgi?id=200963
<rdar://problem/54541355>
Reviewed by Tim Horton.
Update conditionals that reference __TV_OS_VERSION_MIN_REQUIRED and
__TV_OS_VERSION_MAX_ALLOWED, assuming that they both have values >=
130000. This means that expressions like "__TV_OS_VERSION_MIN_REQUIRED
< 130000" are always False and "__TV_OS_VERSION_MIN_REQUIRED >=
130000" are always True.
* wtf/FeatureDefines.h:
* wtf/Platform.h:
2019-08-22 Kate Cheney <katherine_cheney@apple.com>
Logging in FileSystem::deleteFile should avoid logging unsurprising errors
https://bugs.webkit.org/show_bug.cgi?id=200831
Reviewed by Chris Dumez.
To avoid overlogging unnecessary information, added a check to avoid logging
ENOENT (file not found) errors.
* wtf/posix/FileSystemPOSIX.cpp:
(WTF::FileSystemImpl::deleteFile):
2019-08-22 Alex Christensen <achristensen@webkit.org>
Disable legacy TLS versions and add a temporary default to re-enable it
https://bugs.webkit.org/show_bug.cgi?id=200945
Reviewed by Brady Eidson.
* wtf/Platform.h:
2019-08-22 Darin Adler <darin@apple.com>
Rename StringBuilder functions to avoid unclear "append uninitialized" terminology
https://bugs.webkit.org/show_bug.cgi?id=201020
Reviewed by Alex Christensen.
* wtf/text/StringBuilder.cpp:
(WTF::StringBuilder::allocateBuffer): Use std::memcpy instead of just memcpy.
(WTF::StringBuilder::extendBufferForAppending): Renamed.
(WTF::StringBuilder::extendBufferForAppendingWithoutOverflowCheck): Ditto.
(WTF::StringBuilder::extendBufferForAppending8): Ditto.
(WTF::StringBuilder::extendBufferForAppending16): Ditto.
(WTF::StringBuilder::extendBufferForAppendingSlowPath): Ditto.
(WTF::StringBuilder::appendCharacters): Updated for new names.
* wtf/text/StringBuilder.h: Updated for new names.
2019-08-17 Darin Adler <darin@apple.com>
Use makeString and multi-argument StringBuilder::append instead of less efficient multiple appends
https://bugs.webkit.org/show_bug.cgi?id=200862
Reviewed by Ryosuke Niwa.
* wtf/DateMath.cpp:
(WTF::makeRFC2822DateString): Use one append instead of multiple.
* wtf/JSONValues.cpp:
(WTF::appendDoubleQuotedString): Ditto.
2019-08-21 Mark Lam <mark.lam@apple.com>
Fix infinite recursion in WTFCrashWithInfo() after r248930.
https://bugs.webkit.org/show_bug.cgi?id=201022
Reviewed by Saam Barati.
* wtf/Assertions.cpp:
(WTFCrashWithInfoImpl):
(WTFCrashWithInfo): Deleted.
* wtf/Assertions.h:
(WTFCrashWithInfo):
2019-08-21 Chris Dumez <cdumez@apple.com>
registrableDomainsToRemoveWebsiteDataFor() does not need to return a HashMap
https://bugs.webkit.org/show_bug.cgi?id=200985
Reviewed by John Wilander.
Allow calling crossThreadCopy() on a std::pair<>.
* wtf/CrossThreadCopier.h:
2019-08-21 Keith Rollin <krollin@apple.com>
Remove support for watchOS < 6.0
https://bugs.webkit.org/show_bug.cgi?id=200937
<rdar://problem/54524009>
Reviewed by Darin Adler.
Update conditionals that reference __WATCH_OS_VERSION_MIN_REQUIRED and
__WATCH_OS_VERSION_MAX_ALLOWED, assuming that they both have values >=
60000. This means that expressions like
"__WATCH_OS_VERSION_MIN_REQUIRED < 60000" are always False and
"__WATCH_OS_VERSION_MIN_REQUIRED >= 60000" are always True.
* wtf/FeatureDefines.h:
* wtf/Platform.h:
2019-08-20 Mark Lam <mark.lam@apple.com>
Make it easier to pass pointers to WTFCrashWithInfo.
https://bugs.webkit.org/show_bug.cgi?id=200960
Reviewed by Saam Barati and Yusuke Suzuki.
Now, we don't have to explicitly cast them to uint64_ts first. The template
wrappers will take care of it for us.
* wtf/Assertions.h:
(wtfCrashArg):
(WTFCrashWithInfo):
(WTF::isIntegralOrPointerType):
(WTF::isIntegralType): Deleted.
2019-08-20 Saam Barati <sbarati@apple.com>
Unreviewed. Followup to r248903. It's not valid to remove
hasOverflowed() checks from appendCharacters.
* wtf/text/StringBuilder.cpp:
(WTF::StringBuilder::appendCharacters):
2019-08-20 Darin Adler <darin@apple.com>
Variadic StringBuilder::append does not handle upconverting from 8-bit to 16-bit correctly
https://bugs.webkit.org/show_bug.cgi?id=200921
Reviewed by Saam Barati.
* wtf/text/StringBuilder.cpp:
(WTF::StringBuilder::appendUninitialized8): Renamed from
appendUninitializedWithoutOverflowCheckForLChar and moved the length overflow
check in here to cut down on unnecessary inlining and code size.
(WTF::StringBuilder::appendUninitialized16): Renamed from
appendUninitializedWithoutOverflowCheckForUChar, moved the length overflow check
in here, and moved the necessary upconversion code from the const UChar* overload of
the appendCharacters function.
(WTF::StringBuilder::appendCharacters): Removed unneeded "length has already overflowed"
check at the start of the function since the code in the function already handles that
case correctly. Refactored the const UChar* overload to use the new appendCharacters16
function so it can share more code with StringBuilder::appendFromAdapters.
* wtf/text/StringBuilder.h:
(WTF::StringBuilder::appendFromAdapters): Updated the function names for the
two appendUninitialized functions, which now do a bit more than before. Removed the
overflow check since the appendUninitialized8/16 functions now handle that; better to
not make the inlined code larger to handle a failure case.
2019-08-19 Sam Weinig <weinig@apple.com>
[WHLSL] Make generated Metal code should be indented properly to ease reading while debugging
https://bugs.webkit.org/show_bug.cgi?id=200870
Reviewed by Saam Barati.
Adds simple Indentation class to allow programatic indenting compatible with StringTypeAdapter
aware functions/class (e.g. makeString and StringBuilder). Templatized on the number of spaces
to indent.
Also adds IndentationScope, which uses RAII to increment/decrement the indentation value.
* wtf/text/StringConcatenate.h:
(WTF::Indentation::operator++):
(WTF::Indentation::operator--):
(WTF::IndentationScope::IndentationScope):
(WTF::IndentationScope::~IndentationScope):
2019-08-19 Per Arne Vollan <pvollan@apple.com>
Unreviewed build fix for macOS 10.14 after r248832.
* wtf/Platform.h:
2019-08-19 Yusuke Suzuki <ysuzuki@apple.com>
[WTF] Add makeUnique<T>, which ensures T is fast-allocated, actual static_assert part
https://bugs.webkit.org/show_bug.cgi?id=200620
Reviewed by Geoff Garen.
This is the last part of the split patch from https://bugs.webkit.org/show_bug.cgi?id=200620.
Expose T::webkitFastMalloced type to perform static_assert in makeUnique.
makeUnique and makeUniqueRef start performing static_assert check to ensure that the type T is FastMalloced / IsoHeaped.
* wtf/FastMalloc.h:
* wtf/StdLibExtras.h:
(WTF::makeUnique):
* wtf/UniqueRef.h:
(WTF::makeUniqueRef):
2019-08-18 Yusuke Suzuki <ysuzuki@apple.com>
[WTF] Add makeUnique<T>, which ensures T is fast-allocated, makeUnique / makeUniqueWithoutFastMallocCheck part
https://bugs.webkit.org/show_bug.cgi?id=200620
Reviewed by Geoff Garen.
This patch is second part of bug 200620 patch. I split I split it into three pieces to make roll-out easy.
his part, we convert std::make_unique to WTF::makeUnique or WTF::makeUniqueWithoutFastMallocCheck.
In the third patch, we will add a static_assert to makeUnique, which ensures the given class T is FastMalloced or IsoHeaped.
This patch adds `WTF::makeUnique<T>` and `WTF::makeUniqueWithoutFastMallocCheck<T>` as drop-in replacement for `std::make_unique<T>`.
`WTF::makeUnique<T>` has one additional `static_assert` check which ensures `T` FastMalloc / IsoHeap annotated. If it is not, the
compile error happens.
In this patch, I tried using this everywhere in WebKit as much as possible. And we found that surprisingly many classes are missing
FastMalloc annotation and allocated from system-malloc. Using WTF::makeUnique enforces classes / structs to use FastMalloc.
WTF::makeUniqueWithoutFastMallocCheck is offered for the corner cases. This is identical to std::make_unique. We use this for classes
that are offered by non-WebKit code base, like, zlib. This clear name can make us easily find this allocation is intentionally done
by system-malloc.
We do not take the following direction, `WTF::makeUnique` automatically allocates FastMalloc even if FastMalloc annotation is not attached.
Since default deleter is performing `delete` and this is not what we want for FastMalloced ones, we need to return
std::unique_ptr<T, FastFreeDeleter> for T if T does not have FastMalloc-annotation. Automatically doing this sounds a bit dangerous.
auto pointer = WTF::makeUnique<T>();
// Super dangerous, but sometimes it is required...
auto* rawPointer = pointer.release();
// Passing rawPointer to somewhere, and
delete rawPointer;
The above one becomes invalid because pointer may start requiring non `delete` destroying function.
In the above case, the correct way becomes the following.
rawPointer->~T();
fastFree(rawPointer);
This looks non-intuitive. And having two ways to destroying objects (`delete` or the above one) can be error-prone.
If we have WTF_MAKE_FAST_ALLOCATED for T, we do not need to care about this. "new" and "delete" operators are defined, and C++ way works.
The simple invariant, "makeUnique just does `new` internally. And `delete` operator does `delete`. default deleter is just doing `delete`", is kept.
While we need to annotate many classes with WTF_MAKE_FAST_ALLOCATED, it is one time cost when we add a class.
And, by introducing `WTF::makeUnique<>`, we no longer forget adding this.
makeUnique(...)
static_assert(T is FastMalloced or IsoHeaped);
return make_unique<T>(...)
* benchmarks/LockFairnessTest.cpp:
* benchmarks/LockSpeedTest.cpp:
* wtf/ConcurrentVector.h:
* wtf/CrossThreadTaskHandler.cpp:
(WTF::CrossThreadTaskHandler::taskRunLoop):
* wtf/FilePrintStream.cpp:
(WTF::FilePrintStream::open):
* wtf/Function.h:
(WTF::Function<Out):
* wtf/HashTable.h:
(WTF::KeyTraits>::HashTable):
* wtf/MemoryPressureHandler.cpp:
(WTF::MemoryPressureHandler::setShouldUsePeriodicMemoryMonitor):
* wtf/StdLibExtras.h:
(WTF::makeUnique):
(WTF::makeUniqueWithoutFastMallocCheck):
* wtf/StreamBuffer.h:
(WTF::StreamBuffer::append):
* wtf/UniqueRef.h:
(WTF::makeUniqueRefWithoutFastMallocCheck):
(WTF::makeUniqueRef):
* wtf/glib/RunLoopGLib.cpp:
(WTF::RunLoop::dispatchAfter):
* wtf/text/StringView.cpp:
(WTF::StringView::GraphemeClusters::Iterator::Iterator):
2019-08-18 Per Arne Vollan <pvollan@apple.com>
[Mac] Use the PID of the WebContent process when issuing local file read sandbox extensions
https://bugs.webkit.org/show_bug.cgi?id=200543
<rdar://problem/49394015>
Reviewed by Brent Fulgham.
Add new SPI.
* wtf/Platform.h:
* wtf/spi/darwin/SandboxSPI.h:
2019-08-17 Darin Adler <darin@apple.com>
Tidy up checks to see if a character is in the Latin-1 range by using isLatin1 consistently
https://bugs.webkit.org/show_bug.cgi?id=200861
Reviewed by Ross Kirsling.
* wtf/text/StringBuilder.cpp:
(WTF::StringBuilder::appendCharacters): Use isLatin1 and also call append rather than
calling appendCharacters, since it's the same thing, inlined, and removes the need for
a local variable. Also tweaked the idiom of the code using memcpy.
(WTF::StringBuilder::canShrink const): Reworded a comment.
* wtf/text/StringBuilder.h:
(WTF::StringBuilder::append): Use isLatin1.
* wtf/text/StringCommon.h:
(WTF::isLatin1): Moved this function template here so it can be used here.
(WTF::find): Use isLatin1.
* wtf/text/StringImpl.h:
(WTF::isLatin1): Deleted. Moved to StringCommon.h.
(WTF::reverseFind): Use isLatin1.
(WTF::isSpaceOrNewline): Ditto.
2019-08-17 Eric Liang <ericliang@apple.com>
Added HAVE_ACCESSIBILITY_BUNDLES_PATH
https://bugs.webkit.org/show_bug.cgi?id=200367
Reviewed by Darin Adler.
* wtf/Platform.h:
2019-08-17 Sam Weinig <weinig@apple.com>
Rename StringBuilder::flexibleAppend(...) to StringBuilder::append(...)
https://bugs.webkit.org/show_bug.cgi?id=200756
Reviewed by Darin Adler.
Now that there are no remaining multi-parameter or behavior changing overloads
of StringBuilder::append(...), we can rename StringBuilder::flexibleAppend(...)
to StringBuilder::append(...).
This change leaves the existing single parameter overloads StringBuilder::append(...)
for now, and since they have specify specific types, they will continue to be prefered
in overload resolution. Once we have concluded the variadic StringBuilder::append(...)
can provide the same performance as the single parameter variant, we can remove the
single parameter variant.
* wtf/posix/FileSystemPOSIX.cpp:
(WTF::FileSystemImpl::pathByAppendingComponents):
* wtf/text/StringBuilder.h:
(WTF::StringBuilder::appendFromAdapters):
(WTF::StringBuilder::append):
(WTF::StringBuilder::flexibleAppendFromAdapters): Deleted.
(WTF::StringBuilder::flexibleAppend): Deleted.
Update for rename from StringBuilder::flexibleAppend(...) to StringBuilder::append(...).
2019-08-15 Ryosuke Niwa <rniwa@webkit.org>
Don't use union to store NodeRareData* and RenderObject*
https://bugs.webkit.org/show_bug.cgi?id=200744
Reviewed by Antti Koivisto.
Moved the static assert which requires the type of the object to which the pointer type points
into setPointer so that we can use CompactPointerTuple<T*, U> as a member variable
with just a forward declaration of T.
* wtf/CompactPointerTuple.h:
(WTF::CompactPointerTuple::setPointer):
2019-08-15 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Keep track of all the visibility candidates.
https://bugs.webkit.org/show_bug.cgi?id=200777
<rdar://problem/54356331>
Reviewed by Simon Fraser.
* wtf/WeakHashSet.h:
2019-08-15 Brent Fulgham <bfulgham@apple.com>
[FTW] Enable CoreFoundation use if building for Apple target
https://bugs.webkit.org/show_bug.cgi?id=200799
Reviewed by Alex Christensen.
* wtf/PlatformFTW.cmake: Add missing files.
2019-08-15 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r248440.
https://bugs.webkit.org/show_bug.cgi?id=200772
Introduced regressions related to loading of local files.
(Requested by perarne on #webkit).
Reverted changeset:
"[Mac] Use the PID of the WebContent process when issuing
local file read sandbox extensions"
https://bugs.webkit.org/show_bug.cgi?id=200543
https://trac.webkit.org/changeset/248440
2019-08-14 Kate Cheney <katherine_cheney@apple.com>
FileSystem::deleteFile should log error status (178347)
https://bugs.webkit.org/show_bug.cgi?id=178347
Reviewed by Brent Fulgham.
I added logging to the FileSystem::deleteFile function so that the debugger will
be able to see the associated errno string and better understand the reason for an
unlink failure or will know if the fileSystemRepresentation call was not
successful (or returned null).
* wtf/posix/FileSystemPOSIX.cpp:
(WTF::FileSystemImpl::deleteFile):
2019-08-14 Keith Rollin <krollin@apple.com>
Remove support for macOS < 10.13
https://bugs.webkit.org/show_bug.cgi?id=200694
<rdar://problem/54278851>
Reviewed by Youenn Fablet.
Update conditionals that reference __MAC_OS_X_VERSION_MIN_REQUIRED and
__MAC_OS_X_VERSION_MAX_ALLOWED, assuming that they both have values >=
101300. This means that expressions like
"__MAC_OS_X_VERSION_MIN_REQUIRED < 101300" are always False and
"__MAC_OS_X_VERSION_MIN_REQUIRED >= 101300" are always True.
* wtf/FeatureDefines.h:
* wtf/Platform.h:
* wtf/mac/AppKitCompatibilityDeclarations.h:
* wtf/spi/darwin/SandboxSPI.h:
2019-08-14 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Less contended MetaAllocator
https://bugs.webkit.org/show_bug.cgi?id=200278
Reviewed by Mark Lam.
* wtf/MetaAllocator.cpp:
(WTF::MetaAllocator::incrementPageOccupancy):
(WTF::MetaAllocator::decrementPageOccupancy):
* wtf/MetaAllocator.h:
2019-08-14 Samuel Groß <saelo@google.com>
[JSCOnly] JSCOnly port doesn't build on macOS
https://bugs.webkit.org/show_bug.cgi?id=200667
spi/darwin/ProcessMemoryFootprint.h is required by jsc.cpp so we add it to the WTF_PUBLIC_HEADERS.
Reviewed by Alex Christensen.
* wtf/PlatformJSCOnly.cmake:
* wtf/PlatformMac.cmake:
2019-08-13 Sam Weinig <weinig@apple.com>
Rename StringBuilder::append(UChar32) to StringBuilder::appendCharacter(UChar32) to avoid accidental change in behavior when replacing append with flexibleAppend
https://bugs.webkit.org/show_bug.cgi?id=200675
Reviewed by Darin Adler.
When we switch StringBuilder::append(...) to be based on the StringConcatenate/makeString flexibleAppend
implementation, if we don't change anything, the behavior of StringBuilder::append(UChar32) will go from
appending a character to appending a stringified number.
To work around this, we can rename StringBuilder::append(UChar32) to StringBuilder::appendCharacter(UChar32)
and update all the call sites.
* wtf/text/StringBuilder.h:
(WTF::StringBuilder::appendCharacter):
Renamed StringBuilder::append(UChar32) to StringBuilder::appendCharacter(UChar32).
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::decodeFromFilename):
Update for new name.
2019-08-13 Yusuke Suzuki <ysuzuki@apple.com>
Unreviewed, build fix for Windows
https://bugs.webkit.org/show_bug.cgi?id=200611
* wtf/win/GDIObject.h:
2019-08-12 Takashi Komori <Takashi.Komori@sony.com>
[WTF] Thread::removeFromThreadGroup leaks weak pointers.
https://bugs.webkit.org/show_bug.cgi?id=199857
Reviewed by Yusuke Suzuki.
Fix leaking of ThreadGroup's weak pointers.
Tests: WTF.ThreadGroupRemove API tests
* wtf/Threading.cpp:
(WTF::Thread::didExit):
(WTF::Thread::addToThreadGroup):
(WTF::Thread::removeFromThreadGroup):
(WTF::Thread::numberOfThreadGroups):
* wtf/Threading.h:
2019-08-12 Sam Weinig <weinig@apple.com>
Replace multiparameter overloads of append() in StringBuilder as a first step toward standardizinging on the flexibleAppend() implementation
https://bugs.webkit.org/show_bug.cgi?id=200614
Reviewed by Darin Adler.
Renames StringBuilder::append(const LChar*, unsigned), StringBuilder::append(const UChar*, unsigned) and
StringBuilder::append(const char*, unsigned) to StringBuilder::appendCharacters(...).
Renames StringBuilder::append(const String& string, unsigned offset, unsigned length) to
StringBuilder::appendSubstring(...).
* wtf/HexNumber.h:
(WTF::appendUnsignedAsHexFixedSize):
Add overload that explicitly takes a StringBuilder to work around rename from append to appendCharacters.
* wtf/text/StringBuilder.cpp:
(WTF::StringBuilder::appendCharacters):
(WTF::StringBuilder::append):
* wtf/text/StringBuilder.h:
(WTF::StringBuilder::appendCharacters):
(WTF::StringBuilder::append):
(WTF::StringBuilder::appendSubstring):
(WTF::StringBuilder::appendLiteral):
(WTF::IntegerToStringConversionTrait<StringBuilder>::flush):
Update for renames.
2019-08-12 Yusuke Suzuki <ysuzuki@apple.com>
[WTF][JSC] Make JSC and WTF aggressively-fast-malloced
https://bugs.webkit.org/show_bug.cgi?id=200611
Reviewed by Saam Barati.
WTF has many data structures, in particular, containers. And these containers can be allocated like `std::make_unique<Container>()`.
Without WTF_MAKE_FAST_ALLOCATED, this container itself is allocated from the system malloc. This patch attaches WTF_MAKE_FAST_ALLOCATED
more aggressively not to allocate them from the system malloc. And we add some `final` to containers and classes that would be never inherited.
* wtf/Assertions.cpp:
* wtf/Atomics.h:
* wtf/AutodrainedPool.h:
* wtf/Bag.h:
(WTF::Bag::Bag): Deleted.
(WTF::Bag::~Bag): Deleted.
(WTF::Bag::clear): Deleted.
(WTF::Bag::add): Deleted.
(WTF::Bag::iterator::iterator): Deleted.
(WTF::Bag::iterator::operator! const): Deleted.
(WTF::Bag::iterator::operator* const): Deleted.
(WTF::Bag::iterator::operator++): Deleted.
(WTF::Bag::iterator::operator== const): Deleted.
(WTF::Bag::iterator::operator!= const): Deleted.
(WTF::Bag::begin): Deleted.
(WTF::Bag::begin const): Deleted.
(WTF::Bag::end const): Deleted.
(WTF::Bag::isEmpty const): Deleted.
(WTF::Bag::unwrappedHead const): Deleted.
* wtf/BitVector.h:
(WTF::BitVector::BitVector): Deleted.
(WTF::BitVector::~BitVector): Deleted.
(WTF::BitVector::operator=): Deleted.
(WTF::BitVector::size const): Deleted.
(WTF::BitVector::ensureSize): Deleted.
(WTF::BitVector::quickGet const): Deleted.
(WTF::BitVector::quickSet): Deleted.
(WTF::BitVector::quickClear): Deleted.
(WTF::BitVector::get const): Deleted.
(WTF::BitVector::contains const): Deleted.
(WTF::BitVector::set): Deleted.
(WTF::BitVector::add): Deleted.
(WTF::BitVector::ensureSizeAndSet): Deleted.
(WTF::BitVector::clear): Deleted.
(WTF::BitVector::remove): Deleted.
(WTF::BitVector::merge): Deleted.
(WTF::BitVector::filter): Deleted.
(WTF::BitVector::exclude): Deleted.
(WTF::BitVector::bitCount const): Deleted.
(WTF::BitVector::isEmpty const): Deleted.
(WTF::BitVector::findBit const): Deleted.
(WTF::BitVector::isEmptyValue const): Deleted.
(WTF::BitVector::isDeletedValue const): Deleted.
(WTF::BitVector::isEmptyOrDeletedValue const): Deleted.
(WTF::BitVector::operator== const): Deleted.
(WTF::BitVector::hash const): Deleted.
(WTF::BitVector::iterator::iterator): Deleted.
(WTF::BitVector::iterator::operator* const): Deleted.
(WTF::BitVector::iterator::operator++): Deleted.
(WTF::BitVector::iterator::isAtEnd const): Deleted.
(WTF::BitVector::iterator::operator== const): Deleted.
(WTF::BitVector::iterator::operator!= const): Deleted.
(WTF::BitVector::begin const): Deleted.
(WTF::BitVector::end const): Deleted.
(WTF::BitVector::bitsInPointer): Deleted.
(WTF::BitVector::maxInlineBits): Deleted.
(WTF::BitVector::byteCount): Deleted.
(WTF::BitVector::makeInlineBits): Deleted.
(WTF::BitVector::cleanseInlineBits): Deleted.
(WTF::BitVector::bitCount): Deleted.
(WTF::BitVector::findBitFast const): Deleted.
(WTF::BitVector::findBitSimple const): Deleted.
(WTF::BitVector::OutOfLineBits::numBits const): Deleted.
(WTF::BitVector::OutOfLineBits::numWords const): Deleted.
(WTF::BitVector::OutOfLineBits::bits): Deleted.
(WTF::BitVector::OutOfLineBits::bits const): Deleted.
(WTF::BitVector::OutOfLineBits::OutOfLineBits): Deleted.
(WTF::BitVector::isInline const): Deleted.
(WTF::BitVector::outOfLineBits const): Deleted.
(WTF::BitVector::outOfLineBits): Deleted.
(WTF::BitVector::bits): Deleted.
(WTF::BitVector::bits const): Deleted.
* wtf/Bitmap.h:
(WTF::Bitmap::size): Deleted.
(WTF::Bitmap::iterator::iterator): Deleted.
(WTF::Bitmap::iterator::operator* const): Deleted.
(WTF::Bitmap::iterator::operator++): Deleted.
(WTF::Bitmap::iterator::operator== const): Deleted.
(WTF::Bitmap::iterator::operator!= const): Deleted.
(WTF::Bitmap::begin const): Deleted.
(WTF::Bitmap::end const): Deleted.
* wtf/Box.h:
* wtf/BumpPointerAllocator.h:
* wtf/CPUTime.h:
* wtf/CheckedBoolean.h:
* wtf/CommaPrinter.h:
(WTF::CommaPrinter::CommaPrinter): Deleted.
(WTF::CommaPrinter::dump const): Deleted.
(WTF::CommaPrinter::didPrint const): Deleted.
* wtf/CompactPointerTuple.h:
(WTF::CompactPointerTuple::encodeType): Deleted.
(WTF::CompactPointerTuple::decodeType): Deleted.
(WTF::CompactPointerTuple::CompactPointerTuple): Deleted.
(WTF::CompactPointerTuple::pointer const): Deleted.
(WTF::CompactPointerTuple::setPointer): Deleted.
(WTF::CompactPointerTuple::type const): Deleted.
(WTF::CompactPointerTuple::setType): Deleted.
* wtf/CompilationThread.h:
(WTF::CompilationScope::CompilationScope): Deleted.
(WTF::CompilationScope::~CompilationScope): Deleted.
(WTF::CompilationScope::leaveEarly): Deleted.
* wtf/CompletionHandler.h:
(WTF::CompletionHandler<Out):
(WTF::Detail::CallableWrapper<CompletionHandler<Out):
(WTF::CompletionHandlerCallingScope::CompletionHandlerCallingScope): Deleted.
(WTF::CompletionHandlerCallingScope::~CompletionHandlerCallingScope): Deleted.
(WTF::CompletionHandlerCallingScope::CompletionHandler<void): Deleted.
* wtf/ConcurrentBuffer.h:
(WTF::ConcurrentBuffer::ConcurrentBuffer): Deleted.
(WTF::ConcurrentBuffer::~ConcurrentBuffer): Deleted.
(WTF::ConcurrentBuffer::growExact): Deleted.
(WTF::ConcurrentBuffer::grow): Deleted.
(WTF::ConcurrentBuffer::array const): Deleted.
(WTF::ConcurrentBuffer::operator[]): Deleted.
(WTF::ConcurrentBuffer::operator[] const): Deleted.
(WTF::ConcurrentBuffer::createArray): Deleted.
* wtf/ConcurrentPtrHashSet.h:
(WTF::ConcurrentPtrHashSet::contains): Deleted.
(WTF::ConcurrentPtrHashSet::add): Deleted.
(WTF::ConcurrentPtrHashSet::size const): Deleted.
(WTF::ConcurrentPtrHashSet::Table::maxLoad const): Deleted.
(WTF::ConcurrentPtrHashSet::hash): Deleted.
(WTF::ConcurrentPtrHashSet::cast): Deleted.
(WTF::ConcurrentPtrHashSet::containsImpl const): Deleted.
(WTF::ConcurrentPtrHashSet::addImpl): Deleted.
* wtf/ConcurrentVector.h:
(WTF::ConcurrentVector::~ConcurrentVector): Deleted.
(WTF::ConcurrentVector::size const): Deleted.
(WTF::ConcurrentVector::isEmpty const): Deleted.
(WTF::ConcurrentVector::at): Deleted.
(WTF::ConcurrentVector::at const): Deleted.
(WTF::ConcurrentVector::operator[]): Deleted.
(WTF::ConcurrentVector::operator[] const): Deleted.
(WTF::ConcurrentVector::first): Deleted.
(WTF::ConcurrentVector::first const): Deleted.
(WTF::ConcurrentVector::last): Deleted.
(WTF::ConcurrentVector::last const): Deleted.
(WTF::ConcurrentVector::takeLast): Deleted.
(WTF::ConcurrentVector::append): Deleted.
(WTF::ConcurrentVector::alloc): Deleted.
(WTF::ConcurrentVector::removeLast): Deleted.
(WTF::ConcurrentVector::grow): Deleted.
(WTF::ConcurrentVector::begin): Deleted.
(WTF::ConcurrentVector::end): Deleted.
(WTF::ConcurrentVector::segmentExistsFor): Deleted.
(WTF::ConcurrentVector::segmentFor): Deleted.
(WTF::ConcurrentVector::subscriptFor): Deleted.
(WTF::ConcurrentVector::ensureSegmentsFor): Deleted.
(WTF::ConcurrentVector::ensureSegment): Deleted.
(WTF::ConcurrentVector::allocateSegment): Deleted.
* wtf/Condition.h:
(WTF::Condition::waitUntil): Deleted.
(WTF::Condition::waitFor): Deleted.
(WTF::Condition::wait): Deleted.
(WTF::Condition::notifyOne): Deleted.
(WTF::Condition::notifyAll): Deleted.
* wtf/CountingLock.h:
(WTF::CountingLock::LockHooks::lockHook): Deleted.
(WTF::CountingLock::LockHooks::unlockHook): Deleted.
(WTF::CountingLock::LockHooks::parkHook): Deleted.
(WTF::CountingLock::LockHooks::handoffHook): Deleted.
(WTF::CountingLock::tryLock): Deleted.
(WTF::CountingLock::lock): Deleted.
(WTF::CountingLock::unlock): Deleted.
(WTF::CountingLock::isHeld const): Deleted.
(WTF::CountingLock::isLocked const): Deleted.
(WTF::CountingLock::Count::operator bool const): Deleted.
(WTF::CountingLock::Count::operator== const): Deleted.
(WTF::CountingLock::Count::operator!= const): Deleted.
(WTF::CountingLock::tryOptimisticRead): Deleted.
(WTF::CountingLock::validate): Deleted.
(WTF::CountingLock::doOptimizedRead): Deleted.
(WTF::CountingLock::tryOptimisticFencelessRead): Deleted.
(WTF::CountingLock::fencelessValidate): Deleted.
(WTF::CountingLock::doOptimizedFencelessRead): Deleted.
(WTF::CountingLock::getCount): Deleted.
* wtf/CrossThreadQueue.h:
* wtf/CrossThreadTask.h:
* wtf/CryptographicallyRandomNumber.cpp:
* wtf/DataMutex.h:
* wtf/DateMath.h:
* wtf/Deque.h:
(WTF::Deque::size const): Deleted.
(WTF::Deque::isEmpty const): Deleted.
(WTF::Deque::begin): Deleted.
(WTF::Deque::end): Deleted.
(WTF::Deque::begin const): Deleted.
(WTF::Deque::end const): Deleted.
(WTF::Deque::rbegin): Deleted.
(WTF::Deque::rend): Deleted.
(WTF::Deque::rbegin const): Deleted.
(WTF::Deque::rend const): Deleted.
(WTF::Deque::first): Deleted.
(WTF::Deque::first const): Deleted.
(WTF::Deque::last): Deleted.
(WTF::Deque::last const): Deleted.
(WTF::Deque::append): Deleted.
* wtf/Dominators.h:
* wtf/DoublyLinkedList.h:
* wtf/Expected.h:
* wtf/FastBitVector.h:
* wtf/FileMetadata.h:
* wtf/FileSystem.h:
* wtf/GraphNodeWorklist.h:
* wtf/GregorianDateTime.h:
(WTF::GregorianDateTime::GregorianDateTime): Deleted.
(WTF::GregorianDateTime::year const): Deleted.
(WTF::GregorianDateTime::month const): Deleted.
(WTF::GregorianDateTime::yearDay const): Deleted.
(WTF::GregorianDateTime::monthDay const): Deleted.
(WTF::GregorianDateTime::weekDay const): Deleted.
(WTF::GregorianDateTime::hour const): Deleted.
(WTF::GregorianDateTime::minute const): Deleted.
(WTF::GregorianDateTime::second const): Deleted.
(WTF::GregorianDateTime::utcOffset const): Deleted.
(WTF::GregorianDateTime::isDST const): Deleted.
(WTF::GregorianDateTime::setYear): Deleted.
(WTF::GregorianDateTime::setMonth): Deleted.
(WTF::GregorianDateTime::setYearDay): Deleted.
(WTF::GregorianDateTime::setMonthDay): Deleted.
(WTF::GregorianDateTime::setWeekDay): Deleted.
(WTF::GregorianDateTime::setHour): Deleted.
(WTF::GregorianDateTime::setMinute): Deleted.
(WTF::GregorianDateTime::setSecond): Deleted.
(WTF::GregorianDateTime::setUtcOffset): Deleted.
(WTF::GregorianDateTime::setIsDST): Deleted.
(WTF::GregorianDateTime::operator tm const): Deleted.
(WTF::GregorianDateTime::copyFrom): Deleted.
* wtf/HashTable.h:
* wtf/Hasher.h:
* wtf/HexNumber.h:
* wtf/Indenter.h:
* wtf/IndexMap.h:
* wtf/IndexSet.h:
* wtf/IndexSparseSet.h:
* wtf/IndexedContainerIterator.h:
* wtf/Insertion.h:
* wtf/IteratorAdaptors.h:
* wtf/IteratorRange.h:
* wtf/KeyValuePair.h:
* wtf/ListHashSet.h:
(WTF::ListHashSet::begin): Deleted.
(WTF::ListHashSet::end): Deleted.
(WTF::ListHashSet::begin const): Deleted.
(WTF::ListHashSet::end const): Deleted.
(WTF::ListHashSet::random): Deleted.
(WTF::ListHashSet::random const): Deleted.
(WTF::ListHashSet::rbegin): Deleted.
(WTF::ListHashSet::rend): Deleted.
(WTF::ListHashSet::rbegin const): Deleted.
(WTF::ListHashSet::rend const): Deleted.
* wtf/Liveness.h:
* wtf/LocklessBag.h:
(WTF::LocklessBag::LocklessBag): Deleted.
(WTF::LocklessBag::add): Deleted.
(WTF::LocklessBag::iterate): Deleted.
(WTF::LocklessBag::consumeAll): Deleted.
(WTF::LocklessBag::consumeAllWithNode): Deleted.
(WTF::LocklessBag::~LocklessBag): Deleted.
* wtf/LoggingHashID.h:
* wtf/MD5.h:
* wtf/MachSendRight.h:
* wtf/MainThreadData.h:
* wtf/Markable.h:
* wtf/MediaTime.h:
* wtf/MemoryPressureHandler.h:
* wtf/MessageQueue.h:
(WTF::MessageQueue::MessageQueue): Deleted.
* wtf/MetaAllocator.h:
* wtf/MonotonicTime.h:
(WTF::MonotonicTime::MonotonicTime): Deleted.
(WTF::MonotonicTime::fromRawSeconds): Deleted.
(WTF::MonotonicTime::infinity): Deleted.
(WTF::MonotonicTime::nan): Deleted.
(WTF::MonotonicTime::secondsSinceEpoch const): Deleted.
(WTF::MonotonicTime::approximateMonotonicTime const): Deleted.
(WTF::MonotonicTime::operator bool const): Deleted.
(WTF::MonotonicTime::operator+ const): Deleted.
(WTF::MonotonicTime::operator- const): Deleted.
(WTF::MonotonicTime::operator% const): Deleted.
(WTF::MonotonicTime::operator+=): Deleted.
(WTF::MonotonicTime::operator-=): Deleted.
(WTF::MonotonicTime::operator== const): Deleted.
(WTF::MonotonicTime::operator!= const): Deleted.
(WTF::MonotonicTime::operator< const): Deleted.
(WTF::MonotonicTime::operator> const): Deleted.
(WTF::MonotonicTime::operator<= const): Deleted.
(WTF::MonotonicTime::operator>= const): Deleted.
(WTF::MonotonicTime::isolatedCopy const): Deleted.
(WTF::MonotonicTime::encode const): Deleted.
(WTF::MonotonicTime::decode): Deleted.
* wtf/NaturalLoops.h:
* wtf/NoLock.h:
* wtf/OSAllocator.h:
* wtf/OptionSet.h:
* wtf/Optional.h:
* wtf/OrderMaker.h:
* wtf/Packed.h:
(WTF::alignof):
* wtf/PackedIntVector.h:
(WTF::PackedIntVector::PackedIntVector): Deleted.
(WTF::PackedIntVector::operator=): Deleted.
(WTF::PackedIntVector::size const): Deleted.
(WTF::PackedIntVector::ensureSize): Deleted.
(WTF::PackedIntVector::resize): Deleted.
(WTF::PackedIntVector::clearAll): Deleted.
(WTF::PackedIntVector::get const): Deleted.
(WTF::PackedIntVector::set): Deleted.
(WTF::PackedIntVector::mask): Deleted.
* wtf/PageBlock.h:
* wtf/ParallelJobsOpenMP.h:
* wtf/ParkingLot.h:
* wtf/PriorityQueue.h:
(WTF::PriorityQueue::size const): Deleted.
(WTF::PriorityQueue::isEmpty const): Deleted.
(WTF::PriorityQueue::enqueue): Deleted.
(WTF::PriorityQueue::peek const): Deleted.
(WTF::PriorityQueue::dequeue): Deleted.
(WTF::PriorityQueue::decreaseKey): Deleted.
(WTF::PriorityQueue::increaseKey): Deleted.
(WTF::PriorityQueue::begin const): Deleted.
(WTF::PriorityQueue::end const): Deleted.
(WTF::PriorityQueue::isValidHeap const): Deleted.
(WTF::PriorityQueue::parentOf): Deleted.
(WTF::PriorityQueue::leftChildOf): Deleted.
(WTF::PriorityQueue::rightChildOf): Deleted.
(WTF::PriorityQueue::siftUp): Deleted.
(WTF::PriorityQueue::siftDown): Deleted.
* wtf/RandomDevice.h:
* wtf/Range.h:
* wtf/RangeSet.h:
(WTF::RangeSet::RangeSet): Deleted.
(WTF::RangeSet::~RangeSet): Deleted.
(WTF::RangeSet::add): Deleted.
(WTF::RangeSet::contains const): Deleted.
(WTF::RangeSet::overlaps const): Deleted.
(WTF::RangeSet::clear): Deleted.
(WTF::RangeSet::dump const): Deleted.
(WTF::RangeSet::dumpRaw const): Deleted.
(WTF::RangeSet::begin const): Deleted.
(WTF::RangeSet::end const): Deleted.
(WTF::RangeSet::addAll): Deleted.
(WTF::RangeSet::compact): Deleted.
(WTF::RangeSet::overlapsNonEmpty): Deleted.
(WTF::RangeSet::subsumesNonEmpty): Deleted.
(WTF::RangeSet::findRange const): Deleted.
* wtf/RecursableLambda.h:
* wtf/RedBlackTree.h:
(WTF::RedBlackTree::Node::successor const): Deleted.
(WTF::RedBlackTree::Node::predecessor const): Deleted.
(WTF::RedBlackTree::Node::successor): Deleted.
(WTF::RedBlackTree::Node::predecessor): Deleted.
(WTF::RedBlackTree::Node::reset): Deleted.
(WTF::RedBlackTree::Node::parent const): Deleted.
(WTF::RedBlackTree::Node::setParent): Deleted.
(WTF::RedBlackTree::Node::left const): Deleted.
(WTF::RedBlackTree::Node::setLeft): Deleted.
(WTF::RedBlackTree::Node::right const): Deleted.
(WTF::RedBlackTree::Node::setRight): Deleted.
(WTF::RedBlackTree::Node::color const): Deleted.
(WTF::RedBlackTree::Node::setColor): Deleted.
(WTF::RedBlackTree::RedBlackTree): Deleted.
(WTF::RedBlackTree::insert): Deleted.
(WTF::RedBlackTree::remove): Deleted.
(WTF::RedBlackTree::findExact const): Deleted.
(WTF::RedBlackTree::findLeastGreaterThanOrEqual const): Deleted.
(WTF::RedBlackTree::findGreatestLessThanOrEqual const): Deleted.
(WTF::RedBlackTree::first const): Deleted.
(WTF::RedBlackTree::last const): Deleted.
(WTF::RedBlackTree::size): Deleted.
(WTF::RedBlackTree::isEmpty): Deleted.
(WTF::RedBlackTree::treeMinimum): Deleted.
(WTF::RedBlackTree::treeMaximum): Deleted.
(WTF::RedBlackTree::treeInsert): Deleted.
(WTF::RedBlackTree::leftRotate): Deleted.
(WTF::RedBlackTree::rightRotate): Deleted.
(WTF::RedBlackTree::removeFixup): Deleted.
* wtf/ResourceUsage.h:
* wtf/RunLoop.cpp:
* wtf/RunLoopTimer.h:
* wtf/SHA1.h:
* wtf/Seconds.h:
(WTF::Seconds::Seconds): Deleted.
(WTF::Seconds::value const): Deleted.
(WTF::Seconds::minutes const): Deleted.
(WTF::Seconds::seconds const): Deleted.
(WTF::Seconds::milliseconds const): Deleted.
(WTF::Seconds::microseconds const): Deleted.
(WTF::Seconds::nanoseconds const): Deleted.
(WTF::Seconds::minutesAs const): Deleted.
(WTF::Seconds::secondsAs const): Deleted.
(WTF::Seconds::millisecondsAs const): Deleted.
(WTF::Seconds::microsecondsAs const): Deleted.
(WTF::Seconds::nanosecondsAs const): Deleted.
(WTF::Seconds::fromMinutes): Deleted.
(WTF::Seconds::fromHours): Deleted.
(WTF::Seconds::fromMilliseconds): Deleted.
(WTF::Seconds::fromMicroseconds): Deleted.
(WTF::Seconds::fromNanoseconds): Deleted.
(WTF::Seconds::infinity): Deleted.
(WTF::Seconds::nan): Deleted.
(WTF::Seconds::operator bool const): Deleted.
(WTF::Seconds::operator+ const): Deleted.
(WTF::Seconds::operator- const): Deleted.
(WTF::Seconds::operator* const): Deleted.
(WTF::Seconds::operator/ const): Deleted.
(WTF::Seconds::operator% const): Deleted.
(WTF::Seconds::operator+=): Deleted.
(WTF::Seconds::operator-=): Deleted.
(WTF::Seconds::operator*=): Deleted.
(WTF::Seconds::operator/=): Deleted.
(WTF::Seconds::operator%=): Deleted.
(WTF::Seconds::operator== const): Deleted.
(WTF::Seconds::operator!= const): Deleted.
(WTF::Seconds::operator< const): Deleted.
(WTF::Seconds::operator> const): Deleted.
(WTF::Seconds::operator<= const): Deleted.
(WTF::Seconds::operator>= const): Deleted.
(WTF::Seconds::isolatedCopy const): Deleted.
(WTF::Seconds::encode const): Deleted.
(WTF::Seconds::decode): Deleted.
* wtf/SegmentedVector.h:
(WTF::SegmentedVector::~SegmentedVector): Deleted.
(WTF::SegmentedVector::size const): Deleted.
(WTF::SegmentedVector::isEmpty const): Deleted.
(WTF::SegmentedVector::at): Deleted.
(WTF::SegmentedVector::at const): Deleted.
(WTF::SegmentedVector::operator[]): Deleted.
(WTF::SegmentedVector::operator[] const): Deleted.
(WTF::SegmentedVector::first): Deleted.
(WTF::SegmentedVector::first const): Deleted.
(WTF::SegmentedVector::last): Deleted.
(WTF::SegmentedVector::last const): Deleted.
(WTF::SegmentedVector::takeLast): Deleted.
(WTF::SegmentedVector::append): Deleted.
(WTF::SegmentedVector::alloc): Deleted.
(WTF::SegmentedVector::removeLast): Deleted.
(WTF::SegmentedVector::grow): Deleted.
(WTF::SegmentedVector::clear): Deleted.
(WTF::SegmentedVector::begin): Deleted.
(WTF::SegmentedVector::end): Deleted.
(WTF::SegmentedVector::shrinkToFit): Deleted.
(WTF::SegmentedVector::deleteAllSegments): Deleted.
(WTF::SegmentedVector::segmentExistsFor): Deleted.
(WTF::SegmentedVector::segmentFor): Deleted.
(WTF::SegmentedVector::subscriptFor): Deleted.
(WTF::SegmentedVector::ensureSegmentsFor): Deleted.
(WTF::SegmentedVector::ensureSegment): Deleted.
(WTF::SegmentedVector::allocateSegment): Deleted.
* wtf/SetForScope.h:
* wtf/SingleRootGraph.h:
* wtf/SinglyLinkedList.h:
* wtf/SmallPtrSet.h:
* wtf/SpanningTree.h:
* wtf/Spectrum.h:
* wtf/StackBounds.h:
* wtf/StackShot.h:
* wtf/StackShotProfiler.h:
* wtf/StackStats.h:
* wtf/StackTrace.h:
* wtf/StreamBuffer.h:
* wtf/SynchronizedFixedQueue.h:
(WTF::SynchronizedFixedQueue::create): Deleted.
(WTF::SynchronizedFixedQueue::open): Deleted.
(WTF::SynchronizedFixedQueue::close): Deleted.
(WTF::SynchronizedFixedQueue::isOpen): Deleted.
(WTF::SynchronizedFixedQueue::enqueue): Deleted.
(WTF::SynchronizedFixedQueue::dequeue): Deleted.
(WTF::SynchronizedFixedQueue::SynchronizedFixedQueue): Deleted.
* wtf/SystemTracing.h:
* wtf/ThreadGroup.h:
(WTF::ThreadGroup::create): Deleted.
(WTF::ThreadGroup::threads const): Deleted.
(WTF::ThreadGroup::getLock): Deleted.
(WTF::ThreadGroup::weakFromThis): Deleted.
* wtf/ThreadSpecific.h:
* wtf/ThreadingPrimitives.h:
(WTF::Mutex::impl): Deleted.
* wtf/TimeWithDynamicClockType.h:
(WTF::TimeWithDynamicClockType::TimeWithDynamicClockType): Deleted.
(WTF::TimeWithDynamicClockType::fromRawSeconds): Deleted.
(WTF::TimeWithDynamicClockType::secondsSinceEpoch const): Deleted.
(WTF::TimeWithDynamicClockType::clockType const): Deleted.
(WTF::TimeWithDynamicClockType::withSameClockAndRawSeconds const): Deleted.
(WTF::TimeWithDynamicClockType::operator bool const): Deleted.
(WTF::TimeWithDynamicClockType::operator+ const): Deleted.
(WTF::TimeWithDynamicClockType::operator- const): Deleted.
(WTF::TimeWithDynamicClockType::operator+=): Deleted.
(WTF::TimeWithDynamicClockType::operator-=): Deleted.
(WTF::TimeWithDynamicClockType::operator== const): Deleted.
(WTF::TimeWithDynamicClockType::operator!= const): Deleted.
* wtf/TimingScope.h:
* wtf/TinyLRUCache.h:
* wtf/TinyPtrSet.h:
* wtf/URLParser.cpp:
* wtf/URLParser.h:
* wtf/Unexpected.h:
* wtf/Variant.h:
* wtf/WTFSemaphore.h:
(WTF::Semaphore::Semaphore): Deleted.
(WTF::Semaphore::signal): Deleted.
(WTF::Semaphore::waitUntil): Deleted.
(WTF::Semaphore::waitFor): Deleted.
(WTF::Semaphore::wait): Deleted.
* wtf/WallTime.h:
(WTF::WallTime::WallTime): Deleted.
(WTF::WallTime::fromRawSeconds): Deleted.
(WTF::WallTime::infinity): Deleted.
(WTF::WallTime::nan): Deleted.
(WTF::WallTime::secondsSinceEpoch const): Deleted.
(WTF::WallTime::approximateWallTime const): Deleted.
(WTF::WallTime::operator bool const): Deleted.
(WTF::WallTime::operator+ const): Deleted.
(WTF::WallTime::operator- const): Deleted.
(WTF::WallTime::operator+=): Deleted.
(WTF::WallTime::operator-=): Deleted.
(WTF::WallTime::operator== const): Deleted.
(WTF::WallTime::operator!= const): Deleted.
(WTF::WallTime::operator< const): Deleted.
(WTF::WallTime::operator> const): Deleted.
(WTF::WallTime::operator<= const): Deleted.
(WTF::WallTime::operator>= const): Deleted.
(WTF::WallTime::isolatedCopy const): Deleted.
* wtf/WeakHashSet.h:
(WTF::WeakHashSet::WeakHashSetConstIterator::WeakHashSetConstIterator): Deleted.
(WTF::WeakHashSet::WeakHashSetConstIterator::get const): Deleted.
(WTF::WeakHashSet::WeakHashSetConstIterator::operator* const): Deleted.
(WTF::WeakHashSet::WeakHashSetConstIterator::operator-> const): Deleted.
(WTF::WeakHashSet::WeakHashSetConstIterator::operator++): Deleted.
(WTF::WeakHashSet::WeakHashSetConstIterator::skipEmptyBuckets): Deleted.
(WTF::WeakHashSet::WeakHashSetConstIterator::operator== const): Deleted.
(WTF::WeakHashSet::WeakHashSetConstIterator::operator!= const): Deleted.
(WTF::WeakHashSet::WeakHashSet): Deleted.
(WTF::WeakHashSet::begin const): Deleted.
(WTF::WeakHashSet::end const): Deleted.
(WTF::WeakHashSet::add): Deleted.
(WTF::WeakHashSet::remove): Deleted.
(WTF::WeakHashSet::contains const): Deleted.
(WTF::WeakHashSet::capacity const): Deleted.
(WTF::WeakHashSet::computesEmpty const): Deleted.
(WTF::WeakHashSet::hasNullReferences const): Deleted.
(WTF::WeakHashSet::computeSize const): Deleted.
(WTF::WeakHashSet::checkConsistency const): Deleted.
* wtf/WeakRandom.h:
(WTF::WeakRandom::WeakRandom): Deleted.
(WTF::WeakRandom::setSeed): Deleted.
(WTF::WeakRandom::seed const): Deleted.
(WTF::WeakRandom::get): Deleted.
(WTF::WeakRandom::getUint32): Deleted.
(WTF::WeakRandom::lowOffset): Deleted.
(WTF::WeakRandom::highOffset): Deleted.
(WTF::WeakRandom::nextState): Deleted.
(WTF::WeakRandom::generate): Deleted.
(WTF::WeakRandom::advance): Deleted.
* wtf/WordLock.h:
(WTF::WordLock::lock): Deleted.
(WTF::WordLock::unlock): Deleted.
(WTF::WordLock::isHeld const): Deleted.
(WTF::WordLock::isLocked const): Deleted.
(WTF::WordLock::isFullyReset const): Deleted.
* wtf/generic/MainThreadGeneric.cpp:
* wtf/glib/GMutexLocker.h:
* wtf/linux/CurrentProcessMemoryStatus.h:
* wtf/posix/ThreadingPOSIX.cpp:
(WTF::Semaphore::Semaphore): Deleted.
(WTF::Semaphore::~Semaphore): Deleted.
(WTF::Semaphore::wait): Deleted.
(WTF::Semaphore::post): Deleted.
* wtf/text/ASCIILiteral.h:
(WTF::ASCIILiteral::operator const char* const): Deleted.
(WTF::ASCIILiteral::fromLiteralUnsafe): Deleted.
(WTF::ASCIILiteral::null): Deleted.
(WTF::ASCIILiteral::characters const): Deleted.
(WTF::ASCIILiteral::ASCIILiteral): Deleted.
* wtf/text/AtomString.h:
(WTF::AtomString::operator=): Deleted.
(WTF::AtomString::isHashTableDeletedValue const): Deleted.
(WTF::AtomString::existingHash const): Deleted.
(WTF::AtomString::operator const String& const): Deleted.
(WTF::AtomString::string const): Deleted.
(WTF::AtomString::impl const): Deleted.
(WTF::AtomString::is8Bit const): Deleted.
(WTF::AtomString::characters8 const): Deleted.
(WTF::AtomString::characters16 const): Deleted.
(WTF::AtomString::length const): Deleted.
(WTF::AtomString::operator[] const): Deleted.
(WTF::AtomString::contains const): Deleted.
(WTF::AtomString::containsIgnoringASCIICase const): Deleted.
(WTF::AtomString::find const): Deleted.
(WTF::AtomString::findIgnoringASCIICase const): Deleted.
(WTF::AtomString::startsWith const): Deleted.
(WTF::AtomString::startsWithIgnoringASCIICase const): Deleted.
(WTF::AtomString::endsWith const): Deleted.
(WTF::AtomString::endsWithIgnoringASCIICase const): Deleted.
(WTF::AtomString::toInt const): Deleted.
(WTF::AtomString::toDouble const): Deleted.
(WTF::AtomString::toFloat const): Deleted.
(WTF::AtomString::percentage const): Deleted.
(WTF::AtomString::isNull const): Deleted.
(WTF::AtomString::isEmpty const): Deleted.
(WTF::AtomString::operator NSString * const): Deleted.
* wtf/text/AtomStringImpl.h:
(WTF::AtomStringImpl::lookUp): Deleted.
(WTF::AtomStringImpl::add): Deleted.
(WTF::AtomStringImpl::addWithStringTableProvider): Deleted.
* wtf/text/CString.h:
(WTF::CStringBuffer::data): Deleted.
(WTF::CStringBuffer::length const): Deleted.
(WTF::CStringBuffer::CStringBuffer): Deleted.
(WTF::CStringBuffer::mutableData): Deleted.
(WTF::CString::CString): Deleted.
(WTF::CString::data const): Deleted.
(WTF::CString::length const): Deleted.
(WTF::CString::isNull const): Deleted.
(WTF::CString::buffer const): Deleted.
(WTF::CString::isHashTableDeletedValue const): Deleted.
* wtf/text/ExternalStringImpl.h:
(WTF::ExternalStringImpl::freeExternalBuffer): Deleted.
* wtf/text/LineBreakIteratorPoolICU.h:
* wtf/text/NullTextBreakIterator.h:
* wtf/text/OrdinalNumber.h:
* wtf/text/StringBuffer.h:
* wtf/text/StringBuilder.h:
* wtf/text/StringConcatenateNumbers.h:
* wtf/text/StringHasher.h:
* wtf/text/StringImpl.h:
* wtf/text/StringView.cpp:
* wtf/text/StringView.h:
(WTF::StringView::left const): Deleted.
(WTF::StringView::right const): Deleted.
(WTF::StringView::underlyingStringIsValid const): Deleted.
(WTF::StringView::setUnderlyingString): Deleted.
* wtf/text/SymbolImpl.h:
(WTF::SymbolImpl::StaticSymbolImpl::StaticSymbolImpl): Deleted.
(WTF::SymbolImpl::StaticSymbolImpl::operator SymbolImpl&): Deleted.
(WTF::PrivateSymbolImpl::PrivateSymbolImpl): Deleted.
(WTF::RegisteredSymbolImpl::symbolRegistry const): Deleted.
(WTF::RegisteredSymbolImpl::clearSymbolRegistry): Deleted.
(WTF::RegisteredSymbolImpl::RegisteredSymbolImpl): Deleted.
* wtf/text/SymbolRegistry.h:
* wtf/text/TextBreakIterator.h:
* wtf/text/TextPosition.h:
* wtf/text/TextStream.h:
* wtf/text/WTFString.h:
(WTF::String::swap): Deleted.
(WTF::String::adopt): Deleted.
(WTF::String::isNull const): Deleted.
(WTF::String::isEmpty const): Deleted.
(WTF::String::impl const): Deleted.
(WTF::String::releaseImpl): Deleted.
(WTF::String::length const): Deleted.
(WTF::String::characters8 const): Deleted.
(WTF::String::characters16 const): Deleted.
(WTF::String::is8Bit const): Deleted.
(WTF::String::sizeInBytes const): Deleted.
(WTF::String::operator[] const): Deleted.
(WTF::String::find const): Deleted.
(WTF::String::findIgnoringASCIICase const): Deleted.
(WTF::String::reverseFind const): Deleted.
(WTF::String::contains const): Deleted.
(WTF::String::containsIgnoringASCIICase const): Deleted.
(WTF::String::startsWith const): Deleted.
(WTF::String::startsWithIgnoringASCIICase const): Deleted.
(WTF::String::hasInfixStartingAt const): Deleted.
(WTF::String::endsWith const): Deleted.
(WTF::String::endsWithIgnoringASCIICase const): Deleted.
(WTF::String::hasInfixEndingAt const): Deleted.
(WTF::String::append): Deleted.
(WTF::String::left const): Deleted.
(WTF::String::right const): Deleted.
(WTF::String::createUninitialized): Deleted.
(WTF::String::fromUTF8WithLatin1Fallback): Deleted.
(WTF::String::isAllASCII const): Deleted.
(WTF::String::isAllLatin1 const): Deleted.
(WTF::String::isSpecialCharacter const): Deleted.
(WTF::String::isHashTableDeletedValue const): Deleted.
(WTF::String::hash const): Deleted.
(WTF::String::existingHash const): Deleted.
* wtf/text/cf/TextBreakIteratorCF.h:
* wtf/text/icu/TextBreakIteratorICU.h:
* wtf/text/icu/UTextProviderLatin1.h:
* wtf/threads/BinarySemaphore.h:
(WTF::BinarySemaphore::waitFor): Deleted.
(WTF::BinarySemaphore::wait): Deleted.
* wtf/unicode/Collator.h:
* wtf/win/GDIObject.h:
* wtf/win/PathWalker.h:
* wtf/win/Win32Handle.h:
2019-08-12 Chris Dumez <cdumez@apple.com>
Unreviewed, fix post landing review comments for r248533 from Darin.
* wtf/RefCounted.h:
(WTF::RefCountedBase::ref const):
(WTF::RefCountedBase::applyRefDerefThreadingCheck const):
(WTF::RefCountedBase::derefBase const):
(WTF::RefCountedBase::areThreadingCheckedEnabled const): Deleted.
2019-08-12 Chris Dumez <cdumez@apple.com>
Add threading assertions to RefCounted
https://bugs.webkit.org/show_bug.cgi?id=200507
Reviewed by Ryosuke Niwa.
Add threading assertions to RefCounted to try and catch unsafe concurrent ref'ing / derefing of
RefCounted objects from several threads. If you hit these new assertions, it likely means you either
need to:
1. Have your class subclass ThreadSafeRefCounted instead of RefCounted
or
2. Make sure your objects always gets ref'd / deref'd from the same thread.
These assertions already found several thread safety bugs in our code base, which I fixed via
dependency bugs.
These assertions are currently enabled in WebKit (UIProcess, child processes and
WebKitLegacy), they do not apply other JavascriptCore API clients.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/RefCounted.cpp: Added.
* wtf/RefCounted.h:
(WTF::RefCountedBase::ref const):
(WTF::RefCountedBase::disableThreadingChecks):
(WTF::RefCountedBase::enableThreadingChecksGlobally):
(WTF::RefCountedBase::RefCountedBase):
(WTF::RefCountedBase::areThreadingCheckedEnabled const):
(WTF::RefCountedBase::derefBase const):
* wtf/SizeLimits.cpp:
2019-08-12 Chris Dumez <cdumez@apple.com>
Unreviewed, rolling out r248525.
Revert new threading assertions while I work on fixing the
issues they exposed
Reverted changeset:
"Add threading assertions to RefCounted"
https://bugs.webkit.org/show_bug.cgi?id=200507
https://trac.webkit.org/changeset/248525
2019-08-11 Chris Dumez <cdumez@apple.com>
Add threading assertions to RefCounted
https://bugs.webkit.org/show_bug.cgi?id=200507
Reviewed by Ryosuke Niwa.
Add threading assertions to RefCounted to try and catch unsafe concurrent ref'ing / derefing of
RefCounted objects from several threads. If you hit these new assertions, it likely means you either
need to:
1. Have your class subclass ThreadSafeRefCounted instead of RefCounted
or
2. Make sure your objects always gets ref'd / deref'd from the same thread.
These assertions already found several thread safety bugs in our code base, which I fixed via
dependency bugs.
These assertions are currently enabled in WebKit (UIProcess, child processes and
WebKitLegacy), they do not apply other JavascriptCore API clients.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/RefCounted.cpp: Added.
* wtf/RefCounted.h:
(WTF::RefCountedBase::ref const):
(WTF::RefCountedBase::disableThreadingChecks):
(WTF::RefCountedBase::enableThreadingChecksGlobally):
(WTF::RefCountedBase::RefCountedBase):
(WTF::RefCountedBase::areThreadingCheckedEnabled const):
(WTF::RefCountedBase::derefBase const):
* wtf/SizeLimits.cpp:
2019-08-09 Saam Barati <sbarati@apple.com>
[WHLSL] Devirtualize the AST
https://bugs.webkit.org/show_bug.cgi?id=200522
Reviewed by Robin Morisset.
Make RefCounted use std::default_delete instead of explicitly calling delete.
This allows uses of RefCounted to define their own custom deleter.
* wtf/RefCounted.h:
(WTF::RefCounted::deref const):
* wtf/UniqueRef.h:
(WTF::UniqueRef::UniqueRef):
2019-08-08 Chris Dumez <cdumez@apple.com>
Fix thread safety issue in AudioSampleDataSource() constructor
https://bugs.webkit.org/show_bug.cgi?id=200547
Reviewed by Alex Christensen.
Make Logger ThreadSafeRefCounted as it is ref'd / deref'd from various
threads (including the main thread and the WebKitWebRTCAudioModule thread).
* wtf/Logger.h:
2019-08-08 Michael Saboff <msaboff@apple.com>
OpenSource MemoryFootprint API for JSC command line tool
https://bugs.webkit.org/show_bug.cgi?id=200541
Reviewed by Saam Barati.
OpenSource version of WebKitAdditions/MemoryFootprint.h.
* WTF.xcodeproj/project.pbxproj:
* wtf/spi/darwin/ProcessMemoryFootprint.h: Added.
(ProcessMemoryFootprint::now):
(ProcessMemoryFootprint::resetPeak):
2019-08-08 Per Arne Vollan <pvollan@apple.com>
[Mac] Use the PID of the WebContent process when issuing local file read sandbox extensions
https://bugs.webkit.org/show_bug.cgi?id=200543
<rdar://problem/49394015>
Reviewed by Brent Fulgham.
Add new SPI.
* wtf/Platform.h:
* wtf/spi/darwin/SandboxSPI.h:
2019-08-07 Chris Dumez <cdumez@apple.com>
Tighten WeakPtr threading assertions for GC threads
https://bugs.webkit.org/show_bug.cgi?id=200451
Reviewed by Youenn Fablet.
Make sure our GC threads do not dereference WeakPtr for main thread
objects by tightening our threading assertions in WeakPtr. They are
still allowed to call WeakPtr::get() for now though.
* wtf/WeakPtr.h:
(WTF::WeakPtrImpl::get):
(WTF::WeakPtrImpl::wasConstructedOnMainThread const):
(WTF::WeakPtr::get const):
(WTF::WeakPtr::operator-> const):
(WTF::WeakPtr::operator* const):
2019-08-06 Jiewen Tan <jiewen_tan@apple.com>
Unreviewed, a build fix after r248308
Use kSecUseDataProtectionKeychain for iOS 13 and macOS Catalina or newer.
* wtf/Platform.h:
2019-08-06 Chris Dumez <cdumez@apple.com>
Fix inefficiency in HTTPHeaderMap::set(CFStringRef, const String&)
https://bugs.webkit.org/show_bug.cgi?id=200475
Reviewed by Darin Adler.
Add convenience constuctor to StringView which takes in a const char*
and an unsigned length, similarly to what we already have for String.
* wtf/URL.cpp:
(WTF::URL::protocolIs const):
(WTF::protocolIsInternal):
* wtf/text/StringView.h:
(WTF::StringView::StringView):
(WTF::StringView::empty):
2019-08-06 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Enable LocalAuthenticator for macOS
https://bugs.webkit.org/show_bug.cgi?id=182772
<rdar://problem/43347920>
Reviewed by Brent Fulgham.
* wtf/Platform.h:
Adds HAVE_DEVICE_IDENTITY.
* wtf/spi/cocoa/SecuritySPI.h:
Adds a SPI for telling macOS keychain to use the modern one.
2019-08-06 Claudio Saavedra <csaavedra@igalia.com>
FileSystem: silent build warning
Unreviewed compilation warning fix.
Remove unused parameter in empty method
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::createTemporaryZipArchive):
2019-08-05 Youenn Fablet <youenn@apple.com>
Make Logger::log thread safe so that it can be used from background threads
https://bugs.webkit.org/show_bug.cgi?id=200448
Reviewed by Eric Carlson.
Add a lock to ensure calling log is thread-safe.
* wtf/Logger.h:
(WTF::Logger::addObserver):
(WTF::Logger::removeObserver):
(WTF::Logger::log):
(WTF::Logger::observerLock):
2019-08-05 Takashi Komori <Takashi.Komori@sony.com>
[Curl] implement CertificateInfo::summaryInfo
https://bugs.webkit.org/show_bug.cgi?id=191498
Reviewed by Alex Christensen.
Fixed function template for encoding vector.
* wtf/persistence/PersistentCoders.h:
2019-08-02 Mark Lam <mark.lam@apple.com>
[ARM64E] Harden the diversity of the DOMJIT::Signature::unsafeFunction pointer.
https://bugs.webkit.org/show_bug.cgi?id=200292
<rdar://problem/53706881>
Reviewed by Geoffrey Garen.
* wtf/PtrTag.h:
- Introducing WTF_VTBL_FUNCPTR_PTRAUTH and WTF_VTBL_FUNCPTR_PTRAUTH_STR macros for
defining vtbl function pointer style pointer signing modifier.
2019-08-02 Eric Carlson <eric.carlson@apple.com>
uniqueLogIdentifier() should generate a 64-bit identifier
https://bugs.webkit.org/show_bug.cgi?id=200403
<rdar://problem/53878447>
Reviewed by Youenn Fablet.
* wtf/LoggerHelper.h:
(WTF::LoggerHelper::childLogIdentifier const): Use uint64_t masks.
(WTF::LoggerHelper::uniqueLogIdentifier): cryptographicallyRandomNumber returns a
uint32_t so use two to generate a 64-bit identifier.
2019-08-02 Alex Christensen <achristensen@webkit.org>
Fix an internal build after r248139
https://bugs.webkit.org/show_bug.cgi?id=200102
* wtf/cocoa/FileSystemCocoa.mm:
Some internal builds couldn't find BOM framework headers.
No problem. They're not needed. Just remove references to them.
2019-08-01 Alex Christensen <achristensen@webkit.org>
Move FormData zip file generation to NetworkProcess and enable it for all WebKit clients for uploading directories
https://bugs.webkit.org/show_bug.cgi?id=200102
<rdar://problem/53275114>
Reviewed by Darin Adler.
Move code from BlobDataFileReference::generateReplacementFile to FileSystem::createZipArchive.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::createZipArchive):
* wtf/FileSystem.h:
* wtf/cocoa/FileSystemCocoa.mm:
(WTF::FileSystemImpl::createZipArchive):
2019-08-01 Per Arne Vollan <pvollan@apple.com>
Initialize memory pressure flag in MemoryPressureHandler
https://bugs.webkit.org/show_bug.cgi?id=200353
Reviewed by Geoffrey Garen.
The flag 'm_underMemoryPressure' in MemoryPressureHandler should be initialized to 'false'.
* wtf/MemoryPressureHandler.h:
2019-08-01 Chris Dumez <cdumez@apple.com>
Add threading assertion to WeakPtr's operator->()
https://bugs.webkit.org/show_bug.cgi?id=199922
Reviewed by Ryosuke Niwa.
Add threading assertion to WeakPtr's operator->() to make sure that the WeakPtr
always gets dereferenced on the same thread it was constructed on.
* wtf/WeakPtr.h:
(WTF::WeakPtrImpl::get):
(WTF::WeakPtrImpl::WeakPtrImpl):
2019-07-31 Youenn Fablet <youenn@apple.com>
Use CTFontCreateForCharactersWithLanguageAndOption if available instead of CTFontCreateForCharactersWithLanguage
https://bugs.webkit.org/show_bug.cgi?id=200241
Reviewed by Myles C. Maxfield.
* wtf/Platform.h: Add macro to enable/disable new SPI.
2019-07-31 Keith Rollin <krollin@apple.com>
Fix 64-bit vs 32-bit mismatch in PersistentCoders.h
https://bugs.webkit.org/show_bug.cgi?id=200288
<rdar://problem/53734203>
Reviewed by Chris Dumez.
hashMapSize is declared as a uint64_t. It is passed to
HashMapType::reserveInitialCapacity, which takes an unsigned int. This
is a 32-bit value on 32-bit platforms, leading to a compile time
error. Fix his by casting hashMapSize to the expected type.
* wtf/persistence/PersistentCoders.h:
2019-07-31 Keith Rollin <krollin@apple.com>
Fix 64-bit vs 32-bit mismatch in LogArgument
https://bugs.webkit.org/show_bug.cgi?id=200286
<rdar://problem/53733671>
Reviewed by Darin Adler.
LogArgument is a utility for converting scalars into strings. It has a
number of versions of a toString() method that is specialized for each
type and converts the value to a string in a manner appropriate for
that type. However, the versions of toString() for "long long" and
"unsigned long long" are actually declared to take an "long" or
"unsigned long" as a parameter. This difference leads to a 64-bit vs
32-bit build error on 32-bit systems. Fix this by specifying
correct/matching types.
* wtf/Logger.h:
(WTF::LogArgument::toString):
2019-07-30 Myles C. Maxfield <mmaxfield@apple.com>
REGRESSION(r241288): Text on Yahoo Japan mobile looks too bold
https://bugs.webkit.org/show_bug.cgi?id=200065
<rdar://problem/50912757>
Reviewed by Simon Fraser.
* wtf/Platform.h:
2019-07-30 Michael Catanzaro <mcatanzaro@igalia.com>
Fix CRASH_WITH_INFO() so that it doesn't complain about unused parameters on non Clang / MSVC compilers.
https://bugs.webkit.org/show_bug.cgi?id=200243
Reviewed by Mark Lam.
For GCC, we'll implement WTFCrashWithInfo as a function rather than a macro. To use
##__VA_ARGS we would need to enable GNU extensions, and don't want to do that. The proper
solution, format __VA_OPT__(,) __VA_ARGS__, requires C++20. So just use an inline function
for now as a workaround.
* wtf/Assertions.h:
(CRASH_WITH_INFO):
(CRASH_WITH_SECURITY_IMPLICATION_AND_INFO):
2019-07-25 Dean Jackson <dino@apple.com>
Add helper for ignoring deprecated implementation warnings
https://bugs.webkit.org/show_bug.cgi?id=200135
Reviewed by Wenson Hsieh.
Add ALLOW_DEPRECATED_IMPLEMENTATIONS_BEGIN/END macro which
is IGNORE_WARNINGS_BEGIN("deprecated-implementations")
* wtf/Compiler.h:
2019-07-24 Yusuke Suzuki <ysuzuki@apple.com>
[bmalloc] Add IsoHeap test to ensure that IsoHeap pages are not allocating too large VA
https://bugs.webkit.org/show_bug.cgi?id=200103
Reviewed by Mark Lam.
We move VMTag page investigation code from PAL to WTF to use it in TestWTF.
And we also accumulate allocated VA size in `reserved` field of `TagInfo`.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/PlatformMac.cmake:
* wtf/ResourceUsage.h: Added.
* wtf/cocoa/MemoryPressureHandlerCocoa.mm:
* wtf/cocoa/ResourceUsageCocoa.cpp: Added.
(WTF::vmPageSize):
(WTF::logFootprintComparison):
(WTF::displayNameForVMTag):
(WTF::pagesPerVMTag):
* wtf/spi/cocoa/MachVMSPI.h: Added.
2019-07-23 Keith Miller <keith_miller@apple.com>
Add cheat sheet comment for HashMap/Set iterator/AddResult
https://bugs.webkit.org/show_bug.cgi?id=200061
Reviewed by Saam Barati.
* wtf/HashMap.h:
* wtf/HashSet.h:
2019-07-23 Keith Rollin <krollin@apple.com>
Remove rest of NavigatorContentUtils support
https://bugs.webkit.org/show_bug.cgi?id=200052
<rdar://problem/53467357>
Reviewed by Alex Christensen.
Bug 196070 removes most of the support for the never-used
NavigatorContentUtils facility. However, there were still a couple of
left-over references after that change. This patch sweeps those up.
* wtf/FeatureDefines.h:
2019-07-23 Keith Rollin <krollin@apple.com>
Enable HAVE_APP_LINKS_WITH_ISENABLED for entire iOS family
https://bugs.webkit.org/show_bug.cgi?id=200040
<rdar://problem/53457670>
Reviewed by Tim Horton.
This feature was enabled for just iOS, but should be enabled for tvOS
and watchOS, too.
* wtf/Platform.h:
2019-07-23 Alicia Boya García <aboya@igalia.com>
[WTF] Add DataMutex and MainThreadData wrappers
https://bugs.webkit.org/show_bug.cgi?id=199831
Reviewed by Alex Christensen.
This patch adds two new wrapper classes:
DataMutex<T> stores an instance of T in a private member along with a
mutex. In order to use its fields, users need to instantiate a
DataMutex<T>::LockedWrapper instance in the stack. This class uses
RAII to lock and unlock the mutex in construction and destruction
respectively, and by using the arrow operator lets the user access T's
members.
This way, DataMutex<T> prevents most instances of accidental access to
data fields that should only be read and modified in an atomic matter.
Still, both the Lock and the LockHolder are exposed once the user has
taken the lock so that special cases such as waiting for a condition
variable or performing an early unlock are doable.
MainThreadData<T> is another wrapper class, in this case for data
fields that should only be accessed from the main thread. In this
case, it works similar to a smart pointer, except that (1) there is no
actual memory indirection, T is stored directly inside
MainThreadData<T> and (2) attempts to use the -> or * operator have an
isMainThread() assertion.
Together, these two wrapper classes make it easier to write
multi-threaded code in a safer, more self-documented way by letting
the author group data into structures that have certain access safety
requirements.
These structures were originally part of the new GStreamer
WebKitMediaSrc rework patch: https://bugs.webkit.org/show_bug.cgi?id=199719
* wtf/CMakeLists.txt:
* wtf/DataMutex.h: Added.
(WTF::DataMutex::DataMutex):
(WTF::DataMutex::LockedWrapper::LockedWrapper):
(WTF::DataMutex::LockedWrapper::operator->):
(WTF::DataMutex::LockedWrapper::operator*):
(WTF::DataMutex::LockedWrapper::mutex):
(WTF::DataMutex::LockedWrapper::lockHolder):
* wtf/MainThreadData.h: Added.
(WTF::MainThreadData::MainThreadData):
(WTF::MainThreadData::operator->):
(WTF::MainThreadData::operator*):
2019-07-22 Yusuke Suzuki <ysuzuki@apple.com>
[bmalloc] Each IsoPage gets 1MB VA because VMHeap::tryAllocateLargeChunk rounds up
https://bugs.webkit.org/show_bug.cgi?id=200024
Reviewed by Saam Barati.
Start using a VM tag for IsoHeap instead of CLoop Stack.
* wtf/OSAllocator.h:
* wtf/VMTags.h:
2019-07-20 Chris Dumez <cdumez@apple.com>
Speed up HashTable decoding by reserving capacity and avoiding rehashing
https://bugs.webkit.org/show_bug.cgi?id=199982
Reviewed by Saam Barati.
Introduce reserveInitialCapacity() on HashMap to reserve capacity on a
HashMap and cut down on rehashing cost when possible.
* wtf/HashMap.h:
* wtf/HashTable.h:
(WTF::HashTable::reserveInitialCapacity):
* wtf/persistence/PersistentCoders.h:
Use HashMap::reserveInitialCapacity() in the HashMap persistent decoder for
performance.
2019-07-20 Alexander Mikhaylenko <exalm7659@gmail.com>
REGRESSION(r246033/r246496): [GTK] Kinetic scrolling doesn't work
https://bugs.webkit.org/show_bug.cgi?id=199322
Reviewed by Michael Catanzaro.
Introduce ENABLE_KINETIC_SCROLLING to explicitly always have kinetic scrolling on GTK.
* wtf/Platform.h:
2019-07-18 Youenn Fablet <youenn@apple.com>
Make sure to set kCTFontFallbackOptionAttribute to kCTFontFallbackOptionSystem for system fonts
https://bugs.webkit.org/show_bug.cgi?id=199769
<rdar://problem/49390297>
Reviewed by Myles C. Maxfield.
* wtf/Platform.h:
2019-07-17 Christopher Reid <chris.reid@sony.com>
Bytecode cache should use FileSystem
https://bugs.webkit.org/show_bug.cgi?id=199759
Reviewed by Yusuke Suzuki.
* wtf/FileSystem.cpp:
* wtf/FileSystem.h:
Add support for creating MappedFileData from a preexisting file handle
for use with locked files. Also support creating MappedFileData
with either private or shared mappings.
* wtf/UUID.cpp:
Avoid ASSERT with returning a LazyNeverDestroyed object that hasn't been created.
* wtf/glib/FileSystemGlib.cpp:
* wtf/win/FileSystemWin.cpp:
Add truncateFile implementations.
2019-07-17 Sam Weinig <weinig@apple.com>
Add StringBuilder member function which allows makeString() style variadic argument construction
https://bugs.webkit.org/show_bug.cgi?id=198997
Reviewed by Darin Adler.
Adds new StringBuilder::flexibleAppend(...) member function which allows passing one or more
string-adaptable (in the sense that there is StringTypeAdapter specialization for the
type) parameters. This re-ususes the variadic template infrastructure in StringConcatenate.h
that is used for makeString(...) allowing for improvements in one to benefit the other.
The advantage of StringBuilder::flexibleAppend(...) over calling StringBuilder::append(...)
multiple times (beyond the code sharing with makeString(...) is that it can avoid unnecessary
additional re-allocations when the StringBuilder needs to expand it's capacity. It does this
by computing the complete required length for all the passed arguments and then ensuring enough
capacity is available. It also reduces the allocation overhead versus the anti-pattern of
builder.append(makeString(...)).
Ideally, this member function should eventually just be called StringBuilder::append(...), but
the current overload set for StringBuilder::append(...) makes this complicated due to overloads
that take two arguments such as StringBuilder::append(const UChar*, unsigned). Going forward, we
should rename or remove those overloads and move to a standard interface.
* wtf/posix/FileSystemPOSIX.cpp:
(WTF::FileSystemImpl::pathByAppendingComponents):
Adopt StringBuilder::flexibleAppend, using to combine the append of '/' and component.
* wtf/text/StringBuilder.cpp:
(WTF::StringBuilder::appendUninitialized):
(WTF::StringBuilder::appendUninitializedWithoutOverflowCheck):
Extract the part of appendUnitialized that doesn't do the overflow check
into it's own member function to allow callers that have already done the
overflow check to bypass it.
(WTF::StringBuilder::appendUninitializedWithoutOverflowCheckForUChar):
(WTF::StringBuilder::appendUninitializedWithoutOverflowCheckForLChar):
Added to allow template member function flexibleAppendFromAdapters to call
appendUninitializedWithoutOverflowCheck without moving it to the header.
* wtf/text/StringBuilder.h:
(WTF::StringBuilder::flexibleAppendFromAdapters):
(WTF::StringBuilder::flexibleAppend):
Modeled on tryMakeStringFromAdapters in StringConcatenate.h, these
eagerly compute the required length, expand the buffer and then use
the existing string type adaptor accumulation functions used by makeString.
* wtf/text/StringConcatenate.h:
(WTF::stringTypeAdapterAccumulator):
(WTF::tryMakeStringFromAdapters):
(WTF::makeStringAccumulator): Deleted.
Renames makeStringAccumulator to stringTypeAdapterAccumulator now that it is used
by more than just makeString.
2019-07-17 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r247505.
https://bugs.webkit.org/show_bug.cgi?id=199871
"Caused failed ASSERT in stress test" (Requested by creid on
#webkit).
Reverted changeset:
"Bytecode cache should use FileSystem"
https://bugs.webkit.org/show_bug.cgi?id=199759
https://trac.webkit.org/changeset/247505
2019-07-16 Christopher Reid <chris.reid@sony.com>
Bytecode cache should use FileSystem
https://bugs.webkit.org/show_bug.cgi?id=199759
Reviewed by Yusuke Suzuki.
* wtf/FileSystem.cpp:
* wtf/FileSystem.h:
Add support for creating MappedFileData from a preexisting file handle
for use with locked files. Also support creating MappedFileData
with either private or shared mappings.
* wtf/UUID.cpp:
Avoid ASSERT with returning a LazyNeverDestroyed object that hasn't been created.
* wtf/glib/FileSystemGlib.cpp:
* wtf/win/FileSystemWin.cpp:
Add truncateFile implementations.
2019-07-16 Myles C. Maxfield <mmaxfield@apple.com>
New York font erroneously gets synthetic bold
https://bugs.webkit.org/show_bug.cgi?id=199653
Unreviewed MacCatalyst build fix.
* wtf/Platform.h:
2019-07-16 Michael Catanzaro <mcatanzaro@igalia.com>
[WPE][GTK] Improvements and fixes in FileSystemGlib.cpp
https://bugs.webkit.org/show_bug.cgi?id=199800
Reviewed by Carlos Garcia Campos.
Use nullptr.
Fix a GFileInfo leak in getFileSize.
Use GRefPtr to clarify ownership of the GFileIOStream in openFile.
* wtf/glib/FileSystemGlib.cpp:
(WTF::FileSystemImpl::getFileSize):
(WTF::FileSystemImpl::getVolumeFreeSpace):
(WTF::FileSystemImpl::openTemporaryFile):
(WTF::FileSystemImpl::openFile):
(WTF::FileSystemImpl::seekFile):
(WTF::FileSystemImpl::writeToFile):
(WTF::FileSystemImpl::readFromFile):
2019-07-15 Myles C. Maxfield <mmaxfield@apple.com>
New York font erroneously gets synthetic bold
https://bugs.webkit.org/show_bug.cgi?id=199653
Unreviewed watchOS build fix.
* wtf/Platform.h:
2019-07-15 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r247462.
https://bugs.webkit.org/show_bug.cgi?id=199816
completely messed up the patch (Requested by litherum on
#webkit).
Reverted changeset:
"New York font erroneously gets synthetic bold"
https://bugs.webkit.org/show_bug.cgi?id=199653
https://trac.webkit.org/changeset/247462
2019-07-11 Myles C. Maxfield <mmaxfield@apple.com>
New York font erroneously gets synthetic bold
https://bugs.webkit.org/show_bug.cgi?id=199653
<rdar://problem/51692592>
Reviewed by Simon Fraser.
* wtf/Platform.h:
2019-07-15 Brady Eidson <beidson@apple.com>
Make WKURLSchemeTask thread safe.
<rdar://problem/50471863> and https://bugs.webkit.org/show_bug.cgi?id=199764
Reviewed by Alex Christensen.
* wtf/MainThread.cpp:
(WTF::callOnMainAndWait):
(WTF::callOnMainRunLoopAndWait):
(WTF::callOnMainThreadAndWait):
* wtf/MainThread.h:
2019-07-15 Dean Jackson <dino@apple.com>
MacCatalyst asserts when command key is raised
https://bugs.webkit.org/show_bug.cgi?id=199805
<rdar://problem/53120393>
Reviewed by Tim Horton.
Add USE_UIKIT_KEYBOARD_ADDITIONS for iOS 13+ and macCatalyst.
* wtf/FeatureDefines.h:
2019-07-14 Chris Dumez <cdumez@apple.com>
Add threading assertion to WeakPtrFactory::createWeakPtr()
https://bugs.webkit.org/show_bug.cgi?id=199639
Reviewed by Ryosuke Niwa.
Add threading assertion to WeakPtrFactory::createWeakPtr() to make sure it
is called on the same thread where the WeakPtrFactory wad constructed.
* wtf/WeakPtr.h:
(WTF::WeakPtrFactory::WeakPtrFactory):
(WTF::WeakPtrFactory::createWeakPtr const):
2019-07-14 Dean Jackson <dino@apple.com>
WebGL not supported on WKWebView on UIKit for Mac
https://bugs.webkit.org/show_bug.cgi?id=199785
<rdar://problem/52911449>
Reviewed by Antoine Quint.
MacCatalyst has Apple Graphics Control, although
this area is very messy, see <rdar://53062794>.
* wtf/Platform.h:
2019-07-11 Myles C. Maxfield <mmaxfield@apple.com>
New York font erroneously gets synthetic bold
https://bugs.webkit.org/show_bug.cgi?id=199653
<rdar://problem/51692592>
Reviewed by Simon Fraser.
* wtf/Platform.h:
2019-07-11 Pablo Saavedra <psaavedra@igalia.com>
[WPE][GTK] Build failure with ENABLE_ACCESSIBILITY=OFF
https://bugs.webkit.org/show_bug.cgi?id=199625
Added ENABLE(ACCESSIBILITY) and replaced HAVE(ACCESSIBILITY)
with ENABLE(ACCESSIBILITY) in the code.
Additionally, the TestRunner code generator now honors the
Conditional IDL format.
Reviewed by Konstantin Tokarev.
* wtf/FeatureDefines.h:
* wtf/Platform.h:
2019-07-10 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r247286.
Caused TestWTF.WTF.StringOperators to fail on debug bots
Reverted changeset:
"Add StringBuilder member function which allows makeString()
style variadic argument construction"
https://bugs.webkit.org/show_bug.cgi?id=198997
https://trac.webkit.org/changeset/247286
2019-07-09 Michael Catanzaro <mcatanzaro@igalia.com>
[WPE][GTK] GUniqueOutPtr::release should return a raw pointer
https://bugs.webkit.org/show_bug.cgi?id=199579
Reviewed by Carlos Garcia Campos.
GUniqueOutPtr::release should release to a raw pointer, rather than a GUniquePtr. If a
GUniquePtr is desired, it's trivial to construct one from the raw pointer, but all existing
callsites under Source/ would rather have a raw pointer. Currently they have to call
release().release() to get the raw pointer, which is annoying.
* wtf/glib/GUniquePtr.h:
(WTF::GUniqueOutPtr::release):
2019-07-09 Sam Weinig <weinig@apple.com>
Add StringBuilder member function which allows makeString() style variadic argument construction
https://bugs.webkit.org/show_bug.cgi?id=198997
Reviewed by Darin Adler.
Adds new StringBuilder::flexibleAppend(...) member function which allows passing one or more
string-adaptable (in the sense that there is StringTypeAdapter specialization for the
type) parameters. This re-ususes the variadic template infrastructure in StringConcatenate.h
that is used for makeString(...) allowing for improvements in one to benefit the other.
The advantage of StringBuilder::flexibleAppend(...) over calling StringBuilder::append(...)
multiple times (beyond the code sharing with makeString(...) is that it can avoid unnecessary
additional re-allocations when the StringBuilder needs to expand it's capacity. It does this
by computing the complete required length for all the passed arguments and then ensuring enough
capacity is available. It also reduces the allocation overhead versus the anti-pattern of
builder.append(makeString(...)).
Ideally, this member function should eventually just be called StringBuilder::append(...), but
the current overload set for StringBuilder::append(...) makes this complicated due to overloads
that take two arguments such as StringBuilder::append(const UChar*, unsigned). Going forward, we
should rename or remove those overloads and move to a standard interface.
* wtf/posix/FileSystemPOSIX.cpp:
(WTF::FileSystemImpl::pathByAppendingComponents):
Adopt StringBuilder::flexibleAppend, using to combine the append of '/' and component.
* wtf/text/StringBuilder.cpp:
(WTF::StringBuilder::appendUninitialized):
(WTF::StringBuilder::appendUninitializedWithoutOverflowCheck):
Extract the part of appendUnitialized that doesn't do the overflow check
into it's own member function to allow callers that have already done the
overflow check to bypass it.
(WTF::StringBuilder::appendUninitializedWithoutOverflowCheckForUChar):
(WTF::StringBuilder::appendUninitializedWithoutOverflowCheckForLChar):
Added to allow template member function flexibleAppendFromAdapters to call
appendUninitializedWithoutOverflowCheck without moving it to the header.
* wtf/text/StringBuilder.h:
(WTF::StringBuilder::flexibleAppendFromAdapters):
(WTF::StringBuilder::flexibleAppend):
Modeled on tryMakeStringFromAdapters in StringConcatenate.h, these
eagerly compute the required length, expand the buffer and then use
the existing string type adaptor accumulation functions used by makeString.
* wtf/text/StringConcatenate.h:
(WTF::stringTypeAdapterAccumulator):
(WTF::tryMakeStringFromAdapters):
(WTF::makeStringAccumulator): Deleted.
Renames makeStringAccumulator to stringTypeAdapterAccumulator now that it is used
by more than just makeString.
2019-07-09 Alex Christensen <achristensen@webkit.org>
When parsing an IPv4 address, wait until after deciding it is indeed an IPv4 address before reporting syntax violations
https://bugs.webkit.org/show_bug.cgi?id=199628
Reviewed by Brady Eidson.
Otherwise, we sometimes report syntax violations on things that are not IPv4 addresses and don't have syntax violations.
I added a unit test with one such URL that used to cause an assertion.
* wtf/URLParser.cpp:
(WTF::URLParser::parseIPv4Host):
2019-07-09 Alex Christensen <achristensen@webkit.org>
Remove invalid assertion in URLParser::domainToASCII
https://bugs.webkit.org/show_bug.cgi?id=199624
Reviewed by Brady Eidson.
When a non-ASCII domain's punycode encoding is longer than 63 characters,
the URL is supposed to fail to parse, according to https://www.unicode.org/reports/tr46/#ToASCII
We and all other browsers do this. When uidna_nameToASCII tries to punycode encode such a domain,
it can return a number larger than 63. In this case, processingDetails.errors is UIDNA_ERROR_LABEL_TOO_LONG
and we fail to parse as desired and uidna_nameToASCII did not write out of bounds, so it was just the assertion
that was wrong. I added some unit tests that would have hit the assertion and verify that we fail at the correct length.
* wtf/URLParser.cpp:
(WTF::URLParser::domainToASCII):
2019-07-09 Alex Christensen <achristensen@webkit.org>
URLParser should reserialize IPv6 addresses that end with a colon
https://bugs.webkit.org/show_bug.cgi?id=199627
Reviewed by Brady Eidson.
When an IPv6 address ends in a colon, the colon should be removed which means the
serialized output is different than the input, which the URLParser calls a syntax violation.
This matches the URL specification, and I added a unit test that used to assert.
* wtf/URLParser.cpp:
(WTF::URLParser::parseIPv6Host):
2019-07-08 Chris Dumez <cdumez@apple.com>
Use WeakHashSet for WebUserContentControllerProxy::m_processes
https://bugs.webkit.org/show_bug.cgi?id=199591
<rdar://problem/52798721>
Reviewed by Youenn Fablet.
Update WeakHashSet::add() to return an AddResult type, similarly to our other containers.
* wtf/WeakHashSet.h:
(WTF::WeakHashSet::add):
2019-07-08 Christopher Reid <chris.reid@sony.com>
Implement MappedFileData for Windows
https://bugs.webkit.org/show_bug.cgi?id=198269
Reviewed by Darin Adler.
Original patch by Fujii Hironori.
Add Windows implementations for MappedFileData constructor and destructor.
* wtf/FileSystem.cpp:
* wtf/FileSystem.h:
* wtf/win/FileSystemWin.cpp:
2019-07-08 Chris Dumez <cdumez@apple.com>
Add threading assertion to WTF::CompletionHandler
https://bugs.webkit.org/show_bug.cgi?id=199516
Reviewed by Alex Christensen.
Add threading assertion to WTF::CompletionHandler to try and catch common cases
of unsafe usage (completion handler constructed on one thread but called on
another).
* wtf/CompletionHandler.h:
(WTF::CompletionHandler<Out):
2019-07-08 Antoine Quint <graouts@apple.com>
[Pointer Events] Enable only on the most recent version of the supported iOS family
https://bugs.webkit.org/show_bug.cgi?id=199562
<rdar://problem/52766511>
Reviewed by Dean Jackson.
We really don't need HAVE_UI_WEB_TOUCH_EVENTS_GESTURE_RECOGNIZER_WITH_ACTIVE_TOUCHES_BY_ID since the UIKit SPI
that was added in iOS 13 that it's checking for is really required for all parts of the implementation of Pointer
Events, including dispatch of the "pointercancel" event and support for the "touch-action" CSS property.
* wtf/Platform.h:
2019-07-05 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r247115.
Breaks lldbWebKitTester (and by extension, test-webkitpy)
Reverted changeset:
"[WHLSL] Standard library is too big to directly include in
WebCore"
https://bugs.webkit.org/show_bug.cgi?id=198186
https://trac.webkit.org/changeset/247115
2019-07-03 Jonathan Bedard <jbedard@apple.com>
[Catalina] Enable WebKit build
https://bugs.webkit.org/show_bug.cgi?id=199209
Reviewed by Darin Adler.
* wtf/spi/cocoa/SecuritySPI.h: Declare SecTrustedApplicationCreateFromPath(...).
2019-07-03 Keith Miller <keith_miller@apple.com>
PACCage should first cage leaving PAC bits intact then authenticate
https://bugs.webkit.org/show_bug.cgi?id=199372
Reviewed by Saam Barati.
* wtf/CagedPtr.h:
(WTF::CagedPtr::get const):
(WTF::CagedPtr::getMayBeNull const):
(WTF::CagedPtr::mergePointers):
2019-07-03 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r246616.
Caused http/tests/inspector/network/har/har-page.html to fail
on Catalina.
Reverted changeset:
"Web Inspector: Network: replace CFNetwork SPI with new API
where able"
https://bugs.webkit.org/show_bug.cgi?id=198762
https://trac.webkit.org/changeset/246616
2019-07-02 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r247041.
https://bugs.webkit.org/show_bug.cgi?id=199425
broke some iOS arm64e tests (Requested by keith_miller on
#webkit).
Reverted changeset:
"PACCage should first cage leaving PAC bits intact then
authenticate"
https://bugs.webkit.org/show_bug.cgi?id=199372
https://trac.webkit.org/changeset/247041
2019-07-02 Chris Dumez <cdumez@apple.com>
ThreadSafeRefCounted<DestructionThread::Main> is not safe to use in the UIProcess
https://bugs.webkit.org/show_bug.cgi?id=199420
<rdar://problem/52289717>
Reviewed by Ryosuke Niwa.
* wtf/MainThread.cpp:
(WTF::isMainRunLoop):
(WTF::callOnMainRunLoop):
* wtf/MainThread.h:
Add some function to MainThread.h to be used by ThreadSafeRefCounted to interact with the
main RunLoop. This is used to avoid a circular dependency between RunLoop (which is
ThreadSafeRefCounted) and ThreadSafeReCounted.
* wtf/ThreadSafeRefCounted.h:
(WTF::ThreadSafeRefCounted::deref const):
Add a new DestructionThread::MainRunLoop enum value to be used by classes that need to
be destroyed on the main RunLoop rather than the main thread (which may be different
when WK1 is invoved)
2019-07-02 Robin Morisset <rmorisset@apple.com>
[WHLSL] the initializer in VariableDeclaration should be a std::unique_ptr, not Optional<UniqueRef<..>>
https://bugs.webkit.org/show_bug.cgi?id=199389
Reviewed by Sam Weinig.
* wtf/UniqueRef.h:
(WTF::UniqueRef::moveToUniquePtr): Added.
2019-07-02 Keith Miller <keith_miller@apple.com>
PACCage should first cage leaving PAC bits intact then authenticate
https://bugs.webkit.org/show_bug.cgi?id=199372
Reviewed by Saam Barati.
* wtf/CagedPtr.h:
(WTF::CagedPtr::get const):
(WTF::CagedPtr::getMayBeNull const):
(WTF::CagedPtr::mergePointers):
2019-07-01 Philippe Normand <pnormand@igalia.com>
[GStreamer] Cannot play Bert's Bytes radio stream from http://radio.dos.nl/
https://bugs.webkit.org/show_bug.cgi?id=198376
Reviewed by Xabier Rodriguez-Calvar.
* wtf/glib/GLibUtilities.h:
(enumToString): Utility function to get a string representation of of a GLib enum.
2019-06-22 Darin Adler <darin@apple.com>
Streamline some string code, focusing on functions that were using substringSharingImpl
https://bugs.webkit.org/show_bug.cgi?id=198898
Reviewed by Daniel Bates.
* wtf/URLHelpers.cpp:
(WTF::URLHelpers::applyHostNameFunctionToURLString): Change code using
substringSharingImpl so it could call String::find to call StringView::contains
instead. Also rewrote lambdas to be simpler and likely more efficient.
Rewrote another case using substringSharingImpl so it could call String::find
to call StringView::find instead.
* wtf/text/StringView.cpp:
(WTF::StringView::startsWith const): Added.
* wtf/text/StringView.h: Tweaked style a bit, and added an overload of
StringView::contains that takes a CodeUnitMatchFunction and an overload
of startsWith that cakes a UChar.
2019-06-28 Konstantin Tokarev <annulen@yandex.ru>
Remove traces of ENABLE_ICONDATABASE remaining after its removal in 219733
https://bugs.webkit.org/show_bug.cgi?id=199317
Reviewed by Michael Catanzaro.
While IconDatabase and all code using it was removed,
ENABLE_ICONDATABASE still exists as build option and C++ macro.
* wtf/FeatureDefines.h:
2019-06-27 Konstantin Tokarev <annulen@yandex.ru>
Avoid using WTF::Function for passing local function pointers and closures in URLHelpers.cpp
https://bugs.webkit.org/show_bug.cgi?id=199271
Reviewed by Yusuke Suzuki.
WTF::Function allocates memory on heap, which is totally redundant in this
case.
* wtf/URLHelpers.cpp:
(WTF::URLHelpers::isSecondLevelDomainNameAllowedByTLDRules):
2019-06-27 Timothy Hatcher <timothy@apple.com>
Move WebKitLegacy off of a couple AppKit ivars.
https://bugs.webkit.org/show_bug.cgi?id=199279
rdar://problem/34983438
Reviewed by Tim Horton.
* wtf/Platform.h: Added HAVE_SUBVIEWS_IVAR_SPI.
2019-06-27 Beth Dakin <bdakin@apple.com>
Upstream use of MACCATALYST
https://bugs.webkit.org/show_bug.cgi?id=199245
rdar://problem/51687723
Reviewed by Tim Horton.
* Configurations/SDKVariant.xcconfig:
* wtf/FeatureDefines.h:
* wtf/Platform.h:
2019-06-27 Don Olmstead <don.olmstead@sony.com>
[FTW] Build JavaScriptCore
https://bugs.webkit.org/show_bug.cgi?id=199254
Reviewed by Brent Fulgham.
* wtf/PlatformFTW.cmake: Added.
2019-06-27 Fujii Hironori <Hironori.Fujii@sony.com>
[CMake] Bump cmake_minimum_required version to 3.10
https://bugs.webkit.org/show_bug.cgi?id=199181
Reviewed by Don Olmstead.
* CMakeLists.txt:
2019-06-26 Konstantin Tokarev <annulen@yandex.ru>
Remove unneeded #include <wtf/glib/GRefPtr.h>
https://bugs.webkit.org/show_bug.cgi?id=199228
Reviewed by Michael Catanzaro.
* wtf/MemoryPressureHandler.h:
2019-06-26 Myles C. Maxfield <mmaxfield@apple.com>
REGRESSION: ( r246394 ) webgpu/whlsl-buffer-fragment.html and webgpu/whlsl-buffer-vertex.html are failing
https://bugs.webkit.org/show_bug.cgi?id=199012
Reviewed by Saam Barati.
* wtf/Platform.h:
2019-06-25 Keith Miller <keith_miller@apple.com>
CagedPtr doesn't merge PAC bits back into the resulting caged pointer.
https://bugs.webkit.org/show_bug.cgi?id=199214
Reviewed by Yusuke Suzuki.
The current code means that caging will just strip the any failed
authentication bits. Adding this code doesn't appear to be a
regression on iPhone Xs.
* wtf/CagedPtr.h:
(WTF::CagedPtr::get const):
(WTF::CagedPtr::getMayBeNull const):
(WTF::CagedPtr::getUnsafe const):
(WTF::CagedPtr::mergePointers):
2019-06-25 Sam Weinig <weinig@apple.com>
Experiment with simple structured bindings use
https://bugs.webkit.org/show_bug.cgi?id=198905
Reviewed by Darin Adler.
* wtf/URLHelpers.cpp:
(WTF::URLHelpers::mapHostNames):
Simplify code using c++ structured bindings (https://en.cppreference.com/w/cpp/language/structured_binding)
to see if all the platforms will work with it.
2019-06-25 Adam Barth <abarth@webkit.org>
[fuchsia] Update to newer zx_clock_get syscall
https://bugs.webkit.org/show_bug.cgi?id=199191
Reviewed by Sam Weinig.
Fuchsia has changed the zx_clock_get syscall to return the clock value
via an out parameter rather than via its return value. This change
makes zx_clock_get consistent with all the other syscalls.
This patch updates our use of zx_clock_get to use the new syscall. The
old syscall is no longer supported by Fuchsia.
* wtf/fuchsia/CPUTimeFuchsia.cpp:
(WTF::CPUTime::get): Switch to using the out parameter.
(WTF::CPUTime::forCurrentThread): Switch to using the out parameter.
2019-06-25 Michael Catanzaro <mcatanzaro@igalia.com>
Fully rename WebKitGTK+ -> WebKitGTK everywhere
https://bugs.webkit.org/show_bug.cgi?id=199159
Reviewed by Carlos Garcia Campos.
* wtf/URLParser.cpp:
(WTF::URLParser::internationalDomainNameTranscoder):
2019-06-25 Michael Catanzaro <mcatanzaro@igalia.com>
Require GCC 7
https://bugs.webkit.org/show_bug.cgi?id=198914
Reviewed by Darin Adler.
Remove now-stale GCC version check.
* wtf/Compiler.h:
2019-06-23 Simon Fraser <simon.fraser@apple.com>
Add OverflowScrollProxyNodes to the scrolling tree
https://bugs.webkit.org/show_bug.cgi?id=199132
Reviewed by Antti Koivisto.
Setting indent is useful if you want to make a new stream with the indent of an
existing stream.
* wtf/text/TextStream.h:
(WTF::TextStream::setIndent):
2019-06-20 Fujii Hironori <Hironori.Fujii@sony.com>
Try to use C++14 std::enable_if_t in CheckedArithmetic.h again
https://bugs.webkit.org/show_bug.cgi?id=199099
Reviewed by Ross Kirsling.
r242235 changed CheckedArithmetic to not use C++14. Let's try
C++14 again.
* wtf/CheckedArithmetic.h: Use C++14 std::make_unsigned_t and std::enable_if_t.
2019-06-18 Darin Adler <darin@apple.com>
Tidy up the remaining bits of the AtomicString to AtomString rename
https://bugs.webkit.org/show_bug.cgi?id=198990
Reviewed by Michael Catanzaro.
* wtf/text/AtomString.cpp: Fix a comment.
* wtf/text/AtomString.h: Tweak formatting a bit. Use nullptr instead of 0.
Removed "using AtomicString = AtomString".
* wtf/text/AtomStringImpl.cpp:
(WTF::CStringTranslator::translate): Use setIsAtom instead of setIsAtomic.
(WTF::UCharBufferTranslator::translate): Ditto.
(WTF::HashAndUTF8CharactersTranslator::translate): Ditto.
(WTF::SubstringTranslator::translate): Ditto.
(WTF::LCharBufferTranslator::translate): Ditto.
(WTF::BufferFromStaticDataTranslator::translate): Ditto.
(WTF::AtomStringImpl::addSlowCase): Ditto.
(WTF::AtomStringImpl::lookUpSlowCase): Updated assertion message.
* wtf/text/AtomStringImpl.h: Tweaked the implementation of add.
Updated comments to say AtomString.
* wtf/text/AtomStringTable.cpp:
(WTF::AtomStringTable::~AtomStringTable): Use setIsAtom.
* wtf/text/StringImpl.h: Updated name of StringAtomic and
s_hashFlagStringKindIsAtom. Renamed to flagIsAtom and setIsAtom.
* wtf/text/WTFString.cpp:
(WTF::String::isSafeToSendToAnotherThread const): Updated comment.
2019-06-20 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Remove support for GTK2 plugins
https://bugs.webkit.org/show_bug.cgi?id=199065
Reviewed by Sergio Villar Senin.
* wtf/Platform.h:
* wtf/glib/GTypedefs.h:
2019-06-19 Yusuke Suzuki <ysuzuki@apple.com>
[bmalloc] IsoHeap's initialization is racy with IsoHeap::isInitialized
https://bugs.webkit.org/show_bug.cgi?id=199053
Reviewed by Saam Barati.
Add constexpr static functions to generate pseudo random numbers from __LINE__.
* wtf/WeakRandom.h:
(WTF::WeakRandom::nextState):
(WTF::WeakRandom::generate):
(WTF::WeakRandom::advance):
2019-06-19 Fujii Hironori <Hironori.Fujii@sony.com>
Add WTF::crossThreadCopy(T&&) to utilize String::isolatedCopy() &&
https://bugs.webkit.org/show_bug.cgi?id=198957
Reviewed by Alex Christensen.
&&-qualified String::isolatedCopy() has a optimization path which
does just WTFMove if it isSafeToSendToAnotherThread which means
the object hasOneRef.
However, WTF::crossThreadCopy was using only &-qualified
isolatedCopy. To use the optimization, added
WTF::crossThreadCopy(T&&) overloading.
* wtf/CrossThreadCopier.h:
(WTF::crossThreadCopy): Added a overload of (T&&).
* wtf/CrossThreadTask.h:
(WTF::createCrossThreadTask): Removed explicit template arguments of crossThreadCopy.
2019-06-19 Devin Rousso <drousso@apple.com>
Web Inspector: Network: replace CFNetwork SPI with new API where able
https://bugs.webkit.org/show_bug.cgi?id=198762
Reviewed by Timothy Hatcher.
* wtf/Platform.h:
2019-06-19 Alex Christensen <achristensen@webkit.org>
Add a unit test for client certificate authentication
https://bugs.webkit.org/show_bug.cgi?id=197800
Reviewed by Youenn Fablet.
* wtf/spi/cocoa/SecuritySPI.h:
Move declarations from ArgumentCodersCF.cpp so they can be shared.
2019-06-19 Adrian Perez de Castro <aperez@igalia.com>
[WPE][GTK] Fix build with unified sources disabled
https://bugs.webkit.org/show_bug.cgi?id=198752
Reviewed by Michael Catanzaro.
* wtf/text/StringBuilder.h: Add missing include of StringConcatenateNumbers.h
2019-06-19 Zan Dobersek <zdobersek@igalia.com>
USE_ANGLE macro can be evaluated without being defined
https://bugs.webkit.org/show_bug.cgi?id=198991
Reviewed by Carlos Garcia Campos.
* wtf/Platform.h: On platforms not yet defining USE_ANGLE, the
incompatibility check with some other flags leads to the macro being
evaluated even when it was not defined, producing compiler warnings.
To avoid this, the macro should be defined to 0 before the check in
case it was not defined already.
2019-06-18 Dean Jackson <dino@apple.com>
UIContextMenuInteraction implementation for WKContentView
https://bugs.webkit.org/show_bug.cgi?id=198986
<rdar://problem/51875189>
Reviewed by Andy Estes.
Add USE_UICONTEXTMENU for iOS 13+.
* wtf/Platform.h:
2019-06-18 Kenneth Russell <kbr@chromium.org>
Add preliminary ANGLE backend to WebCore
https://bugs.webkit.org/show_bug.cgi?id=197755
Reviewed by Dean Jackson.
Add a USE_ANGLE definition to wtf/Platform.h (currently disabled)
which, when enabled, uses ANGLE instead of the OpenGL or OpenGL ES
backend.
* wtf/Platform.h:
2019-06-17 Jiewen Tan <jiewen_tan@apple.com>
Move SOAuthorization from WebKitAdditions to WebKit
https://bugs.webkit.org/show_bug.cgi?id=198874
<rdar://problem/47573431>
Reviewed by Brent Fulgham.
* wtf/Platform.h:
Adds a feature flag to detect AppSSO framework.
2019-06-17 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r246501.
Breaks Apple internal builds.
Reverted changeset:
"Support using ANGLE as the backend for the WebGL
implementation"
https://bugs.webkit.org/show_bug.cgi?id=197755
https://trac.webkit.org/changeset/246501
2019-06-17 Kenneth Russell <kbr@chromium.org>
Support using ANGLE as the backend for the WebGL implementation
https://bugs.webkit.org/show_bug.cgi?id=197755
Reviewed by Dean Jackson.
Add a USE_ANGLE definition to wtf/Platform.h (currently disabled)
which, when enabled, uses ANGLE instead of the OpenGL or OpenGL ES
backend.
* wtf/Platform.h:
2019-06-16 Darin Adler <darin@apple.com>
Rename AtomicString to AtomString
https://bugs.webkit.org/show_bug.cgi?id=195276
Reviewed by Michael Catanzaro.
* many files: Let do-webcore-rename do the renaming.
* wtf/text/AtomString.h: After renaming, added AtomicString as a synonym for
now; helps smooth things over with a tiny bit of Apple internal software so
we don't have to do this all at once. Can remove it soon.
2019-06-16 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Avoid roundoff error when setting AVCapture min/max frame rate
https://bugs.webkit.org/show_bug.cgi?id=198875
<rdar://problem/51768374>
Reviewed by Youenn Fablet.
* wtf/MediaTime.h:
(WTF::LogArgument<MediaTime>::toString):
(WTF::LogArgument<MediaTimeRange>::toString):
2019-06-12 Antoine Quint <graouts@apple.com>
Show the web page URL when sharing an AR model
https://bugs.webkit.org/show_bug.cgi?id=198812
<rdar://problem/48689498>
Reviewed by Dean Jackson.
* wtf/Platform.h:
2019-06-12 Youenn Fablet <youenn@apple.com>
Use NSURLSession for WebSocket
https://bugs.webkit.org/show_bug.cgi?id=198568
Reviewed by Geoffrey Garen.
* wtf/Platform.h:
Introduce compile flag for WebSocket NSURLSession
2019-06-12 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r246322.
https://bugs.webkit.org/show_bug.cgi?id=198796
"It's a huge page load regression on iOS" (Requested by
saamyjoon on #webkit).
Reverted changeset:
"Roll out PAC cage"
https://bugs.webkit.org/show_bug.cgi?id=198726
https://trac.webkit.org/changeset/246322
2019-06-10 Simon Fraser <simon.fraser@apple.com>
Add logging for UI-side compositing hit-testing
https://bugs.webkit.org/show_bug.cgi?id=198739
Reviewed by Antti Koivisto.
Make it possible to output an Objective-C object to TextStream, which will
log its -description.
Also add a template for OptionSet<> printing.
* WTF.xcodeproj/project.pbxproj:
* wtf/text/TextStream.h:
(WTF::operator<<):
* wtf/text/cocoa/TextStreamCocoa.mm: Added.
(WTF::TextStream::operator<<):
2019-06-11 Saam Barati <sbarati@apple.com>
Roll out PAC cage
https://bugs.webkit.org/show_bug.cgi?id=198726
Reviewed by Keith Miller.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/CagedPtr.h:
(WTF::CagedPtr::CagedPtr):
(WTF::CagedPtr::get const):
(WTF::CagedPtr::getMayBeNull const):
(WTF::CagedPtr::operator=):
(WTF::CagedPtr::operator== const):
(WTF::CagedPtr::operator!= const):
(WTF::CagedPtr::operator bool const):
(WTF::CagedPtr::operator* const):
(WTF::CagedPtr::operator-> const):
(WTF::CagedPtr::operator[] const):
(WTF::CagedPtr::getUnsafe const): Deleted.
(WTF::CagedPtr::at const): Deleted.
(WTF::CagedPtr::recage): Deleted.
* wtf/CagedUniquePtr.h:
(WTF::CagedUniquePtr::CagedUniquePtr):
(WTF::CagedUniquePtr::create):
(WTF::CagedUniquePtr::operator=):
(WTF::CagedUniquePtr::~CagedUniquePtr):
(WTF::CagedUniquePtr::destroy):
* wtf/Gigacage.h:
(Gigacage::caged):
(Gigacage::cagedMayBeNull): Deleted.
* wtf/PtrTag.h:
(WTF::tagArrayPtr): Deleted.
(WTF::untagArrayPtr): Deleted.
(WTF::removeArrayPtrTag): Deleted.
(WTF::retagArrayPtr): Deleted.
* wtf/TaggedArrayStoragePtr.h:
(WTF::TaggedArrayStoragePtr::TaggedArrayStoragePtr): Deleted.
(WTF::TaggedArrayStoragePtr::get const): Deleted.
(WTF::TaggedArrayStoragePtr::getUnsafe const): Deleted.
(WTF::TaggedArrayStoragePtr::resize): Deleted.
(WTF::TaggedArrayStoragePtr::operator bool const): Deleted.
2019-06-10 Andy Estes <aestes@apple.com>
[iOS] Use PDFKit SPI for taking snapshots when the hosting app is not entitled for global capture
https://bugs.webkit.org/show_bug.cgi?id=198731
<rdar://problem/46215174>
Reviewed by Tim Horton.
* wtf/FeatureDefines.h:
2019-06-10 Sam Weinig <weinig@apple.com>
Remove Dashboard support
https://bugs.webkit.org/show_bug.cgi?id=198615
Reviewed by Ryosuke Niwa.
* wtf/FeatureDefines.h:
2019-06-10 Timothy Hatcher <timothy@apple.com>
Integrate dark mode support for iOS.
https://bugs.webkit.org/show_bug.cgi?id=198687
rdar://problem/51545643
Reviewed by Tim Horton.
* wtf/Platform.h:
2019-06-08 Andy Estes <aestes@apple.com>
[Apple Pay] If we have a bound interface identifier, set it on new PKPaymentRequests
https://bugs.webkit.org/show_bug.cgi?id=198690
<rdar://problem/48041803>
Reviewed by Tim Horton.
* wtf/FeatureDefines.h: Defined HAVE_PASSKIT_BOUND_INTERFACE_IDENTIFIER, and cleaned up some
other PassKit HAVEs.
2019-06-06 Caio Lima <ticaiolima@gmail.com>
[JSCOnly] JSCOnly port is not building on macOS
https://bugs.webkit.org/show_bug.cgi?id=198563
Reviewed by Don Olmstead.
We are adding `<mach/vm_types.h>` to fix build issues when compiling
JSCOnly port on macOS.
* wtf/WTFAssertions.cpp:
2019-06-03 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r246022.
https://bugs.webkit.org/show_bug.cgi?id=198486
Causing Internal build failures and JSC test failures
(Requested by ShawnRoberts on #webkit).
Reverted changeset:
"Reenable Gigacage on ARM64."
https://bugs.webkit.org/show_bug.cgi?id=198453
https://trac.webkit.org/changeset/246022
2019-06-03 Darin Adler <darin@apple.com>
Finish cleanup of String::number for floating point
https://bugs.webkit.org/show_bug.cgi?id=198471
Reviewed by Yusuke Suzuki.
* wtf/JSONValues.cpp:
(WTF::JSONImpl::Value::writeJSON const): Use appendNumber instead of
appendECMAScriptNumber, since that's now the default.
* wtf/text/StringBuilder.cpp:
(WTF::StringBuilder::appendNumber): Renamed from appendShortestFormNumber.
* wtf/text/StringBuilder.h: Removed appendShortestFormNumber and
appendECMAScriptNumber, replacing both with overload of appendNumber.
* wtf/text/WTFString.cpp:
(WTF::String::number): Renamed from numberToStringShortest.
* wtf/text/WTFString.h: Removed numberToStringShortest and
numberToStringECMAScript, replacing both with overload of number.
2019-06-02 Keith Miller <keith_miller@apple.com>
Reenable Gigacage on ARM64.
https://bugs.webkit.org/show_bug.cgi?id=198453
Reviewed by Filip Pizlo.
* wtf/CagedPtr.h:
(WTF::CagedPtr::authenticatingLoad):
(WTF::CagedPtr::get const):
(WTF::CagedPtr::getMayBeNull const):
2019-05-31 Alex Christensen <achristensen@webkit.org>
URLParser::parseIPv6Host should properly parse 0's around compression
https://bugs.webkit.org/show_bug.cgi?id=198424
Reviewed by Tim Horton.
* wtf/URLParser.cpp:
(WTF::URLParser::parseIPv6Host):
2019-05-31 Alex Christensen <achristensen@webkit.org>
URLParser::parseHostAndPort should not allow non-port characters after an ipv6 host
https://bugs.webkit.org/show_bug.cgi?id=198428
<rdar://problem/51209196>
Reviewed by Tim Horton.
This matches Chrome and Firefox.
* wtf/URLParser.cpp:
(WTF::URLParser::parseHostAndPort):
2019-05-31 Tim Horton <timothy_horton@apple.com>
Optionally respect device management restrictions when loading from the network
https://bugs.webkit.org/show_bug.cgi?id=198318
<rdar://problem/44263806>
Reviewed by Alex Christensen.
* wtf/Platform.h:
Add a HAVE flag for DeviceManagement.framework.
It does exist in the simulator, but does not function; pretend it doesn't exist.
2019-05-31 Geoffrey Garen <ggaren@apple.com>
Some WeakPtr cleanup
https://bugs.webkit.org/show_bug.cgi?id=198390
Reviewed by Chris Dumez.
* wtf/WeakHashSet.h:
(WTF::HashTraits<Ref<WeakPtrImpl>>::isReleasedWeakValue):
(WTF::WeakHashSet::WeakHashSetConstIterator::WeakHashSetConstIterator):
Updated for rename to WeakPtrImpl.
(WTF::WeakHashSet::WeakHashSetConstIterator::get const): Updated for new
get() interface. Also, switched to iterator operator* to help clarify
the double dereference here.
(WTF::WeakHashSet::add):
(WTF::WeakHashSet::remove):
(WTF::WeakHashSet::contains const):
(WTF::WeakHashSet::computeSize const):
(WTF::HashTraits<Ref<WeakReference>>::isReleasedWeakValue): Deleted.
Updated for rename to WeakPtrImpl.
* wtf/WeakPtr.h:
(WTF::WeakPtrImpl::create):
(WTF::WeakPtrImpl::~WeakPtrImpl): Renamed WeakReference to WeakPtrImpl.
Now we don't need a comment explaining that this class is the backing
implementation of WeakPtr.
(WTF::WeakPtrImpl::get): Return the pointer type we stored, rather than
the pointer type requested by our client. It's a little too surprising
for a field to store one pointer type and load another.
(WTF::WeakPtrImpl::WeakPtrImpl): Fixed a theoretical type safety bug.
Make sure to store T::WeakValueType* instead of T*, since they might
not be the same pointer value. (In practice, T and T::WeakValueType*
are always the same type in this constructor because WeakPtrFactory
makes them so, but it's best not to depend on implementation details
across classes.)
(WTF::WeakPtr::get const): Updated for new get() interface.
(WTF::WeakPtr::operator bool const):
(WTF::WeakPtr::operator=):
(WTF::WeakPtr::clear):
(WTF::WeakPtr::WeakPtr): Updated for WeakPtrImpl rename.
(WTF::WeakPtrFactory::~WeakPtrFactory): Updated for WeakPtrImpl rename.
(WTF::WeakPtrFactory::createWeakPtr const): ASSERT that the passed-in
pointer is equal to the stored pointer. As a space optimization, we
require our client to remind us what we point to each time a weak
pointer is created -- but nothing guarantees that our client will do
this correctly.
(WTF::WeakPtrFactory::revokeAll): Updated for WeakPtrImpl rename.
(WTF::CanMakeWeakPtr::weakPtrFactory const):
(WTF::CanMakeWeakPtr::weakPtrFactory): Use idiomatic accessor naming.
(WTF::weak_ptr_impl_cast): Fixed a theoretical type safety bug.
Previously, if Base and Derived both inherited CanMakeWeakPtr, and
you casted WeakPtr<Base> to WeakPtr<Derived> (or vice versa), and
casting Base <-> Derived required pointer fixup, the previous
compile-time check would accept the cast, even though the stored pointer
would be wrong.
(WTF::WeakPtr<T>::WeakPtr):
(WTF::=):
(WTF::makeWeakPtr):
(WTF::WeakReference::create): Deleted.
(WTF::WeakReference::~WeakReference): Deleted.
(WTF::WeakReference::get const): Deleted.
(WTF::WeakReference::operator bool const): Deleted.
(WTF::WeakReference::clear): Deleted.
(WTF::WeakReference::WeakReference): Deleted.
(WTF::weak_reference_cast): Deleted. Updated for rename to WeakPtrImpl.
Don't export WeakPtrImpl because it's an implmenetation detail and
it shouldn't be easy to use outside WTF.
2019-05-31 Don Olmstead <don.olmstead@sony.com>
[CMake] Add WebKit::WTF target
https://bugs.webkit.org/show_bug.cgi?id=198400
Reviewed by Konstantin Tokarev.
Create the WebKit::WTF target and use that to propagate headers. Use
WEBKIT_COPY_FILES instead of WEBKIT_MAKE_FORWARDING_HEADERS.
* wtf/CMakeLists.txt:
2019-05-30 Saam Barati <sbarati@apple.com>
[WHLSL] Enforce variable lifetimes
https://bugs.webkit.org/show_bug.cgi?id=195794
<rdar://problem/50746293>
Reviewed by Myles C. Maxfield.
* wtf/PrintStream.h:
2019-05-30 Keith Rollin <krollin@apple.com>
Fix yet more deprecated uses of -[UIApplication interfaceOrientation]
https://bugs.webkit.org/show_bug.cgi?id=198381
<rdar://problem/51265846>
Reviewed by Wenson Hsieh.
r245267, r245272, and r245874 fixed many instances of this issue; this
change fixes the issue for tvOS.
* wtf/FeatureDefines.h:
2019-05-29 David Kilzer <ddkilzer@apple.com>
Clean up a few #include statements in WTF
<https://webkit.org/b/198351>
Reviewed by Alex Christensen.
* benchmarks/HashSetDFGReplay.cpp:
- Add missing "config.h" include.
* wtf/ParallelJobsGeneric.cpp:
- Replace include of ParallelJobs.h with
ParallelJobsGeneric.h.
* wtf/StackBounds.cpp:
- Fix include ordering of StackBounds.h.
2019-05-29 Keith Rollin <krollin@apple.com>
Followup to r245267 and r245272: fix even more deprecated uses of -[UIApplication interfaceOrientation]
https://bugs.webkit.org/show_bug.cgi?id=198348
<rdar://problem/51234077>
Reviewed by Wenson Hsieh.
r245267 and r245272 fixed many instances of this issue; this change
fixes the issue for watchOS.
* wtf/FeatureDefines.h:
2019-05-29 David Kilzer <ddkilzer@apple.com>
IndexedDatabase Server thread in com.apple.WebKit.Networking process leaks objects into an autoreleasePool that's never cleared
<https://webkit.org/b/198346>
<rdar://problem/50895658>
Reviewed by Brent Fulgham.
* wtf/CrossThreadTaskHandler.cpp:
(WTF::CrossThreadTaskHandler::CrossThreadTaskHandler):
- Add optional second argument to enable use of an
AutodrainedPool when running the runloop.
(WTF::CrossThreadTaskHandler::taskRunLoop):
- Create an AutodrainedPool if requested when
CrossThreadTaskHandler was created.
* wtf/CrossThreadTaskHandler.h:
(WTF::CrossThreadTaskHandler::AutodrainedPoolForRunLoop):
- Add enum class for enabling an AutodrainedPool for
CrossThreadTaskHandler::taskRunLoop().
(WTF::CrossThreadTaskHandler::CrossThreadTaskHandler):
- Add optional second argument to enable use of an
AutodrainedPool when running the runloop.
2019-05-29 Geoffrey Garen <ggaren@apple.com>
WeakPtr breaks vtables when upcasting to base classes
https://bugs.webkit.org/show_bug.cgi?id=188799
Reviewed by Youenn Fablet.
This patch switches from reinterpret_cast to static_cast when loading
from WeakReference storage.
We know which type to cast *to* because it's specified by the type of
the calling WeakPtr.
We know which type to cast *from* because it's specified by a typedef
in CanMakeWeakPtr.
(Our convention is that we store a pointer to the class that derives
from CanMakeWeakPtr. We cast from that pointer to derived pointers when
we get(). This means that #include of the derived type header is now
required in order to get() the pointer.)
* wtf/WeakHashSet.h:
(WTF::HashTraits<Ref<WeakReference>>::isReleasedWeakValue): Definition
is now eagerly required because WeakReference is not a template anymore.
(WTF::WeakHashSet::WeakHashSetConstIterator::get const):
(WTF::WeakHashSet::WeakHashSetConstIterator::skipEmptyBuckets):
(WTF::WeakHashSet::remove):
(WTF::WeakHashSet::contains const):
(WTF::WeakHashSet::computesEmpty const):
(WTF::WeakHashSet::hasNullReferences const):
(WTF::WeakHashSet::computeSize const):
(WTF::HashTraits<Ref<WeakReference<T>>>::isReleasedWeakValue): Deleted.
Updated for new WeakReference get() API.
* wtf/WeakPtr.h: Use a macro for TestAPI support. We can't use template
specialization because WeakReference is not a class template anymore.
(Or maybe we could have kept it working with a dummy template argument?
Felt weird, so I switched.)
(WTF::WeakReference::create):
(WTF::WeakReference::~WeakReference):
(WTF::WeakReference::get const):
(WTF::WeakReference::operator bool const):
(WTF::WeakReference::WeakReference): WeakReference is just a void* now.
It's the caller's responsibility, when creating and getting, to use
a consistent storage type. We ensure a canonical storage type using a
typedef inside CanMakeWeakPtr.
(WTF::WeakPtr::WeakPtr):
(WTF::WeakPtr::get const):
(WTF::WeakPtr::operator bool const):
(WTF::WeakPtr::operator-> const):
(WTF::WeakPtr::operator* const): Adopted new WeakReference API.
(WTF::WeakPtrFactory::createWeakPtr const): No need for reinterpret_cast.
(WTF::weak_reference_cast): This isn't required for correctness, but it's
nice to show a complier error at WeakPtr construction sites when you know
that the types won't work. Otherwise, you get compiler errors at
dereference sites, which are slightly more mysterious ways of saying that
you constructed your WeakPtr incorrectly.
(WTF::WeakPtr<T>::WeakPtr):
(WTF::=):
(WTF::makeWeakPtr):
(WTF::weak_reference_upcast): Deleted.
(WTF::weak_reference_downcast): Deleted.
2019-05-29 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r245857.
Breaks internal builds.
Reverted changeset:
"WeakPtr breaks vtables when upcasting to base classes"
https://bugs.webkit.org/show_bug.cgi?id=188799
https://trac.webkit.org/changeset/245857
2019-05-28 Geoffrey Garen <ggaren@apple.com>
WeakPtr breaks vtables when upcasting to base classes
https://bugs.webkit.org/show_bug.cgi?id=188799
Reviewed by Youenn Fablet.
This patch switches from reinterpret_cast to static_cast when loading
from WeakReference storage.
We know which type to cast *to* because it's specified by the type of
the calling WeakPtr.
We know which type to cast *from* because it's specified by a typedef
in CanMakeWeakPtr.
(Our convention is that we store a pointer to the class that derives
from CanMakeWeakPtr. We cast from that pointer to derived pointers when
we get(). This means that #include of the derived type header is now
required in order to get() the pointer.)
* wtf/WeakHashSet.h:
(WTF::HashTraits<Ref<WeakReference>>::isReleasedWeakValue): Definition
is now eagerly required because WeakReference is not a template anymore.
(WTF::WeakHashSet::WeakHashSetConstIterator::get const):
(WTF::WeakHashSet::WeakHashSetConstIterator::skipEmptyBuckets):
(WTF::WeakHashSet::remove):
(WTF::WeakHashSet::contains const):
(WTF::WeakHashSet::computesEmpty const):
(WTF::WeakHashSet::hasNullReferences const):
(WTF::WeakHashSet::computeSize const):
(WTF::HashTraits<Ref<WeakReference<T>>>::isReleasedWeakValue): Deleted.
Updated for new WeakReference get() API.
* wtf/WeakPtr.h: Use a macro for TestAPI support. We can't use template
specialization because WeakReference is not a class template anymore.
(Or maybe we could have kept it working with a dummy template argument?
Felt weird, so I switched.)
(WTF::WeakReference::create):
(WTF::WeakReference::~WeakReference):
(WTF::WeakReference::get const):
(WTF::WeakReference::operator bool const):
(WTF::WeakReference::WeakReference): WeakReference is just a void* now.
It's the caller's responsibility, when creating and getting, to use
a consistent storage type. We ensure a canonical storage type using a
typedef inside CanMakeWeakPtr.
(WTF::WeakPtr::WeakPtr):
(WTF::WeakPtr::get const):
(WTF::WeakPtr::operator bool const):
(WTF::WeakPtr::operator-> const):
(WTF::WeakPtr::operator* const): Adopted new WeakReference API.
(WTF::WeakPtrFactory::createWeakPtr const): No need for reinterpret_cast.
(WTF::weak_reference_cast): This isn't required for correctness, but it's
nice to show a complier error at WeakPtr construction sites when you know
that the types won't work. Otherwise, you get compiler errors at
dereference sites, which are slightly more mysterious ways of saying that
you constructed your WeakPtr incorrectly.
(WTF::WeakPtr<T>::WeakPtr):
(WTF::=):
(WTF::makeWeakPtr):
(WTF::weak_reference_upcast): Deleted.
(WTF::weak_reference_downcast): Deleted.
2019-05-27 Chris Dumez <cdumez@apple.com>
Use a strongly-typed identifier for pages
https://bugs.webkit.org/show_bug.cgi?id=198206
Reviewed by Youenn Fablet.
* wtf/ObjectIdentifier.h:
(WTF::operator<<):
2019-05-23 Don Olmstead <don.olmstead@sony.com>
[CMake] Use target oriented design for bmalloc
https://bugs.webkit.org/show_bug.cgi?id=198046
Reviewed by Konstantin Tokarev.
Use WebKit::bmalloc target.
* wtf/CMakeLists.txt:
2019-05-23 Ross Kirsling <ross.kirsling@sony.com>
[PlayStation] Implement platformUserPreferredLanguages.
https://bugs.webkit.org/show_bug.cgi?id=198149
Reviewed by Fujii Hironori.
* wtf/PlatformPlayStation.cmake:
* wtf/playstation/LanguagePlayStation.cpp: Added.
(WTF::platformUserPreferredLanguages):
2019-05-22 Myles C. Maxfield <mmaxfield@apple.com>
font-optical-sizing applies the wrong variation value
https://bugs.webkit.org/show_bug.cgi?id=197528
<rdar://problem/50152854>
Reviewed by Antti Koivisto.
* wtf/Platform.h:
2019-05-22 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r245598.
Breaks watchOS build.
Reverted changeset:
"font-optical-sizing applies the wrong variation value"
https://bugs.webkit.org/show_bug.cgi?id=197528
https://trac.webkit.org/changeset/245598
2019-05-21 Ross Kirsling <ross.kirsling@sony.com>
[PlayStation] Don't call fcntl.
https://bugs.webkit.org/show_bug.cgi?id=197961
Reviewed by Fujii Hironori.
* wtf/PlatformGTK.cmake:
* wtf/PlatformJSCOnly.cmake:
* wtf/PlatformPlayStation.cmake:
* wtf/PlatformWPE.cmake:
* wtf/UniStdExtras.h:
* wtf/playstation/UniStdExtrasPlayStation.cpp: Added.
(WTF::setCloseOnExec):
(WTF::dupCloseOnExec):
(WTF::setNonBlock):
* wtf/unix/UniStdExtrasUnix.cpp: Renamed from Source/WTF/wtf/UniStdExtras.cpp.
(WTF::setNonBlock):
Move UniStdExtras to unix/, add a PlayStation version that doesn't use fcntl, add an abstraction for O_NONBLOCK.
2019-05-20 Tadeu Zagallo <tzagallo@apple.com>
Only cache bytecode for API clients in data vaults
https://bugs.webkit.org/show_bug.cgi?id=197898
Reviewed by Keith Miller.
Add SPI to check if a filesystem path is restricted as a data vault.
* WTF.xcodeproj/project.pbxproj:
* wtf/spi/darwin/DataVaultSPI.h: Added.
2019-05-20 Carlos Garcia Campos <cgarcia@igalia.com>
[GLIB] Repeating timer is not stopped when stop is called from the callback
https://bugs.webkit.org/show_bug.cgi?id=197986
Reviewed by Michael Catanzaro.
In case of repeating timers we always update the ready time to fire interval after the user callback is called.
* wtf/glib/RunLoopGLib.cpp:
(WTF::RunLoop::TimerBase::stop): Reset m_fireInterval and m_isRepeating.
2019-05-19 Darin Adler <darin@apple.com>
Change String::number to use "shortest" instead of "fixed precision 6 digits"
https://bugs.webkit.org/show_bug.cgi?id=178319
Reviewed by Sam Weinig.
* wtf/text/StringBuilder.h: Delete appendNumber for floating point and
appendECMAScriptNumber for single-precision.
* wtf/text/WTFString.h: Delete String::number for floating point and
numberToStringECMAScript for single-precision.
2019-05-18 Tadeu Zagallo <tzagallo@apple.com>
Add extra information to dumpJITMemory
https://bugs.webkit.org/show_bug.cgi?id=197998
Reviewed by Saam Barati.
Add a new trace point code for JSC::dumpJITMemory
* wtf/SystemTracing.h:
2019-05-17 Don Olmstead <don.olmstead@sony.com>
[CMake] Use builtin FindICU
https://bugs.webkit.org/show_bug.cgi?id=197934
Reviewed by Michael Catanzaro.
Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES. Use ICU:: targets which end
up propagating to all consumers of WTF.
* wtf/CMakeLists.txt:
* wtf/PlatformPlayStation.cmake:
2019-05-17 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r245418.
https://bugs.webkit.org/show_bug.cgi?id=197989
New API test causing crashes on Mojave testers (Requested by
ShawnRoberts on #webkit).
Reverted changeset:
"Add a unit test for client certificate authentication"
https://bugs.webkit.org/show_bug.cgi?id=197800
https://trac.webkit.org/changeset/245418
2019-05-16 Keith Miller <keith_miller@apple.com>
Wasm should cage the memory base pointers in structs
https://bugs.webkit.org/show_bug.cgi?id=197620
Reviewed by Saam Barati.
Rename reauthenticate to recage.
* wtf/CagedPtr.h:
(WTF::CagedPtr::recage):
(WTF::CagedPtr::reauthenticate): Deleted.
2019-05-16 Alex Christensen <achristensen@webkit.org>
Add a unit test for client certificate authentication
https://bugs.webkit.org/show_bug.cgi?id=197800
Reviewed by Youenn Fablet.
* wtf/spi/cocoa/SecuritySPI.h:
Move declarations from ArgumentCodersCF.cpp so they can be shared.
2019-05-16 Eike Rathke <erack@redhat.com>
Fix memcpy() call for big endian
https://bugs.webkit.org/show_bug.cgi?id=197945
Reviewed by Michael Catanzaro.
* wtf/Packed.h:
(WTF::alignof):
2019-05-15 Ross Kirsling <ross.kirsling@sony.com>
[PlayStation] WTFCrash should preserve register state.
https://bugs.webkit.org/show_bug.cgi?id=197932
Reviewed by Don Olmstead.
* wtf/Assertions.cpp:
* wtf/Assertions.h:
Let r196397 apply to PlayStation port as well.
2019-05-15 Simon Fraser <simon.fraser@apple.com>
Make LOG_WITH_STREAM more efficient
https://bugs.webkit.org/show_bug.cgi?id=197905
Reviewed by Alex Christensen.
Add a streamable repeat() class that can be used to output a series of characters.
This is useful for indenting output.
* wtf/text/TextStream.h:
(WTF::TextStream::repeat::repeat):
(WTF::TextStream::operator<<):
2019-05-15 Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
compilation failure with clang 9
https://bugs.webkit.org/show_bug.cgi?id=197911
Reviewed by Alex Christensen.
Use std namespace for nullptr_t in tagArrayPtr templates.
* wtf/PtrTag.h:
(WTF::tagArrayPtr):
2019-05-14 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r245281.
https://bugs.webkit.org/show_bug.cgi?id=197887
Broke API Test TestWebKitAPI.Challenge.ClientCertificate
(Requested by aakashjain on #webkit).
Reverted changeset:
"Add a unit test for client certificate authentication"
https://bugs.webkit.org/show_bug.cgi?id=197800
https://trac.webkit.org/changeset/245281
2019-05-14 Alex Christensen <achristensen@webkit.org>
Add a unit test for client certificate authentication
https://bugs.webkit.org/show_bug.cgi?id=197800
Reviewed by Youenn Fablet.
* wtf/spi/cocoa/SecuritySPI.h:
Move declarations from ArgumentCodersCF.cpp so they can be shared.
2019-05-13 Robin Morisset <rmorisset@apple.com>
IndexSet::isEmpty should use BitVector::isEmpty() instead of size()
https://bugs.webkit.org/show_bug.cgi?id=197857
Reviewed by Darin Adler.
* wtf/IndexSet.h:
(WTF::IndexSet::isEmpty const):
2019-05-13 Youenn Fablet <youenn@apple.com>
[Mac] Use realpath for dlopen_preflight
https://bugs.webkit.org/show_bug.cgi?id=197803
Reviewed by Eric Carlson.
* wtf/cocoa/SoftLinking.h:
2019-05-13 Yusuke Suzuki <ysuzuki@apple.com>
Unreviewed, wrokaround for MACH_VM_MAX_ADDRESS in ARM32_64
https://bugs.webkit.org/show_bug.cgi?id=197730
Interestingly, MACH_VM_MAX_ADDRESS is larger than 32bit in ARM32_64, I think this is a bug.
But for now, we workaround for this case by using `CPU(ADDRESS64)`.
* wtf/WTFAssertions.cpp:
2019-05-13 Yusuke Suzuki <ysuzuki@apple.com>
[WTF] Remove Threading workaround for support libraries in Windows
https://bugs.webkit.org/show_bug.cgi?id=197350
Reviewed by Darin Adler.
We kept old APIs for some support libraries at 2017. This patch removes them.
* wtf/Threading.h:
* wtf/win/ThreadingWin.cpp:
(WTF::createThread): Deleted.
(WTF::waitForThreadCompletion): Deleted.
2019-05-13 Yusuke Suzuki <ysuzuki@apple.com>
[WTF] Simplify GCThread and CompilationThread flags by adding them to WTF::Thread
https://bugs.webkit.org/show_bug.cgi?id=197146
Reviewed by Saam Barati.
Since GCThread and CompilationThread flags exist in WTF, we put these flags into WTF::Thread directly instead of holding them in ThreadSpecific<>.
And this patch removes dependency from Threading.h to ThreadSpecific.h. ThreadSpecific.h's OS threading primitives are moved to ThreadingPrimitives.h,
and Threading.h relies on it instead.
* wtf/CompilationThread.cpp:
(WTF::isCompilationThread):
(WTF::initializeCompilationThreads): Deleted.
(WTF::exchangeIsCompilationThread): Deleted.
* wtf/CompilationThread.h:
(WTF::CompilationScope::CompilationScope):
(WTF::CompilationScope::~CompilationScope):
(WTF::CompilationScope::leaveEarly):
* wtf/MainThread.cpp:
(WTF::initializeMainThread):
(WTF::initializeMainThreadToProcessMainThread):
(WTF::isMainThreadOrGCThread):
(WTF::initializeGCThreads): Deleted.
(WTF::registerGCThread): Deleted.
(WTF::mayBeGCThread): Deleted.
* wtf/MainThread.h:
* wtf/ThreadSpecific.h:
(WTF::canBeGCThread>::ThreadSpecific):
(WTF::canBeGCThread>::set):
(WTF::threadSpecificKeyCreate): Deleted.
(WTF::threadSpecificKeyDelete): Deleted.
(WTF::threadSpecificSet): Deleted.
(WTF::threadSpecificGet): Deleted.
* wtf/Threading.cpp:
(WTF::Thread::exchangeIsCompilationThread):
(WTF::Thread::registerGCThread):
(WTF::Thread::mayBeGCThread):
* wtf/Threading.h:
(WTF::Thread::isCompilationThread const):
(WTF::Thread::gcThreadType const):
(WTF::Thread::joinableState const):
(WTF::Thread::hasExited const):
(WTF::Thread::Thread):
(WTF::Thread::joinableState): Deleted.
(WTF::Thread::hasExited): Deleted.
* wtf/ThreadingPrimitives.h:
(WTF::threadSpecificKeyCreate):
(WTF::threadSpecificKeyDelete):
(WTF::threadSpecificSet):
(WTF::threadSpecificGet):
* wtf/win/ThreadSpecificWin.cpp:
(WTF::flsKeys):
2019-05-13 Yusuke Suzuki <ysuzuki@apple.com>
Unreviewed, follow-up after r245214
https://bugs.webkit.org/show_bug.cgi?id=197730
Suggested by Sam. We should have static_assert with MACH_VM_MAX_ADDRESS.
* wtf/WTFAssertions.cpp:
2019-05-13 Youenn Fablet <youenn@apple.com>
Use kDNSServiceFlagsKnownUnique for DNSServiceRegisterRecord only on platforms supporting it
https://bugs.webkit.org/show_bug.cgi?id=197802
Reviewed by Eric Carlson.
* wtf/Platform.h:
2019-05-13 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Compress miscelaneous JIT related data structures with Packed<>
https://bugs.webkit.org/show_bug.cgi?id=197830
Reviewed by Saam Barati.
* wtf/Packed.h:
(WTF::alignof):
2019-05-13 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, fix unused variable warnings in release builds
* wtf/URLHelpers.cpp:
(WTF::URLHelpers::escapeUnsafeCharacters):
2019-05-12 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Compress Watchpoint size by using enum type and Packed<> data structure
https://bugs.webkit.org/show_bug.cgi?id=197730
Reviewed by Filip Pizlo.
This patch introduces a new data structures, WTF::Packed, WTF::PackedPtr, and WTF::PackedAlignedPtr.
- WTF::Packed
WTF::Packed is data storage. We can read and write trivial (in C++ term [1]) data to this storage. The difference to
the usual storage is that the alignment of this storage is always 1. We access the underlying data by using unalignedLoad/unalignedStore.
This class offers alignment = 1 data structure instead of missing the following characteristics.
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
in a racy way. (e.g. fields accessed optimistically from the concurrent compilers).
2. We cannot take reference / pointer to the underlying storage since they are unaligned.
3. Access to this storage is unaligned access. The code is using memcpy, and the compiler will convert to an appropriate unaligned access
in certain architectures (x86_64 / ARM64). It could be slow. So use it for non performance sensitive & memory sensitive places.
- WTF::PackedPtr
WTF::PackedPtr is a specialization of WTF::Packed<T*>. And it is basically WTF::PackedAlignedPtr with alignment = 1. We further compact
the pointer by leveraging the platform specific knowledge. In 64bit architectures, the effective width of pointers are less than 64 bit.
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
x86_64 and 5 bytes in Darwin ARM64.
- WTF::PackedAlignedPtr
WTF::PackedAlignedPtr is the WTF::PackedPtr with alignment information of the T. If we use this alignment information, we could reduce the
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
this information in Darwin ARM64 platform allows us to make packed JSCell pointer 4 bytes (36 - 4 bits). We do not use passed alignment
information if it is not profitable.
We also have PackedPtrTraits. This is new PtrTraits and use it for various data structures such as Bag<>.
[1]: https://en.cppreference.com/w/cpp/types/is_trivial
* WTF.xcodeproj/project.pbxproj:
* wtf/Bag.h:
(WTF::Bag::clear):
(WTF::Bag::iterator::operator++):
* wtf/CMakeLists.txt:
* wtf/DumbPtrTraits.h:
* wtf/DumbValueTraits.h:
* wtf/MathExtras.h:
(WTF::clzConstexpr):
(WTF::clz):
(WTF::ctzConstexpr):
(WTF::ctz):
(WTF::getLSBSetConstexpr):
(WTF::getMSBSetConstexpr):
* wtf/Packed.h: Added.
(WTF::Packed::Packed):
(WTF::Packed::get const):
(WTF::Packed::set):
(WTF::Packed::operator=):
(WTF::Packed::exchange):
(WTF::Packed::swap):
(WTF::alignof):
(WTF::PackedPtrTraits::exchange):
(WTF::PackedPtrTraits::swap):
(WTF::PackedPtrTraits::unwrap):
* wtf/Platform.h:
* wtf/SentinelLinkedList.h:
(WTF::BasicRawSentinelNode::BasicRawSentinelNode):
(WTF::BasicRawSentinelNode::prev):
(WTF::BasicRawSentinelNode::next):
(WTF::PtrTraits>::remove):
(WTF::PtrTraits>::prepend):
(WTF::PtrTraits>::append):
(WTF::RawNode>::SentinelLinkedList):
(WTF::RawNode>::remove):
(WTF::BasicRawSentinelNode<T>::remove): Deleted.
(WTF::BasicRawSentinelNode<T>::prepend): Deleted.
(WTF::BasicRawSentinelNode<T>::append): Deleted.
* wtf/StdLibExtras.h:
(WTF::roundUpToMultipleOfImpl):
(WTF::roundUpToMultipleOfImpl0): Deleted.
* wtf/UnalignedAccess.h:
(WTF::unalignedLoad):
(WTF::unalignedStore):
2019-05-10 Saam barati <sbarati@apple.com>
Bag's move operator= leaks memory
https://bugs.webkit.org/show_bug.cgi?id=197757
Reviewed by Keith Miller.
It was unused. So I'm just removing it. We can implement it properly
if we ever need it.
* wtf/Bag.h:
(WTF::Bag::operator=): Deleted.
2019-05-10 Fujii Hironori <Hironori.Fujii@sony.com>
[WinCairo] storage/indexeddb tests are timing out
https://bugs.webkit.org/show_bug.cgi?id=196289
Reviewed by Alex Christensen.
* wtf/FileSystem.h: Added hardLink.
* wtf/glib/FileSystemGlib.cpp:
(WTF::FileSystemImpl::hardLink):
(WTF::FileSystemImpl::hardLinkOrCopyFile):
* wtf/posix/FileSystemPOSIX.cpp:
(WTF::FileSystemImpl::hardLink):
(WTF::FileSystemImpl::hardLinkOrCopyFile):
* wtf/win/FileSystemWin.cpp:
(WTF::FileSystemImpl::hardLink):
(WTF::FileSystemImpl::hardLinkOrCopyFile):
Added hardLink. Let hardLinkOrCopyFile use the hardLink.
2019-05-10 Yusuke Suzuki <ysuzuki@apple.com>
[WTF] Remove "private:" from Noncopyable and Nonmovable macros
https://bugs.webkit.org/show_bug.cgi?id=197767
Reviewed by Saam Barati.
We no longer need "private:".
* wtf/Noncopyable.h:
* wtf/Nonmovable.h:
2019-05-08 Zan Dobersek <zdobersek@igalia.com>
[GLib] Rework WPE RunLoopSourcePriority values
https://bugs.webkit.org/show_bug.cgi?id=197167
Reviewed by Carlos Garcia Campos.
The GLib priorities for the WPE port were initially aligned on the -70
value, theory being that this would help avoid any default-priority
GSources spawned in different dependency libraries affecting our
scheduling. Today it seems that extra caution might not be really
necessary.
This change aligns the base priority value with GLib's default priority
value of 0. We maintain the relativity of priority values by effectively
increasing each priority by 70.
* wtf/glib/RunLoopSourcePriority.h:
2019-05-08 Alex Christensen <achristensen@webkit.org>
Add SPI to set HSTS storage directory
https://bugs.webkit.org/show_bug.cgi?id=197259
Reviewed by Brady Eidson.
* wtf/Platform.h:
2019-05-08 Keith Miller <keith_miller@apple.com>
Remove Gigacage from arm64 and use PAC for arm64e instead
https://bugs.webkit.org/show_bug.cgi?id=197110
Reviewed by Saam Barati.
This patch changes the Gigacage to use PAC on arm64e. As part of
this process all platforms must provide their length when
materializing the caged pointer. Since it would be somewhat
confusing to have two parameters for an operator [] those methods
have been removed. Lastly, this patch removes the specializations
for void* caged pointers, instead opting to use enable_if on the
methods that would normally fail on void* e.g. anything that
returns a T&.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/CagedPtr.h:
(WTF::CagedPtr::CagedPtr):
(WTF::CagedPtr::get const):
(WTF::CagedPtr::getMayBeNull const):
(WTF::CagedPtr::getUnsafe const):
(WTF::CagedPtr::at const):
(WTF::CagedPtr::reauthenticate):
(WTF::CagedPtr::operator=):
(WTF::CagedPtr::operator== const):
(WTF::CagedPtr::operator bool const):
(WTF::CagedPtr::operator* const): Deleted.
(WTF::CagedPtr::operator-> const): Deleted.
(WTF::CagedPtr::operator[] const): Deleted.
(): Deleted.
* wtf/CagedUniquePtr.h:
(WTF::CagedUniquePtr::CagedUniquePtr):
(WTF::CagedUniquePtr::create):
(WTF::CagedUniquePtr::~CagedUniquePtr):
(WTF::CagedUniquePtr::destroy):
(): Deleted.
* wtf/Gigacage.h:
(Gigacage::cagedMayBeNull):
* wtf/PtrTag.h:
(WTF::tagArrayPtr):
(WTF::untagArrayPtr):
(WTF::removeArrayPtrTag):
(WTF::retagArrayPtr):
* wtf/TaggedArrayStoragePtr.h: Copied from Source/JavaScriptCore/runtime/ArrayBufferView.cpp.
(WTF::TaggedArrayStoragePtr::TaggedArrayStoragePtr):
(WTF::TaggedArrayStoragePtr::get const):
(WTF::TaggedArrayStoragePtr::getUnsafe const):
(WTF::TaggedArrayStoragePtr::resize):
(WTF::TaggedArrayStoragePtr::operator bool const):
2019-05-08 Robin Morisset <rmorisset@apple.com>
WTF::TimingScope should show the total duration and not just the mean
https://bugs.webkit.org/show_bug.cgi?id=197672
Reviewed by Alex Christensen.
* wtf/TimingScope.cpp:
(WTF::TimingScope::scopeDidEnd):
2019-05-07 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] LLIntPrototypeLoadAdaptiveStructureWatchpoint does not require Bag<>
https://bugs.webkit.org/show_bug.cgi?id=197645
Reviewed by Saam Barati.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/Nonmovable.h: Copied from Source/JavaScriptCore/bytecode/LLIntPrototypeLoadAdaptiveStructureWatchpoint.h.
* wtf/Vector.h:
(WTF::minCapacity>::uncheckedConstructAndAppend):
2019-05-07 Eric Carlson <eric.carlson@apple.com>
Define media buffering policy
https://bugs.webkit.org/show_bug.cgi?id=196979
<rdar://problem/28383861>
Reviewed by Jer Noble.
* wtf/Platform.h:
2019-05-07 Robin Morisset <rmorisset@apple.com>
WTF::BitVector should have an isEmpty() method
https://bugs.webkit.org/show_bug.cgi?id=197637
Reviewed by Keith Miller.
* wtf/BitVector.cpp:
(WTF::BitVector::isEmptySlow const):
* wtf/BitVector.h:
(WTF::BitVector::isEmpty const):
2019-05-07 Brent Fulgham <bfulgham@apple.com>
Correct JSON parser to address unterminated escape character
https://bugs.webkit.org/show_bug.cgi?id=197582
<rdar://problem/50459177>
Reviewed by Alex Christensen.
Correct JSON parser code to properly deal with unterminated escape
characters.
* wtf/JSONValues.cpp:
(WTF::JSONImpl::decodeString):
(WTF::JSONImpl::parseStringToken):
2019-05-07 Alex Christensen <achristensen@webkit.org>
Add a release assertion that Functions can only be constructed from non-null CompletionHandlers
https://bugs.webkit.org/show_bug.cgi?id=197641
Reviewed by Chris Dumez.
This will help us find the cause of rdar://problem/48679972 by seeing the crash when the Function is dispatched,
not when it's called with no interesting stack trace. I manually verified this assertion is hit in such a case.
We should also have no legitimate use of creating a Function out of a null CompletionHandler then never calling it.
* wtf/CompletionHandler.h:
(WTF::Detail::CallableWrapper<CompletionHandler<Out):
* wtf/Function.h:
(WTF::Detail::CallableWrapperBase::~CallableWrapperBase):
(WTF::Detail::CallableWrapper::CallableWrapper):
(WTF::Function<Out):
2019-05-06 Christopher Reid <chris.reid@sony.com>
[JSC] Respect already defined USE_LLINT_EMBEDDED_OPCODE_ID compiler variable.
https://bugs.webkit.org/show_bug.cgi?id=197633
Reviewed by Don Olmstead.
When the variable `USE_LLINT_EMBEDDED_OPCODE_ID` is defined, stop defining
its value with platform default one.
* wtf/Platform.h:
2019-05-03 Sihui Liu <sihui_liu@apple.com>
Add assertion to check whether shm files have maximum FileProtection of CompleteUnlessOpen
https://bugs.webkit.org/show_bug.cgi?id=197390
<rdar://problem/42685773>
Reviewed by Geoffrey Garen.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::isSafeToUseMemoryMapForPath):
(WTF::FileSystemImpl::makeSafeToUseMemoryMapForPath):
* wtf/FileSystem.h:
* wtf/cocoa/FileSystemCocoa.mm:
(WTF::FileSystemImpl::isSafeToUseMemoryMapForPath):
(WTF::FileSystemImpl::makeSafeToUseMemoryMapForPath):
2019-05-03 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r244881.
https://bugs.webkit.org/show_bug.cgi?id=197559
Breaks compilation of jsconly on linux, breaking compilation
for jsc-i386-ews, jsc-mips-ews and jsc-armv7-ews (Requested by
guijemont on #webkit).
Reverted changeset:
"[CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into
WEBKIT_COPY_FILES"
https://bugs.webkit.org/show_bug.cgi?id=197174
https://trac.webkit.org/changeset/244881
2019-05-02 Alex Christensen <achristensen@webkit.org>
Mark U+01C0 as a homograph of U+006C
https://bugs.webkit.org/show_bug.cgi?id=197526
<rdar://problem/50301904>
Reviewed by Tim Horton.
* wtf/URLHelpers.cpp:
(WTF::URLHelpers::isLookalikeCharacter):
2019-05-02 Don Olmstead <don.olmstead@sony.com>
[CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into WEBKIT_COPY_FILES
https://bugs.webkit.org/show_bug.cgi?id=197174
Reviewed by Alex Christensen.
Replace WEBKIT_MAKE_FORWARDING_HEADERS with WEBKIT_COPY_FILES.
* wtf/CMakeLists.txt:
2019-05-01 Darin Adler <darin@apple.com>
WebKit has too much of its own UTF-8 code and should rely more on ICU's UTF-8 support
https://bugs.webkit.org/show_bug.cgi?id=195535
Reviewed by Alexey Proskuryakov.
* wtf/text/AtomicString.cpp:
(WTF::AtomicString::fromUTF8Internal): Added code to compute string length when the
end is nullptr; this behavior used to be implemented inside the
calculateStringHashAndLengthFromUTF8MaskingTop8Bits function.
* wtf/text/AtomicStringImpl.cpp:
(WTF::HashAndUTF8CharactersTranslator::translate): Updated for change to
convertUTF8ToUTF16.
* wtf/text/AtomicStringImpl.h: Took the WTF_EXPORT_PRIVATE off of the
AtomicStringImpl::addUTF8 function. This is used only inside a non-inlined function in
the AtomicString class and its behavior changed subtly in this patch; it's helpful
to document that it's not exported.
* wtf/text/StringImpl.cpp:
(WTF::StringImpl::utf8Impl): Don't pass "true" for strictness to convertUTF16ToUTF8
since strict is the default. Also updated for changes to ConversionResult.
(WTF::StringImpl::utf8ForCharacters): Updated for change to convertLatin1ToUTF8.
(WTF::StringImpl::tryGetUtf8ForRange const): Ditto.
* wtf/text/StringView.cpp: Removed uneeded include of UTF8Conversion.h.
* wtf/text/WTFString.cpp:
(WTF::String::fromUTF8): Updated for change to convertUTF8ToUTF16.
* wtf/unicode/UTF8Conversion.cpp:
(WTF::Unicode::inlineUTF8SequenceLengthNonASCII): Deleted.
(WTF::Unicode::inlineUTF8SequenceLength): Deleted.
(WTF::Unicode::UTF8SequenceLength): Deleted.
(WTF::Unicode::decodeUTF8Sequence): Deleted.
(WTF::Unicode::convertLatin1ToUTF8): Use U8_APPEND, enabling us to remove
almost everything in the function. Also changed resturn value to be a boolean
to indicate success since there is only one possible failure (target exhausted).
There is room for further simplification, since most callers have lengths rather
than end pointers for the source buffer, and all but one caller supplies a buffer
size known to be sufficient, so those don't need a return value, nor do they need
to pass an end of buffer pointer.
(WTF::Unicode::convertUTF16ToUTF8): Use U_IS_LEAD, U_IS_TRAIL,
U16_GET_SUPPLEMENTARY, U_IS_SURROGATE, and U8_APPEND. Also changed behavior
for non-strict mode so that unpaired surrogates will be turned into the
replacement character instead of invalid UTF-8 sequences, because U8_APPEND
won't create an invalid UTF-8 sequence, and because we don't need to do that
for any good reason at any call site.
(WTF::Unicode::isLegalUTF8): Deleted.
(WTF::Unicode::readUTF8Sequence): Deleted.
(WTF::Unicode::convertUTF8ToUTF16): Use U8_NEXT instead of
inlineUTF8SequenceLength, isLegalUTF8, and readUTF8Sequence. Use
U16_APPEND instead of lots of code that does the same thing. There is
room for further simplification since most callers don't need the "all ASCII"
feature and could probably pass the arguments in a more natural way.
(WTF::Unicode::calculateStringHashAndLengthFromUTF8MaskingTop8Bits):
Use U8_NEXT instead of isLegalUTF8, readUTF8Sequence, and various
error handling checks for things that are handled by U8_NEXT. Also removed
support for passing nullptr for end to specify a null-terminated string.
(WTF::Unicode::equalUTF16WithUTF8): Ditto.
* wtf/unicode/UTF8Conversion.h: Removed UTF8SequenceLength and
decodeUTF8Sequence. Changed the ConversionResult to match WebKit coding
style, with an eye toward perhaps removing it in the future. Changed
the convertUTF8ToUTF16 return value to a boolean and removed the "strict"
argument since no caller was passing false. Changed the convertLatin1ToUTF8
return value to a boolean. Tweaked comments.
2019-05-01 Shawn Roberts <sroberts@apple.com>
Unreviewed, rolling out r244821.
Causing
Reverted changeset:
"WebKit has too much of its own UTF-8 code and should rely
more on ICU's UTF-8 support"
https://bugs.webkit.org/show_bug.cgi?id=195535
https://trac.webkit.org/changeset/244821
2019-05-01 Shawn Roberts <sroberts@apple.com>
Unreviewed, rolling out r244822.
Causing 4 Test262 failures on JSC Release and Debug
Reverted changeset:
https://trac.webkit.org/changeset/244822 https://trac.webkit.org/changeset/244821
2019-04-29 Darin Adler <darin@apple.com>
WebKit has too much of its own UTF-8 code and should rely more on ICU's UTF-8 support
https://bugs.webkit.org/show_bug.cgi?id=195535
Reviewed by Alexey Proskuryakov.
* wtf/text/AtomicString.cpp:
(WTF::AtomicString::fromUTF8Internal): Added code to compute string length when the
end is nullptr; this behavior used to be implemented inside the
calculateStringHashAndLengthFromUTF8MaskingTop8Bits function.
* wtf/text/AtomicStringImpl.cpp:
(WTF::HashAndUTF8CharactersTranslator::translate): Updated for change to
convertUTF8ToUTF16.
* wtf/text/AtomicStringImpl.h: Took the WTF_EXPORT_PRIVATE off of the
AtomicStringImpl::addUTF8 function. This is used only inside a non-inlined function in
the AtomicString class and its behavior changed subtly in this patch; it's helpful
to document that it's not exported.
* wtf/text/StringImpl.cpp:
(WTF::StringImpl::utf8Impl): Don't pass "true" for strictness to convertUTF16ToUTF8
since strict is the default. Also updated for changes to ConversionResult.
(WTF::StringImpl::utf8ForCharacters): Updated for change to convertLatin1ToUTF8.
(WTF::StringImpl::tryGetUtf8ForRange const): Ditto.
* wtf/text/StringView.cpp: Removed uneeded include of UTF8Conversion.h.
* wtf/text/WTFString.cpp:
(WTF::String::fromUTF8): Updated for change to convertUTF8ToUTF16.
* wtf/unicode/UTF8Conversion.cpp:
(WTF::Unicode::inlineUTF8SequenceLengthNonASCII): Deleted.
(WTF::Unicode::inlineUTF8SequenceLength): Deleted.
(WTF::Unicode::UTF8SequenceLength): Deleted.
(WTF::Unicode::decodeUTF8Sequence): Deleted.
(WTF::Unicode::convertLatin1ToUTF8): Use U8_APPEND, enabling us to remove
almost everything in the function. Also changed resturn value to be a boolean
to indicate success since there is only one possible failure (target exhausted).
There is room for further simplification, since most callers have lengths rather
than end pointers for the source buffer, and all but one caller supplies a buffer
size known to be sufficient, so those don't need a return value, nor do they need
to pass an end of buffer pointer.
(WTF::Unicode::convertUTF16ToUTF8): Use U_IS_LEAD, U_IS_TRAIL,
U16_GET_SUPPLEMENTARY, U_IS_SURROGATE, and U8_APPEND. Also changed behavior
for non-strict mode so that unpaired surrogates will be turned into the
replacement character instead of invalid UTF-8 sequences, because U8_APPEND
won't create an invalid UTF-8 sequence, and because we don't need to do that
for any good reason at any call site.
(WTF::Unicode::isLegalUTF8): Deleted.
(WTF::Unicode::readUTF8Sequence): Deleted.
(WTF::Unicode::convertUTF8ToUTF16): Use U8_NEXT instead of
inlineUTF8SequenceLength, isLegalUTF8, and readUTF8Sequence. Use
U16_APPEND instead of lots of code that does the same thing. There is
room for further simplification since most callers don't need the "all ASCII"
feature and could probably pass the arguments in a more natural way.
(WTF::Unicode::calculateStringHashAndLengthFromUTF8MaskingTop8Bits):
Use U8_NEXT instead of isLegalUTF8, readUTF8Sequence, and various
error handling checks for things that are handled by U8_NEXT. Also removed
support for passing nullptr for end to specify a null-terminated string.
(WTF::Unicode::equalUTF16WithUTF8): Ditto.
* wtf/unicode/UTF8Conversion.h: Removed UTF8SequenceLength and
decodeUTF8Sequence. Changed the ConversionResult to match WebKit coding
style, with an eye toward perhaps removing it in the future. Changed
the convertUTF8ToUTF16 return value to a boolean and removed the "strict"
argument since no caller was passing false. Changed the convertLatin1ToUTF8
return value to a boolean. Tweaked comments.
2019-04-30 John Wilander <wilander@apple.com>
Add logging of Ad Click Attribution errors and events to a dedicated channel
https://bugs.webkit.org/show_bug.cgi?id=197332
<rdar://problem/49918800>
Reviewed by Youenn Fablet.
Added missing RELEASE_LOG_INFO and RELEASE_LOG_INFO_IF dummies
for RELEASE_LOG_DISABLED.
* wtf/Assertions.h:
2019-04-30 Youenn Fablet <youenn@apple.com>
Make Document audio producers use WeakPtr
https://bugs.webkit.org/show_bug.cgi?id=197382
Reviewed by Eric Carlson.
* wtf/WeakHashSet.h:
(WTF::WeakHashSet::hasNullReferences const):
2019-04-30 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r244773.
https://bugs.webkit.org/show_bug.cgi?id=197436
Causing assertion failures on debug queues (Requested by
ShawnRoberts on #webkit).
Reverted changeset:
"Make Document audio producers use WeakPtr"
https://bugs.webkit.org/show_bug.cgi?id=197382
https://trac.webkit.org/changeset/244773
2019-04-30 Youenn Fablet <youenn@apple.com>
Make Document audio producers use WeakPtr
https://bugs.webkit.org/show_bug.cgi?id=197382
Reviewed by Eric Carlson.
* wtf/WeakHashSet.h:
(WTF::WeakHashSet::hasNullReferences const):
2019-04-29 Alex Christensen <achristensen@webkit.org>
<rdar://problem/50299396> Fix internal High Sierra build
https://bugs.webkit.org/show_bug.cgi?id=197388
* Configurations/Base.xcconfig:
2019-04-29 Yusuke Suzuki <ysuzuki@apple.com>
JITStubRoutineSet wastes 180KB of HashTable capacity on can.com
https://bugs.webkit.org/show_bug.cgi?id=186732
Reviewed by Saam Barati.
* wtf/Range.h:
(WTF::Range::contains const):
2019-04-29 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Win] Add flag to enable version information stamping and disable by default.
https://bugs.webkit.org/show_bug.cgi?id=197249
<rdar://problem/50224412>
Reviewed by Ross Kirsling.
This feature is only used in AppleWin port. Add flag for this task and make it OFF by default.
Then enable it by default on AppleWin.
* wtf/CMakeLists.txt:
2019-04-26 Don Olmstead <don.olmstead@sony.com>
Add WTF::findIgnoringASCIICaseWithoutLength to replace strcasestr
https://bugs.webkit.org/show_bug.cgi?id=197291
Reviewed by Konstantin Tokarev.
Adds an implementation of strcasestr within WTF.
* wtf/text/StringCommon.h:
(WTF::findIgnoringASCIICaseWithoutLength):
2019-04-26 Sihui Liu <sihui_liu@apple.com>
Stop IDB transactions to release locked database files when network process is ready to suspend
https://bugs.webkit.org/show_bug.cgi?id=196372
<rdar://problem/48930116>
Reviewed by Brady Eidson.
Provide a method to suspend the thread and block main thread until the thread is suspended.
* wtf/CrossThreadTaskHandler.cpp:
(WTF::CrossThreadTaskHandler::taskRunLoop):
(WTF::CrossThreadTaskHandler::suspendAndWait):
(WTF::CrossThreadTaskHandler::resume):
* wtf/CrossThreadTaskHandler.h:
2019-04-25 Fujii Hironori <Hironori.Fujii@sony.com>
Unreviewed, rolling out r244669.
Windows ports can't clean build.
Reverted changeset:
"[Win] Add flag to enable version information stamping and
disable by default."
https://bugs.webkit.org/show_bug.cgi?id=197249
https://trac.webkit.org/changeset/244669
2019-04-25 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Win] Add flag to enable version information stamping and disable by default.
https://bugs.webkit.org/show_bug.cgi?id=197249
Reviewed by Ross Kirsling.
This feature is only used in AppleWin port. Add flag for this task and make it OFF by default.
Then enable it by default on AppleWin.
* wtf/CMakeLists.txt:
2019-04-25 Timothy Hatcher <timothy@apple.com>
Disable date and time inputs on iOSMac.
https://bugs.webkit.org/show_bug.cgi?id=197287
rdar://problem/46794376
Reviewed by Wenson Hsieh.
* wtf/FeatureDefines.h:
2019-04-25 Alex Christensen <achristensen@webkit.org>
Fix High Sierra build after r244653
https://bugs.webkit.org/show_bug.cgi?id=197131
* wtf/StdLibExtras.h:
High Sierra thinks __cplusplus is 201406 even when using C++17.
Removing the __cplusplus check resolves the build failure on High Sierra.
We can clean up StdLibExtras more later.
2019-04-25 Alex Christensen <achristensen@webkit.org>
Start using C++17
https://bugs.webkit.org/show_bug.cgi?id=197131
Reviewed by Darin Adler.
* Configurations/Base.xcconfig:
* wtf/CMakeLists.txt:
* wtf/Variant.h:
(WTF::switchOn):
2019-04-25 Alex Christensen <achristensen@webkit.org>
Remove DeprecatedOptional
https://bugs.webkit.org/show_bug.cgi?id=197161
Reviewed by Darin Adler.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/DeprecatedOptional.h: Removed.
2019-04-24 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Hardcoded text color in input fields
https://bugs.webkit.org/show_bug.cgi?id=126907
Reviewed by Michael Catanzaro.
Define HAVE_OS_DARK_MODE_SUPPORT for GTK port.
* wtf/Platform.h:
2019-04-24 Tim Horton <timothy_horton@apple.com>
Clean up WKActionSheetAssistant's use of LaunchServices
https://bugs.webkit.org/show_bug.cgi?id=194645
<rdar://problem/47707952>
Reviewed by Andy Estes.
* wtf/Platform.h:
2019-04-24 chris fleizach <cfleizach@apple.com>
AX: Remove deprecated Accessibility Object Model events
https://bugs.webkit.org/show_bug.cgi?id=197073
<rdar://problem/50027819>
Reviewed by Ryosuke Niwa.
* wtf/Platform.h:
2019-04-23 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r244558.
https://bugs.webkit.org/show_bug.cgi?id=197219
Causing crashes on iOS Sim Release and Debug (Requested by
ShawnRoberts on #webkit).
Reverted changeset:
"Remove DeprecatedOptional"
https://bugs.webkit.org/show_bug.cgi?id=197161
https://trac.webkit.org/changeset/244558
2019-04-23 Alex Christensen <achristensen@webkit.org>
Remove DeprecatedOptional
https://bugs.webkit.org/show_bug.cgi?id=197161
Reviewed by Darin Adler.
This was added in r209326 to be compatible with a shipping version of Safari.
We have released several versions of Safari since then, so do what the comments say and remove it.
The existence of this std::optional makes migrating to C++17 harder, and there's no reason to keep it.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/DeprecatedOptional.h: Removed.
2019-04-21 Zan Dobersek <zdobersek@igalia.com>
[WTF] Generic memoryFootprint() implementation should use bmalloc on Linux
https://bugs.webkit.org/show_bug.cgi?id=196963
Reviewed by Don Olmstead.
Have the generic memoryFootprint() implementation use bmalloc's
memoryFootprint() API on Linux, whenever the system malloc option is
not enabled. Limitation to Linux platforms is due to the bmalloc
implementation being limited to those configurations (excluding iOS
which doesn't use MemoryFootprintGeneric.cpp).
* wtf/PlatformWPE.cmake: Switch to building MemoryFootprintGeneric.cpp.
* wtf/generic/MemoryFootprintGeneric.cpp:
(WTF::memoryFootprint):
2019-04-19 Ryosuke Niwa <rniwa@webkit.org>
HashTable::removeIf always shrinks the hash table by half even if there is nothing left
https://bugs.webkit.org/show_bug.cgi?id=196681
<rdar://problem/49917764>
Reviewed by Darin Adler.
Address Darin's comments by removing the explicit type from std::max.
* wtf/HashTable.h:
(WTF::KeyTraits>::computeBestTableSize):
(WTF::KeyTraits>::shrinkToBestSize):
2019-04-18 Chris Dumez <cdumez@apple.com>
[iOS] Improve detection of when web views go to background / foreground
https://bugs.webkit.org/show_bug.cgi?id=197035
<rdar://problem/45281182>
Reviewed by Tim Horton.
Add build time flag.
* wtf/FeatureDefines.h:
2019-04-18 Jer Noble <jer.noble@apple.com>
Add support for parsing FairPlayStreaming PSSH boxes.
https://bugs.webkit.org/show_bug.cgi?id=197064
Reviewed by Eric Carlson.
* wtf/Platform.h:
2019-04-18 Yusuke Suzuki <ysuzuki@apple.com>
[WTF] StringBuilder should set correct m_is8Bit flag when merging
https://bugs.webkit.org/show_bug.cgi?id=197053
Reviewed by Saam Barati.
When appending StringBuilder to the other StringBuilder, we have a path that does not set m_is8Bit flag correctly.
This patch correctly sets this flag. And we also change 0 to nullptr when we are using 0 as a pointer.
* wtf/text/StringBuilder.cpp:
(WTF::StringBuilder::reserveCapacity):
(WTF::StringBuilder::appendUninitializedSlow):
(WTF::StringBuilder::append):
* wtf/text/StringBuilder.h:
(WTF::StringBuilder::append):
(WTF::StringBuilder::characters8 const):
(WTF::StringBuilder::characters16 const):
(WTF::StringBuilder::clear):
2019-04-17 Tim Horton <timothy_horton@apple.com>
Adopt different scroll view flashing SPI
https://bugs.webkit.org/show_bug.cgi?id=197043
<rdar://problem/49996476>
Reviewed by Wenson Hsieh.
* wtf/Platform.h:
2019-04-17 Jer Noble <jer.noble@apple.com>
Enable HAVE_AVFOUNDATION_VIDEO_OUTPUT on PLATFORM(IOSMAC)
https://bugs.webkit.org/show_bug.cgi?id=196994
<rdar://problem/44158331>
Reviewed by Alex Christensen.
* wtf/Platform.h:
2019-04-16 Stephan Szabo <stephan.szabo@sony.com>
[PlayStation] Update port for system library changes
https://bugs.webkit.org/show_bug.cgi?id=196978
Reviewed by Ross Kirsling.
* wtf/PlatformPlayStation.cmake:
Remove reference to deleted system library
2019-04-16 Jer Noble <jer.noble@apple.com>
Enable HAVE_AVKIT on PLATFORM(IOSMAC)
https://bugs.webkit.org/show_bug.cgi?id=196987
Reviewed by Tim Horton.
* wtf/Platform.h:
2019-04-16 Robin Morisset <rmorisset@apple.com>
[WTF] holdLock should be marked WARN_UNUSED_RETURN
https://bugs.webkit.org/show_bug.cgi?id=196922
Reviewed by Keith Miller.
* wtf/Locker.h:
2019-04-16 Don Olmstead <don.olmstead@sony.com>
[CMake] Set WTF_SCRIPTS_DIR
https://bugs.webkit.org/show_bug.cgi?id=196917
Reviewed by Konstantin Tokarev.
Use WTF_SCRIPTS_DIR for copying the unified sources script.
* wtf/CMakeLists.txt:
2019-04-15 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] FontPlatformData objects aren't cached at all when using font-family:system-ui
https://bugs.webkit.org/show_bug.cgi?id=196846
<rdar://problem/49499971>
Reviewed by Simon Fraser and Darin Adler.
* wtf/RetainPtr.h:
(WTF::safeCFEqual):
(WTF::safeCFHash):
2019-04-12 Ryosuke Niwa <rniwa@webkit.org>
HashTable::removeIf always shrinks the hash table by half even if there is nothing left
https://bugs.webkit.org/show_bug.cgi?id=196681
Reviewed by Darin Adler.
Made HashTable::removeIf shrink to the "best size", which is the least power of two bigger
than twice the key count as already used in the copy constructor.
* wtf/HashTable.h:
(WTF::HashTable::computeBestTableSize): Extracted from the copy constructor.
(WTF::HashTable::shrinkToBestSize): Added.
(WTF::HashTable::removeIf): Use shrinkToBestSize instead of shrink.
(WTF::HashTable::HashTable):
2019-04-12 Eric Carlson <eric.carlson@apple.com>
Update AudioSession route sharing policy
https://bugs.webkit.org/show_bug.cgi?id=196776
<rdar://problem/46501611>
Reviewed by Jer Noble.
* wtf/Platform.h: Define HAVE_ROUTE_SHARING_POLICY_LONG_FORM_VIDEO.
2019-04-10 Said Abou-Hallawa <sabouhallawa@apple.com>
requestAnimationFrame should execute before the next frame
https://bugs.webkit.org/show_bug.cgi?id=177484
Reviewed by Simon Fraser.
Add trace points for the page RenderingUpdate.
* wtf/SystemTracing.h:
2019-04-10 Claudio Saavedra <csaavedra@igalia.com>
Do not generate empty unified sources when unified builds are disabled
https://bugs.webkit.org/show_bug.cgi?id=196767
Reviewed by Konstantin Tokarev.
If unified builds are disabled, the ruby script to generate them
is still used to list the sources that need to be
compiled. Currently, the script always generates bundled unified
sources, even if it's being used just to list all the sources. So
when the unified builds are disabled and no files are going to be
bundled, the script generates one empty file per bundle manager
(that is, one C++ and one ObjectiveC), that gets added to the
sources to be compiled.
* Scripts/generate-unified-source-bundles.rb: Only go through the
bundle managers file generation when not running in
PrintAllSources mode, to avoid generating empty bundle files.
2019-04-10 Enrique Ocaña González <eocanha@igalia.com>
[WPE] Avoid async IO starving timers
https://bugs.webkit.org/show_bug.cgi?id=196733
Reviewed by Carlos Garcia Campos.
If AsyncIONetwork and DiskCacheRead priorities are higher than
MainThreadSharedTimer the timers get starved. This causes the NetworkProcess
to accumulate MB of data instead of handing it down to the WebProcess (done
using a Timer). This eventually causes an Out Of Memory kill on the
NetworkProcess on some embedded platforms with low memory limits.
This patch levels the three priorities to the same value, while still leaving
DiskCacheWrite with less priority than DiskCacheRead.
* wtf/glib/RunLoopSourcePriority.h: Changed RunLoopSourcePriority values for WPE.
2019-04-09 Don Olmstead <don.olmstead@sony.com>
[CMake] WTF derived sources should only be referenced inside WTF
https://bugs.webkit.org/show_bug.cgi?id=196706
Reviewed by Konstantin Tokarev.
Use ${WTF_DERIVED_SOURCES_DIR} instead of ${DERIVED_SOURCES_DIR} within WTF.
* wtf/CMakeLists.txt:
* wtf/PlatformJSCOnly.cmake:
* wtf/PlatformMac.cmake:
2019-04-09 Don Olmstead <don.olmstead@sony.com>
[CMake] Apple builds should use ICU_INCLUDE_DIRS
https://bugs.webkit.org/show_bug.cgi?id=196720
Reviewed by Konstantin Tokarev.
Copy ICU headers for Apple builds into ICU_INCLUDE_DIRS.
* CMakeLists.txt:
* wtf/PlatformMac.cmake:
2019-04-08 Don Olmstead <don.olmstead@sony.com>
[CMake][WinCairo] Separate copied headers into different directories
https://bugs.webkit.org/show_bug.cgi?id=196655
Reviewed by Michael Catanzaro.
* wtf/CMakeLists.txt:
2019-04-08 Guillaume Emont <guijemont@igalia.com>
Enable DFG on MIPS
https://bugs.webkit.org/show_bug.cgi?id=196689
Reviewed by Žan Doberšek.
Since the bytecode change, we enabled the baseline JIT on mips in
r240432, but DFG is still missing. With this change, all tests are
passing on a ci20 board.
* wtf/Platform.h: Enable DFG on MIPS by default.
2019-04-06 Ryosuke Niwa <rniwa@webkit.org>
Added tests for WeakHashSet::computesEmpty and WeakHashSet::computeSize
https://bugs.webkit.org/show_bug.cgi?id=196669
Reviewed by Geoffrey Garen.
Removed the superflous type names from forward declarations, and made WeakHashSet::add
take a const object to match other container types in WTF.
* wtf/WeakHashSet.h:
(WTF::WeakHashSet::add):
* wtf/WeakPtr.h:
2019-04-05 Ryosuke Niwa <rniwa@webkit.org>
Make WeakPtr<Element> possible and deploy it in form associated elements code
https://bugs.webkit.org/show_bug.cgi?id=196626
Reviewed by Antti Koivisto.
Make it possible to call WeakHashSet::remove and WeakHashSet::contains with
a subclass type U of a type T used to define WeakReference<T>.
Also added computesEmpty, which is slightly more efficient than computeSize
when m_set is either empty or when there are non-released weak references in the set.
* wtf/WeakHashSet.h:
(WTF::WeakHashSet::remove):
(WTF::WeakHashSet::contains const):
(WTF::WeakHashSet::computesEmpty const): Added.
* wtf/WeakPtr.h: Added an explicit forward declaration of WeakHashSet to avoid
build failures in GTK+ and WPE ports.
2019-04-05 Eric Carlson <eric.carlson@apple.com>
Remove AUDIO_TOOLBOX_AUDIO_SESSION
https://bugs.webkit.org/show_bug.cgi?id=196653
<rdar://problem/49652098>
Reviewed by Jer Noble.
* wtf/Platform.h:
2019-04-05 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed manual rollout of r243929
https://bugs.webkit.org/show_bug.cgi?id=196626
* wtf/WeakHashSet.h:
(WTF::WeakHashSet::remove):
(WTF::WeakHashSet::contains const):
(WTF::WeakHashSet::computesEmpty const): Deleted.
2019-04-05 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r243833.
https://bugs.webkit.org/show_bug.cgi?id=196645
This change breaks build of WPE and GTK ports (Requested by
annulen on #webkit).
Reverted changeset:
"[CMake][WTF] Mirror XCode header directories"
https://bugs.webkit.org/show_bug.cgi?id=191662
https://trac.webkit.org/changeset/243833
2019-04-05 Ryosuke Niwa <rniwa@webkit.org>
Make WeakPtr<Element> possible and deploy it in form associated elements code
https://bugs.webkit.org/show_bug.cgi?id=196626
Reviewed by Antti Koivisto.
Make it possible to call WeakHashSet::remove and WeakHashSet::contains with
a subclass type U of a type T used to define WeakReference<T>.
Also added computesEmpty, which is slightly more efficient than computeSize
when m_set is either empty or when there are non-released weak references in the set.
* wtf/WeakHashSet.h:
(WTF::WeakHashSet::remove):
(WTF::WeakHashSet::contains const):
(WTF::WeakHashSet::computesEmpty const): Added.
2019-04-04 Yusuke Suzuki <ysuzuki@apple.com>
[WebCore] Put most of derived classes of ScriptWrappable into IsoHeap
https://bugs.webkit.org/show_bug.cgi?id=196475
Reviewed by Saam Barati.
* wtf/ForbidHeapAllocation.h:
* wtf/IsoMalloc.h:
* wtf/IsoMallocInlines.h:
2019-04-03 Don Olmstead <don.olmstead@sony.com>
[CMake][WTF] Mirror XCode header directories
https://bugs.webkit.org/show_bug.cgi?id=191662
Reviewed by Konstantin Tokarev.
Rename WTF forwarding header target to WTFFramework and update the install location
to WTF_FRAMEWORK_HEADERS_DIR.
* wtf/CMakeLists.txt:
2019-04-03 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Remote Inspector indicate callback should always happen on the main thread
https://bugs.webkit.org/show_bug.cgi?id=196513
<rdar://problem/49498284>
Reviewed by Devin Rousso.
* wtf/MainThread.h:
* wtf/cocoa/MainThreadCocoa.mm:
(WTF::dispatchAsyncOnMainThreadWithWebThreadLockIfNeeded):
* wtf/ios/WebCoreThread.cpp:
* wtf/ios/WebCoreThread.h:
2019-04-02 Keith Rollin <krollin@apple.com>
Inhibit CFNetwork logging in private sessions
https://bugs.webkit.org/show_bug.cgi?id=196268
<rdar://problem/48210793>
Fix a conditional in Platform.h where IOS should have been used
instead of IOS_FAMILY. The latter happened to work, but we really want
to be using the proper symbol here.
Reviewed by Alexey Proskuryakov.
* wtf/Platform.h:
2019-04-01 Michael Catanzaro <mcatanzaro@igalia.com>
Stop trying to support building JSC with clang 3.8
https://bugs.webkit.org/show_bug.cgi?id=195947
<rdar://problem/49069219>
Reviewed by Darin Adler.
It seems WebKit hasn't built with clang 3.8 in a while, no devs are using this compiler, we
don't know how much effort it would be to make JSC work again, and it's making the code
worse. Remove my hacks to support clang 3.8 from WTF.
* wtf/MetaAllocator.cpp:
(WTF::MetaAllocator::allocate):
* wtf/text/StringConcatenate.h:
(WTF::tryMakeStringFromAdapters):
2019-03-31 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Butterfly allocation from LargeAllocation should try "realloc" behavior if collector thread is not active
https://bugs.webkit.org/show_bug.cgi?id=196160
Reviewed by Saam Barati.
* wtf/FastMalloc.h:
(WTF::FastMalloc::tryRealloc):
* wtf/Gigacage.cpp:
(Gigacage::tryRealloc):
* wtf/Gigacage.h:
2019-03-31 Andy Estes <aestes@apple.com>
[iOS] WebKit should consult the navigation response policy delegate before previewing a QuickLook document
https://bugs.webkit.org/show_bug.cgi?id=196433
<rdar://problem/49293305>
Reviewed by Tim Horton.
* wtf/NeverDestroyed.h:
(WTF::NeverDestroyed::operator->):
(WTF::NeverDestroyed::operator-> const):
2019-03-28 Fujii Hironori <Hironori.Fujii@sony.com>
Unreviewed build fix.
* wtf/CMakeLists.txt: Added SpanningTree.h to WTF_PUBLIC_HEADERS.
2019-03-28 Saam Barati <sbarati@apple.com>
BackwardsGraph needs to consider back edges as the backward's root successor
https://bugs.webkit.org/show_bug.cgi?id=195991
Reviewed by Filip Pizlo.
Previously, our backwards graph analysis was slightly wrong. The idea of
backwards graph is that the root of the graph has edges to terminals in
the original graph. And then the original directed edges in the graph are flipped.
However, we weren't considering loops as a form of terminality. For example,
we wouldn't consider an infinite loop as a terminal. So there were no edges
from the root to a node in the infinite loop. This lead us to make mistakes
when we used backwards dominators to compute control flow equivalence.
This is better understood in an example:
```
preheader:
while (1) {
if (!isCell(v))
continue;
load structure ID
if (cond)
continue;
return
}
```
In the previous version of this algorithm, the only edge from the backwards
root would be to the block containing the return. This would lead us to
believe that the loading of the structureID backwards dominates the preheader,
leading us to believe it's control flow equivalent to preheader. This is
obviously wrong, since we can loop forever if "v" isn't a cell.
The solution here is to treat any backedge in the graph as a "terminal" node.
Since a backedge implies the existence of a loop.
In the above example, the backwards root now has an edge to both blocks with
"continue". This prevents us from falsely claiming that the return is control
flow equivalent with the preheader.
This patch uses DFS spanning trees to compute back edges. An edge
u->v is a back edge when u is a descendent of v in the DFS spanning
tree of the Graph.
* WTF.xcodeproj/project.pbxproj:
* wtf/BackwardsGraph.h:
(WTF::BackwardsGraph::BackwardsGraph):
* wtf/SpanningTree.h: Added.
(SpanningTree::SpanningTree):
(SpanningTree::isDescendent):
2019-03-28 Tim Horton <timothy_horton@apple.com>
Un-fix the build
* wtf/Platform.h:
It is no longer necessary to exclude this from PLATFORM(IOSMAC).
2019-03-27 Per Arne Vollan <pvollan@apple.com>
Layout Test js/math-clz32.html is failing
https://bugs.webkit.org/show_bug.cgi?id=196209
Reviewed by Ross Kirsling.
Use the correct number of loop iterations when counting leading zeros. Also, the
count was off by one for the Win64 case.
* wtf/MathExtras.h:
(WTF::clz):
2019-03-26 Keith Rollin <krollin@apple.com>
Inhibit CFNetwork logging in private sessions
https://bugs.webkit.org/show_bug.cgi?id=196268
<rdar://problem/48210793>
Reviewed by Alex Christensen.
Before performing any logging, the NetworkProcess checks to see if
it's performing an operation associated with a private (ephemeral)
browsing session. If so, it skips the logging. However, networking
layers below the NetworkProcess don't know about private browsing, so
they would still perform their own logging. CFNetwork now has a flag
that lets us control that, so set it to False if private browsing.
* wtf/Platform.h:
2019-03-25 Alex Christensen <achristensen@webkit.org>
Expected shouldn't assume its contained types are copyable
https://bugs.webkit.org/show_bug.cgi?id=195986
Reviewed by JF Bastien.
* wtf/Expected.h:
(std::experimental::fundamentals_v3::__expected_detail::constexpr_base::constexpr_base):
(std::experimental::fundamentals_v3::operator==):
(std::experimental::fundamentals_v3::operator!=):
* wtf/Unexpected.h:
(std::experimental::fundamentals_v3::unexpected::unexpected):
2019-03-24 Keith Miller <keith_miller@apple.com>
Unreviewed, forgot to refactor variable name for windows build in
r243418.
* wtf/MathExtras.h:
(WTF::clz):
(WTF::ctz):
2019-03-24 Andy Estes <aestes@apple.com>
[watchOS] Remove unused Proximity Networking code
https://bugs.webkit.org/show_bug.cgi?id=196188
Reviewed by Tim Horton.
* wtf/FeatureDefines.h:
2019-03-23 Keith Miller <keith_miller@apple.com>
Refactor clz/ctz and fix getLSBSet.
https://bugs.webkit.org/show_bug.cgi?id=196162
Reviewed by Saam Barati.
This patch makes clz32/64 and ctz32 generic so they work on any
numeric type. Since these methods work on any type we don't need
to have a separate implementation of getLSBSet, which also
happened to be getMSBSet. This patch also adds getMSBSet as there
may be users who want that in the future.
* wtf/MathExtras.h:
(WTF::clz):
(WTF::ctz):
(WTF::getLSBSet):
(WTF::getMSBSet):
(getLSBSet): Deleted.
(WTF::clz32): Deleted.
(WTF::clz64): Deleted.
(WTF::ctz32): Deleted.
2019-03-22 Keith Rollin <krollin@apple.com>
Enable ThinLTO support in Production builds
https://bugs.webkit.org/show_bug.cgi?id=190758
<rdar://problem/45413233>
Reviewed by Daniel Bates.
Enable building with Thin LTO in Production when using Xcode 10.2 or
later. This change results in a 1.45% progression in PLT5. Full
Production build times increase about 2-3%. Incremental build times
are more severely affected, and so LTO is not enabled for local
engineering builds.
LTO is enabled only on macOS for now, until rdar://problem/49013399,
which affects ARM builds, is fixed.
To change the LTO setting when building locally:
- If building with `make`, specify WK_LTO_MODE={none,thin,full} on the
command line.
- If building with `build-webkit`, specify --lto-mode={none,thin,full}
on the command line.
- If building with `build-root`, specify --lto={none,thin,full} on the
command line.
- If building with Xcode, create a LocalOverrides.xcconfig file at the
top level of your repository directory (if needed) and define
WK_LTO_MODE to full, thin, or none.
* Configurations/Base.xcconfig:
2019-03-22 Tim Horton <timothy_horton@apple.com>
Fix the build after r243354
* wtf/Platform.h:
2019-03-22 Tim Horton <timothy_horton@apple.com>
Fix the build after r243354
https://bugs.webkit.org/show_bug.cgi?id=196138
<rdar://problem/49145951>
* wtf/Platform.h:
2019-03-21 Eric Carlson <eric.carlson@apple.com>
Add UI process WebRTC runtime logging.
https://bugs.webkit.org/show_bug.cgi?id=196020
<rdar://problem/49071443>
Reviewed by Youenn Fablet.
* wtf/Logger.h:
(WTF::LogArgument::toString): Add long long and unsigned long long variants.
2019-03-20 Simon Fraser <simon.fraser@apple.com>
Rename ENABLE_ACCELERATED_OVERFLOW_SCROLLING macro to ENABLE_OVERFLOW_SCROLLING_TOUCH
https://bugs.webkit.org/show_bug.cgi?id=196049
Reviewed by Tim Horton.
This macro is about the -webkit-overflow-scrolling CSS property, not accelerated
overflow scrolling in general, so rename it.
* wtf/FeatureDefines.h:
2019-03-20 Mark Lam <mark.lam@apple.com>
Open source arm64e code.
https://bugs.webkit.org/show_bug.cgi?id=196012
<rdar://problem/49066237>
Reviewed by Keith Miller.
* WTF.xcodeproj/project.pbxproj:
* wtf/BlockPtr.h:
* wtf/Platform.h:
* wtf/PlatformRegisters.cpp: Added.
(WTF::threadStateLRInternal):
(WTF::threadStatePCInternal):
* wtf/PlatformRegisters.h:
* wtf/PointerPreparations.h:
* wtf/PtrTag.cpp: Added.
(WTF::tagForPtr):
(WTF::ptrTagName):
(WTF::registerPtrTagLookup):
(WTF::reportBadTag):
* wtf/PtrTag.h:
(WTF::removeCodePtrTag):
(WTF::tagCodePtrImpl):
(WTF::tagCodePtr):
(WTF::untagCodePtrImplHelper):
(WTF::untagCodePtrImpl):
(WTF::untagCodePtr):
(WTF::retagCodePtrImplHelper):
(WTF::retagCodePtrImpl):
(WTF::retagCodePtr):
(WTF::tagCFunctionPtrImpl):
(WTF::tagCFunctionPtr):
(WTF::untagCFunctionPtrImpl):
(WTF::untagCFunctionPtr):
(WTF::tagInt):
(WTF::assertIsCFunctionPtr):
(WTF::assertIsNullOrCFunctionPtr):
(WTF::assertIsNotTagged):
(WTF::assertIsTagged):
(WTF::assertIsNullOrTagged):
(WTF::isTaggedWith):
(WTF::assertIsTaggedWith):
(WTF::assertIsNullOrTaggedWith):
(WTF::usesPointerTagging):
(WTF::registerPtrTagLookup):
(WTF::reportBadTag):
(WTF::tagForPtr): Deleted.
2019-03-20 Keith Rollin <krollin@apple.com>
Update checks that determine if WebKit is system WebKit
https://bugs.webkit.org/show_bug.cgi?id=195756
Reviewed by Alexey Proskuryakov.
The system WebKit can be installed in additional locations, so check
for and allow those, too.
* wtf/Platform.h:
2019-03-20 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, further attempt to fix clang 3.8 build
https://bugs.webkit.org/show_bug.cgi?id=195947
* wtf/MetaAllocator.cpp:
(WTF::MetaAllocator::allocate):
2019-03-20 Michael Catanzaro <mcatanzaro@igalia.com>
REGRESSION(r243115) breaks build for clang 3.8
https://bugs.webkit.org/show_bug.cgi?id=195947
Reviewed by Chris Dumez.
* wtf/text/StringConcatenate.h:
(WTF::tryMakeStringFromAdapters):
2019-03-20 Tim Horton <timothy_horton@apple.com>
Add an platform-driven spell-checking mechanism
https://bugs.webkit.org/show_bug.cgi?id=195795
Reviewed by Ryosuke Niwa.
* wtf/Platform.h:
Add an ENABLE flag.
2019-03-19 Michael Catanzaro <mcatanzaro@igalia.com>
Build cleanly with GCC 9
https://bugs.webkit.org/show_bug.cgi?id=195920
Reviewed by Chris Dumez.
WebKit triggers three new GCC 9 warnings:
"""
-Wdeprecated-copy, implied by -Wextra, warns about the C++11 deprecation of implicitly
declared copy constructor and assignment operator if one of them is user-provided.
"""
Solution is to either add a copy constructor or copy assignment operator, if required, or
else remove one if it is redundant.
"""
-Wredundant-move, implied by -Wextra, warns about redundant calls to std::move.
-Wpessimizing-move, implied by -Wall, warns when a call to std::move prevents copy elision.
"""
These account for most of this patch. Solution is to just remove the bad WTFMove().
Additionally, -Wclass-memaccess has been enhanced to catch a few cases that GCC 8 didn't.
These are solved by casting nontrivial types to void* before using memcpy. (Of course, it
would be safer to not use memcpy on nontrivial types, but that's too complex for this
patch. Searching for memcpy used with static_cast<void*> will reveal other cases to fix.)
* wtf/CheckedArithmetic.h:
(WTF::Checked::Checked):
* wtf/MetaAllocator.cpp:
(WTF::MetaAllocator::allocate):
* wtf/URLParser.cpp:
(WTF::CodePointIterator::operator!= const):
(WTF::CodePointIterator::operator=): Deleted.
* wtf/text/StringView.h:
(WTF::StringView::CodePoints::Iterator::operator=): Deleted.
2019-03-19 Alex Christensen <achristensen@webkit.org>
Make WTFLogChannelState and WTFLogLevel enum classes
https://bugs.webkit.org/show_bug.cgi?id=195904
Reviewed by Eric Carlson.
* wtf/Assertions.cpp:
* wtf/Assertions.h:
* wtf/Logger.h:
(WTF::Logger::logAlways const):
(WTF::Logger::error const):
(WTF::Logger::warning const):
(WTF::Logger::info const):
(WTF::Logger::debug const):
(WTF::Logger::willLog const):
(WTF::Logger::log):
* wtf/MemoryPressureHandler.cpp:
* wtf/RefCountedLeakCounter.cpp:
2019-03-19 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, rolling out r243132.
Broke GTK build
Reverted changeset:
"Make WTFLogChannelState and WTFLogLevel enum classes"
https://bugs.webkit.org/show_bug.cgi?id=195904
https://trac.webkit.org/changeset/243132
2019-03-18 Alex Christensen <achristensen@webkit.org>
Make WTFLogChannelState and WTFLogLevel enum classes
https://bugs.webkit.org/show_bug.cgi?id=195904
Reviewed by Eric Carlson.
* wtf/Assertions.cpp:
* wtf/Assertions.h:
* wtf/Logger.h:
(WTF::Logger::logAlways const):
(WTF::Logger::error const):
(WTF::Logger::warning const):
(WTF::Logger::info const):
(WTF::Logger::debug const):
(WTF::Logger::willLog const):
(WTF::Logger::log):
* wtf/MemoryPressureHandler.cpp:
* wtf/RefCountedLeakCounter.cpp:
2019-03-18 Darin Adler <darin@apple.com>
Cut down on use of StringBuffer, possibly leading toward removing it entirely
https://bugs.webkit.org/show_bug.cgi?id=195870
Reviewed by Daniel Bates.
* wtf/URL.cpp: Remove a now-inaccurate comment mentioning StringBuffer.
* wtf/text/StringView.cpp:
(WTF::convertASCIICase): Use createUninitialized instead of StringBuffer.
2019-03-18 Xan Lopez <xan@igalia.com>
[WTF] Remove redundant std::move in StringConcatenate
https://bugs.webkit.org/show_bug.cgi?id=195798
Reviewed by Darin Adler.
Remove redundant calls to WTFMove in return values for this
method. C++ will already do an implicit move here since we are
returning a local value where copy/move elision is not applicable.
* wtf/text/StringConcatenate.h:
(WTF::tryMakeStringFromAdapters):
2019-03-16 Darin Adler <darin@apple.com>
Improve normalization code, including moving from unorm.h to unorm2.h
https://bugs.webkit.org/show_bug.cgi?id=195330
Reviewed by Michael Catanzaro.
* wtf/URLHelpers.cpp: Removed unneeded include of unorm.h since the
normalization code is now in StringView.cpp.
(WTF::URLHelpers::escapeUnsafeCharacters): Renamed from
createStringWithEscapedUnsafeCharacters since it now only creates
a new string if one is needed. Use unsigned for string lengths, since
that's what WTF::String uses, not size_t. Added a first loop so that
we can return the string unmodified if no lookalike characters are
found. Removed unnecessary round trip from UTF-16 and then back in
the case where the character is not a lookalike.
(WTF::URLHelpers::toNormalizationFormC): Deleted. Moved this logic
into the WTF::normalizedNFC function in StringView.cpp.
(WTF::URLHelpers::userVisibleURL): Call escapeUnsafeCharacters and
normalizedNFC. The normalizedNFC function is better in multiple ways,
but primarily it handles 8-bit strings and other already-normalized
strings much more efficiently.
* wtf/text/StringView.cpp:
(WTF::normalizedNFC): Added. This has two overloads. One is for when
we already have a String, and want to re-use it if no normalization
is needed, and another is when we only have a StringView, and may need
to allocate a String to hold the result. Includes a fast special case
for 8-bit and already-normalized strings, and uses the same strategy
that JSC::normalize was already using: calls unorm2_normalize twice,
first just to determine the length.
* wtf/text/StringView.h: Added normalizedNFC, which can be called with
either a StringView or a String. Also moved StringViewWithUnderlyingString
here from JSString.h, here for use as the return value of normalizedNFC;
it is used for a similar purpose in the JavaScriptCore rope implementation.
Also removed an inaccurate comment.
2019-03-16 Diego Pino Garcia <dpino@igalia.com>
[GTK] [WPE] Fix compilation errors due to undefined ALWAYS_LOG_IF
https://bugs.webkit.org/show_bug.cgi?id=195850
Unreviewed build fix after r243033.
* wtf/LoggerHelper.h:
2019-03-15 Per Arne Vollan <pvollan@apple.com>
[iOS] Block the accessibility server when accessibility is not enabled.
https://bugs.webkit.org/show_bug.cgi?id=195342
Reviewed by Brent Fulgham.
Add SPI to issue a mach extension to a process by pid. Also, add a macro for
the availability of this SPI.
* wtf/Platform.h:
* wtf/spi/darwin/SandboxSPI.h:
2019-03-15 Eric Carlson <eric.carlson@apple.com>
Add media stream release logging
https://bugs.webkit.org/show_bug.cgi?id=195823
Reviewed by Youenn Fablet.
* wtf/LoggerHelper.h: Add LOG_IF variants that check a condition before logging.
2019-03-15 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r243008.
This revision broke High Sierra builders
Reverted changeset:
"[iOS] Block the accessibility server when accessibility is
not enabled."
https://bugs.webkit.org/show_bug.cgi?id=195342
https://trac.webkit.org/changeset/243008
2019-03-15 Per Arne Vollan <pvollan@apple.com>
[iOS] Block the accessibility server when accessibility is not enabled.
https://bugs.webkit.org/show_bug.cgi?id=195342
Reviewed by Brent Fulgham.
Add SPI to issue a mach extension to a process by pid.
* wtf/spi/darwin/SandboxSPI.h:
2019-03-13 Sam Weinig <sam@webkit.org>
Add utility function to allow easy reverse range-based iteration of a container
https://bugs.webkit.org/show_bug.cgi?id=195542
Reviewed by Antti Koivisto.
Add functions to create an IteratorRange<T> that will iterate a container backwards. It
works with any container that is compatible with std::rbegin() and std::rend(). It is
expected to be used in conjunction with range-based for-loops like so:
for (auto& value : WTF::makeReversedRange(myContainer))
...
* wtf/IteratorRange.h:
(WTF::makeReversedRange):
2019-03-13 Keith Rollin <krollin@apple.com>
Add support for new StagedFrameworks layout
https://bugs.webkit.org/show_bug.cgi?id=195543
Reviewed by Alexey Proskuryakov.
Opportunistic cleanup: remove unused JAVASCRIPTCORE_FRAMEWORKS_DIR
variable.
* Configurations/Base.xcconfig:
2019-03-13 Dominik Infuehr <dinfuehr@igalia.com>
String overflow when using StringBuilder in JSC::createError
https://bugs.webkit.org/show_bug.cgi?id=194957
Reviewed by Mark Lam.
When calculating the new capacity of a StringBuilder object,
use a limit of MaxLength instead of MaxLength+1. Allocating
a string of size MaxLength+1 always fails. This means that expanding
a StringBuilder only worked when the newly doubled capacity is less or
equal to MaxLength.
* wtf/text/StringBuilder.cpp:
2019-03-13 Chris Dumez <cdumez@apple.com>
Better build fix after r242901.
Reviewed by Jer Noble.
* wtf/Logger.h:
(WTF::LogArgument::toString):
2019-03-13 Jer Noble <jer.noble@apple.com>
Add AggregateLogger, a Logger specialization for singleton classes.
https://bugs.webkit.org/show_bug.cgi?id=195644
Reviewed by Eric Carlson.
Add a new class, AggregateLogger, which will log messages to each of its aggregated loggers.
Drive-by fixes: allow "const void*" to be directly logged by converting the pointer to a hex string.
* WTF.xcodeproj/project.pbxproj:
* wtf/AggregateLogger.h: Added.
(WTF::AggregateLogger::create):
(WTF::AggregateLogger::addLogger):
(WTF::AggregateLogger::removeLogger):
(WTF::AggregateLogger::logAlways const):
(WTF::AggregateLogger::error const):
(WTF::AggregateLogger::warning const):
(WTF::AggregateLogger::info const):
(WTF::AggregateLogger::debug const):
(WTF::AggregateLogger::willLog const):
(WTF::AggregateLogger::AggregateLogger):
(WTF::AggregateLogger::log const):
* wtf/CMakeLists.h:
* wtf/Logger.cpp:
(WTF::>::toString):
* wtf/Logger.h:
2019-03-12 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r242747.
https://bugs.webkit.org/show_bug.cgi?id=195641
Performance measurement is difficult in this period, rolling
out it and rolling in later to isolate it from the other
sensitive patches (Requested by yusukesuzuki on #webkit).
Reverted changeset:
"[JSC] Make StaticStringImpl & StaticSymbolImpl actually
static"
https://bugs.webkit.org/show_bug.cgi?id=194212
https://trac.webkit.org/changeset/242747
2019-03-12 Robin Morisset <rmorisset@apple.com>
A lot more classes have padding that can be reduced by reordering their fields
https://bugs.webkit.org/show_bug.cgi?id=195579
Reviewed by Mark Lam.
* wtf/CrossThreadQueue.h:
* wtf/Logger.h:
* wtf/MemoryPressureHandler.h:
* wtf/MetaAllocator.h:
* wtf/Threading.cpp:
2019-03-11 Alex Christensen <achristensen@webkit.org>
WTF::Expected should use std::addressof instead of operator&
https://bugs.webkit.org/show_bug.cgi?id=195604
Reviewed by Myles Maxfield.
The latter was causing problems with types that do tricky things with constructors and operator&,
specifically UniqueRef but I made a reduced test case. When it used operator&, it would get the contained
type and call the constructor that takes a contained type instead of the move constructor.
* wtf/Expected.h:
(std::experimental::fundamentals_v3::__expected_detail::base::base):
(std::experimental::fundamentals_v3::expected::swap):
2019-03-11 Ross Kirsling <ross.kirsling@sony.com>
Add Optional to Forward.h.
https://bugs.webkit.org/show_bug.cgi?id=195586
Reviewed by Darin Adler.
* wtf/Forward.h:
Add forward declaration for Optional.
* wtf/CPUTime.h:
* wtf/Expected.h:
* wtf/MainThread.h:
* wtf/MemoryFootprint.h:
* wtf/URLHelpers.cpp:
* wtf/URLHelpers.h:
* wtf/cocoa/CPUTimeCocoa.cpp:
* wtf/fuchsia/CPUTimeFuchsia.cpp:
* wtf/unix/CPUTimeUnix.cpp:
* wtf/win/CPUTimeWin.cpp:
Remove unnecessary includes from headers.
2019-03-11 Andy Estes <aestes@apple.com>
[Apple Pay] Use PKPaymentAuthorizationController to present the Apple Pay UI remotely from the Networking service on iOS
https://bugs.webkit.org/show_bug.cgi?id=195530
<rdar://problem/48747164>
Reviewed by Alex Christensen.
* wtf/FeatureDefines.h: Defined ENABLE_APPLE_PAY_REMOTE_UI.
2019-03-11 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Make StaticStringImpl & StaticSymbolImpl actually static
https://bugs.webkit.org/show_bug.cgi?id=194212
Reviewed by Mark Lam.
Avoid mutation onto refcounts if `isStatic()` returns true so that the content of StaticStringImpl never gets modified.
* wtf/text/StringImpl.h:
(WTF::StringImpl::ref):
(WTF::StringImpl::deref):
2019-03-11 Sihui Liu <sihui_liu@apple.com>
Crash under WebCore::IDBDatabase::connectionToServerLost
https://bugs.webkit.org/show_bug.cgi?id=195563
<rdar://problem/37193655>
CrossThreadTask should protect callee if it is ThreadSafeRefCounted.
Reviewed by Geoffrey Garen.
* wtf/CrossThreadTask.h:
(WTF::createCrossThreadTask):
2019-03-11 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r242688, r242643, r242624.
Caused multiple layout test failures and crashes on iOS and macOS.
Reverted changeset:
"requestAnimationFrame should execute before the next frame"
https://bugs.webkit.org/show_bug.cgi?id=177484
https://trac.webkit.org/changeset/242624/webkit
* wtf/SystemTracing.h:
2019-03-11 Darin Adler <darin@apple.com>
Specify fixed precision explicitly to prepare to change String::number and StringBuilder::appendNumber floating point behavior
https://bugs.webkit.org/show_bug.cgi?id=195533
Reviewed by Brent Fulgham.
Soon, we will change String::number and StringBuilder::appendNumber for floating
point to use "shortest form" serialization instead of the current default, which is
"6-digit fixed precision stripping trailing zeros". To prepare to do this safely
without accidentally changing any behavior, changing callers to call the explicit
versions. Later, we may want to return and change many of them to use shortest form
instead, but that may require rebaselining tests, and in some extreme cases, getting
rid of flawed logic that converts between different single and double precision
floating point; such problems may be hidden by fixed precision serialization.
Since "shortest form" is already the behavior for AtomicString::number and
for makeString, no changes required for clients of either of those.
* wtf/Logger.h:
(WTF::LogArgument::toString): Use numberToStringFixedPrecision.
* wtf/MediaTime.cpp:
(WTF::MediaTime::toString const): Use appendFixedPrecisionNumber.
* wtf/text/ValueToString.h:
(WTF::ValueToString<float>::string): Use numberToStringFixedPrecision.
(WTF::ValueToString<double>::string): Ditto.
2019-03-11 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r242702.
Broke High Sierra builders.
Reverted changeset:
"Add utility function to allow easy reverse range-based
iteration of a container"
https://bugs.webkit.org/show_bug.cgi?id=195542
https://trac.webkit.org/changeset/242702
2019-03-11 Sam Weinig <sam@webkit.org>
Add utility function to allow easy reverse range-based iteration of a container
https://bugs.webkit.org/show_bug.cgi?id=195542
Reviewed by Antti Koivisto.
Add functions to create an IteratorRange<T> that will iterate a container backwards. It
works with any container that is compatible with std::rbegin() and std::rend(). It is
expected to be used in conjunction with range-based for-loops like so:
for (auto& value : WTF::makeReversedRange(myContainer))
...
* wtf/IteratorRange.h:
(WTF::makeReversedRange):
2019-03-10 Yusuke Suzuki <utatane.tea@gmail.com> and Fujii Hironori <Hironori.Fujii@sony.com>
[WTF] Align assumption in RunLoopWin to the other platform's RunLoop
https://bugs.webkit.org/show_bug.cgi?id=181151
Reviewed by Don Olmstead.
This patch fixes RunLoop in Windows to align it to the implementations in the other platforms
to use RunLoop more aggressively.
* wtf/RunLoop.h:
(WTF::RunLoop::Timer::Timer):
* wtf/win/MainThreadWin.cpp:
(initializeMainThreadPlatform): Call RunLoop::registerRunLoopMessageWindowClass.
* wtf/win/RunLoopWin.cpp:
(WTF::RunLoop::wndProc):
(WTF::RunLoop::iterate):
(WTF::RunLoop::stop):
PostQuitMessage is only available in the RunLoop's thread. We should post a message and call
it inside this task.
(WTF::RunLoop::registerRunLoopMessageWindowClass):
Changed the return type from bool to void, and added RELEASE_ASSERT to check the return value of RegisterClass.
(WTF::RunLoop::~RunLoop):
When the RunLoop's thread is freed, its associated window is freed. We do not need to do here.
(WTF::RunLoop::TimerBase::timerFired):
(WTF::RunLoop::TimerBase::TimerBase):
(WTF::RunLoop::TimerBase::start):
(WTF::RunLoop::TimerBase::stop):
(WTF::RunLoop::TimerBase::isActive const):
(WTF::RunLoop::TimerBase::secondsUntilFire const):
(WTF::generateTimerID): Deleted.
We can use TimerBase's pointer as ID since it is uintptr_t.
2019-03-07 Said Abou-Hallawa <sabouhallawa@apple.com>
requestAnimationFrame should execute before the next frame
https://bugs.webkit.org/show_bug.cgi?id=177484
Reviewed by Simon Fraser.
Add trace points for the page RenderingUpdate.
* wtf/SystemTracing.h:
2019-03-06 Ross Kirsling <ross.kirsling@sony.com>
[Win] Remove -DUCHAR_TYPE=wchar_t stopgap and learn to live with char16_t.
https://bugs.webkit.org/show_bug.cgi?id=195346
Reviewed by Fujii Hironori.
* wtf/PlatformWin.cmake:
* wtf/text/AtomicString.h:
(WTF::AtomicString::AtomicString):
* wtf/text/WTFString.h:
(WTF::String::String):
* wtf/text/win/StringWin.cpp: Added.
(WTF::String::wideCharacters const): Renamed from WTF::stringToNullTerminatedWChar.
* wtf/text/win/WCharStringExtras.h:
(WTF::ucharFrom):
(WTF::wcharFrom):
(WTF::stringToNullTerminatedWChar): Deleted.
(WTF::wcharToString): Deleted.
(WTF::nullTerminatedWCharToString): Deleted.
Add static_assert-guarded reinterpret_cast wrappers for going between UChar* and wchar_t*.
Move existing to/from-String helpers into the String (and AtomicString) class(es).
* wtf/win/FileSystemWin.cpp:
(WTF::FileSystemImpl::getFindData):
(WTF::FileSystemImpl::getFinalPathName):
(WTF::FileSystemImpl::createSymbolicLink):
(WTF::FileSystemImpl::deleteFile):
(WTF::FileSystemImpl::deleteEmptyDirectory):
(WTF::FileSystemImpl::moveFile):
(WTF::FileSystemImpl::pathByAppendingComponent):
(WTF::FileSystemImpl::fileSystemRepresentation):
(WTF::FileSystemImpl::makeAllDirectories):
(WTF::FileSystemImpl::pathGetFileName):
(WTF::FileSystemImpl::storageDirectory):
(WTF::FileSystemImpl::generateTemporaryPath):
(WTF::FileSystemImpl::openTemporaryFile):
(WTF::FileSystemImpl::openFile):
(WTF::FileSystemImpl::hardLinkOrCopyFile):
(WTF::FileSystemImpl::deleteNonEmptyDirectory):
* wtf/win/LanguageWin.cpp:
(WTF::localeInfo):
* wtf/win/PathWalker.cpp:
(WTF::PathWalker::PathWalker):
Use wchar helpers as needed.
2019-02-28 Ryosuke Niwa <rniwa@webkit.org>
Add WeakHashSet
https://bugs.webkit.org/show_bug.cgi?id=195152
Reviewed by Antti Koivisto.
Added WeakHashSet which is a HashSet of WeakPtr. When the object pointed by WeakPtr is deleted,
WeakHashSet treats the key to be no longer in the set. That is, WeakHashSet::contains returns false
and const_iterator skips such a WeakPtr in the set.
We decided not to make HashSet<WeahPtr<T>> work because it involves weird semantics such as making
find(X) delete the table entry as remove(find(X)) would be a no-op otherwise as find(X) would return
necessarily need to return HashSet<WeakPtr<T>>::end().
Furthermore, we cannot determine the true size of this set in O(1) because the objected pointed by
some of WeakPtr in the set may have already been deleted. This has implications that we can't have
size(), isEmpty(), random(), etc... as O(1) operation.
WeakHashSet is implemented as HashSet<WeakReference<T>>. HashTable::rehash has been updated to delete
WeakReference<T>'s whose m_ptr has become null, and HashTable::expand first deletes any such entry
before deciding an actual expansion is needed. This is accomplished via newly added hash trait,
hasIsReleasedWeakValueFunction, and HashTraits<Ref<WeakReference<T>>>::isReleasedWeakValue which
returns true for when WeakReference<T> pointed by Ref<WeakReference<T>> has null m_ptr, not to be
confused with Ref<WeakReference<T>> itself pointing to a null WeakReference<T>.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/Forward.h:
* wtf/HashSet.h:
(WTF::HashSet<T, U, V>::checkConsistency const): Added.
* wtf/HashTable.h:
(WTF::HashTable::isReleasedWeakBucket): Added.
(WTF::HashTable::expand): Delete WeakReference<T> with null m_ptr first. This updates m_keyCount
and may make mustRehashInPlace() return true.
(WTF::HashTable::deleteReleasedWeakBuckets): Added.
(WTF::HashTable::rehash): Delete WeakReference<T> with null m_ptr. Also refactored the code a bit
to avoid keep repeating oldTable[i].
* wtf/HashTraits.h:
(WTF::HashTraits<T>::isHashTraitsReleasedWeakValue): Added.
(WTF::RefHashTraits<T>): Extracted from HashTraits<Ref<P>> to share code with
HashTraits<Ref<WeakReference<T>>>.
(WTF::HashTraitsReleasedWeakValueChecker<Traits, hasIsReleasedWeakValueFunction>): Added.
(WTF::isHashTraitsReleasedWeakValue<Traits, hasIsReleasedWeakValueFunction>): Added.
* wtf/WeakHashSet.h: Added.
(WTF::WeakHashSet): Added.
(WTF::WeakHashSet::WeakHashSetConstIterator::WeakHashSetConstIterator):
(WTF::WeakHashSet::WeakHashSetConstIterator::get const):
(WTF::WeakHashSet::WeakHashSetConstIterator::operator* const):
(WTF::WeakHashSet::WeakHashSetConstIterator::operator-> const):
(WTF::WeakHashSet::WeakHashSetConstIterator::operator++):
(WTF::WeakHashSet::WeakHashSetConstIterator::skipEmptyBuckets):
(WTF::WeakHashSet::WeakHashSetConstIterator::operator== const):
(WTF::WeakHashSet::WeakHashSetConstIterator::operator!= const):
(WTF::WeakHashSet::WeakHashSet):
(WTF::WeakHashSet::begin const):
(WTF::WeakHashSet::end const):
(WTF::WeakHashSet::add):
(WTF::WeakHashSet::remove):
(WTF::WeakHashSet::contains const):
(WTF::WeakHashSet::capacity const):
(WTF::WeakHashSet::computeSize const): Deletes any WeakReference<T> with null m_ptr first.
(WTF::WeakHashSet::checkConsistency const):
(WTF::HashTraits<Ref<WeakReference<T>>>): Added. This hash traits triggers the new code in HashTable's
expand and rehash methods to delete WeakReference<T> with null m_ptr.
(WTF::HashTraits<Ref<WeakReference<T>>>::isReleasedWeakValue):
* wtf/WeakPtr.h:
(WTF::WeakReference::~WeakReference): Added so that we can keep track the number of live WeakReference
in API tests by template specializations.
2019-03-03 Darin Adler <darin@apple.com>
Prepare to improve handling of conversion of float to strings
https://bugs.webkit.org/show_bug.cgi?id=195262
Reviewed by Daniel Bates.
* wtf/dtoa.cpp:
(WTF::truncateTrailingZeros): Renamed from
formatStringTruncatingTrailingZerosIfNeeded and removed the calls
to double_conversion::StringBuilder::Finalizer, since the caller
already does that.
(WTF::numberToFixedPrecisionString): Added an overload for float
and updated to use the new truncateTrailingZeros.
(WTF::numberToFixedWidthString): Added an overload for float.
* wtf/text/AtomicString.cpp:
(WTF::AtomicString::number): Added float overload. This is a
behavior change, but in all cases for the better. The old behavior
was to convert to double first and then do "shortest form"
conversion, and it's always better to just do that as float.
* wtf/text/AtomicString.h: Added float overload of AtomicString::number.
* wtf/text/StringBuilder.cpp:
(WTF::StringBuilder::appendFixedPrecisionNumber): Added float
overload.
(WTF::StringBuilder::appendShortestFormNumber): Renamed from
appendECMAScriptNumber and did the above.
(WTF::StringBuilder::appendFixedWidthNumber): Ditto.
* wtf/text/StringBuilder.h: Added overloads for float and
appendShortestFormNumber. The appendNumber and appendECMAScriptNumber
functions are now inlines in the header, since they are expressed
entirely in terms of the other functions.
* wtf/text/WTFString.cpp:
(WTF::String::numberToStringFixedPrecision): Added float overload.
Removed unnecessary explicit conversion to String.
(WTF::String::numberToStringShortest): Renamed from
numberToStringECMAScript and did the above.
(WTF::String::numberToStringFixedWidth): Ditto.
* wtf/text/WTFString.h: Added overloads for float and
numberToStringShortest. The number and numberToStringECMAScript
functions are now inlines in the header, since they are expressed
entirely in terms of the other functions.
2019-03-04 Andy Estes <aestes@apple.com>
[Apple Pay] Move WebPaymentCoordinatorProxy from Source/WebKit/UIProcess to Source/WebKit/Shared
https://bugs.webkit.org/show_bug.cgi?id=195080
<rdar://problem/48421558>
Reviewed by Antti Koivisto.
* wtf/FeatureDefines.h:
2019-03-04 Michael Catanzaro <mcatanzaro@igalia.com>
URLHelpers should use unorm2_quickCheck before converting to NFC
https://bugs.webkit.org/show_bug.cgi?id=194272
Reviewed by Darin Adler.
If the string is already in normalization form C, don't try to normalize it.
* wtf/URLHelpers.cpp:
(WTF::URLHelpers::toNormalizationFormC):
2019-03-02 Darin Adler <darin@apple.com>
Retire legacy dtoa function and DecimalNumber class
https://bugs.webkit.org/show_bug.cgi?id=195253
Reviewed by Daniel Bates.
* WTF.xcodeproj/project.pbxproj: Removed DecimalNumber.cpp/h.
* wtf/CMakeLists.txt: Ditto.
* wtf/DecimalNumber.cpp: Removed.
* wtf/DecimalNumber.h: Removed.
* wtf/JSONValues.cpp:
(WTF::JSONImpl::Value::writeJSON const): Use
StringBuilder::appendECMAScriptNumber instead of custom logic
using the DecimalNumber class.
* wtf/dtoa.cpp:
(WTF::storeInc): Deleted.
(WTF::BigInt): Deleted.
(WTF::multadd): Deleted.
(WTF::hi0bits): Deleted.
(WTF::lo0bits): Deleted.
(WTF::i2b): Deleted.
(WTF::mult): Deleted.
(WTF::P5Node::P5Node): Deleted.
(WTF::pow5mult): Deleted.
(WTF::lshift): Deleted.
(WTF::cmp): Deleted.
(WTF::diff): Deleted.
(WTF::d2b): Deleted.
(WTF::quorem): Deleted.
(WTF::dtoa): Deleted.
* wtf/dtoa.h: Removed DtoaBuffer, dtoa, and NumberToStringBufferLength.
2019-02-27 Darin Adler <darin@apple.com>
Fixed makeString(float) to do shortest-form serialization without first converting to double
https://bugs.webkit.org/show_bug.cgi?id=195142
Reviewed by Daniel Bates.
* wtf/DecimalNumber.cpp: Removed unneeded includes.
* wtf/DecimalNumber.h: Removed unused constructors; over time we will be
deprecating DecimalNumber, so we should removed the unused parts. Also
marked the constructor explicit, removed types used only for arguments for
the constructors, and removed the sign, exponent, significand, and precision
member functions.
* wtf/JSONValues.cpp:
(WTF::JSONImpl::Value::writeJSON const): Updated for changes to DecimalNumber
switched from NumberToLStringBuffer to NumberToStringBuffer, and for use of
std::array instead of C arrays.
* wtf/dtoa.cpp: Removed unused dtoaRoundSF and dtoaRoundDP functions.
(WTF::dtoa): Updated to use std::array instead of C arrays.
(WTF::dtoaRoundSF): Removed.
(WTF::dtoaRoundDP): Removed.
(WTF::numberToString): Added an overload for float and updated to use std::array.
(WTF::formatStringTruncatingTrailingZerosIfNeeded): Updated to use std::array.
(WTF::numberToFixedPrecisionString): Ditto.
(WTF::numberToFixedWidthString): Ditto.
* wtf/dtoa.h: Changed arrays to be std::array instead of C arrays so the
array types will be checked. Removed dtoaRoundSF and dtoaRoundDP.
Added float overloads for numberToString, numberToFixedPrecisionString,
and numberToFixedWidthString. The only one of these that is called at this
time is numberToString, called by the floating point StringTypeAdapter in
StringConcatenateNummbers.h.
* wtf/text/StringConcatenateNumbers.h: Updated for std::array.
2019-03-01 Darin Adler <darin@apple.com>
Finish removing String::format
https://bugs.webkit.org/show_bug.cgi?id=194893
Reviewed by Daniel Bates.
* wtf/Assertions.cpp:
(WTF::createWithFormatAndArguments): Moved this here from WTFString.cpp.
(WTFLog): Use WTF::createWithFormatAndArguments instead of String::format.
* wtf/HexNumber.h: Deleted unneeded toString function.
* wtf/text/StringConcatenate.h: Got rid of unneeded forward declaration of
StringTypeAdapter, since that's now in Forward.h. Tweaked formatting of templates
a bit. Use function templates for writeTo functions rather than having two of each.
Removed unused toString functions. Optimized case where we use have a UChar* and
a length of zero to not force the result to be 16-bit. Also gets rid of a small
NO_RETURN_DUE_TO_CRASH mess that we don't need. Refactored constructors to use some
static member helper functions to compute string lengths. Added the pad function
and the PaddingSpecification struct template, so we can add padding to anything
we can turn into a string. Got rid of the special case overload for single
arguments, since it only worked for things that the String constructor can handle.
Instead we will now use StringTypeAdapter, which works for more types. Possibly
less optimal for some special cases, which we could specialize for later if we like.
* wtf/text/StringConcatenateNumbers.h: Ditto.
* wtf/text/StringOperators.h: Ditto.
* wtf/text/StringView.h: Ditto.
* wtf/text/WTFString.cpp:
(WTF::createWithFormatAndArguments): Deleted.
(WTF::String::format): Deleted.
* wtf/text/WTFString.h: Deleted declaration of String::format.
2019-03-01 Alex Christensen <achristensen@webkit.org>
Revert r241223, r241235, and r241287
https://bugs.webkit.org/show_bug.cgi?id=194427
<rdar://48045861>
* wtf/spi/darwin/XPCSPI.h:
2019-03-01 Simon Fraser <simon.fraser@apple.com>
Add a system trace scope for event region building
https://bugs.webkit.org/show_bug.cgi?id=195226
Reviewed by Jon Lee.
This trace scope measures the time spend converting element rects into Region objects,
which can be large on some pages.
The value for "Display Refresh Dispatch to main thread" was wrong and I fixed it.
* wtf/SystemTracing.h:
2019-02-28 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] sizeof(JSString) should be 16
https://bugs.webkit.org/show_bug.cgi?id=194375
Reviewed by Saam Barati.
* wtf/text/StringImpl.h:
(WTF::StringImpl::flagIs8Bit):
(WTF::StringImpl::flagIsAtomic):
(WTF::StringImpl::flagIsSymbol):
(WTF::StringImpl::maskStringKind):
* wtf/text/WTFString.cpp:
(WTF::nullString):
* wtf/text/WTFString.h:
2019-02-28 Mark Lam <mark.lam@apple.com>
Change CheckedArithmetic to not use std::enable_if_t.
https://bugs.webkit.org/show_bug.cgi?id=195187
<rdar://problem/48464665>
Reviewed by Keith Miller.
Because C++11 does not like std::enable_if_t and there's a need to use this file with C++11.
* wtf/CheckedArithmetic.h:
2019-02-27 Simon Fraser <simon.fraser@apple.com>
Roll out r242014; it caused crashes in compositing logging (webkit.org/b/195141)
* wtf/Assertions.cpp:
(WTF::createWithFormatAndArguments): Deleted.
* wtf/HexNumber.h:
(WTF::StringTypeAdapter<HexNumberBuffer>::toString const):
* wtf/text/StringConcatenate.h:
(WTF::makeString):
(WTF::pad): Deleted.
(WTF::StringTypeAdapter<PaddingSpecification<UnderlyingAdapterType>>::StringTypeAdapter): Deleted.
(WTF::StringTypeAdapter<PaddingSpecification<UnderlyingAdapterType>>::length const): Deleted.
(WTF::StringTypeAdapter<PaddingSpecification<UnderlyingAdapterType>>::is8Bit const): Deleted.
(WTF::StringTypeAdapter<PaddingSpecification<UnderlyingAdapterType>>::writeTo const): Deleted.
* wtf/text/StringConcatenateNumbers.h:
(WTF::FormattedNumber::fixedPrecision):
(WTF::FormattedNumber::fixedWidth):
(WTF::StringTypeAdapter<FormattedNumber>::toString const):
* wtf/text/StringOperators.h:
(WTF::StringAppend::StringAppend):
* wtf/text/StringView.h:
(WTF::StringView::invalidate):
* wtf/text/WTFString.cpp:
(WTF::createWithFormatAndArguments):
(WTF::String::format):
* wtf/text/WTFString.h:
2019-02-26 Mark Lam <mark.lam@apple.com>
Remove remaining poisoning code.
https://bugs.webkit.org/show_bug.cgi?id=194138
Reviewed by Saam Barati.
This patch removes the instantiation of Poisoned variants of the various containers
but retains the ability of those containers to work with pointer traits. This
allows us to use them with smart pointers in the future (just like we used to with
Poisoned values). At minimum, this ability will be useful when we want to insert
an observer into the container storage type for debugging purposes, or to collect
statistics for profiling.
* WTF.xcodeproj/project.pbxproj:
* wtf/Bag.h:
* wtf/CMakeLists.txt:
* wtf/Platform.h:
* wtf/Poisoned.cpp: Removed.
* wtf/Poisoned.h: Removed.
* wtf/PoisonedUniquePtr.h: Removed.
* wtf/Ref.h:
* wtf/RefCountedArray.h:
* wtf/RefPtr.h:
* wtf/WTFAssertions.cpp:
2019-02-26 Keith Miller <keith_miller@apple.com>
Code quality cleanup in NeverDestroyed
https://bugs.webkit.org/show_bug.cgi?id=194824
Reviewed by Yusuke Suzuki.
First, move data members to the end of the class per WebKit
style. Also, add forbid heap allocation since we expect the
NeverDestroyed classes to be static.
* wtf/NeverDestroyed.h:
2019-02-25 Xabier Rodriguez Calvar <calvaris@igalia.com>
Fix WTFLogVerbose variadic parameters forwarding
https://bugs.webkit.org/show_bug.cgi?id=194920
Reviewed by Alex Christensen.
WTFLogVerbose was passing the va_list to WTFLog but this function
also used variadic parameters and this is not allowed in C (that
part of the code is extern "C").
* wtf/Assertions.cpp:
(WTF::WTFLogVaList): Created to take a va_list argument instead of
variadic parameters.
(WTF::WTFLog): Kept with variadic parameters, which are
transformed to va_list and passed to WTFLogVaList.
(WTF::WTFLogVerbose): Use WTFLogVaList instead of WTFLog.
2019-02-25 Sam Weinig <sam@webkit.org>
Update double-conversion to the latest version
https://bugs.webkit.org/show_bug.cgi?id=194994
Import the latest version of the double-conversion library based on
https://github.com/google/double-conversion/commit/990c44707c70832dc1ce1578048c2198bafd3307
In additon to importing the code, the following changes were applied (or re-applied) to maintain
parity with what we had previously:
- Add #include "config.h" to each cpp file.
- Put everything inside the WTF namespace.
- Changed all in library includes to be of the form #include <wtf/dtoa/FILE.h>.
- Renamed double_conversion::Vector<> to double_conversion::BufferReference<>.
- Replaced duplicated functions with ASCIICType.h variants
- Made CachedPower table a constexpr.
- Exported (via WTF_EXPORT_PRIVATE) several functions in double-conversion.h.
- Made substantial changes to StringToDoubleConverter to avoid unnecessary overhead of
parameterization, as we only ever want one configuration. Instead of constructing a
configured class and calling StringToDouble on it, StringToDouble is now a static
function. This allows a bunch of now dead code (hex support, octal support, etc.) to
be eliminated. As StringToDoubleConverter now supports single precision floats, some
additional templating of StringToIeee was added to avoid extra unnecessary branching.
- Added RemoveCharacters function to double_conversion::StringBuilder.
Reviewed by Darin Adler.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/dtoa/AUTHORS: Added.
* wtf/dtoa/README: Removed.
* wtf/dtoa/README.md: Added.
* wtf/dtoa/bignum-dtoa.cc:
* wtf/dtoa/bignum-dtoa.h:
* wtf/dtoa/bignum.cc:
* wtf/dtoa/bignum.h:
(WTF::double_conversion::Bignum::Times10):
(WTF::double_conversion::Bignum::Equal):
(WTF::double_conversion::Bignum::LessEqual):
(WTF::double_conversion::Bignum::Less):
(WTF::double_conversion::Bignum::PlusEqual):
(WTF::double_conversion::Bignum::PlusLessEqual):
(WTF::double_conversion::Bignum::PlusLess):
(WTF::double_conversion::Bignum::EnsureCapacity):
(WTF::double_conversion::Bignum::BigitLength const):
* wtf/dtoa/cached-powers.cc:
* wtf/dtoa/cached-powers.h:
* wtf/dtoa/diy-fp.cc:
* wtf/dtoa/diy-fp.h:
(WTF::double_conversion::DiyFp::DiyFp):
(WTF::double_conversion::DiyFp::Subtract):
(WTF::double_conversion::DiyFp::Minus):
(WTF::double_conversion::DiyFp::Times):
(WTF::double_conversion::DiyFp::Normalize):
(WTF::double_conversion::DiyFp::f const):
(WTF::double_conversion::DiyFp::e const):
(WTF::double_conversion::DiyFp::set_f):
(WTF::double_conversion::DiyFp::set_e):
* wtf/dtoa/double-conversion.cc:
* wtf/dtoa/double-conversion.h:
(WTF::double_conversion::DoubleToStringConverter::DoubleToStringConverter):
(WTF::double_conversion::DoubleToStringConverter::ToShortest const):
(WTF::double_conversion::DoubleToStringConverter::ToShortestSingle const):
(WTF::double_conversion::StringToDoubleConverter::StringToDoubleConverter):
* wtf/dtoa/double.h: Removed.
* wtf/dtoa/fast-dtoa.cc:
* wtf/dtoa/fast-dtoa.h:
* wtf/dtoa/fixed-dtoa.cc:
* wtf/dtoa/fixed-dtoa.h:
* wtf/dtoa/ieee.h: Added.
(WTF::double_conversion::double_to_uint64):
(WTF::double_conversion::uint64_to_double):
(WTF::double_conversion::float_to_uint32):
(WTF::double_conversion::uint32_to_float):
(WTF::double_conversion::Double::Double):
(WTF::double_conversion::Double::AsDiyFp const):
(WTF::double_conversion::Double::AsNormalizedDiyFp const):
(WTF::double_conversion::Double::AsUint64 const):
(WTF::double_conversion::Double::NextDouble const):
(WTF::double_conversion::Double::PreviousDouble const):
(WTF::double_conversion::Double::Exponent const):
(WTF::double_conversion::Double::Significand const):
(WTF::double_conversion::Double::IsDenormal const):
(WTF::double_conversion::Double::IsSpecial const):
(WTF::double_conversion::Double::IsNan const):
(WTF::double_conversion::Double::IsInfinite const):
(WTF::double_conversion::Double::Sign const):
(WTF::double_conversion::Double::UpperBoundary const):
(WTF::double_conversion::Double::NormalizedBoundaries const):
(WTF::double_conversion::Double::LowerBoundaryIsCloser const):
(WTF::double_conversion::Double::value const):
(WTF::double_conversion::Double::SignificandSizeForOrderOfMagnitude):
(WTF::double_conversion::Double::Infinity):
(WTF::double_conversion::Double::NaN):
(WTF::double_conversion::Double::DiyFpToUint64):
(WTF::double_conversion::Single::Single):
(WTF::double_conversion::Single::AsDiyFp const):
(WTF::double_conversion::Single::AsUint32 const):
(WTF::double_conversion::Single::Exponent const):
(WTF::double_conversion::Single::Significand const):
(WTF::double_conversion::Single::IsDenormal const):
(WTF::double_conversion::Single::IsSpecial const):
(WTF::double_conversion::Single::IsNan const):
(WTF::double_conversion::Single::IsInfinite const):
(WTF::double_conversion::Single::Sign const):
(WTF::double_conversion::Single::NormalizedBoundaries const):
(WTF::double_conversion::Single::UpperBoundary const):
(WTF::double_conversion::Single::LowerBoundaryIsCloser const):
(WTF::double_conversion::Single::value const):
(WTF::double_conversion::Single::Infinity):
(WTF::double_conversion::Single::NaN):
* wtf/dtoa/strtod.cc:
* wtf/dtoa/strtod.h:
* wtf/dtoa/utils.h:
(abort_noreturn):
(WTF::double_conversion::Max):
(WTF::double_conversion::Min):
(WTF::double_conversion::StrLength):
(WTF::double_conversion::BufferReference::BufferReference):
(WTF::double_conversion::BufferReference::SubVector):
(WTF::double_conversion::BufferReference::length const):
(WTF::double_conversion::BufferReference::is_empty const):
(WTF::double_conversion::BufferReference::start const):
(WTF::double_conversion::BufferReference::operator[] const):
(WTF::double_conversion::BufferReference::first):
(WTF::double_conversion::BufferReference::last):
(WTF::double_conversion::StringBuilder::StringBuilder):
(WTF::double_conversion::StringBuilder::~StringBuilder):
(WTF::double_conversion::StringBuilder::size const):
(WTF::double_conversion::StringBuilder::position const):
(WTF::double_conversion::StringBuilder::Reset):
(WTF::double_conversion::StringBuilder::AddCharacter):
(WTF::double_conversion::StringBuilder::AddString):
(WTF::double_conversion::StringBuilder::AddSubstring):
(WTF::double_conversion::StringBuilder::AddPadding):
(WTF::double_conversion::StringBuilder::RemoveCharacters):
(WTF::double_conversion::StringBuilder::Finalize):
(WTF::double_conversion::StringBuilder::is_finalized const):
(WTF::double_conversion::BitCast):
(WTF::double_conversion::BufferReference::SubBufferReference): Deleted.
(WTF::double_conversion::StringBuilder::SetPosition): Deleted.
2019-02-20 Darin Adler <darin@apple.com>
Finish removing String::format
https://bugs.webkit.org/show_bug.cgi?id=194893
Reviewed by Daniel Bates.
* wtf/Assertions.cpp:
(WTF::createWithFormatAndArguments): Moved this here from WTFString.cpp.
(WTFLog): Use WTF::createWithFormatAndArguments instead of String::format.
* wtf/HexNumber.h: Deleted unneeded toString function.
* wtf/text/StringConcatenate.h: Got rid of unneeded forward declaration of
StringTypeAdapter, since that's now in Forward.h. Tweaked formatting of templates
a bit. Use function templates for writeTo functions rather than having two of each.
Removed unused toString functions. Optimized case where we use have a UChar* and
a length of zero to not force the result to be 16-bit. Also gets rid of a small
NO_RETURN_DUE_TO_CRASH mess that we don't need. Refactored constructors to use some
static member helper functions to compute string lengths. Added the pad function
and the PaddingSpecification struct template, so we can add padding to anything
we can turn into a string. Got rid of the special case overload for single
arguments, since it only worked for things that the String constructor can handle.
Instead we will now use StringTypeAdapter, which works for more types. Possibly
less optimal for some special cases, which we could specialize for later if we like.
* wtf/text/StringConcatenateNumbers.h: Ditto.
* wtf/text/StringOperators.h: Ditto.
* wtf/text/StringView.h: Ditto.
* wtf/text/WTFString.cpp:
(WTF::createWithFormatAndArguments): Deleted.
(WTF::String::format): Deleted.
* wtf/text/WTFString.h: Deleted declaration of String::format.
2019-02-23 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, fix find/replace error from r232178
Looks like this was the only such error in that commit.
* wtf/URLHelpers.cpp:
(WTF::URLHelpers::isLookalikeCharacter):
2019-02-23 Mark Lam <mark.lam@apple.com>
Add an exception check and some assertions in StringPrototype.cpp.
https://bugs.webkit.org/show_bug.cgi?id=194962
<rdar://problem/48013416>
Reviewed by Yusuke Suzuki and Saam Barati.
Add an AssertNoOverflow overflow handler which allows us to do CheckedArithmetic
for assertion purpose only on debug builds but sacrifices no performance on
release builds.
* wtf/CheckedArithmetic.h:
(WTF::AssertNoOverflow::overflowed):
(WTF::AssertNoOverflow::clearOverflow):
(WTF::AssertNoOverflow::crash):
(WTF::AssertNoOverflow::hasOverflowed const):
(WTF::observesOverflow):
(WTF::observesOverflow<AssertNoOverflow>):
(WTF::safeAdd):
(WTF::safeSub):
(WTF::safeMultiply):
(WTF::Checked::operator+=):
(WTF::Checked::operator-=):
(WTF::Checked::operator*=):
(WTF::operator+):
(WTF::operator-):
(WTF::operator*):
2019-02-23 Keith Miller <keith_miller@apple.com>
Add new mac target numbers
https://bugs.webkit.org/show_bug.cgi?id=194955
Reviewed by Tim Horton.
* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
2019-02-21 Antoine Quint <graouts@apple.com>
Move UIWebTouchEventsGestureRecognizer.activeTouchesByIdentifier to SPI
https://bugs.webkit.org/show_bug.cgi?id=194531
<rdar://problem/47714562>
Reviewed by Tim Horton.
Follow-up commit to ensure this SPI is only called on newer versions of iOS.
* wtf/Platform.h:
2019-02-21 Dean Jackson <dino@apple.com>
Rotation animations sometimes use the wrong origin (affects apple.com)
https://bugs.webkit.org/show_bug.cgi?id=194878
<rdar://problem/43908047>
Follow-up commit to ensure this change only affects newer versions
of iOS.
* wtf/Platform.h: Add a version check.
2019-02-20 Alex Christensen <achristensen@webkit.org>
URL percent-encode operations should use checked arithmetic for buffer allocation length
https://bugs.webkit.org/show_bug.cgi?id=194877
<rdar://problem/48212062>
Reviewed by Tim Horton.
* wtf/URLHelpers.cpp:
(WTF::URLHelpers::userVisibleURL):
* wtf/cocoa/NSURLExtras.mm:
(WTF::dataWithUserTypedString):
2019-02-20 Dean Jackson <dino@apple.com>
Rotation animations sometimes use the wrong origin (affects apple.com)
https://bugs.webkit.org/show_bug.cgi?id=194878
<rdar://problem/43908047>
Reviewed by Simon Fraser.
* wtf/Platform.h: Add HAVE(CA_WHERE_ADDITIVE_TRANSFORMS_ARE_REVERSED).
2019-02-20 Andy Estes <aestes@apple.com>
[Xcode] Add SDKVariant.xcconfig to various Xcode projects
https://bugs.webkit.org/show_bug.cgi?id=194869
Rubber-stamped by Jer Noble.
* WTF.xcodeproj/project.pbxproj:
2019-02-20 Adrian Perez de Castro <aperez@igalia.com>
[WPE][GTK] Enable support for CONTENT_EXTENSIONS
https://bugs.webkit.org/show_bug.cgi?id=167941
Reviewed by Carlos Garcia Campos.
Add specialization of the refGPtr() and derefGPtr() templates for GMappedFile.
* wtf/glib/GRefPtr.cpp:
(WTF::refGPtr): Added.
(WTF::derefGPtr): Added.
* wtf/glib/GRefPtr.h: Declare template specializations.
2019-02-19 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r241770.
https://bugs.webkit.org/show_bug.cgi?id=194833
Caused crashes (Requested by smfr on #webkit).
Reverted changeset:
"Code quality cleanup in NeverDestroyed"
https://bugs.webkit.org/show_bug.cgi?id=194824
https://trac.webkit.org/changeset/241770
2019-02-19 Keith Miller <keith_miller@apple.com>
Code quality cleanup in NeverDestroyed
https://bugs.webkit.org/show_bug.cgi?id=194824
Reviewed by Yusuke Suzuki.
First, move data members to the end of the class per WebKit
style. Also, add forbid heap allocation since we expect the
NeverDestroyed classes to be static.
* wtf/NeverDestroyed.h:
2019-02-16 Darin Adler <darin@apple.com>
Continue reducing use of String::format, now focusing on hex: "%p", "%x", etc.
https://bugs.webkit.org/show_bug.cgi?id=194752
Reviewed by Daniel Bates.
* WTF.xcodeproj/project.pbxproj: Added HexNumber.cpp and Logger.cpp.
* wtf/CMakeLists.txt: Ditto.
* wtf/HexNumber.cpp: Added.
(WTF::Internal::appendHex): Non-inline, non-template hex formatting logic.
* wtf/HexNumber.h:
(WTF::Internal::appendHex): Refactored main logic of appendUnsignedAsHex and
appendUnsignedAsHexFixedSize so they can be reused in a function named hex for
use with StringTypeAdapter.
(WTF::appendUnsignedAsHex): Ditto.
(WTF::appendUnsignedAsHexFixedSize): Ditto.
(WTF::hex): Added.
(WTF::StringTypeAdapter<HexNumberBuffer>): Added.
* wtf/Logger.cpp: Added.
(WTF::Logger::LogSiteIdentifier::toString const): Made this a non-template
function and moved it here so that we don't need to include HexNumber.h
in Logger.h. Since HexNumber.h has substantial code in it, it's good if we
don't include it in any other headers.
* wtf/Logger.h:
(WTF::LogArgument<Logger::LogSiteIdentifier>::toString): Changed to call
a non-template function, LogSiteIdentifier::toString.
* wtf/text/StringConcatenateNumbers.h: Replaced overloaded writeTo functions
with function templates and used StringImpl::copyCharacters instead of
hand-written loops.
2019-02-18 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Better categorize CPU usage per-thread / worker
https://bugs.webkit.org/show_bug.cgi?id=194564
Reviewed by Devin Rousso.
* wtf/Threading.h:
* wtf/Threading.cpp:
(WTF::Thread::allThreadsMutex):
(WTF::Thread::create):
(WTF::Thread::didExit):
Add a set of all WTF::Thread created threads.
2019-02-18 Tadeu Zagallo <tzagallo@apple.com>
Bytecode cache should a have a boot-specific validation
https://bugs.webkit.org/show_bug.cgi?id=194769
<rdar://problem/48149509>
Reviewed by Keith Miller.
Add helper to get kern.bootsessionuuid from sysctl
* wtf/UUID.cpp:
(WTF::bootSessionUUIDString):
* wtf/UUID.h:
2019-02-17 David Kilzer <ddkilzer@apple.com>
Unreviewed, rolling out r241620.
"Causes use-after-free crashes running layout tests with ASan and GuardMalloc."
(Requested by ddkilzer on #webkit.)
Reverted changeset:
"[WTF] Add environment variable helpers"
https://bugs.webkit.org/show_bug.cgi?id=192405
https://trac.webkit.org/changeset/241620
2019-02-15 Ross Kirsling <ross.kirsling@sony.com>
[WTF] Add environment variable helpers
https://bugs.webkit.org/show_bug.cgi?id=192405
Reviewed by Michael Catanzaro.
Create a new Environment API as a platform-independent, thread-safe(r)
way to get and set environment variables.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/Environment.h: Added.
* wtf/PlatformGTK.cmake:
* wtf/PlatformJSCOnly.cmake:
* wtf/PlatformMac.cmake:
* wtf/PlatformPlayStation.cmake:
* wtf/PlatformWPE.cmake:
* wtf/PlatformWin.cmake:
* wtf/posix/EnvironmentPOSIX.cpp: Added.
* wtf/win/EnvironmentWin.cpp: Added.
Introduce WTF::Environment.
* wtf/Threading.cpp:
(WTF::threadingIsInitialized):
(WTF::initializeThreading):
* wtf/Threading.h:
Introduce WTF::threadingIsInitialized() so that we can ASSERT that it's
false before setting an environment variable through the new API.
* wtf/DataLog.cpp:
(WTF::initializeLogFileOnce):
* wtf/NumberOfCores.cpp:
(WTF::numberOfProcessorCores):
* wtf/posix/FileSystemPOSIX.cpp:
(WTF::FileSystemImpl::openTemporaryFile):
Utilize WTF::Environment where possible.
2019-02-15 Brian Burg <bburg@apple.com>
[Mac] WebInspectorUI.framework does not need to be soft-linked anymore
https://bugs.webkit.org/show_bug.cgi?id=194411
<rdar://problem/47787614>
Reviewed by Joseph Pecoraro.
* wtf/cocoa/SoftLinking.h:
Remove macro that now has no uses.
2019-02-15 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r241559 and r241566.
https://bugs.webkit.org/show_bug.cgi?id=194710
Causes layout test crashes under GuardMalloc (Requested by
ryanhaddad on #webkit).
Reverted changesets:
"[WTF] Add environment variable helpers"
https://bugs.webkit.org/show_bug.cgi?id=192405
https://trac.webkit.org/changeset/241559
"Unreviewed build fix for WinCairo Debug after r241559."
https://trac.webkit.org/changeset/241566
2019-02-15 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r241564.
Caused 50+ Timeouts on Mac WK2, mostly in the http/ directory
Reverted changeset:
"[Mac] WebInspectorUI.framework does not need to be soft-
linked anymore"
https://bugs.webkit.org/show_bug.cgi?id=194411
https://trac.webkit.org/changeset/241564
2019-02-15 Dominik Infuehr <dinfuehr@igalia.com>
Fix deadlock on Linux/x64 between SamplingProfiler and VMTraps
https://bugs.webkit.org/show_bug.cgi?id=194014
Reviewed by Michael Catanzaro.
Do not block SIGUSR1 when installing signal handlers, since this signal
is used to suspend/resume machine threads on Linux.
ftl-ai-filter-phantoms-should-clear-clear-value.js deadlocked with
enabled watchdog and sampling.
Deadlock happened in the following situation:
Thread 1 (Sampling): SamplingProfiler.cpp:takeSample takes all needed locks
and then tries to suspend the main thread.
Thread 2 (Watchdog/VMTraps): Before the Sampling-Thread suspends the main thread
a signal is caught and the signal handler is invoked (VMTraps.cpp:SignalSender).
SignalSender tries to lock codeBlockSet, but this is already locked by the
SamplingProfiler.
The SamplingProfiler can only give up the lock when it suspends
the thread. However since the VMTraps signal handler is active, all other signals blocked,
therefore the SamplingProfiler also waits until its signal handler is invoked.
This patch fixes this by not blocking SIGUSR1 in installSignalHandler, since
it is used to suspend/resume threads on Linux.
* wtf/Threading.h:
* wtf/posix/ThreadingPOSIX.cpp:
* wtf/threads/Signals.cpp:
(WTF::installSignalHandler):
2019-02-15 Saam barati <sbarati@apple.com>
[WebAssembly] Write a new register allocator for Air O0 and make BBQ use it
https://bugs.webkit.org/show_bug.cgi?id=194036
Reviewed by Yusuke Suzuki.
* wtf/IndexMap.h:
(WTF::IndexMap::at):
(WTF::IndexMap::at const):
(WTF::IndexMap::operator[]):
(WTF::IndexMap::operator[] const):
2019-02-14 Brian Burg <bburg@apple.com>
[Mac] WebInspectorUI.framework does not need to be soft-linked anymore
https://bugs.webkit.org/show_bug.cgi?id=194411
<rdar://problem/47787614>
Reviewed by Joseph Pecoraro.
* wtf/cocoa/SoftLinking.h:
Remove macro that now has no uses.
2019-02-14 Ross Kirsling <ross.kirsling@sony.com>
[WTF] Add environment variable helpers
https://bugs.webkit.org/show_bug.cgi?id=192405
Reviewed by Michael Catanzaro.
Create a new Environment API as a platform-independent, thread-safe(r)
way to get and set environment variables.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/Environment.h: Added.
* wtf/PlatformGTK.cmake:
* wtf/PlatformJSCOnly.cmake:
* wtf/PlatformMac.cmake:
* wtf/PlatformPlayStation.cmake:
* wtf/PlatformWPE.cmake:
* wtf/PlatformWin.cmake:
* wtf/posix/EnvironmentPOSIX.cpp: Added.
* wtf/win/EnvironmentWin.cpp: Added.
Introduce WTF::Environment.
* wtf/Threading.cpp:
(WTF::threadingIsInitialized):
(WTF::initializeThreading):
* wtf/Threading.h:
Introduce WTF::threadingIsInitialized() so that we can ASSERT that it's
false before setting an environment variable through the new API.
* wtf/DataLog.cpp:
(WTF::initializeLogFileOnce):
* wtf/NumberOfCores.cpp:
(WTF::numberOfProcessorCores):
* wtf/posix/FileSystemPOSIX.cpp:
(WTF::FileSystemImpl::openTemporaryFile):
Utilize WTF::Environment where possible.
2019-02-13 Yusuke Suzuki <ysuzuki@apple.com>
We should only make rope strings when concatenating strings long enough.
https://bugs.webkit.org/show_bug.cgi?id=194465
Reviewed by Mark Lam.
* wtf/text/StringImpl.h:
(WTF::StringImpl::headerSize):
2019-02-12 Tim Horton <timothy_horton@apple.com>
Remove WKLegacyPDFView
https://bugs.webkit.org/show_bug.cgi?id=194559
Reviewed by Andy Estes.
* wtf/FeatureDefines.h:
2019-02-12 David Kilzer <ddkilzer@apple.com>
REGRESSION (r238955, r240494): Soft-linking optional Lookup.framework triggers release assertion when missing
<https://webkit.org/b/194529>
<rdar://problem/47924449>
Reviewed by Eric Carlson.
* wtf/cocoa/SoftLinking.h:
(SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT_AND_IS_OPTIONAL): Rename
SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT_AND_ASSERTION() to this
and change `assertion` argument to `isOptional`. Pass
`isOptional` to framework##Library() method to control assertion
behavior. Only check RELEASE_ASSERT() if `!isOptional`, else
that code should be optimized out by the compiler. This fixes
the crash.
(NO_ASSERT): Remove macro since it's no longer used.
(SOFT_LINK_IS_OPTIONAL): Add macro to use for soft-linking
optional classes.
(SOFT_LINK_IS_NOT_OPTIONAL): Add macro to use for soft-linking
non-optional classes.
(SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT): Update to use new
SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT_AND_IS_OPTIONAL() macro.
(SOFT_LINK_CLASS_FOR_SOURCE_OPTIONAL_WITH_EXPORT): Ditto.
(SOFT_LINK_CLASS_FOR_SOURCE): Ditto.
(SOFT_LINK_CLASS_FOR_SOURCE_OPTIONAL): Ditto.
2019-02-12 Andy Estes <aestes@apple.com>
[iOSMac] Enable Parental Controls Content Filtering
https://bugs.webkit.org/show_bug.cgi?id=194521
<rdar://39732376>
Reviewed by Tim Horton.
* wtf/Platform.h:
2019-02-11 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Ask platform for generic font family mappings
https://bugs.webkit.org/show_bug.cgi?id=187723
<rdar://problem/41892438>
Reviewed by Brent Fulgham.
Add an ENABLE in Platform.
* wtf/Platform.h:
2019-02-11 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r241229.
Revision broke internal builds for watchOS.
Reverted changeset:
"[Cocoa] Ask platform for generic font family mappings"
https://bugs.webkit.org/show_bug.cgi?id=187723
https://trac.webkit.org/changeset/241229
2019-02-10 Darin Adler <darin@apple.com>
Switch uses of StringBuilder with String::format for hex numbers to use HexNumber.h instead
https://bugs.webkit.org/show_bug.cgi?id=194485
Reviewed by Daniel Bates.
* wtf/HexNumber.h: Removed unused functions placeByteAsHexCompressIfPossible and
placeByteAsHex. Can always bring them back if someone needs them. Updated
appendUnsignedAsHex to be a template so we can use it on any integer type,
got rid of unnecessary use of Vector and unnecessary reversing, and got rid of
appendUnsigned64AsHex since callers can now just use appendUnsignedAsHex.
Rewrote appendUnsignedAsHexFixedSize to share mode code rather than replicating.
* wtf/Logger.h: Use appendUnsignedAsHex instead of appendUnsigned64AsHex.
* wtf/URL.cpp: Removed unnecessary include of HexNumber.h.
* wtf/cocoa/NSURLExtras.h: Added missing include of Foundation.h that was
worked around in NSURLExtras.mm.
* wtf/cocoa/NSURLExtras.mm: Removed unnecessary includes of HexNumber.h
and Foundation.h.
2019-02-09 Darin Adler <darin@apple.com>
Eliminate unnecessary String temporaries by using StringConcatenateNumbers
https://bugs.webkit.org/show_bug.cgi?id=194021
Reviewed by Geoffrey Garen.
* wtf/URL.cpp:
(WTF::URL::setPort): Remove String::number and let makeString do the conversion
without allocating/destroying a String. Added a cast to "unsigned" to sidestep the
ambiguity with 16-bit unsigned types that are sometimes used for numbers (uint16_t)
and sometimes used for UTF-16 code units (UChar) and can be the same type.
* wtf/text/StringConcatenateNumbers.h:
Changed FormattedNumber::fixedPrecision to more closely match String::number and
StringBuilder::appendNumber by defaulting to truncating trailing zeros and using
a named enumeration for the truncation policy rather than a boolean.
2019-02-09 Yusuke Suzuki <ysuzuki@apple.com>
Unreviewed, rolling in r241237 again
https://bugs.webkit.org/show_bug.cgi?id=194469
After the measurement, this patch was unrelated to recent regression.
* wtf/text/StringImpl.h:
(WTF::StringImpl::isSubString const):
(WTF::StringImpl::createSubstringSharingImpl):
2019-02-09 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r241237.
https://bugs.webkit.org/show_bug.cgi?id=194474
Shows significant memory increase in WSL (Requested by
yusukesuzuki on #webkit).
Reverted changeset:
"[WTF] Use BufferInternal StringImpl if substring StringImpl
takes more memory"
https://bugs.webkit.org/show_bug.cgi?id=194469
https://trac.webkit.org/changeset/241237
2019-02-08 Yusuke Suzuki <ysuzuki@apple.com>
[WTF] Use BufferInternal StringImpl if substring StringImpl takes more memory
https://bugs.webkit.org/show_bug.cgi?id=194469
Reviewed by Geoffrey Garen.
Because pointer is large and aligned in 64bit in 64bit architecture, BufferSubstring StringImpl
implementation takes more memory than BufferInternal StringImpl implementation for small strings.
And BufferInternal StringImpl does not have a problem like, small substring StringImpl keeps super
large owner StringImpl. This patch calculates the required size of memory and selects the more efficient one.
* wtf/text/StringImpl.h:
(WTF::StringImpl::isSubString const):
(WTF::StringImpl::createSubstringSharingImpl):
2019-02-08 Alex Christensen <achristensen@webkit.org>
Add SPI to use networking daemon instead of XPC service
https://bugs.webkit.org/show_bug.cgi?id=194427
Reviewed by Geoffrey Garen.
* wtf/spi/darwin/XPCSPI.h:
Instead of using XPC bootstrap SPI, we just send a separate message.
xpc_copy_bootstrap does not seem to work in daemons.
2019-02-08 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r241197.
Broke iOS Simulator Debug build and casued 1 API failure on
High Sierra
Reverted changeset:
"Add SPI to use networking daemon instead of XPC service"
https://bugs.webkit.org/show_bug.cgi?id=194427
https://trac.webkit.org/changeset/241197
2019-02-08 Alex Christensen <achristensen@webkit.org>
Add SPI to use networking daemon instead of XPC service
https://bugs.webkit.org/show_bug.cgi?id=194427
Reviewed by Geoffrey Garen.
* wtf/spi/darwin/XPCSPI.h:
Instead of using XPC bootstrap SPI, we just send a separate message.
xpc_copy_bootstrap does not seem to work in daemons.
2019-02-08 Benjamin Poulain <benjamin@webkit.org>
clampTo(): do not convert the input to double when dealing with integers
https://bugs.webkit.org/show_bug.cgi?id=194263
<rdar://problem/47692312>
Reviewed by Darin Adler.
Previously, every use of clampTo() was converting the input to double,
doing the comparison in double, then casting back to whatever type was needed.
In many case, that was very wasteful. WebKit has many cases of clampTo() with
the same type as input/output, or with integer types of different size/sign.
This patch adds a few versions of clampTo() for the common cases seen in WebKit.
In each case, I tried to minimize the amount of conversion needed at runtime.
* wtf/MathExtras.h:
(clampTo):
2019-02-07 Chris Dumez <cdumez@apple.com>
Mark more heap-allocated classes as fast allocated
https://bugs.webkit.org/show_bug.cgi?id=194422
Reviewed by Ryosuke Niwa.
* wtf/Function.h:
(WTF::Function<Out):
* wtf/RefCounter.h:
* wtf/URL.h:
* wtf/text/StringView.cpp:
2019-02-07 Per Arne Vollan <pvollan@apple.com>
[macOS] Block coreservicesd in sandbox.
https://bugs.webkit.org/show_bug.cgi?id=192670
Reviewed by Alexey Proskuryakov.
Add HAVE_CSCHECKFIXDISABLE define.
* wtf/Platform.h:
2019-02-07 Eric Carlson <eric.carlson@apple.com>
[MSE] Convert debug-only logging to runtime logging
https://bugs.webkit.org/show_bug.cgi?id=194348
<rdar://problem/47566449>
Reviewed by Jer Noble.
* wtf/LoggerHelper.h:
(WTF::LoggerHelper::childLogIdentifier const): Helper to generate a log identifier for an
object that is associated with another logging object.
* wtf/MediaTime.cpp:
(WTF::MediaTime::toJSONObject const):
(WTF::MediaTime::toJSONString const):
(WTF::MediaTimeRange::toJSONString const):
(WTF::toJSONStringInternal): Deleted.
* wtf/MediaTime.h:
2019-02-05 Keith Rollin <krollin@apple.com>
Enable the automatic checking and regenerations of .xcfilelists during builds
https://bugs.webkit.org/show_bug.cgi?id=194124
<rdar://problem/47721277>
Reviewed by Tim Horton.
Bug 193790 add a facility for checking -- during build time -- that
any needed .xcfilelist files are up-to-date and for updating them if
they are not. This facility was initially opt-in by setting
WK_ENABLE_CHECK_XCFILELISTS until other pieces were in place and until
the process seemed robust. Its now time to enable this facility and
make it opt-out. If there is a need to disable this facility, set and
export WK_DISABLE_CHECK_XCFILELISTS=1 in your environment before
running `make` or `build-webkit`, or before running Xcode from the
command line.
Additionally, remove the step that generates a list of source files
going into the UnifiedSources build step. It's only necessarily to
specify Sources.txt and SourcesCocoa.txt as inputs.
* Scripts/generate-unified-source-bundles.rb:
2019-02-05 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Shrink sizeof(UnlinkedCodeBlock)
https://bugs.webkit.org/show_bug.cgi?id=194281
Reviewed by Michael Saboff.
* wtf/TriState.h:
2019-02-05 Zan Dobersek <zdobersek@igalia.com>
[GLib] Stop URI-escaping file system representations
https://bugs.webkit.org/show_bug.cgi?id=194213
Reviewed by Carlos Garcia Campos.
Stop URI-escaping of file representation strings in
FileSystem::stringFromFileSystemRepresentation(), and URI-unescaping
of strings in FileSystem::fileSystemRepresentation().
This behavior deviates from POSIX and CF implementations and is
currently breaking IndexedDB-specific calculation of database sizes due
to directory components used in that process that are URL-based and are
as such URI-escaped. When unescaped, those single directory components
explode into multiple directory components, leading to incorrect total
database size calculation when iterating the database directory.
FileSystem::stringFromFileSystemRepresentation() now retrieves GLib's
filename charsets and in worst case converts the filesystem
representation to UTF-8 before String::fromUTF8() is used.
FileSystem::fileSystemRepresentation() reverses that process, taking
String's UTF-8 data and converting it to target charset if necessary.
Other FileSystem functions are adjusted to convert passed-in String
objects to filesystem representations.
* wtf/glib/FileSystemGlib.cpp:
(WTF::FileSystemImpl::stringFromFileSystemRepresentation):
(WTF::FileSystemImpl::fileSystemRepresentation):
(WTF::FileSystemImpl::validRepresentation):
(WTF::FileSystemImpl::filenameForDisplay):
(WTF::FileSystemImpl::fileExists):
(WTF::FileSystemImpl::deleteFile):
(WTF::FileSystemImpl::deleteEmptyDirectory):
(WTF::FileSystemImpl::getFileStat):
(WTF::FileSystemImpl::getFileLStat):
(WTF::FileSystemImpl::makeAllDirectories):
(WTF::FileSystemImpl::createSymbolicLink):
(WTF::FileSystemImpl::pathGetFileName):
(WTF::FileSystemImpl::getVolumeFreeSpace):
(WTF::FileSystemImpl::directoryName):
(WTF::FileSystemImpl::listDirectory):
(WTF::FileSystemImpl::openFile):
(WTF::FileSystemImpl::moveFile):
(WTF::FileSystemImpl::hardLinkOrCopyFile):
(WTF::FileSystemImpl::getFileDeviceId): Align with POSIX implementation
and treat input CString as an existing filesystem representation.
(WTF::FileSystemImpl::unescapedFilename): Deleted.
2019-02-04 Ms2ger <Ms2ger@igalia.com>
[GTK][WPE] Need a function to convert internal URI to display ("pretty") URI
https://bugs.webkit.org/show_bug.cgi?id=174816
Reviewed by Michael Catanzaro.
Translate userVisibleString and dependent code into platform-neutral C++
in wtf/URLHelpers.{h,cpp}.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/URLHelpers.cpp: Added.
(WTF::URLHelpers::loadIDNScriptWhiteList):
(WTF::URLHelpers::isArmenianLookalikeCharacter):
(WTF::URLHelpers::isArmenianScriptCharacter):
(WTF::URLHelpers::isASCIIDigitOrValidHostCharacter):
(WTF::URLHelpers::isLookalikeCharacter):
(WTF::URLHelpers::whiteListIDNScript):
(WTF::URLHelpers::initializeDefaultIDNScriptWhiteList):
(WTF::URLHelpers::allCharactersInIDNScriptWhiteList):
(WTF::URLHelpers::isSecondLevelDomainNameAllowedByTLDRules):
(WTF::URLHelpers::isRussianDomainNameCharacter):
(WTF::URLHelpers::allCharactersAllowedByTLDRules):
(WTF::URLHelpers::mapHostName):
(WTF::URLHelpers::collectRangesThatNeedMapping):
(WTF::URLHelpers::applyHostNameFunctionToMailToURLString):
(WTF::URLHelpers::applyHostNameFunctionToURLString):
(WTF::URLHelpers::mapHostNames):
(WTF::URLHelpers::createStringWithEscapedUnsafeCharacters):
(WTF::URLHelpers::toNormalizationFormC):
(WTF::URLHelpers::userVisibleURL):
* wtf/URLHelpers.h: Added.
* wtf/cocoa/NSURLExtras.mm:
(WTF::URLHelpers::loadIDNScriptWhiteList):
(WTF::decodePercentEscapes):
(WTF::decodeHostName):
(WTF::encodeHostName):
(WTF::URLWithUserTypedString):
(WTF::userVisibleString):
2019-02-03 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r240896.
https://bugs.webkit.org/show_bug.cgi?id=194202
"Fixes leaks, but is probably not the correct fix." (Requested
by ddkilzer on #webkit).
Reverted changeset:
"Leak of WTF::StringImpl under SymbolImpl::createNullSymbol()
(48 bytes) in com.apple.WebKit.WebContent running layout
tests"
https://bugs.webkit.org/show_bug.cgi?id=193291
https://trac.webkit.org/changeset/240896
2019-02-02 David Kilzer <ddkilzer@apple.com>
Leak of WTF::StringImpl under SymbolImpl::createNullSymbol() (48 bytes) in com.apple.WebKit.WebContent running layout tests
<https://webkit.org/b/193291>
<rdar://problem/46655953>
Reviewed by Keith Miller.
* wtf/text/SymbolImpl.h:
(WTF::SymbolImpl::~SymbolImpl): Fix the leak by implementing the
class destructor that calls StringImpl::deref() on `m_owner`.
Two of the three constructors leak the StringImpl when setting
`m_owner`, so we need to balance that by manually calling
deref().
2018-12-16 Darin Adler <darin@apple.com>
Convert additional String::format clients to alternative approaches
https://bugs.webkit.org/show_bug.cgi?id=192746
Reviewed by Alexey Proskuryakov.
* wtf/JSONValues.cpp:
(WTF::appendDoubleQuotedStringEscapedCharacter): Renamed from
escapeChar and reordered arguments to make sense as an append function.
(WTF::appendDoubleQuotedString): Renamed from doubleQuoteString,
reordered arguments to make sense as an append function, take a
StringView instead of a String, used early exit to make the code
a bit easier to read. Use the ASCIIHexDigit functions to construct
a hex number a nibble at a time rather than using String::format.
(WTF::JSONImpl::Value::writeJSON const): Update for name change.
(WTF::JSONImpl::ObjectBase::writeJSON const): Ditto.
2019-01-31 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix WPE compile warnings due to deprecated glib API.
* wtf/Platform.h:
2019-01-29 Chris Dumez <cdumez@apple.com>
Make sure WTF::generateObjectIdentifier() internal counter does not get duplicated
https://bugs.webkit.org/show_bug.cgi?id=193848
Reviewed by Youenn Fablet.
Move WTF::generateObjectIdentifier()'s internal counter out-of-line so make sure it never gets
duplicated at each call site. This has caused some hard-to-debug issues with duplicate
identifiers such as Bug 193761.
Also move it to ObjectIdentifier and rename it to generate() as this make call sites nicer
when they have a typedef for the ObjectIdentifier<T> type.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/ObjectIdentifier.cpp: Copied from Source/WebCore/platform/Process.cpp.
(WTF::ObjectIdentifierBase::generateIdentifierInternal):
(WTF::ObjectIdentifierBase::generateThreadSafeIdentifierInternal):
* wtf/ObjectIdentifier.h:
(WTF::ObjectIdentifier::generate):
(WTF::ObjectIdentifier::generateThreadSafe):
2019-01-28 Ross Kirsling <ross.kirsling@sony.com>
Move platform-specific files out of WTF root directory.
https://bugs.webkit.org/show_bug.cgi?id=193929
Reviewed by Alex Christensen.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/PlatformGTK.cmake:
* wtf/PlatformJSCOnly.cmake:
* wtf/PlatformMac.cmake:
* wtf/PlatformPlayStation.cmake:
* wtf/PlatformWPE.cmake:
* wtf/PlatformWin.cmake:
* wtf/cf/RunLoopTimerCF.cpp: Renamed from Source/WTF/wtf/RunLoopTimerCF.cpp.
* wtf/cf/SchedulePairCF.cpp: Renamed from Source/WTF/wtf/SchedulePairCF.cpp.
* wtf/mac/SchedulePairMac.mm: Renamed from Source/WTF/wtf/SchedulePairMac.mm.
* wtf/posix/OSAllocatorPOSIX.cpp: Renamed from Source/WTF/wtf/OSAllocatorPosix.cpp.
* wtf/posix/ThreadingPOSIX.cpp: Renamed from Source/WTF/wtf/ThreadingPthreads.cpp.
* wtf/win/CONTRIBUTORS.pthreads-win32: Renamed from Source/WTF/wtf/CONTRIBUTORS.pthreads-win32.
* wtf/win/OSAllocatorWin.cpp: Renamed from Source/WTF/wtf/OSAllocatorWin.cpp.
* wtf/win/ThreadSpecificWin.cpp: Renamed from Source/WTF/wtf/ThreadSpecificWin.cpp.
* wtf/win/ThreadingWin.cpp: Renamed from Source/WTF/wtf/ThreadingWin.cpp.
2019-01-28 Andy Estes <aestes@apple.com>
[watchOS] Enable Parental Controls content filtering
https://bugs.webkit.org/show_bug.cgi?id=193939
<rdar://problem/46641912>
Reviewed by Ryosuke Niwa.
* wtf/Platform.h:
2019-01-28 Ross Kirsling <ross.kirsling@sony.com>
[JSCOnly][WTF] Expose FileSystem.
https://bugs.webkit.org/show_bug.cgi?id=193789
Reviewed by Don Olmstead.
* wtf/FileSystem.h:
* wtf/PlatformJSCOnly.cmake:
* wtf/posix/FileSystemPOSIX.cpp:
(WTF::FileSystemImpl::getVolumeFreeSpace):
* wtf/win/FileSystemWin.cpp:
(WTF::FileSystemImpl::fileSystemRepresentation):
2019-01-28 Eric Carlson <eric.carlson@apple.com>
AVStreamSession isn't always available, make a HAVE compile flag for it
https://bugs.webkit.org/show_bug.cgi?id=193889
<rdar://problem/47452863>
Reviewed by Jer Noble.
* wtf/FeatureDefines.h:
2018-12-15 Darin Adler <darin@apple.com>
Replace many uses of String::format with more type-safe alternatives
https://bugs.webkit.org/show_bug.cgi?id=192742
Reviewed by Mark Lam.
* wtf/WorkQueue.cpp:
(WTF::WorkQueue::concurrentApply): Use makeString.
* wtf/dtoa.cpp:
(WTF::dtoa): Use sprintf instead of String::format in the comments,
since these functions have nothing to do with WTF::String.
2019-01-25 Chris Dumez <cdumez@apple.com>
[iOS] Add support for the download attribute
https://bugs.webkit.org/show_bug.cgi?id=167341
<rdar://problem/30296281>
Reviewed by Geoffrey Garen.
Turn on HTML download attribute support on iOS.
* wtf/FeatureDefines.h:
2019-01-25 David Kilzer <ddkilzer@apple.com>
Move soft-linking of Lookup.framework out of LookupSPI.h
<https://webkit.org/b/193815>
Reviewed by Tim Horton.
* wtf/cocoa/SoftLinking.h:
(SOFT_LINK_CONSTANT_FOR_HEADER):
(SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT):
(SOFT_LINK_CONSTANT_MAY_FAIL_FOR_HEADER):
- Remove local declaration of constant. This should be handled
by including *SPI.h or "real" headers.
(SOFT_LINK_CONSTANT_MAY_FAIL_FOR_SOURCE_WITH_EXPORT):
- Remove local declaration of constant.
- Rename from SOFT_LINK_CONSTANT_MAY_FAIL_FOR_SOURCE() and add
`export` argument to support exporting of functions.
(SOFT_LINK_CONSTANT_MAY_FAIL_FOR_SOURCE):
- Redefine in terms of
SOFT_LINK_CONSTANT_MAY_FAIL_FOR_SOURCE_WITH_EXPORT().
2019-01-24 Youenn Fablet <youenn@apple.com>
Use MonotonicTime in WorkerRunLoop
https://bugs.webkit.org/show_bug.cgi?id=193417
Reviewed by Saam Barati.
* wtf/MessageQueue.h:
(WTF::MessageQueue<DataType>::waitForMessage):
(WTF::MessageQueue<DataType>::waitForMessageFilteredWithTimeout):
2019-01-24 Ross Kirsling <ross.kirsling@sony.com>
Move FileSystem to WTF
https://bugs.webkit.org/show_bug.cgi?id=193602
Reviewed by Yusuke Suzuki.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/FileMetadata.h: Renamed from Source/WebCore/platform/FileMetadata.h.
* wtf/FileSystem.cpp: Renamed from Source/WebCore/platform/FileSystem.cpp.
* wtf/FileSystem.h: Renamed from Source/WebCore/platform/FileSystem.h.
* wtf/PlatformGTK.cmake:
* wtf/PlatformMac.cmake:
* wtf/PlatformPlayStation.cmake:
* wtf/PlatformWPE.cmake:
* wtf/PlatformWin.cmake:
* wtf/cf/FileSystemCF.cpp: Renamed from Source/WebCore/platform/cf/FileSystemCF.cpp.
* wtf/cocoa/FileSystemCocoa.mm: Renamed from Source/WebCore/platform/cocoa/FileSystemCocoa.mm.
* wtf/glib/FileSystemGlib.cpp: Renamed from Source/WebCore/platform/glib/FileSystemGlib.cpp.
* wtf/mac/FileSystemMac.mm: Renamed from Source/WebCore/platform/mac/FileSystemMac.mm.
* wtf/posix/FileSystemPOSIX.cpp: Renamed from Source/WebCore/platform/posix/FileSystemPOSIX.cpp.
* wtf/spi/mac/MetadataSPI.h: Renamed from Source/WebCore/PAL/pal/spi/mac/MetadataSPI.h.
* wtf/win/FileSystemWin.cpp: Renamed from Source/WebCore/platform/win/FileSystemWin.cpp.
* wtf/win/PathWalker.cpp: Renamed from Source/WebCore/platform/win/PathWalker.cpp.
* wtf/win/PathWalker.h: Renamed from Source/WebCore/platform/win/PathWalker.h.
2019-01-24 Guillaume Emont <guijemont@igalia.com>
[JSC] Reenable baseline JIT on mips
https://bugs.webkit.org/show_bug.cgi?id=192983
Reviewed by Mark Lam.
Use baseline JIT by default on MIPS.
* wtf/Platform.h:
2019-01-24 David Kilzer <ddkilzer@apple.com>
Duplicate global variables: WTF::asciiCaseFoldTable
<https://webkit.org/b/193726>
<rdar://problem/47334622>
Reviewed by Michael Catanzaro.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
- Add ASCIICType.cpp to build systems.
* wtf/ASCIICType.cpp: Added.
(WTF::asciiCaseFoldTable): Move table to here so there is only
one copy. Mark as exported for other frameworks to use.
* wtf/ASCIICType.h:
(WTF::asciiCaseFoldTable): Change to extern declaration, and
mark as exported for other frameworks to use.
2019-01-23 Mark Lam <mark.lam@apple.com>
ARM64E should not ENABLE(SEPARATED_WX_HEAP).
https://bugs.webkit.org/show_bug.cgi?id=193744
<rdar://problem/46262952>
Reviewed by Saam Barati.
* wtf/Platform.h:
2019-01-23 David Kilzer <ddkilzer@apple.com>
Switch remaining CoreMedia soft-linking in WebKit over to CoreMediaSoftLink.{cpp,h}
<https://webkit.org/b/193694>
<rdar://problem/47464025>
Reviewed by Tim Horton.
* wtf/win/SoftLinking.h:
(SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT):
- Implement for Windows.
(SOFT_LINK_CONSTANT_FOR_SOURCE):
- Define using SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT().
2019-01-22 Tadeu Zagallo <tzagallo@apple.com>
Cache bytecode to disk
https://bugs.webkit.org/show_bug.cgi?id=192782
<rdar://problem/46084932>
Reviewed by Keith Miller.
BitVectors have to be friends with JSC::CacheBitVector to allow
serializing its buffer as part of the bytecode cache encoding.
* wtf/BitVector.h:
2019-01-21 Claudio Saavedra <csaavedra@igalia.com>
[GTK] Speculative build fix for Ubuntu LTS
https://bugs.webkit.org/show_bug.cgi?id=193651
Unreviewed build fix.
* wtf/Assertions.h: Add missing <cstdlib> include.
2019-01-20 Saam Barati <sbarati@apple.com>
Rollout r240210: It broke tests on iOS
https://bugs.webkit.org/show_bug.cgi?id=193640
Unreviewed.
* wtf/BitVector.h:
2019-01-20 Tadeu Zagallo <tzagallo@apple.com>
Cache bytecode to disk
https://bugs.webkit.org/show_bug.cgi?id=192782
<rdar://problem/46084932>
Reviewed by Keith Miller.
BitVectors have to be friends with JSC::CacheBitVector to allow
serializing its buffer as part of the bytecode cache encoding.
* wtf/BitVector.h:
2019-01-18 Tim Horton <timothy_horton@apple.com>
Get rid of ADVANCED_SPELL_CHECKING
https://bugs.webkit.org/show_bug.cgi?id=193592
Reviewed by Wenson Hsieh.
* wtf/Platform.h:
2019-01-18 Jer Noble <jer.noble@apple.com>
SDK_VARIANT build destinations should be separate from non-SDK_VARIANT builds
https://bugs.webkit.org/show_bug.cgi?id=189553
Reviewed by Tim Horton.
* Configurations/Base.xcconfig:
* Configurations/SDKVariant.xcconfig: Added.
2019-01-18 Keith Miller <keith_miller@apple.com>
Gigacages should start allocations from a slide
https://bugs.webkit.org/show_bug.cgi?id=193523
Reviewed by Mark Lam.
This patch changes some macros into constants since macros are the
devil.
* wtf/Gigacage.cpp:
* wtf/Gigacage.h:
2019-01-18 Matt Lewis <jlewis3@apple.com>
Unreviewed, rolling out r240160.
This broke multiple internal builds.
Reverted changeset:
"Gigacages should start allocations from a slide"
https://bugs.webkit.org/show_bug.cgi?id=193523
https://trac.webkit.org/changeset/240160
2019-01-18 Keith Miller <keith_miller@apple.com>
Gigacages should start allocations from a slide
https://bugs.webkit.org/show_bug.cgi?id=193523
Reviewed by Mark Lam.
This patch changes some macros into constants since macros are the
devil.
* wtf/Gigacage.cpp:
* wtf/Gigacage.h:
2019-01-17 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r240124.
This commit broke an internal build.
Reverted changeset:
"SDK_VARIANT build destinations should be separate from non-
SDK_VARIANT builds"
https://bugs.webkit.org/show_bug.cgi?id=189553
https://trac.webkit.org/changeset/240124
2019-01-17 Jer Noble <jer.noble@apple.com>
SDK_VARIANT build destinations should be separate from non-SDK_VARIANT builds
https://bugs.webkit.org/show_bug.cgi?id=189553
Reviewed by Tim Horton.
* Configurations/Base.xcconfig:
* Configurations/SDKVariant.xcconfig: Added.
2019-01-16 Keith Miller <keith_miller@apple.com>
bmalloc should use JSC VM tag for gigacage
https://bugs.webkit.org/show_bug.cgi?id=193496
Reviewed by Mark Lam.
Move most of the macros for vm tagging to bmalloc.
* wtf/VMTags.h:
2019-01-16 Alberto Garcia <berto@igalia.com>
[WTF] Compilation fails with system malloc
https://bugs.webkit.org/show_bug.cgi?id=172445
Reviewed by Michael Catanzaro.
Follow-up to r217270. The sysinfo() system call is specific to
Linux so update the #ifdef checks accordingly.
* wtf/RAMSize.cpp:
(WTF::computeRAMSize):
2019-01-15 Chris Dumez <cdumez@apple.com>
Unreviewed, revert part of r239997 as it is not needed to fix the build.
* wtf/RefCounter.h:
2019-01-15 Alex Christensen <achristensen@webkit.org>
Fix iOS build after r239993
https://bugs.webkit.org/show_bug.cgi?id=193361
* wtf/RefCounter.h:
2019-01-14 Michael Catanzaro <mcatanzaro@igalia.com>
Use unorm2_normalize instead of precomposedStringWithCanonicalMapping in userVisibleString
https://bugs.webkit.org/show_bug.cgi?id=192945
Reviewed by Alex Christensen.
Replace use of the nice NSString function precomposedStringWithCanonicalMapping with the ICU
API unorm2_normalize. This is to prep the code for translation to cross-platform C++. Of
course this is much worse than the preexisting code, but this is just a transitional
measure and not the final state of the code. It wouldn't make sense to do this if the code
were to remain Objective C++.
* wtf/cocoa/NSURLExtras.mm:
(WTF::toNormalizationFormC):
(WTF::userVisibleString):
2019-01-14 Alex Christensen <achristensen@webkit.org>
Bulgarian TLD should not punycode-encode URLs with Bulgarian Cyrillic characters
https://bugs.webkit.org/show_bug.cgi?id=193411
<rdar://problem/47215929>
Reviewed by Alexey Proskuryakov.
* wtf/cocoa/NSURLExtras.mm:
(WTF::allCharactersAllowedByTLDRules):
2019-01-12 Timothy Hatcher <timothy@apple.com>
Have prefers-color-scheme: light always match on macOS versions before Mojave.
https://bugs.webkit.org/show_bug.cgi?id=191655
rdar://problem/46074680
Reviewed by Megan Gardner.
* wtf/Platform.h: Define HAVE_OS_DARK_MODE_SUPPORT on macOS 10.14.
2019-01-11 David Kilzer <ddkilzer@apple.com>
Follow-up: WorkQueue::concurrentApply() passes a raw pointer to a temporary String to Thread::create().
https://bugs.webkit.org/show_bug.cgi?id=191350
* wtf/WorkQueue.cpp:
(WTF::WorkQueue::concurrentApply): Fix whitespace.
2019-01-11 Devin Rousso <drousso@apple.com>
Fix style CFNetworkSPI style checker warnings from r239698
https://bugs.webkit.org/show_bug.cgi?id=193369
Reviewed by Joseph Pecoraro.
* wtf/Platform.h:
2019-01-11 Said Abou-Hallawa <sabouhallawa@apple.com>
WorkQueue::concurrentApply() passes a raw pointer to a temporary String to Thread::create().
https://bugs.webkit.org/show_bug.cgi?id=191350
Reviewed by Brent Fulgham.
The non COCOA version of WorkQueue::concurrentApply() creates a temporary
String for the threadName and passes the raw pointer of this String to
Thread::create(). After freeing this String, Thread::entryPoint() uses
the raw char pointer to internally initialize the thread.
The fix is to use a single literal string for all the threads' names since
they are created for a thread-pool.
* wtf/WorkQueue.cpp:
(WTF::WorkQueue::concurrentApply):
2019-01-11 Dominik Infuehr <dinfuehr@igalia.com>
Enable DFG on ARM/Linux again
https://bugs.webkit.org/show_bug.cgi?id=192496
Reviewed by Yusuke Suzuki.
After changing the bytecode format DFG was disabled on all 32-bit
architectures. Enable DFG now again on ARM/Linux.
* wtf/Platform.h:
2019-01-10 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r239825.
https://bugs.webkit.org/show_bug.cgi?id=193330
Broke tests on armv7/linux bots (Requested by guijemont on
#webkit).
Reverted changeset:
"Enable DFG on ARM/Linux again"
https://bugs.webkit.org/show_bug.cgi?id=192496
https://trac.webkit.org/changeset/239825
2019-01-10 John Wilander <wilander@apple.com>
Override the session configuration for cookieAcceptPolicy
https://bugs.webkit.org/show_bug.cgi?id=190925
<rdar://problem/45497382>
Reviewed by Alexey Proskuryakov and Alex Christensen.
* wtf/Platform.h:
Definition of HAVE_CFNETWORK_OVERRIDE_SESSION_COOKIE_ACCEPT_POLICY.
2019-01-10 Dominik Infuehr <dinfuehr@igalia.com>
Enable DFG on ARM/Linux again
https://bugs.webkit.org/show_bug.cgi?id=192496
Reviewed by Yusuke Suzuki.
After changing the bytecode format DFG was disabled on all 32-bit
architectures. Enable DFG now again on ARM/Linux.
* wtf/Platform.h:
2019-01-10 Carlos Garcia Campos <cgarcia@igalia.com>
[FreeType] Color emoji not properly supported
https://bugs.webkit.org/show_bug.cgi?id=191976
Reviewed by Michael Catanzaro.
Add a name for combining enclosing keycap character.
* wtf/unicode/CharacterNames.h:
2019-01-09 Carlos Eduardo Ramalho <cadubentzen@gmail.com> and Fujii Hironori <Hironori.Fujii@sony.com>
Use directory local sequential numbers for Unified Sources filenames instead of global sequential numbers for CMake
https://bugs.webkit.org/show_bug.cgi?id=192391
Reviewed by Don Olmstead.
Unified Source Builds are using global sequential numbers for
bundle filenames UnifiedSource{sequential-number}.cpp. As the
result, every new source file added would shift the next ones and
prevent compiler caches from speeding up consecutive builds e.g.
in git-bisect sessions.
Changed it to directory local sequential numbers,
UnifiedSource-{hash-of-dir-name}-{sequential-number-within-the-dir}.cpp.
This is affecting only CMake builds which is where no
'--max-cpp-bundle-count' nor '--max-obj-c-bundle-count' options
are set. Xcode builds still use the old convention.
* Scripts/generate-unified-source-bundles.rb: Add new instance
variables @currentDirectory and @extraFiles to BundleManager.
Still use global sequential numbers if --max-cpp-bundle-count or
--max-obj-c-bundle-count is given.
2019-01-09 Alex Christensen <achristensen@webkit.org>
Expand use of sourceApplicationAuditData
https://bugs.webkit.org/show_bug.cgi?id=192995
<rdar://problem/46627875>
Reviewed by Brady Eidson.
* wtf/Platform.h:
2019-01-09 Mark Lam <mark.lam@apple.com>
Gigacage disabling checks should handle the GIGACAGE_ALLOCATION_CAN_FAIL case properly.
https://bugs.webkit.org/show_bug.cgi?id=193292
<rdar://problem/46485450>
Reviewed by Yusuke Suzuki.
Update the USE_SYSTEM_MALLOC version of Gigacage.h to match the bmalloc version.
* wtf/Gigacage.h:
2019-01-07 David Kilzer <ddkilzer@apple.com>
Prefer RetainPtr<NSObject> to RetainPtr<NSObject *>
<https://webkit.org/b/193056>
Reviewed by Alex Christensen.
* wtf/RetainPtr.h:
(WTF::RetainPtr<T>::HelperPtrType):
- Use C++ template metaprogramming to define a shared return
type for adoptNS() and retainPtr() that uses
RetainPtr<NSObject> instead of RetainPtr<NSObject *>. The
non-Objective-C typedef is used with retainPtr() for CFTypeRef
objects.
(WTF::adoptNS):
- Only make declarations available when compilng with
Objective-C. The inline implementation is only available for
Objective-C, so this makes the declarations consistent.
- Change return type to remove '*' from NS types using
RetainPtr<T>::HelperPtrType.
(WTF::retainPtr):
- Change return type to remove '*' from NS types using
RetainPtr<T>::HelperPtrType.
* wtf/SchedulePair.h:
- Remove '*' from RetainPtr<> type.
2019-01-07 Eric Carlson <eric.carlson@apple.com>
A MediaTime timescale must never be zero
https://bugs.webkit.org/show_bug.cgi?id=193156
<rdar://problem/32504501>
Reviewed by Jer Noble.
* wtf/MediaTime.cpp:
(WTF::greatestCommonDivisor): ASSERT if either parameter or return value is zero.
(WTF::MediaTime::MediaTime): Create +/- infinity if passed zero timescale.
(WTF::MediaTime::createWithFloat): Ditto.
(WTF::MediaTime::createWithDouble): Ditto.
(WTF::MediaTime::setTimeScale): Ditto.
2019-01-02 Alex Christensen <achristensen@webkit.org>
Homograph with LATIN SMALL LETTER R WITH FISHHOOK
https://bugs.webkit.org/show_bug.cgi?id=192944
Reviewed by Tim Horton.
* wtf/cocoa/NSURLExtras.mm:
(WTF::isLookalikeCharacter):
2019-01-02 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r239524.
https://bugs.webkit.org/show_bug.cgi?id=193083
basic browsing seems not to work (Requested by thorton on
#webkit).
Reverted changeset:
"Expand use of sourceApplicationAuditData"
https://bugs.webkit.org/show_bug.cgi?id=192995
https://trac.webkit.org/changeset/239524
2018-12-28 Yusuke Suzuki <yusukesuzuki@slowstart.org>
Add ENABLE_UNIFIED_BUILDS option to cmake ports
https://bugs.webkit.org/show_bug.cgi?id=193045
Reviewed by Don Olmstead.
* Scripts/generate-unified-source-bundles.rb:
2018-12-27 Alex Christensen <achristensen@webkit.org>
Resurrect Mac CMake build
https://bugs.webkit.org/show_bug.cgi?id=192658
Reviewed by Yusuke Suzuki.
* wtf/PlatformMac.cmake:
* wtf/cf/CFURLExtras.cpp:
* wtf/cf/CFURLExtras.h:
* wtf/cf/URLCF.cpp:
* wtf/cocoa/NSURLExtras.h:
* wtf/cocoa/NSURLExtras.mm:
* wtf/cocoa/URLCocoa.mm:
2018-12-21 Dan Bernstein <mitz@apple.com>
Fixed building for macOS 10.13 using the macOS 10.14 SDK.
* wtf/Platform.h: Changed HAVE_AUTHORIZATION_STATUS_FOR_MEDIA_TYPE to depend on the
deployment target, not the SDK.
2018-12-20 Yusuke Suzuki <yusukesuzuki@slowstart.org>
[JSC] Implement "well-formed JSON.stringify" proposal
https://bugs.webkit.org/show_bug.cgi?id=191677
Reviewed by Darin Adler.
This patch implements "well-formed JSON.stringify" proposal[1], which is now stage 3.
JSON.stringify appended surrogate pair codes even if it is not paired appropriately.
The proposal requires that broken surrogate pairs are unicode-escaped.
[1]: https://github.com/tc39/proposal-well-formed-stringify
* wtf/text/StringBuilderJSON.cpp:
(WTF::appendQuotedJSONStringInternal):
2018-12-21 Alex Christensen <achristensen@webkit.org>
Expand use of sourceApplicationAuditData
https://bugs.webkit.org/show_bug.cgi?id=192995
<rdar://problem/46627875>
Reviewed by Brady Eidson.
* wtf/Platform.h:
2018-12-21 Alex Christensen <achristensen@webkit.org>
Revert r239503.
https://bugs.webkit.org/show_bug.cgi?id=192944
* wtf/cocoa/NSURLExtras.mm:
(WTF::isLookalikeCharacter):
2018-12-20 Brent Fulgham <bfulgham@apple.com>
Show punycode if URL contains Latin small letter dotless i
https://bugs.webkit.org/show_bug.cgi?id=192944
<rdar://problem/46103047>
Reviewed by Andy Estes.
Revise our "lookalike character" logic to include the small Latin
dotless i character.
Test: fast/url/host.html
* wtf/cocoa/NSURLExtras.mm:
(WTF::isLookalikeCharacter):
2018-12-20 Chris Dumez <cdumez@apple.com>
Use Optional::hasValue() instead of Optional::has_value()
https://bugs.webkit.org/show_bug.cgi?id=192948
Reviewed by Tim Horton.
* wtf/Hasher.h:
(WTF::add):
* wtf/Optional.h:
2018-12-20 Chris Dumez <cdumez@apple.com>
Use Optional::valueOr() instead of Optional::value_or()
https://bugs.webkit.org/show_bug.cgi?id=192933
Reviewed by Geoffrey Garen.
* wtf/Optional.h:
(WTF::Optional<T::valueOr const):
2018-12-20 Tadeu Zagallo <tzagallo@apple.com>
Consistently use MaxLength for all WTF strings
https://bugs.webkit.org/show_bug.cgi?id=192853
<rdar://problem/45726906>
Reviewed by Mark Lam.
MaxLength was introduced to be INT_MAX for WTF::String and StringImpl,
but all the assertions were still done using UINT_MAX. Change it to
use MaxLength for all checks.
* wtf/text/StringImpl.cpp:
(WTF::StringImpl::createUninitializedInternalNonEmpty):
(WTF::StringImpl::reallocateInternal):
(WTF::StringImpl::create):
(WTF::StringImpl::convertToLowercaseWithoutLocale):
(WTF::StringImpl::convertToUppercaseWithoutLocale):
(WTF::StringImpl::convertToLowercaseWithLocale):
(WTF::StringImpl::convertToUppercaseWithLocale):
(WTF::StringImpl::foldCase):
(WTF::StringImpl::find):
(WTF::StringImpl::replace):
(WTF::StringImpl::utf8ForCharacters):
(WTF::StringImpl::tryGetUtf8ForRange const):
* wtf/text/StringImpl.h:
(WTF::lengthOfNullTerminatedString):
(WTF::StringImpl::tryCreateUninitialized):
(WTF::StringImpl::adopt):
(WTF::StringImpl::maxInternalLength):
* wtf/text/WTFString.cpp:
(WTF::String::append):
(WTF::String::insert):
(WTF::String::fromUTF8):
* wtf/text/WTFString.h:
(WTF::String::reverseFind const):
2018-12-19 Chris Dumez <cdumez@apple.com>
wtf/Optional.h: move-constructor and move-assignment operator should disengage the value being moved from
https://bugs.webkit.org/show_bug.cgi?id=192728
<rdar://problem/46746779>
Reviewed by Geoff Garen.
Update optional's move-constructor and move-assignment operator to disengage the value being moved from.
Rename to optional to Optional, make_optional() to makeOptional(), and move class from std to WTF namespace.
Based on patch by David Kilzer.
* wtf/*:
2018-12-19 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Force system camera/microphone TCC prompt if necessary
https://bugs.webkit.org/show_bug.cgi?id=192820
<rdar://problem/42680098>
Reviewed by Jer Noble.
* wtf/Platform.h: Define HAVE_AUTHORIZATION_STATUS_FOR_MEDIA_TYPE.
2018-12-17 Chris Fleizach <cfleizach@apple.com>
Some builds are broken after r239262
https://bugs.webkit.org/show_bug.cgi?id=192777
Reviewed by Simon Fraser.
* wtf/Platform.h:
2018-12-17 Daniel Bates <dabates@apple.com>
Support concatenating StringView with other string types
https://bugs.webkit.org/show_bug.cgi?id=177566
Reviewed by Darin Adler.
Add operator+ overloads to StringOperators.h to support concatenating a StringView with
other string types (e.g. String). This lets a person write more naturally looking code:
stringView + string
Instead of:
makeString(stringView, string)
* wtf/text/StringOperators.h:
(WTF::operator+): Added various operator+ overloads.
2018-12-17 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r239265 and r239274.
https://bugs.webkit.org/show_bug.cgi?id=192765
unorm_normalize is deprecated, and broke an internal build
(Requested by Truitt on #webkit).
Reverted changesets:
"[GTK][WPE] Need a function to convert internal URI to display
("pretty") URI"
https://bugs.webkit.org/show_bug.cgi?id=174816
https://trac.webkit.org/changeset/239265
"Fix the Apple Internal Mac build with a newer SDK"
https://trac.webkit.org/changeset/239274
2018-12-17 Daniel Bates <dabates@apple.com>
Fix the Apple Internal Mac build with a newer SDK
* wtf/URLHelpers.cpp:
(WTF::URLHelpers::userVisibleURL):
2018-12-17 Matt Lewis <jlewis3@apple.com>
Unreviewed, rolling out r239254.
This broke the Windows 10 Debug build
Reverted changeset:
"Replace many uses of String::format with more type-safe
alternatives"
https://bugs.webkit.org/show_bug.cgi?id=192742
https://trac.webkit.org/changeset/239254
2018-12-17 Ms2ger <Ms2ger@igalia.com>
[GTK][WPE] Need a function to convert internal URI to display ("pretty") URI
https://bugs.webkit.org/show_bug.cgi?id=174816
Reviewed by Michael Catanzaro.
Translate userVisibleString and dependent code into platform-neutral C++
in wtf/URLHelpers.{h,cpp}.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/URLHelpers.cpp: Added.
(WTF::URLHelpers::loadIDNScriptWhiteList):
(WTF::URLHelpers::isArmenianLookalikeCharacter):
(WTF::URLHelpers::isArmenianScriptCharacter):
(WTF::URLHelpers::isASCIIDigitOrValidHostCharacter):
(WTF::URLHelpers::isLookalikeCharacter):
(WTF::URLHelpers::whiteListIDNScript):
(WTF::URLHelpers::initializeDefaultIDNScriptWhiteList):
(WTF::URLHelpers::allCharactersInIDNScriptWhiteList):
(WTF::URLHelpers::isSecondLevelDomainNameAllowedByTLDRules):
(WTF::URLHelpers::isRussianDomainNameCharacter):
(WTF::URLHelpers::allCharactersAllowedByTLDRules):
(WTF::URLHelpers::mapHostName):
(WTF::URLHelpers::collectRangesThatNeedMapping):
(WTF::URLHelpers::applyHostNameFunctionToMailToURLString):
(WTF::URLHelpers::applyHostNameFunctionToURLString):
(WTF::URLHelpers::mapHostNames):
(WTF::URLHelpers::createStringWithEscapedUnsafeCharacters):
(WTF::URLHelpers::userVisibleURL):
* wtf/URLHelpers.h: Added.
* wtf/cocoa/NSURLExtras.mm:
(WTF::URLHelpers::loadIDNScriptWhiteList):
(WTF::decodePercentEscapes):
(WTF::decodeHostName):
(WTF::encodeHostName):
(WTF::URLWithUserTypedString):
(WTF::userVisibleString):
2018-12-15 Darin Adler <darin@apple.com>
Use warning-ignoring macros more consistently and simply
https://bugs.webkit.org/show_bug.cgi?id=192743
Reviewed by Mark Lam.
* wtf/Assertions.h: Use IGNORE_WARNINGS_BEGIN rather than
IGNORE_CLANG_WARNINGS_BEGIN since we don't need special handling for
non-clang compilers, in part since the code is already inside
#if COMPILER(CLANG), but also because it would be harmless to ignore this
warning on non-clang; we should almost never use IGNORE_CLANG_WARNINGS_BEGIN.
2018-12-15 Darin Adler <darin@apple.com>
Replace many uses of String::format with more type-safe alternatives
https://bugs.webkit.org/show_bug.cgi?id=192742
Reviewed by Mark Lam.
* wtf/WorkQueue.cpp:
(WTF::WorkQueue::concurrentApply): Use makeString.
* wtf/dtoa.cpp:
(WTF::dtoa): Use sprintf instead of String::format in the comments,
since these functions have nothing to do with WTF::String.
2018-12-14 Darin Adler <darin@apple.com>
Verify size is valid in USE_SYSTEM_MALLOC version of tryAllocateZeroedVirtualPages
https://bugs.webkit.org/show_bug.cgi?id=192738
rdar://problem/37502342
Reviewed by Mark Lam.
* wtf/Gigacage.cpp:
(Gigacage::tryAllocateZeroedVirtualPages): Added a RELEASE_ASSERT just
like the one in tryLargeZeroedMemalignVirtual in bmalloc.
2018-12-14 David Kilzer <ddkilzer@apple.com>
clang-tidy: Fix unnecessary copy of AtomicString each time one is logged
<https://webkit.org/b/192710>
<rdar://problem/46738962>
Reviewed by Eric Carlson.
* wtf/Logger.h:
(WTF::LogArgument::toString): Make argument a const reference to
avoid the copy.
2018-12-14 Zan Dobersek <zdobersek@igalia.com>
[GLib] RunLoop::dispatchAfter() GSource requires microsecond precision
https://bugs.webkit.org/show_bug.cgi?id=192696
Reviewed by Michael Catanzaro.
The GSource we set up in GLib's RunLoop::dispatchAfter() implementation
should support microsecond-precision delays. Such delays are common in
JSC's Watchdog implementation and missing support for them has been
causing test failures in the `testapi` program as well as some JSC
tests that depend on the termination determination functionality of the
JSC::Watchdog class.
RunLoop::dispatchAfter() is changed to spawn a raw GSource that uses the
existing GSourceFuncs implementation used elsewhere in GLib's RunLoop.
The GSource's ready time is set manually, now with the necessary
microsecond precision.
* wtf/glib/RunLoopGLib.cpp:
(WTF::RunLoop::dispatchAfter):
2018-12-13 Saam Barati <sbarati@apple.com>
The JSC shell should listen for memory pressure events and respond to them
https://bugs.webkit.org/show_bug.cgi?id=192647
Reviewed by Keith Miller.
* wtf/MemoryPressureHandler.cpp:
(WTF::MemoryPressureHandler::MemoryPressureHandler):
(WTF::MemoryPressureHandler::setDispatchQueue):
Make it so that we can customize which dispatch queue memory pressure
events get handled on.
* wtf/MemoryPressureHandler.h:
(WTF::MemoryPressureHandler::setShouldLogMemoryMemoryPressureEvents):
Make it so that we can disable logging that happens on each memory
pressure event.
* wtf/cocoa/MemoryPressureHandlerCocoa.mm:
(WTF::MemoryPressureHandler::install):
(WTF::MemoryPressureHandler::uninstall):
(WTF::MemoryPressureHandler::holdOff):
2018-12-13 David Kilzer <ddkilzer@apple.com>
clang-tidy: Fix unnecessary parameter copies in ParallelHelperPool.cpp
<https://webkit.org/b/192666>
<rdar://problem/46697952>
Reviewed by Alex Christensen.
* wtf/ParallelHelperPool.cpp:
(WTF::ParallelHelperClient::ParallelHelperClient): Use rvalue
reference and WTFMove().
(WTF::ParallelHelperClient::setTask): Ditto.
(WTF::ParallelHelperClient::runTaskInParallel): Ditto.
(WTF::ParallelHelperClient::runTask): Use const reference.
* wtf/ParallelHelperPool.h: Update declarations to match
implementations.
2018-12-12 Alex Christensen <achristensen@webkit.org>
Implement safe browsing in WebKit on WatchOS
https://bugs.webkit.org/show_bug.cgi?id=192641
<rdar://problem/46376188>
Reviewed by Geoff Garen.
* wtf/Platform.h:
WatchOS has safe browsing, too!
2018-12-11 Fujii Hironori <Hironori.Fujii@sony.com>
[Win][Clang] Fix compilation warnings of WTF
https://bugs.webkit.org/show_bug.cgi?id=192583
Reviewed by Alex Christensen.
clang-cl reports the following warnings.
> [92/206] Building CXX object Source\WTF\wtf\CMakeFiles\WTF.dir\StackBounds.cpp.obj
> ..\..\Source\WTF\wtf\StackBounds.cpp(163,48): warning: missing field 'AllocationBase' initializer [-Wmissing-field-initializers]
> MEMORY_BASIC_INFORMATION stackOrigin = { 0 };
> ^
> 1 warning generated.
> [160/206] Building CXX object Source\WTF\wtf\CMakeFiles\WTF.dir\win\RunLoopWin.cpp.obj
> ..\..\Source\WTF\wtf\win\RunLoopWin.cpp(34,54): warning: ISO C++11 does not allow conversion from string literal to 'const LPWSTR' (aka 'wchar_t *const') [-Wwritable-strings]
> static const LPWSTR kRunLoopMessageWindowClassName = L"RunLoopMessageWindow";
> ^
> ..\..\Source\WTF\wtf\win\RunLoopWin.cpp(86,32): warning: missing field 'lpfnWndProc' initializer [-Wmissing-field-initializers]
> WNDCLASS windowClass = { 0 };
> ^
> 2 warnings generated.
> [175/206] Building CXX object Source\WTF\wtf\CMakeFiles\WTF.dir\DateMath.cpp.obj
> ..\..\Source\WTF\wtf\DateMath.cpp(125,20): warning: unused function 'getLocalTime' [-Wunused-function]
> static inline void getLocalTime(const time_t* localTime, struct tm* localTM)
> ^
> 1 warning generated.
* wtf/DateMath.cpp:
(WTF::getLocalTime): Defined only if used.
* wtf/StackBounds.cpp:
(WTF::StackBounds::currentThreadStackBoundsInternal): Initialize stackOrigin with '{ }'.
* wtf/win/RunLoopWin.cpp: Change the type of kRunLoopMessageWindowClassName to LPCWSTR.
(WTF::RunLoop::registerRunLoopMessageWindowClass): Initialize windowClass with '{ }'.
2018-12-11 Andy Estes <aestes@apple.com>
Introduce makeBlockPtr for lambdas
https://bugs.webkit.org/show_bug.cgi?id=192594
Reviewed by Alex Christensen.
BlockPtr<...>::fromCallable is cumbersome because it requires repeating the callable's
signature as a class template argument. This patch introduces an overload of makeBlockPtr
that deduces the correct BlockPtr instantiation from a lambda's operator() signature.
* wtf/BlockPtr.h:
(WTF::makeBlockPtr):
Adopted makeBlockPtr.
* wtf/cocoa/WorkQueueCocoa.cpp:
(WTF::WorkQueue::dispatch):
(WTF::WorkQueue::dispatchAfter):
(WTF::WorkQueue::concurrentApply):
2018-12-10 Don Olmstead <don.olmstead@sony.com>
Move ENABLE_RESOURCE_LOAD_STATISTICS to FeatureDefines.xcconfig
https://bugs.webkit.org/show_bug.cgi?id=192573
Reviewed by Simon Fraser.
Remove ENABLE_RESOURCE_LOAD_STATISTICS from Platform.h and instead rely
on it being set in FeatureDefines.xcconfig.
* wtf/Platform.h:
2018-12-10 Alexey Proskuryakov <ap@apple.com>
Move ENABLE_SEC_ITEM_SHIM out of WebKit's config.h
https://bugs.webkit.org/show_bug.cgi?id=192428
Reviewed by Tim Horton.
* wtf/Platform.h:
2018-12-10 Alexey Proskuryakov <ap@apple.com>
Move more macros out of WebKit's config.h
https://bugs.webkit.org/show_bug.cgi?id=192430
Reviewed by Tim Horton.
* wtf/Platform.h:
2018-12-09 Yusuke Suzuki <yusukesuzuki@slowstart.org>
Unreviewed, fix build failure on GCC 8.2, part 2
Add RefCountedArray::assign, and use it instead of operator= internally.
We should have operator=(const RefCountedArray&) since it will be automatically generated
if we do not have correct implementation here.
* wtf/RefCountedArray.h:
(WTF::RefCountedArray::operator=):
(WTF::RefCountedArray::assign):
2018-12-09 Yusuke Suzuki <yusukesuzuki@slowstart.org>
Unreviewed, fix build failure on GCC 8.2
We remove operator=<PtrTraits> call since it is not necessary.
This is a workaround. It seems that GCC 8.2 fails to parse this specialization.
* wtf/RefCountedArray.h:
2018-12-08 Darin Adler <darin@apple.com>
Fix stray-semicolon warning seen with a new version of clang in Xcode
https://bugs.webkit.org/show_bug.cgi?id=192534
Reviewed by Alexey Proskuryakov.
* wtf/Lock.h: Removed an unneeded semicolon.
2018-12-08 Adrian Perez de Castro <aperez@igalia.com>
[WTF] Debug build fails due conflicting abort() method
https://bugs.webkit.org/show_bug.cgi?id=192491
Reviewed by Michael Catanzaro.
* wtf/Assertions.h: Use namespaced std::abort() insted of plain abort() to avoid clashes
inside classes which have an ::abort() method, but only when __cplusplus is defined to
allow inclusion of the header in plain C sources.
2018-12-07 Andy Estes <aestes@apple.com>
[Cocoa] Add optional variants of SOFT_LINK_CLASS_FOR_SOURCE
https://bugs.webkit.org/show_bug.cgi?id=192498
Reviewed by Tim Horton.
Added SOFT_LINK_CLASS_FOR_SOURCE_OPTIONAL and SOFT_LINK_CLASS_FOR_SOURCE_OPTIONAL_WITH_EXPORT,
which behave like their non-optional variants but do not require their classes to exist.
* wtf/cocoa/SoftLinking.h:
2018-12-06 Alexey Proskuryakov <ap@apple.com>
Move USE_NEW_THEME out of WebCore's config.h
https://bugs.webkit.org/show_bug.cgi?id=192426
Reviewed by Tim Horton.
* wtf/Platform.h:
2018-12-04 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Move URLSoup back to WebCore after r238771
https://bugs.webkit.org/show_bug.cgi?id=192306
Reviewed by Michael Catanzaro.
In r238771 URL was moved from WebCore to WTF, including the soup implementation. Unfortunately that added
libsoup as a new dependency of libjavascriptcoregtk.
* wtf/PlatformGTK.cmake:
* wtf/PlatformWPE.cmake:
* wtf/URL.h:
* wtf/glib/URLGLib.cpp: Copied from Source/WTF/wtf/glib/URLSoup.cpp.
2018-12-03 Don Olmstead <don.olmstead@sony.com>
Fix some unused parameter warnings
https://bugs.webkit.org/show_bug.cgi?id=192336
Reviewed by Fujii Hironori.
* wtf/StackTrace.cpp:
(WTFGetBacktrace):
(WTF::StackTrace::demangle):
* wtf/generic/MemoryPressureHandlerGeneric.cpp:
(WTF::MemoryPressureHandler::holdOff):
(WTF::MemoryPressureHandler::respondToMemoryPressure):
2018-12-01 Alexey Proskuryakov <ap@apple.com>
Modernize version check for _suppressedAutoAddedHTTPHeaders
https://bugs.webkit.org/show_bug.cgi?id=192175
Reviewed by Tim Horton.
* wtf/Platform.h:
2018-11-30 Alex Christensen <achristensen@webkit.org>
Fix Windows build after r238771
https://bugs.webkit.org/show_bug.cgi?id=190234
* wtf/URLParser.h:
Just make defaultPortForProtocol public so we don't have to worry about DLL linkage.
2018-11-30 Alex Christensen <achristensen@webkit.org>
Move URL from WebCore to WTF
https://bugs.webkit.org/show_bug.cgi?id=190234
Reviewed by Keith Miller.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/Forward.h:
* wtf/PlatformGTK.cmake:
* wtf/PlatformMac.cmake:
* wtf/PlatformWPE.cmake:
* wtf/PlatformWin.cmake:
* wtf/URL.cpp: Renamed from Source/WebCore/platform/URL.cpp.
(WTF::URL::protocolIs):
* wtf/URL.h: Renamed from Source/WebCore/platform/URL.h.
* wtf/URLHash.h: Renamed from Source/WebCore/platform/URLHash.h.
(WTF::URLHash::hash):
(WTF::URLHash::equal):
* wtf/URLParser.cpp: Renamed from Source/WebCore/platform/URLParser.cpp.
(WTF::URLParser::isInUserInfoEncodeSet):
(WTF::URLParser::parseAuthority):
* wtf/URLParser.h: Renamed from Source/WebCore/platform/URLParser.h.
(WTF::URLParser::URLParser):
(WTF::URLParser::result):
* wtf/cf/CFURLExtras.cpp: Renamed from Source/WebCore/platform/cf/CFURLExtras.cpp.
* wtf/cf/CFURLExtras.h: Renamed from Source/WebCore/platform/cf/CFURLExtras.h.
* wtf/cf/URLCF.cpp: Renamed from Source/WebCore/platform/cf/URLCF.cpp.
* wtf/cocoa/NSURLExtras.h: Copied from Source/WebCore/loader/archive/ArchiveResourceCollection.h.
* wtf/cocoa/NSURLExtras.mm: Copied from Source/WebCore/platform/mac/WebCoreNSURLExtras.mm.
(WTF::isArmenianLookalikeCharacter):
(WTF::isArmenianScriptCharacter):
(WTF::isASCIIDigitOrValidHostCharacter):
(WTF::isLookalikeCharacter):
(WTF::whiteListIDNScript):
(WTF::readIDNScriptWhiteListFile):
(WTF::allCharactersInIDNScriptWhiteList):
(WTF::isSecondLevelDomainNameAllowedByTLDRules):
(WTF::isRussianDomainNameCharacter):
(WTF::allCharactersAllowedByTLDRules):
(WTF::mapHostNameWithRange):
(WTF::hostNameNeedsDecodingWithRange):
(WTF::hostNameNeedsEncodingWithRange):
(WTF::decodeHostNameWithRange):
(WTF::encodeHostNameWithRange):
(WTF::decodeHostName):
(WTF::encodeHostName):
(WTF::collectRangesThatNeedMapping):
(WTF::collectRangesThatNeedEncoding):
(WTF::collectRangesThatNeedDecoding):
(WTF::applyHostNameFunctionToMailToURLString):
(WTF::applyHostNameFunctionToURLString):
(WTF::mapHostNames):
(WTF::stringByTrimmingWhitespace):
(WTF::URLByTruncatingOneCharacterBeforeComponent):
(WTF::URLByRemovingResourceSpecifier):
(WTF::URLWithData):
(WTF::dataWithUserTypedString):
(WTF::URLWithUserTypedString):
(WTF::URLWithUserTypedStringDeprecated):
(WTF::hasQuestionMarkOnlyQueryString):
(WTF::dataForURLComponentType):
(WTF::URLByRemovingComponentAndSubsequentCharacter):
(WTF::URLByRemovingUserInfo):
(WTF::originalURLData):
(WTF::createStringWithEscapedUnsafeCharacters):
(WTF::userVisibleString):
(WTF::isUserVisibleURL):
(WTF::rangeOfURLScheme):
(WTF::looksLikeAbsoluteURL):
* wtf/cocoa/URLCocoa.mm: Renamed from Source/WebCore/platform/mac/URLMac.mm.
(WTF::URL::URL):
(WTF::URL::createCFURL const):
* wtf/glib/GUniquePtrSoup.h: Renamed from Source/WebCore/platform/network/soup/GUniquePtrSoup.h.
* wtf/glib/URLSoup.cpp: Renamed from Source/WebCore/platform/soup/URLSoup.cpp.
2018-11-30 Alexey Proskuryakov <ap@apple.com>
Move USE_CFNETWORK_IGNORE_HSTS to its proper place
https://bugs.webkit.org/show_bug.cgi?id=192173
Reviewed by Tim Horton.
* wtf/Platform.h: Also renamed it to better match other version checks.
2018-11-29 Alexey Proskuryakov <ap@apple.com>
Modernize the check for kCFURLRequestContentDecoderSkipURLCheck existence
https://bugs.webkit.org/show_bug.cgi?id=192041
Reviewed by Tim Horton.
* wtf/Platform.h:
2018-11-28 Mark Lam <mark.lam@apple.com>
ENABLE_SEPARATED_WX_HEAP needs to be defined in Platform.h.
https://bugs.webkit.org/show_bug.cgi?id=192110
<rdar://problem/46317746>
Reviewed by Saam Barati.
Contrary my previous claim in r238564, ENABLE_SEPARATED_WX_HEAP needs to be
defined in Platform.h because it is also needed in WebCore for the CSS JIT. Also
contrary to my previous claim, ENABLE(FAST_JIT_PERMISSIONS) is defined for WebCore
(and other projects) as well as JSC. Hence, there's no reason why
ENABLE_SEPARATED_WX_HEAP cannot be defined in Platform.h.
* wtf/Platform.h:
2018-11-28 Keith Rollin <krollin@apple.com>
Update generate-unified-source-bundles.rb to generate .xcfilelist files
https://bugs.webkit.org/show_bug.cgi?id=192029
<rdar://problem/46285918>
Reviewed by Alex Christensen.
Update generate-unified-source-bundles.rb to generate output for
.xcfilelist files. These files are used to indicate the sets of input
and output files to Run Script build phases in Xcode. By invoking
generate-unified-source-bundles.rb with -generate-xcfilelists, the
script generates these .xcfilelist files. These .xcfilelist files can
then be used to specify the inputs and outputs of the Generate Unified
Sources build phases.
* Scripts/generate-unified-source-bundles.rb:
2018-11-28 Alexey Proskuryakov <ap@apple.com>
Remove another OS version check from NetworkDataTaskCocoa.mm
https://bugs.webkit.org/show_bug.cgi?id=192046
Reviewed by Alex Christensen.
* wtf/Platform.h:
2018-11-28 Alexey Proskuryakov <ap@apple.com>
Modernize version checks for same site cookie support
https://bugs.webkit.org/show_bug.cgi?id=192054
Reviewed by Tim Horton.
* wtf/Platform.h:
2018-11-27 Alexey Proskuryakov <ap@apple.com>
Modernize the check for async _saveCookies existence
https://bugs.webkit.org/show_bug.cgi?id=191987
Reviewed by Dean Jackson.
* wtf/Platform.h: Added a specific macro for this. Not changing the behavior here,
although it seems very likely that we want to do the same on other iOS family OSes.
2018-11-26 Fujii Hironori <Hironori.Fujii@sony.com>
[Win][Clang] SOFT_LINK reports warning: implicit conversion between pointer-to-function and pointer-to-object is a Microsoft extension [-Wmicrosoft-cast]
https://bugs.webkit.org/show_bug.cgi?id=191960
Reviewed by Alex Christensen.
* wtf/win/SoftLinking.h: Do reinterpret_cast<void*> a function
pointer argument of EncodePointer. Changed the type of stored
function pointer returned by EncodePointer.
2018-11-26 Sam Weinig <sam@webkit.org>
Streamline ListHashSet use in floating object code
https://bugs.webkit.org/show_bug.cgi?id=191957
Reviewed by Alex Christensen.
* wtf/ListHashSet.h:
Reverses the order of the template arguments for the find() and contains()
overload that allow specifying a hash translator to allow the compiler to
deduce type T. This simplifies call sites and matches other WTF containers.
2018-11-25 Michael Catanzaro <mcatanzaro@igalia.com>
CRASH() should call abort() except on Darwin and in developer builds
https://bugs.webkit.org/show_bug.cgi?id=184408
Reviewed by Daniel Bates.
CRASH() should call abort() except on Darwin and in developer builds, as discussed on
webkit-dev. This should be slightly nicer than dereferencing 0xbadbeef.
On Darwin, CRASH() uses a breakpoint trap, which seems to corrupt the stack on Linux, so we
can't do that.
Continue to call WTFCrash() in developer mode, and make no changes to WTFCrash(), since it
is reportedly useful in nightmare scenarios where core dumps are unavailable.
We also have to define CRASH_UNDER_CONSTEXPR_CONTEXT(). It's a bit odd that it's possible to
use a non-constexpr function here, but it works. Currently this macro uses WTFCrash(), which
is also non-constexpr.
* wtf/Assertions.h:
2018-11-25 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, rolling out r238469.
Broke the build
Reverted changeset:
"CRASH() should call abort() except on Darwin and in developer
builds"
https://bugs.webkit.org/show_bug.cgi?id=184408
https://trac.webkit.org/changeset/238469
2018-11-24 Andy Estes <aestes@apple.com>
[Cocoa] SOFT_LINK_CLASS_FOR_{HEADER,SOURCE} should generate a more concise getter function
https://bugs.webkit.org/show_bug.cgi?id=191899
Reviewed by Dean Jackson.
Currently, SOFT_LINK_CLASS_FOR_HEADER declares a class getter function that includes the
framework name. For example, NSView would have a class getter named
namespace::get_AppKit_NSViewClass().
Including the framework name in the getter is unnecessary. Objective-C classes already exist
in a global namespace, so there is no need to disambiguate class names by framework. This
patch elides the framework name from the getter function. For example, NSView would now have
a getter named namespace::getNSViewClass().
* wtf/cocoa/SoftLinking.h:
2018-11-24 Michael Catanzaro <mcatanzaro@igalia.com>
CRASH() should call abort() except on Darwin and in developer builds
https://bugs.webkit.org/show_bug.cgi?id=184408
Reviewed by Daniel Bates.
CRASH() should call abort() except on Darwin and in developer builds, as discussed on
webkit-dev. This should be slightly nicer than dereferencing 0xbadbeef.
On Darwin, CRASH() uses a breakpoint trap, which seems to corrupt the stack on Linux, so we
can't do that.
Continue to call WTFCrash() in developer mode, and make no changes to WTFCrash(), since it
is reportedly useful in nightmare scenarios where core dumps are unavailable.
* wtf/Assertions.h:
2018-11-23 Sam Weinig <sam@webkit.org>
Add raw pointer overloads to ListHashSet via SmartPtr specialized functions
https://bugs.webkit.org/show_bug.cgi?id=191936
Reviewed by Zalan Bujtas.
Adds overloads for find, contains, insertBefore and remove that take raw pointers
when the value type V of a ListHashSet is true for the predicate IsSmartPtr<V>::value.
This brings the interface to ListHashSet closer inline with HashSet, HashMap and HashCountedSet
which already have this functionality. Like in the other collections, this is especially
useful when using std::unique_ptr<> as the value, since there would be no way to pass it
to these functions. One difference between this set of overloads is the inclusion of insertBefore,
which is unique to ListHashSet. As would be expected, this specialization only changes the first
parameter, the one that needs to be found, to support a raw pointer.
* wtf/ListHashSet.h:
(WTF::U>::find):
(WTF::U>::find const):
(WTF::U>::contains const):
(WTF::U>::insertBefore):
(WTF::U>::remove):
2018-11-21 Yusuke Suzuki <yusukesuzuki@slowstart.org>
[JSC] Drop ARM_TRADITIONAL support in LLInt, baseline JIT, and DFG
https://bugs.webkit.org/show_bug.cgi?id=191675
Reviewed by Mark Lam.
* wtf/InlineASM.h:
* wtf/Platform.h:
2018-11-21 Andy Estes <aestes@apple.com>
[Cocoa] Create a soft-linking file for PassKit
https://bugs.webkit.org/show_bug.cgi?id=191875
<rdar://problem/46203215>
Reviewed by Myles Maxfield.
* wtf/Platform.h: Defined USE_PASSKIT.
* wtf/cocoa/SoftLinking.h: Added _WITH_EXPORT variants of SOFT_LINK_FRAMEWORK_FOR_SOURCE,
SOFT_LINK_PRIVATE_FRAMEWORK_FOR_SOURCE, SOFT_LINK_CLASS_FOR_SOURCE,
SOFT_LINK_FUNCTION_FOR_SOURCE, and SOFT_LINK_CONSTANT_FOR_SOURCE.
2018-11-21 Dominik Infuehr <dinfuehr@igalia.com>
Enable JIT on ARM/Linux
https://bugs.webkit.org/show_bug.cgi?id=191548
Reviewed by Yusuke Suzuki.
Enable JIT by default on ARMv7/Linux after it was disabled with
recent bytcode format change.
* wtf/Platform.h:
2018-11-14 Keith Rollin <krollin@apple.com>
Fix #end vs. #endif typo.
https://bugs.webkit.org/show_bug.cgi?id=191668
<rdar://problem/46081704>
Reviewed by Alexey Proskuryakov.
Source/WebCore/SourcesCocoa.txt had a #end that should have been a
#endif. Fix this, an add a check to generate-unified-source-bundles.rb
to detect similar typos.
* Scripts/generate-unified-source-bundles.rb:
2018-11-12 Mark Lam <mark.lam@apple.com>
Add OOM detection to StringPrototype's substituteBackreferences().
https://bugs.webkit.org/show_bug.cgi?id=191563
<rdar://problem/45720428>
Reviewed by Saam Barati.
Enhanced StringBuilder::toString() to skip the shrinkToFit(), reifyString(), and
the hasOverflowed() check if m_string is not null. When m_string is not null,
the StringBuilder either only has a single String in m_string (with m_buffer being
null), or reifyString() has already been called (resulting in a non-null m_string
with a possibly non-null m_buffer).
We can skip the overflow check because:
1. if the StringBuilder only has a single String, then there cannot be an overflow.
2. if reifyString() has already been called, then the hasOverflowed() checked has
already been done because every code path that calls reifyString() first does
the hasOverflowed() check.
We can skip shrinkToFit() because it only applies to m_buffer.
1. if the StringBuilder only has a single String, then there's no m_buffer to shrink.
2. if reifyString() has already been called, then we either came down
a. the toString() path with a null m_string previously, where we would have
already called shrinkToFit() before reifyString(), or
b. the toStringPreserveCapacity() path where we don't want to shrinkToFit().
We can skip reifyString() because:
1. if the StringBuilder only has a single String, then the string is already reified.
2. if reifyString() has been already called, then the string is already reified.
Note that if m_string is the null string and m_buffer is null, reifyString() will
replace it with the empty string. For this reason, we cannot solely check for
!m_buffer because we need to reify the null string into the empty string.
Note also that if m_string is null and m_buffer is non-null, reifyString() will
create a String and set m_string to it. However, m_buffer remains non-null.
For this reason, we cannot assert !m_buffer alone when m_string is non-null.
We add a m_isReified flag (only when assertions are enabled) to track the reified
case where both m_buffer and m_string are non-null.
* wtf/text/StringBuilder.cpp:
(WTF::StringBuilder::reifyString const):
* wtf/text/StringBuilder.h:
(WTF::StringBuilder::toString):
2018-11-10 Benjamin Poulain <benjamin@webkit.org>
Fix a fixme: rename wtfObjcMsgSend to wtfObjCMsgSend
https://bugs.webkit.org/show_bug.cgi?id=191492
Reviewed by Alex Christensen.
Because renaming ObjcRuntimeExtras.h to ObjCRuntimeExtras.h only changes
the cases, some systems have issues with applying this patch.
To work around the problem, the change is made is two patches, first rename to
WTFObjCRuntimeExtras.h, then back to ObjCRuntimeExtras.h.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/WTFObjCRuntimeExtras.h: Renamed from Source/WTF/wtf/ObjcRuntimeExtras.h.
(wtfObjCMsgSend):
2018-11-09 Keith Miller <keith_miller@apple.com>
LLInt VectorSizeOffset should be based on offset extraction
https://bugs.webkit.org/show_bug.cgi?id=191468
Reviewed by Yusuke Suzuki.
Make things friends with LLIntOffsetsExtractor.
* wtf/RefCountedArray.h:
* wtf/Vector.h:
2018-11-09 Jim Mason <jmason@ibinx.com>
[WTF] Changes in bug 188867 break non-Linux Unix builds
https://bugs.webkit.org/show_bug.cgi?id=191380
The intention of 188867 was to split out platform-specific
heap query/release code. Any unsupported platform
would use a generic, no-op stub. However, wtf/PlatformGTK.cmake
ended up sending all non-Linux platforms through the Linux
implementation, which breaks the build for those platforms.
This includes any user of the GTK target which is not Linux,
such as the *BSDs, Solaris, etc.
Reviewed by Yusuke Suzuki.
* wtf/PlatformGTK.cmake: Updated to include Linux-specific
code only for Linux; all other platforms use the generic stub.
2018-11-06 Geoffrey Garen <ggaren@apple.com>
Removed mbmalloc target from WTF
https://bugs.webkit.org/show_bug.cgi?id=191313
Reviewed by Saam Barati.
For benchmarking, WTF::fastMalloc is no longer meaningfully different
from bmalloc. (And bmalloc has its own mbmalloc target.)
* Configurations/mbmalloc.xcconfig: Removed.
* WTF.xcodeproj/project.pbxproj:
* wtf/mbmalloc.cpp: Removed.
2018-11-08 Alexey Proskuryakov <ap@apple.com>
Re-add PLATFORM(IOS), now with the strict meaning
https://bugs.webkit.org/show_bug.cgi?id=191281
Reviewed by Tim Horton.
* wtf/Platform.h: No change in behavior. Some of the macros look a bit weird
when expanded, it might be that the values are incorrect for some flavors of iOS family.
2018-11-08 Dean Jackson <dino@apple.com>
Add a String literal that returns a String
https://bugs.webkit.org/show_bug.cgi?id=191425
<rdar://problem/45914556>
Reviewed by Sam Weinig.
Add a new String literal, _str, that will return a String type.
This is useful when ""_s won't work, such as for things that
don't take an ASCIILiteral directly e.g. ExceptionOr<String>
or Variants.
* wtf/text/WTFString.h:
(WTF::StringLiterals::operator _str): Added.
2018-11-06 Justin Fan <justin_fan@apple.com>
[WebGPU] Experimental prototype for WebGPURenderPipeline and WebGPUSwapChain
https://bugs.webkit.org/show_bug.cgi?id=191291
Reviewed by Myles Maxfield.
Properly disable WEBGPU on all non-Metal platforms for now.
* wtf/Platform.h:
2018-11-05 Myles C. Maxfield <mmaxfield@apple.com>
Cache glyph paths and share underline skipping code between all the ports
https://bugs.webkit.org/show_bug.cgi?id=191239
Reviewed by Alex Christensen.
Remove CSS3_TEXT_DECORATION_SKIP_INK. It's now interoperable and part of the Web Platform.
* wtf/Platform.h:
2018-11-05 Dominik Infuehr <dinfuehr@igalia.com>
Enable LLInt on ARMv7/Linux
https://bugs.webkit.org/show_bug.cgi?id=191190
Reviewed by Yusuke Suzuki.
After enabling the new bytecode format in r237547, C_LOOP was
forced on all 32-bit platforms. Now enable LLInt again on
ARMv7-Thumb2/Linux by default.
* wtf/Platform.h:
2018-11-04 Fujii Hironori <Hironori.Fujii@sony.com>
[Win] Use C++14, not C++17
https://bugs.webkit.org/show_bug.cgi?id=191101
Reviewed by Alex Christensen.
* wtf/StdLibExtras.h: Use _MSVC_LANG to check C++ language version
instead of _MSC_FULL_VER.
2018-11-02 Justin Fan <justin_fan@apple.com>
[WebGPU] Experimental prototype for MSL shaders
https://bugs.webkit.org/show_bug.cgi?id=191084
Reviewed by Dean Jackson.
Disabling WebGPU on non-Cocoa platforms and iOS Simulator.
* wtf/Platform.h:
2018-11-01 Jiewen Tan <jiewen_tan@apple.com>
Replace CommonRandom SPI with API
https://bugs.webkit.org/show_bug.cgi?id=191178
<rdar://problem/45722391>
Reviewed by Brent Fulgham.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/RandomDevice.cpp:
(WTF::RandomDevice::cryptographicallyRandomValues):
* wtf/spi/darwin/CommonCryptoSPI.h: Removed.
2018-11-01 Fujii Hironori <Hironori.Fujii@sony.com>
Rename <wtf/unicode/UTF8.h> to <wtf/unicode/UTF8Conversion.h> in order to avoid conflicting with ICU's unicode/utf8.h
https://bugs.webkit.org/show_bug.cgi?id=189693
Reviewed by Yusuke Suzuki.
* WTF.xcodeproj/project.pbxproj: Replaced unicode/UTF8.{cpp,h} with unicode/UTF8Conversion.{cpp,h}.
* wtf/CMakeLists.txt: Ditto.
* wtf/text/AtomicStringImpl.cpp: Replaced <wtf/unicode/UTF8.h> with <wtf/unicode/UTF8Conversion.h>.
* wtf/text/StringImpl.cpp: Ditto.
* wtf/text/StringView.cpp: Ditto.
* wtf/text/WTFString.cpp: Ditto.
* wtf/unicode/UTF8Conversion.cpp: Renamed from Source/WTF/wtf/unicode/UTF8.cpp.
* wtf/unicode/UTF8Conversion.h: Renamed from Source/WTF/wtf/unicode/UTF8.h.
2018-10-30 Don Olmstead <don.olmstead@sony.com>
[PlayStation] Enable JavaScriptCore
https://bugs.webkit.org/show_bug.cgi?id=191072
Reviewed by Brent Fulgham.
Add platform files for the PlayStation port.
* wtf/PlatformPlayStation.cmake: Added.
2018-10-30 David Kilzer <ddkilzer@apple.com>
XSLTProcessor should limit max transform depth
<https://webkit.org/b/191075>
<rdar://problem/45531453>
Reviewed by Alex Christensen.
* wtf/cocoa/SoftLinking.h:
(SOFT_LINK_VARIABLE_FOR_HEADER):
(SOFT_LINK_VARIABLE_FOR_SOURCE):
- Add macros for non-constant global variables.
2018-10-30 Alexey Proskuryakov <ap@apple.com>
Clean up some obsolete MAX_ALLOWED macros
https://bugs.webkit.org/show_bug.cgi?id=190916
Reviewed by Tim Horton.
* WTF.xcodeproj/project.pbxproj:
* wtf/PlatformMac.cmake:
* wtf/spi/cocoa/NSMapTableSPI.h: Removed. This was only needed for old SDKs.
2018-10-29 Mark Lam <mark.lam@apple.com>
Correctly detect string overflow when using the 'Function' constructor.
https://bugs.webkit.org/show_bug.cgi?id=184883
<rdar://problem/36320331>
Reviewed by Saam Barati.
1. Enhanced StringBuilder so that it supports 2 modes of behavior:
a. StringBuilder::OverflowHandler::CrashOnOverflow.
b. StringBuilder::OverflowHandler::RecordOverflow.
CrashOnOverflow will crash the moment an overflow or failure to allocate
memory is detected.
RecordOverflow will make StringBuilder::hasOverflowed() return true when an
overflow or failure to allocate memory is detected. However, if the user
invokes toString(), toStringPreserveCapacity(), toAtomicString(), length(),
capacity(), isEmpty(), characters8(), or characters16(), then the StringBuilder
will crash regardless because these methods can only meaningfully do their
work and return a result if and only if the builder has not overflowed.
By default, the StringBuilder crashes on overflow (the old behavior) unless it
is explicitly constructed with the StringBuilder::OverflowHandler::RecordOverflow
enum.
Design note:
The StringBuilder can only be put in 1 of the 2 modes at the time of
construction. This means that we could have implemented it as a template
that is parameterized on an OverflowHandler class (like CheckedArithmetic)
instead of using a runtime check in the ConditionalCrashOnOverflow handler.
However, I was not able to get clang to export the explicitly instantiated
instances (despite the methods having being decorated with WTF_EXPORT_PRIVATE).
Since the StringBuilder is a transient object (not stored for a long time on
the heap), and the runtime check of the boolean is not that costly compared
to other work that StringBuilder routinely does (e.g. memcpy), using the
new ConditionalCrashOnOverflow (which does a runtime check to determine to
crash or not on overflow) is fine.
When clang is able to export explicitly instantiated template methods, we can
templatize StringBuilder and do away with ConditionalCrashOnOverflow.
See https://bugs.webkit.org/show_bug.cgi?id=191050.
To support the above, we also did:
2. Enhanced all StringBuilder append and buffer allocation methods to be able to
fail without crashing. This also meant that ...
3. Added tryReallocate() support to StringImpl. tryRealloc() was added to
FastMalloc, and bmalloc (and related peers) to enable this.
4. Added ConditionalCrashOnOverflow, which can choose at runtime whether to behave
like CrashOnOverflow or RecordOverflow.
* wtf/CheckedArithmetic.h:
(WTF::ConditionalCrashOnOverflow::overflowed):
(WTF::ConditionalCrashOnOverflow::shouldCrashOnOverflow const):
(WTF::ConditionalCrashOnOverflow::setShouldCrashOnOverflow):
(WTF::ConditionalCrashOnOverflow::hasOverflowed const):
(WTF::ConditionalCrashOnOverflow::clearOverflow):
(WTF::ConditionalCrashOnOverflow::crash):
(WTF::RecordOverflow::overflowed):
(WTF::Checked::unsafeGet const):
* wtf/FastMalloc.cpp:
(WTF::tryFastRealloc):
* wtf/FastMalloc.h:
* wtf/text/StringBuilder.cpp:
(WTF::expandedCapacity):
(WTF::StringBuilder::reifyString const):
(WTF::StringBuilder::resize):
(WTF::StringBuilder::allocateBuffer):
(WTF::StringBuilder::allocateBufferUpConvert):
(WTF::StringBuilder::reallocateBuffer<LChar>):
(WTF::StringBuilder::reallocateBuffer<UChar>):
(WTF::StringBuilder::reserveCapacity):
(WTF::StringBuilder::appendUninitialized):
(WTF::StringBuilder::appendUninitializedSlow):
(WTF::StringBuilder::append):
(WTF::StringBuilder::canShrink const):
(WTF::StringBuilder::shrinkToFit):
* wtf/text/StringBuilder.h:
(WTF::StringBuilder::StringBuilder):
(WTF::StringBuilder::didOverflow):
(WTF::StringBuilder::hasOverflowed const):
(WTF::StringBuilder::crashesOnOverflow const):
(WTF::StringBuilder::append):
(WTF::StringBuilder::toString):
(WTF::StringBuilder::toStringPreserveCapacity const):
(WTF::StringBuilder::toAtomicString const):
(WTF::StringBuilder::length const):
(WTF::StringBuilder::capacity const):
(WTF::StringBuilder::operator[] const):
(WTF::StringBuilder::swap):
(WTF::StringBuilder::getBufferCharacters<UChar>):
* wtf/text/StringBuilderJSON.cpp:
(WTF::StringBuilder::appendQuotedJSONString):
* wtf/text/StringImpl.cpp:
(WTF::StringImpl::reallocateInternal):
(WTF::StringImpl::reallocate):
(WTF::StringImpl::tryReallocate):
* wtf/text/StringImpl.h:
2018-10-29 Tim Horton <timothy_horton@apple.com>
Modernize WebKit nibs and lprojs for localization's sake
https://bugs.webkit.org/show_bug.cgi?id=190911
<rdar://problem/45349466>
Reviewed by Dan Bernstein.
* WTF.xcodeproj/project.pbxproj:
English->en
2018-10-29 Tadeu Zagallo <tzagallo@apple.com>
New bytecode format for JSC
https://bugs.webkit.org/show_bug.cgi?id=187373
<rdar://problem/44186758>
Reviewed by Filip Pizlo.
* wtf/Forward.h: Fix WTF_LAZY_FOR_EACH_TERM on MSVC and add WTF_LAZY_HAS_REST to check whether
a macro was passed multiple arguments
* wtf/Platform.h: Force ENABLE_JIT=false on all 32-bit platforms
* wtf/Vector.h:
(WTF::minCapacity>::insertVector): Allow vectors with different overflow handlers to be passed to insertVector
2018-10-28 Geoffrey Garen <ggaren@apple.com>
HashMap should support selecting a random entry
https://bugs.webkit.org/show_bug.cgi?id=190814
Reviewed by Ryosuke Niwa.
* wtf/HashTable.h:
(WTF::HashTable::random):
(WTF::HashTable::random const): Merge the empty and deleted checks, and
use more idiomatic addressing.
2018-10-26 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r237479 and r237484.
https://bugs.webkit.org/show_bug.cgi?id=190978
broke JSC on iOS (Requested by tadeuzagallo on #webkit).
Reverted changesets:
"New bytecode format for JSC"
https://bugs.webkit.org/show_bug.cgi?id=187373
https://trac.webkit.org/changeset/237479
"Gardening: Build fix after r237479."
https://bugs.webkit.org/show_bug.cgi?id=187373
https://trac.webkit.org/changeset/237484
2018-10-26 Tadeu Zagallo <tzagallo@apple.com>
New bytecode format for JSC
https://bugs.webkit.org/show_bug.cgi?id=187373
<rdar://problem/44186758>
Reviewed by Filip Pizlo.
* wtf/Forward.h: Fix WTF_LAZY_FOR_EACH_TERM on MSVC and add WTF_LAZY_HAS_REST to check whether
a macro was passed multiple arguments
* wtf/Platform.h: Force ENABLE_JIT=false on all 32-bit platforms
* wtf/Vector.h:
(WTF::minCapacity>::insertVector): Allow vectors with different overflow handlers to be passed to insertVector
2018-10-26 Geoffrey Garen <ggaren@apple.com>
HashMap should support selecting a random entry
https://bugs.webkit.org/show_bug.cgi?id=190814
Reviewed by Antti Koivisto.
* wtf/HashTable.h:
(WTF::HashTable::random):
(WTF::HashTable::random const): Draw a new random bucket any time we
have a miss, to avoid bias caused by lopsided tables.
2018-10-26 Antti Koivisto <antti@apple.com>
hashSet.remove(hashSet.random()) doesn't build
https://bugs.webkit.org/show_bug.cgi?id=190953
Reviewed by Chris Dumez.
* wtf/HashSet.h:
Remove non-const random(). HashSet only returns const iterators (it is immutable via iterator).
* wtf/HashTable.h:
(WTF::HashTable::random const):
Invoke const_iterator() by using static_cast<> instead of trying to do it directly.
2018-10-26 Alicia Boya García <aboya@igalia.com>
[MSE][WTF][Media] Invalid MediaTime should be falsy
https://bugs.webkit.org/show_bug.cgi?id=190893
Reviewed by Jer Noble.
This patch modifies the definition of MediaTime so that invalid times
are evaluated to false in the context of a boolean expression.
* wtf/MediaTime.cpp:
(WTF::MediaTime::operator! const):
(WTF::MediaTime::operator bool const):
2018-10-26 Keith Miller <keith_miller@apple.com>
Some internal projects include wtf headers and build with C++11
https://bugs.webkit.org/show_bug.cgi?id=190791
Reviewed by Alexey Proskuryakov.
C++11 doesn't support constexpr functions that contain
statements. This patch removes getLSBSet set from builds before
C++14 to avoid this for now.
* wtf/MathExtras.h:
(getLSBSet):
2018-10-25 Ross Kirsling <ross.kirsling@sony.com>
Cleanup: inline constexpr is redundant as constexpr implies inline
https://bugs.webkit.org/show_bug.cgi?id=190819
Reviewed by Mark Lam.
* wtf/Bitmap.h:
(WTF::WordType>::Bitmap):
* wtf/LEBDecoder.h:
(WTF::LEBDecoder::maxByteLength):
* wtf/MathExtras.h:
(defaultMinimumForClamp):
(defaultMaximumForClamp):
(clampToAccepting64):
(isLessThan):
(isLessThanEqual):
(isGreaterThan):
(isGreaterThanEqual):
(WTF::roundUpToPowerOfTwo):
(WTF::maskForSize):
* wtf/Optional.h:
* wtf/PtrTag.h:
(WTF::tagCodePtr):
(WTF::untagCodePtr):
(WTF::retagCodePtr):
(WTF::removeCodePtrTag):
* wtf/StdLibExtras.h:
(WTF::roundUpToMultipleOf):
* wtf/Variant.h:
(WTF::operator==):
(WTF::operator!=):
(WTF::operator>=):
(WTF::operator<=):
(WTF::operator>):
(WTF::operator<):
* wtf/text/StringImpl.h:
(WTF::StringImplShape::StringImplShape):
(WTF::StringImpl::StaticStringImpl::StaticStringImpl):
2018-10-25 Geoffrey Garen <ggaren@apple.com>
HashMap should support selecting a random entry
https://bugs.webkit.org/show_bug.cgi?id=190814
Reviewed by Antti Koivisto.
In some cases, remove(begin()) is not quite good enough as a random
eviction strategy. (See https://bugs.webkit.org/show_bug.cgi?id=190792.)
So, let's support real random eviction.
(And by "real" I mean "pseudo".)
* wtf/HashCountedSet.h:
* wtf/HashMap.h:
* wtf/HashSet.h:
* wtf/ListHashSet.h:
(WTF::ListHashSet::random):
(WTF::ListHashSet::random const):
* wtf/LoggingHashMap.h:
* wtf/LoggingHashSet.h: Plumb through the random() iterator.
* wtf/HashTable.h:
(WTF::HashTable::random):
(WTF::HashTable::random const): Implement the random() iterator.
makeIterator() already supports starting from any bucket, so this is
pretty easy.
In the subtle case where we select end(), we choose to wrap around and
return begin(). We expect that clients don't really think of the end()
bucket as being in the domain of the random search. Also, we don't want
to annoy clients who know their tables are non-empty with needless
checks for end().
* wtf/RandomNumber.cpp:
(WTF::weakRandomUint32):
* wtf/RandomNumber.h: Added a free function for weak random numbers so
that clients that want cheap random numbers aren't required to allocate
storage for a WeakRandom generator.
2018-10-24 Megan Gardner <megan_gardner@apple.com>
Turn on Conic Gradients
https://bugs.webkit.org/show_bug.cgi?id=190810
Reviewed by Tim Horton.
* wtf/FeatureDefines.h:
2018-10-24 Christopher Reid <chris.reid@sony.com>
[Win] Add function call name information to stack traces
https://bugs.webkit.org/show_bug.cgi?id=190761
Reviewed by Fujii Hironori.
Add symbol information to stack traces using dbghelp.dll
This library will use symbols files from these sources:
- The current working directory
- The directory containing the application's executable
- _NT_SYMBOL_PATH environment variable
- _NT_ALTERNATE_SYMBOL_PATH environment variable
This functionality is currently only enabled in debug mode since dbghelp is not threadsafe.
The DbgHelper class attempts to synchronize calls to dbghelp.dll but external code
can still attempt to call the library at the same time as WebKit.
* wtf/CMakeLists.txt:
* wtf/PlatformWin.cmake:
* wtf/StackTrace.cpp:
* wtf/win/DbgHelperWin.cpp: Added.
* wtf/win/DbgHelperWin.h: Added.
2018-10-22 Alexey Proskuryakov <ap@apple.com>
Really prevent PLATFORM(IOS) from being used
https://bugs.webkit.org/show_bug.cgi?id=190813
Reviewed by Tim Horton.
* wtf/Platform.h: This relies on -Wundef, which we have enabled.
2018-10-22 Chris Dumez <cdumez@apple.com>
Deque's contains() and findIf() should be const
https://bugs.webkit.org/show_bug.cgi?id=190796
Reviewed by Antti Koivisto.
Deque's contains() and findIf() should be const as they do not modify the container.
* wtf/Deque.h:
(WTF::inlineCapacity>::findIf):
(WTF::inlineCapacity>::findIf const):
(WTF::inlineCapacity>::contains const):
(WTF::inlineCapacity>::contains): Deleted.
2018-10-18 Alicia Boya García <aboya@igalia.com>
[Media] Use nanoseconds as MaximumTimeScale
https://bugs.webkit.org/show_bug.cgi?id=190631
1e9 is a much more useful timescale than the previous one 2^31-1.
Unlike 2^31-1, which is a prime number, nanosecond scale is pretty
common among some formats like WebM and frameworks like GStreamer
where base 10 timescale is common... and it's those big timescales the
ones that are usually scaled up to MaximumTimeScale.
Reviewed by Jer Noble.
* wtf/MediaTime.cpp:
2018-10-18 Alexey Proskuryakov <ap@apple.com>
Remove PLATFORM(IOS) for now
https://bugs.webkit.org/show_bug.cgi?id=190737
Reviewed by Tim Horton.
* wtf/Platform.h:
2018-10-18 Alexey Proskuryakov <ap@apple.com>
Switch from PLATFORM(IOS) to PLATFORM(IOS_FAMILY)
https://bugs.webkit.org/show_bug.cgi?id=190729
Reviewed by Tim Horton.
* wtf/Assertions.h:
* wtf/FeatureDefines.h:
* wtf/InlineASM.h:
* wtf/MemoryPressureHandler.cpp:
(WTF::thresholdForPolicy):
* wtf/Platform.h:
* wtf/cocoa/MemoryPressureHandlerCocoa.mm:
(WTF::MemoryPressureHandler::install):
(WTF::MemoryPressureHandler::respondToMemoryPressure):
* wtf/spi/cocoa/NSMapTableSPI.h:
* wtf/spi/darwin/XPCSPI.h:
* wtf/text/StringCommon.h:
* wtf/text/TextBreakIterator.cpp:
* wtf/text/TextBreakIterator.h:
* wtf/unicode/icu/CollatorICU.cpp:
(WTF::copyDefaultLocale):
2018-10-18 Alex Christensen <achristensen@webkit.org>
Clean up FrameLoader two-state enums
https://bugs.webkit.org/show_bug.cgi?id=190731
Reviewed by Chris Dumez.
* wtf/EnumTraits.h:
(WTF::isValidEnum):
2018-10-17 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r237208.
https://bugs.webkit.org/show_bug.cgi?id=190691
Caused the API test that was changed to failure continuously
(Requested by Truitt on #webkit).
Reverted changeset:
"[Media] Use nanoseconds as MaximumTimeScale"
https://bugs.webkit.org/show_bug.cgi?id=190631
https://trac.webkit.org/changeset/237208
2018-10-16 Alicia Boya García <aboya@igalia.com>
[Media] Use nanoseconds as MaximumTimeScale
https://bugs.webkit.org/show_bug.cgi?id=190631
1e9 is a much more useful timescale than the previous one 2^31-1.
Unlike 2^31-1, which is a prime number, nanosecond scale is pretty
common among some formats like WebM and frameworks like GStreamer
where base 10 timescale is common... and it's those big timescales the
ones that are usually scaled up to MaximumTimeScale.
Reviewed by Jer Noble.
* wtf/MediaTime.cpp:
2018-10-15 Keith Miller <keith_miller@apple.com>
Support arm64 CPUs with a 32-bit address space
https://bugs.webkit.org/show_bug.cgi?id=190273
Reviewed by Michael Saboff.
Use WTF_CPU_ADDRESS64/32 to decide if the system is running on arm64_32.
* wtf/MathExtras.h:
(getLSBSet):
* wtf/Platform.h:
2018-10-15 Timothy Hatcher <timothy@apple.com>
Add support for prefers-color-scheme media query
https://bugs.webkit.org/show_bug.cgi?id=190499
rdar://problem/45212025
Reviewed by Dean Jackson.
* wtf/FeatureDefines.h: Added ENABLE_DARK_MODE_CSS.
2018-10-15 Saam barati <sbarati@apple.com>
Emit fjcvtzs on ARM64E on Darwin
https://bugs.webkit.org/show_bug.cgi?id=184023
Reviewed by Yusuke Suzuki and Filip Pizlo.
* wtf/Platform.h:
2018-10-15 Alex Christensen <achristensen@webkit.org>
Use pragma once in WTF
https://bugs.webkit.org/show_bug.cgi?id=190527
Reviewed by Chris Dumez.
We also need to consistently include wtf headers from within wtf so we can build wtf without
symbol redefinition errors from including the copy in Source and the copy in the build directory.
* wtf/ASCIICType.h:
* wtf/Assertions.cpp:
* wtf/Assertions.h:
* wtf/Atomics.h:
* wtf/AutomaticThread.cpp:
* wtf/AutomaticThread.h:
* wtf/BackwardsGraph.h:
* wtf/Bag.h:
* wtf/BagToHashMap.h:
* wtf/BitVector.cpp:
* wtf/BitVector.h:
* wtf/Bitmap.h:
* wtf/BloomFilter.h:
* wtf/Box.h:
* wtf/BubbleSort.h:
* wtf/BumpPointerAllocator.h:
* wtf/ByteOrder.h:
* wtf/CPUTime.cpp:
* wtf/CallbackAggregator.h:
* wtf/CheckedArithmetic.h:
* wtf/CheckedBoolean.h:
* wtf/ClockType.cpp:
* wtf/ClockType.h:
* wtf/CommaPrinter.h:
* wtf/CompilationThread.cpp:
* wtf/CompilationThread.h:
* wtf/Compiler.h:
* wtf/ConcurrentPtrHashSet.cpp:
* wtf/ConcurrentVector.h:
* wtf/Condition.h:
* wtf/CountingLock.cpp:
* wtf/CrossThreadTaskHandler.cpp:
* wtf/CryptographicUtilities.cpp:
* wtf/CryptographicUtilities.h:
* wtf/CryptographicallyRandomNumber.cpp:
* wtf/CryptographicallyRandomNumber.h:
* wtf/CurrentTime.cpp:
* wtf/DataLog.cpp:
* wtf/DataLog.h:
* wtf/DateMath.cpp:
* wtf/DateMath.h:
* wtf/DecimalNumber.cpp:
* wtf/DecimalNumber.h:
* wtf/Deque.h:
* wtf/DisallowCType.h:
* wtf/Dominators.h:
* wtf/DoublyLinkedList.h:
* wtf/FastBitVector.cpp:
* wtf/FastMalloc.cpp:
* wtf/FastMalloc.h:
* wtf/FeatureDefines.h:
* wtf/FilePrintStream.cpp:
* wtf/FilePrintStream.h:
* wtf/FlipBytes.h:
* wtf/FunctionDispatcher.cpp:
* wtf/FunctionDispatcher.h:
* wtf/GetPtr.h:
* wtf/Gigacage.cpp:
* wtf/GlobalVersion.cpp:
* wtf/GraphNodeWorklist.h:
* wtf/GregorianDateTime.cpp:
* wtf/GregorianDateTime.h:
* wtf/HashFunctions.h:
* wtf/HashMap.h:
* wtf/HashMethod.h:
* wtf/HashSet.h:
* wtf/HashTable.cpp:
* wtf/HashTraits.h:
* wtf/Indenter.h:
* wtf/IndexSparseSet.h:
* wtf/InlineASM.h:
* wtf/Insertion.h:
* wtf/IteratorAdaptors.h:
* wtf/IteratorRange.h:
* wtf/JSONValues.cpp:
* wtf/JSValueMalloc.cpp:
* wtf/LEBDecoder.h:
* wtf/Language.cpp:
* wtf/ListDump.h:
* wtf/Lock.cpp:
* wtf/Lock.h:
* wtf/LockAlgorithm.h:
* wtf/LockedPrintStream.cpp:
* wtf/Locker.h:
* wtf/MD5.cpp:
* wtf/MD5.h:
* wtf/MainThread.cpp:
* wtf/MainThread.h:
* wtf/MallocPtr.h:
* wtf/MathExtras.h:
* wtf/MediaTime.cpp:
* wtf/MediaTime.h:
* wtf/MemoryPressureHandler.cpp:
* wtf/MessageQueue.h:
* wtf/MetaAllocator.cpp:
* wtf/MetaAllocator.h:
* wtf/MetaAllocatorHandle.h:
* wtf/MonotonicTime.cpp:
* wtf/MonotonicTime.h:
* wtf/NakedPtr.h:
* wtf/NoLock.h:
* wtf/NoTailCalls.h:
* wtf/Noncopyable.h:
* wtf/NumberOfCores.cpp:
* wtf/NumberOfCores.h:
* wtf/OSAllocator.h:
* wtf/OSAllocatorPosix.cpp:
* wtf/OSRandomSource.cpp:
* wtf/OSRandomSource.h:
* wtf/ObjcRuntimeExtras.h:
* wtf/OrderMaker.h:
* wtf/PackedIntVector.h:
* wtf/PageAllocation.h:
* wtf/PageBlock.cpp:
* wtf/PageBlock.h:
* wtf/PageReservation.h:
* wtf/ParallelHelperPool.cpp:
* wtf/ParallelHelperPool.h:
* wtf/ParallelJobs.h:
* wtf/ParallelJobsLibdispatch.h:
* wtf/ParallelVectorIterator.h:
* wtf/ParkingLot.cpp:
* wtf/ParkingLot.h:
* wtf/Platform.h:
* wtf/PointerComparison.h:
* wtf/Poisoned.cpp:
* wtf/PrintStream.cpp:
* wtf/PrintStream.h:
* wtf/ProcessID.h:
* wtf/ProcessPrivilege.cpp:
* wtf/RAMSize.cpp:
* wtf/RAMSize.h:
* wtf/RandomDevice.cpp:
* wtf/RandomNumber.cpp:
* wtf/RandomNumber.h:
* wtf/RandomNumberSeed.h:
* wtf/RangeSet.h:
* wtf/RawPointer.h:
* wtf/ReadWriteLock.cpp:
* wtf/RedBlackTree.h:
* wtf/Ref.h:
* wtf/RefCountedArray.h:
* wtf/RefCountedLeakCounter.cpp:
* wtf/RefCountedLeakCounter.h:
* wtf/RefCounter.h:
* wtf/RefPtr.h:
* wtf/RetainPtr.h:
* wtf/RunLoop.cpp:
* wtf/RunLoop.h:
* wtf/RunLoopTimer.h:
* wtf/RunLoopTimerCF.cpp:
* wtf/SHA1.cpp:
* wtf/SHA1.h:
* wtf/SaturatedArithmetic.h:
(saturatedSubtraction):
* wtf/SchedulePair.h:
* wtf/SchedulePairCF.cpp:
* wtf/SchedulePairMac.mm:
* wtf/ScopedLambda.h:
* wtf/Seconds.cpp:
* wtf/Seconds.h:
* wtf/SegmentedVector.h:
* wtf/SentinelLinkedList.h:
* wtf/SharedTask.h:
* wtf/SimpleStats.h:
* wtf/SingleRootGraph.h:
* wtf/SinglyLinkedList.h:
* wtf/SixCharacterHash.cpp:
* wtf/SixCharacterHash.h:
* wtf/SmallPtrSet.h:
* wtf/Spectrum.h:
* wtf/StackBounds.cpp:
* wtf/StackBounds.h:
* wtf/StackStats.cpp:
* wtf/StackStats.h:
* wtf/StackTrace.cpp:
* wtf/StdLibExtras.h:
* wtf/StreamBuffer.h:
* wtf/StringHashDumpContext.h:
* wtf/StringPrintStream.cpp:
* wtf/StringPrintStream.h:
* wtf/ThreadGroup.cpp:
* wtf/ThreadMessage.cpp:
* wtf/ThreadSpecific.h:
* wtf/Threading.cpp:
* wtf/Threading.h:
* wtf/ThreadingPrimitives.h:
* wtf/ThreadingPthreads.cpp:
* wtf/TimeWithDynamicClockType.cpp:
* wtf/TimeWithDynamicClockType.h:
* wtf/TimingScope.cpp:
* wtf/TinyLRUCache.h:
* wtf/TinyPtrSet.h:
* wtf/TriState.h:
* wtf/TypeCasts.h:
* wtf/UUID.cpp:
* wtf/UnionFind.h:
* wtf/VMTags.h:
* wtf/ValueCheck.h:
* wtf/Vector.h:
* wtf/VectorTraits.h:
* wtf/WallTime.cpp:
* wtf/WallTime.h:
* wtf/WeakPtr.h:
* wtf/WeakRandom.h:
* wtf/WordLock.cpp:
* wtf/WordLock.h:
* wtf/WorkQueue.cpp:
* wtf/WorkQueue.h:
* wtf/WorkerPool.cpp:
* wtf/cf/LanguageCF.cpp:
* wtf/cf/RunLoopCF.cpp:
* wtf/cocoa/Entitlements.mm:
* wtf/cocoa/MachSendRight.cpp:
* wtf/cocoa/MainThreadCocoa.mm:
* wtf/cocoa/MemoryFootprintCocoa.cpp:
* wtf/cocoa/WorkQueueCocoa.cpp:
* wtf/dtoa.cpp:
* wtf/dtoa.h:
* wtf/ios/WebCoreThread.cpp:
* wtf/ios/WebCoreThread.h:
* wtf/mac/AppKitCompatibilityDeclarations.h:
* wtf/mac/DeprecatedSymbolsUsedBySafari.mm:
* wtf/mbmalloc.cpp:
* wtf/persistence/PersistentCoders.cpp:
* wtf/persistence/PersistentDecoder.cpp:
* wtf/persistence/PersistentEncoder.cpp:
* wtf/spi/cf/CFBundleSPI.h:
* wtf/spi/darwin/CommonCryptoSPI.h:
* wtf/text/ASCIIFastPath.h:
* wtf/text/ASCIILiteral.cpp:
* wtf/text/AtomicString.cpp:
* wtf/text/AtomicString.h:
* wtf/text/AtomicStringHash.h:
* wtf/text/AtomicStringImpl.cpp:
* wtf/text/AtomicStringImpl.h:
* wtf/text/AtomicStringTable.cpp:
* wtf/text/AtomicStringTable.h:
* wtf/text/Base64.cpp:
* wtf/text/CString.cpp:
* wtf/text/CString.h:
* wtf/text/ConversionMode.h:
* wtf/text/ExternalStringImpl.cpp:
* wtf/text/IntegerToStringConversion.h:
* wtf/text/LChar.h:
* wtf/text/LineEnding.cpp:
* wtf/text/StringBuffer.h:
* wtf/text/StringBuilder.cpp:
* wtf/text/StringBuilder.h:
* wtf/text/StringBuilderJSON.cpp:
* wtf/text/StringCommon.h:
* wtf/text/StringConcatenate.h:
* wtf/text/StringHash.h:
* wtf/text/StringImpl.cpp:
* wtf/text/StringImpl.h:
* wtf/text/StringOperators.h:
* wtf/text/StringView.cpp:
* wtf/text/StringView.h:
* wtf/text/SymbolImpl.cpp:
* wtf/text/SymbolRegistry.cpp:
* wtf/text/SymbolRegistry.h:
* wtf/text/TextBreakIterator.cpp:
* wtf/text/TextBreakIterator.h:
* wtf/text/TextBreakIteratorInternalICU.h:
* wtf/text/TextPosition.h:
* wtf/text/TextStream.cpp:
* wtf/text/UniquedStringImpl.h:
* wtf/text/WTFString.cpp:
* wtf/text/WTFString.h:
* wtf/text/cocoa/StringCocoa.mm:
* wtf/text/cocoa/StringViewCocoa.mm:
* wtf/text/cocoa/TextBreakIteratorInternalICUCocoa.cpp:
* wtf/text/icu/UTextProvider.cpp:
* wtf/text/icu/UTextProvider.h:
* wtf/text/icu/UTextProviderLatin1.cpp:
* wtf/text/icu/UTextProviderLatin1.h:
* wtf/text/icu/UTextProviderUTF16.cpp:
* wtf/text/icu/UTextProviderUTF16.h:
* wtf/threads/BinarySemaphore.cpp:
* wtf/threads/BinarySemaphore.h:
* wtf/threads/Signals.cpp:
* wtf/unicode/CharacterNames.h:
* wtf/unicode/Collator.h:
* wtf/unicode/CollatorDefault.cpp:
* wtf/unicode/UTF8.cpp:
* wtf/unicode/UTF8.h:
2018-10-12 Alex Christensen <achristensen@webkit.org>
Allow encoding of small enum classes
https://bugs.webkit.org/show_bug.cgi?id=190531
Reviewed by Tim Horton.
* wtf/Forward.h:
2018-10-11 Alexey Proskuryakov <ap@apple.com>
Add PLATFORM(IOS_FAMILY) and OS(IOS_FAMILY)
https://bugs.webkit.org/show_bug.cgi?id=190477
Reviewed by Tim Horton.
Currently, PLATFORM(IOS) and OS(IOS) are true when building for any
TARGET_OS_IPHONE target, which is quite confusing. Add a better named alternative,
as a first step towards mass replacing PLATFORM(IOS). Can't so it all at once
because of dependencies in other source repositories.
* wtf/Platform.h: Changed to the new name in this file though. Kept a few
instances that actually target iOS only, having a version check.
2018-10-11 Yusuke Suzuki <yusukesuzuki@slowstart.org>
Use currentStackPointer more
https://bugs.webkit.org/show_bug.cgi?id=190503
Reviewed by Saam Barati.
Use WTF::currentStackPointer more in WebKit to adopt ASAN detect_stack_use_after_return option.
* wtf/StackBounds.cpp:
(WTF::testStackDirection2):
(WTF::testStackDirection):
* wtf/ThreadingPthreads.cpp:
(WTF::Thread::signalHandlerSuspendResume):
(WTF::getApproximateStackPointer): Deleted.
2018-10-11 Ross Kirsling <ross.kirsling@sony.com>
[WTF] Semaphore.h conflicts with POSIX header
https://bugs.webkit.org/show_bug.cgi?id=190486
Reviewed by Yusuke Suzuki.
Rename Semaphore.h to WTFSemaphore.h to avoid conflict with POSIX semaphore.h on case-insensitive file systems.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/WTFSemaphore.h: Renamed from wtf/Semaphore.h.
2018-10-10 Mark Lam <mark.lam@apple.com>
Changes towards allowing use of the ASAN detect_stack_use_after_return option.
https://bugs.webkit.org/show_bug.cgi?id=190405
<rdar://problem/45131464>
Reviewed by Michael Saboff.
Introduce WTF::currentStackPointer() which computes its caller's stack pointer value.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/StackBounds.h:
(WTF::StackBounds::checkConsistency const):
* wtf/StackPointer.cpp: Added.
(WTF::currentStackPointer):
* wtf/StackPointer.h: Added.
2018-10-09 Mark Lam <mark.lam@apple.com>
StringTypeAdapter constructor is not properly enforcing String::MaxLength.
https://bugs.webkit.org/show_bug.cgi?id=190392
<rdar://problem/45116210>
Reviewed by Saam Barati.
Previously, the StringTypeAdapter constructor for a UChar* string was summing the
unsigned length of the source string without an overflow check. We now make that
length a size_t which removes this issue, and assert that it's within
String::MaxLength thereafter.
Also made the StringTypeAdapter constructor for a LChar* string behave in an
equivalent manner for consistency. In both cases, we'll crash in a RELEASE_ASSERT
if the source string length exceeds String::MaxLength.
* wtf/text/StringConcatenate.h:
2018-10-09 Mark Lam <mark.lam@apple.com>
Revert temporary asserts for debugging a mysterious ASAN bot crash.
https://bugs.webkit.org/show_bug.cgi?id=190396
Reviewed by Yusuke Suzuki.
* wtf/StackBounds.cpp:
(WTF::StackBounds::newThreadStackBounds):
* wtf/StackBounds.h:
(WTF::StackBounds::checkConsistency const):
2018-10-08 Aditya Keerthi <akeerthi@apple.com>
Make <input type=color> a runtime enabled (on-by-default) feature
https://bugs.webkit.org/show_bug.cgi?id=189162
Reviewed by Wenson Hsieh and Tim Horton.
* wtf/FeatureDefines.h:
2018-10-06 Mark Lam <mark.lam@apple.com>
Adding some temporary asserts with data logging to debug a mysterious ASAN bot crash.
https://bugs.webkit.org/show_bug.cgi?id=190334
<rdar://problem/45071303>
Reviewed by Yusuke Suzuki.
These assertions are needed because we can't reproduce the issue locally.
We'll remove these asserts after the needed data has been collected from the bot.
* wtf/StackBounds.cpp:
(WTF::StackBounds::newThreadStackBounds):
* wtf/StackBounds.h:
(WTF::StackBounds::checkConsistency const):
2018-10-07 Yusuke Suzuki <yusukesuzuki@slowstart.org>
Name Heap threads
https://bugs.webkit.org/show_bug.cgi?id=190337
Reviewed by Mark Lam.
Add a functionality naming threads of ParallelHelperPool.
* wtf/ParallelHelperPool.cpp:
(WTF::ParallelHelperPool::ParallelHelperPool):
* wtf/ParallelHelperPool.h:
2018-10-06 Mark Lam <mark.lam@apple.com>
Adding some temporary asserts to debug a mysterious ASAN bot crash.
https://bugs.webkit.org/show_bug.cgi?id=190331
Reviewed by Filip Pizlo.
These assertions are needed because we can't reproduce the issue locally.
We'll remove these asserts after the needed data has been collected from the bot.
* wtf/StackBounds.h:
(WTF::StackBounds::checkConsistency const):
2018-10-05 Yusuke Suzuki <yusukesuzuki@slowstart.org>
[JSC][Linux] Support Perf JITDump logging
https://bugs.webkit.org/show_bug.cgi?id=189893
Reviewed by Mark Lam.
* wtf/PageReservation.h:
(WTF::PageReservation::reserveAndCommitWithGuardPages):
2018-10-03 Dan Bernstein <mitz@apple.com>
WTF part of [Xcode] Update some build settings as recommended by Xcode 10
https://bugs.webkit.org/show_bug.cgi?id=190250
Reviewed by Alex Christensen.
* Configurations/Base.xcconfig: Enabled CLANG_WARN_COMMA, CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS,
and CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF.
* WTF.xcodeproj/project.pbxproj: Let Xcode update LastUpgradeCheck.
* wtf/MathExtras.h:
(WTF::fastLog2): Addressed newly-enabled CLANG_WARN_COMMA by splitting some comma-separated
expressions into individual statements.
2018-10-03 Mark Lam <mark.lam@apple.com>
Make string MaxLength for all WTF and JS strings consistently equal to INT_MAX.
https://bugs.webkit.org/show_bug.cgi?id=190187
<rdar://problem/42512909>
Reviewed by Michael Saboff.
* wtf/text/StringConcatenate.h:
(WTF::tryMakeStringFromAdapters):
(WTF::sumWithOverflow): Deleted.
* wtf/text/StringImpl.h:
* wtf/text/WTFString.h:
2018-10-03 Michael Catanzaro <mcatanzaro@igalia.com>
-Wunused-variable in RenderLayer::updateScrollableAreaSet
https://bugs.webkit.org/show_bug.cgi?id=190200
Reviewed by Yusuke Suzuki.
Add a new UNUSED_VARIABLE() macro. It's the same as UNUSED_PARAM(), just named differently.
* wtf/Compiler.h:
2018-10-01 Dean Jackson <dino@apple.com>
[macOS] Switching to discrete GPU should be done in the UI process
https://bugs.webkit.org/show_bug.cgi?id=189361
<rdar://problem/43949622>
Reviewed by Simon Fraser.
Define GL_SILENCE_DEPRECATION to avoid deprecation warnings for OpenGL.
* wtf/Platform.h:
2018-10-02 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r236624 and r236671.
https://bugs.webkit.org/show_bug.cgi?id=190207
The change in r236624 introduced crashes on the bots
(Requested by ryanhaddad on #webkit).
Reverted changesets:
"Refactoring: eliminate raw pointer usage in Fullscreen code"
https://bugs.webkit.org/show_bug.cgi?id=188747
https://trac.webkit.org/changeset/236624
"Unify implementation in VideoFullscreenInterfaceAVKit"
https://bugs.webkit.org/show_bug.cgi?id=190091
https://trac.webkit.org/changeset/236671
2018-10-02 Caio Lima <ticaiolima@gmail.com>
[BigInt] BigInt.proptotype.toString is broken when radix is power of 2
https://bugs.webkit.org/show_bug.cgi?id=190033
Reviewed by Yusuke Suzuki.
* wtf/MathExtras.h:
(WTF::ctz32):
2018-10-01 Andy Estes <aestes@apple.com>
[watchOS] Adopt NSURLSessionCompanionProxyPreference
https://bugs.webkit.org/show_bug.cgi?id=190177
<rdar://problem/43402114>
Reviewed by Wenson Hsieh.
* wtf/FeatureDefines.h:
2018-10-01 Koby Boyango <koby.b@mce-sys.com>
[WTF][JSCONLY] Use MainThreadWin on Windows in the JSCOnly port
https://bugs.webkit.org/show_bug.cgi?id=190121
Reviewed by Yusuke Suzuki.
This fixes JSCOnly build on Windows after r236617.
* wtf/PlatformJSCOnly.cmake:
2018-10-01 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r236647.
https://bugs.webkit.org/show_bug.cgi?id=190124
Breaking test stress/big-int-to-string.js (Requested by
caiolima_ on #webkit).
Reverted changeset:
"[BigInt] BigInt.proptotype.toString is broken when radix is
power of 2"
https://bugs.webkit.org/show_bug.cgi?id=190033
https://trac.webkit.org/changeset/236647
2018-09-30 Caio Lima <ticaiolima@gmail.com>
[BigInt] BigInt.proptotype.toString is broken when radix is power of 2
https://bugs.webkit.org/show_bug.cgi?id=190033
Reviewed by Yusuke Suzuki.
* wtf/MathExtras.h:
(WTF::ctz32):
2018-09-28 Jer Noble <jer.noble@apple.com>
Refactoring: eliminate raw pointer usage in Fullscreen code
https://bugs.webkit.org/show_bug.cgi?id=188747
<rdar://problem/43541164>
Reviewed by Alex Christensen.
* WTF.xcodeproj/project.pbxproj:
* wtf/WeakPtrContainer.h: Added.
2018-09-28 Yusuke Suzuki <yusukesuzuki@slowstart.org>
[WTF] Make isMainThread more reliable
https://bugs.webkit.org/show_bug.cgi?id=189880
Reviewed by Mark Lam.
isMainThread() relied on Thread::current(). This API becomes broken in Windows
when the Thread is about to be destroyed since TLS is already cleared. This causes
a bug since `isMainThread()` is called in Thread::didExit in Windows.
This patch makes this `isMainThread` more reliable in all the platforms. In Windows,
we use `Thread::currentID()` instead of `Thread::current()` since `Thread::currentID`
uses Win32 GetCurrentThreadId directly. In the other system, we use `pthread_main_np`
or `pthread_self` instead.
We also move `holdLock` code inside `if (shouldRemoveThreadFromThreadGroup())`. If
the other thread takes a mutex and destroyed, this `holdLock` waits forever. This problem
only happens in Windows since Windows calls TLS destructor for the main thread.
* WTF.xcodeproj/project.pbxproj:
* wtf/MainThread.cpp:
(WTF::initializeMainThread):
(): Deleted.
(WTF::isMainThread): Deleted.
(WTF::isMainThreadIfInitialized): Deleted.
* wtf/Platform.h:
* wtf/PlatformMac.cmake:
* wtf/Threading.cpp:
(WTF::Thread::didExit):
* wtf/cocoa/MainThreadCocoa.mm: Renamed from Source/WTF/wtf/mac/MainThreadMac.mm.
* wtf/generic/MainThreadGeneric.cpp:
(WTF::initializeMainThreadPlatform):
(WTF::isMainThread):
(WTF::isMainThreadIfInitialized):
* wtf/win/MainThreadWin.cpp:
(WTF::initializeMainThreadPlatform):
(WTF::isMainThread):
(WTF::isMainThreadIfInitialized):
2018-09-28 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r236605.
https://bugs.webkit.org/show_bug.cgi?id=190087
caused three API test timeouts (Requested by jernoble on
#webkit).
Reverted changeset:
"Refactoring: eliminate raw pointer usage in Fullscreen code"
https://bugs.webkit.org/show_bug.cgi?id=188747
https://trac.webkit.org/changeset/236605
2018-09-28 Brian Burg <bburg@apple.com>
Replace recently added line comments in Compiler.h
https://bugs.webkit.org/show_bug.cgi?id=190062
<rdar://problem/44838618>
Reviewed by Joseph Pecoraro.
This breaks some Apple-internal tooling. For now, work around it by
changing the comment style. On the other side, the issue will be fixed
more permanently by adopting the approach from r230213.
* wtf/Compiler.h: Use multiline comments.
2018-09-28 Jer Noble <jer.noble@apple.com>
Refactoring: eliminate raw pointer usage in Fullscreen code
https://bugs.webkit.org/show_bug.cgi?id=188747
<rdar://problem/43541164>
Reviewed by Alex Christensen.
* WTF.xcodeproj/project.pbxproj:
* wtf/WeakPtrContainer.h: Added.
2018-09-28 Koby Boyango <koby.b@mce.systems>
[WTF] Add ExternalStringImpl, a StringImpl for user controlled buffers
https://bugs.webkit.org/show_bug.cgi?id=189991
Reviewed by Yusuke Suzuki.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/text/ExternalStringImpl.cpp: Added.
* wtf/text/ExternalStringImpl.h: Added.
* wtf/text/StringImpl.cpp:
* wtf/text/StringImpl.h:
2018-09-27 Saam barati <sbarati@apple.com>
Verify the contents of AssemblerBuffer on arm64e
https://bugs.webkit.org/show_bug.cgi?id=190057
<rdar://problem/38916630>
Reviewed by Mark Lam.
* wtf/PtrTag.h:
(WTF::tagInt):
2018-09-27 Jer Noble <jer.noble@apple.com>
MediaPlayer should have mediaPlayerWaitingForKeyChanged() / bool waitingForKey() accessor
https://bugs.webkit.org/show_bug.cgi?id=189951
Reviewed by Eric Carlson.
Templated functions should take r-value references, as they have perfect type deduction for
all parameter types; references, l-value references, and r-value references in template function
parameters have special type deduction semantics.
See: <https://en.cppreference.com/w/cpp/language/reference#Forwarding_references>
Previously, const reference parameters would be copied when passed into anyOf(), and containers
of Ref<> would generate compile errors when passed into anyOf, as they cannot be copied. Now,
with r-value reference types in template parameters, a const reference is mapped to a const reference,
a non-const reference is mapped to a non-const reference, and a r-value reference is mapped to
an r-value reference.
* wtf/Algorithms.h:
(WTF::forEach):
(WTF::anyOf):
(WTF::allOf):
2018-09-25 John Wilander <wilander@apple.com>
Change from HAVE(CFNETWORK_STORAGE_PARTITIONING) to ENABLE(RESOURCE_LOAD_STATISTICS)
https://bugs.webkit.org/show_bug.cgi?id=189959
<rdar://problem/44767642>
Reviewed by Chris Dumez.
* wtf/Platform.h:
Enables RESOURCE_LOAD_STATISTICS for Cocoa platforms.
2018-09-24 Fujii Hironori <Hironori.Fujii@sony.com>
Rename WTF_COMPILER_GCC_OR_CLANG to WTF_COMPILER_GCC_COMPATIBLE
https://bugs.webkit.org/show_bug.cgi?id=189733
Reviewed by Michael Catanzaro.
Clang for Windows build enables WTF_COMPILER_CLANG and
WTF_COMPILER_MSVC, but disables WTF_COMPILER_GCC_OR_CLANG. It is
strange WTF_COMPILER_GCC_OR_CLANG is not enabled even though
WTF_COMPILER_CLANG is enabled. However, Clang for Windows imitates
MSVC, and codes for COMPILER(GCC_OR_CLANG) are for non MSVC. At
least at the moment, it is not feasible to define
WTF_COMPILER_GCC_OR_CLANG for Clang for Windows.
To solve the issue, this change renames WTF_COMPILER_GCC_OR_CLANG
to WTF_COMPILER_GCC_COMPATIBLE.
As an exception, I'd like to use IGNORE_WARNINGS_* macros even in
Clang for Windows builds.
* wtf/Assertions.cpp: Replaced COMPILER(GCC_OR_CLANG) with COMPILER(GCC_COMPATIBLE).
* wtf/Assertions.h: Ditto.
* wtf/Atomics.h: Ditto.
* wtf/CheckedArithmetic.h: Ditto.
* wtf/FastMalloc.h: Ditto.
* wtf/MathExtras.h: Ditto.
* wtf/Platform.h: Ditto.
* wtf/StdLibExtras.h: Ditto.
* wtf/Vector.h: Ditto.
* wtf/text/ASCIIFastPath.h: Ditto.
* wtf/Compiler.h: Ditto. Replaced "COMPILER(GCC_OR_CLANG)" with "COMPILER(GCC) || COMPILER(CLANG)" of IGNORE_WARNINGS_* macros.
2018-09-21 Yusuke Suzuki <yusukesuzuki@slowstart.org>
[JSC] Enable LLInt ASM interpreter on X64 and ARM64 in non JIT configuration
https://bugs.webkit.org/show_bug.cgi?id=189778
Reviewed by Keith Miller.
This patch adds ENABLE(C_LOOP) which indicates we use CLoop as the interpreter.
Previously, we used !ENABLE(JIT) for this configuration. But now, we have
a build configuration that has LLInt ASM interpreter (not CLoop) and !ENABLE(JIT).
We enable LLInt ASM interpreter for non JIT environment in X86_64 and ARM64 architectures.
And we enable ENABLE(ASSEMBLER) for non JIT environment since it offers machine register
information which is used for LLInt and SamplingProfiler.
* wtf/Platform.h:
2018-09-21 Keith Miller <keith_miller@apple.com>
Add Promise SPI
https://bugs.webkit.org/show_bug.cgi?id=189809
Reviewed by Saam Barati.
Fix issue where creating a JSContextRef off the main thread before
creating initializing the main thread would cause an assertion
failure.
* wtf/MainThread.cpp:
(WTF::isMainThreadIfInitialized):
* wtf/MainThread.h:
* wtf/mac/MainThreadMac.mm:
(WTF::isMainThreadIfInitialized):
* wtf/text/cf/StringImplCF.cpp:
(WTF::StringImpl::createCFString):
2018-09-21 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r236359.
Broke the Windows build.
Reverted changeset:
"Add Promise SPI"
https://bugs.webkit.org/show_bug.cgi?id=189809
https://trac.webkit.org/changeset/236359
2018-09-21 Keith Miller <keith_miller@apple.com>
Add Promise SPI
https://bugs.webkit.org/show_bug.cgi?id=189809
Reviewed by Saam Barati.
Fix issue where creating a JSContextRef off the main thread before
creating initializing the main thread would cause an assertion
failure.
* wtf/MainThread.cpp:
(WTF::isMainThreadIfInitialized):
* wtf/MainThread.h:
* wtf/mac/MainThreadMac.mm:
(WTF::isMainThreadIfInitialized):
* wtf/text/cf/StringImplCF.cpp:
(WTF::StringImpl::createCFString):
2018-09-20 Fujii Hironori <Hironori.Fujii@sony.com>
[Win][Clang] UNUSED_PARAM(this) causes compilation error of "cannot take the address of an rvalue of type"
https://bugs.webkit.org/show_bug.cgi?id=189732
Reviewed by Per Arne Vollan.
Clang for Windows can't compile the MSVC workaround of
UNUSED_PARAM which has been introduced for Windows CE and Visual
Studio 10. I think it's safe just to remove it.
* wtf/Compiler.h: Removed the code for COMPILER(MSVC).
2018-09-20 Alex Christensen <achristensen@webkit.org>
Unreviewed, rolling out r235976.
Broke ARM
Reverted changeset:
"Use a Variant instead of a union in CSSSelector"
https://bugs.webkit.org/show_bug.cgi?id=188559
https://trac.webkit.org/changeset/235976
2018-09-17 Yusuke Suzuki <utatane.tea@gmail.com>
[WTF] Use Semaphore and BinarySemaphore instead of dispatch_semaphore_t
https://bugs.webkit.org/show_bug.cgi?id=185339
Reviewed by Mark Lam.
This patch adds WTF::Semaphore, which is based on WTF::Lock and WTF::Condition.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/Semaphore.h: Added.
(WTF::Semaphore::Semaphore):
(WTF::Semaphore::signal):
(WTF::Semaphore::waitUntil):
(WTF::Semaphore::waitFor):
(WTF::Semaphore::wait):
* wtf/generic/WorkQueueGeneric.cpp:
(WorkQueue::platformInitialize):
* wtf/threads/BinarySemaphore.cpp:
(WTF::BinarySemaphore::waitUntil):
(WTF::BinarySemaphore::wait): Deleted.
* wtf/threads/BinarySemaphore.h:
(WTF::BinarySemaphore::waitFor):
(WTF::BinarySemaphore::wait):
Align the names of the functions to WTF::Condition.
Add BinarySemaphore::wait(), which is the same to waitUntil(WallTime::infinity()).
2018-09-17 Jer Noble <jer.noble@apple.com>
Add support for HEVC codec types in Media Capabilities
https://bugs.webkit.org/show_bug.cgi?id=189565
Reviewed by Eric Carlson.
Extract the toIntegralType template into its own header.
* wtf/CMakeLists.txt:
* wtf/text/StringConversion.h: Added.
(isCharacterAllowedInBase):
(toIntegralType):
* wtf/text/WTFString.cpp:
2018-09-17 Jer Noble <jer.noble@apple.com>
Enable USE_MEDIAREMOTE on iOS
https://bugs.webkit.org/show_bug.cgi?id=189096
Reviewed by Eric Carlson.
* wtf/Platform.h:
2018-09-17 Frederic Wang <fwang@igalia.com>
Build error in ImageBufferCG when compiled with IOSurfacePool
https://bugs.webkit.org/show_bug.cgi?id=189579
Reviewed by Tim Horton.
IOSurface.h might be included with different value of IOSURFACE_CANVAS_BACKING_STORE, causing
compilation errors when files in the same unified source do not agree on the definition.
This patch moves the definition of IOSURFACE_CANVAS_BACKING_STORE from ImageBufferDataCG.h
to Platform.h so that IOSURFACE_CANVAS_BACKING_STORE is set to the same value in all files.
Finally some minors changes to explicitly declare/define ImageBuffer are performed in order
to prevent future issues with Unified build rotating.
* wtf/Platform.h: Move definition from ImageBufferDataCG.h.
2018-09-14 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r235990.
Introduced TestWebKitAPI.NowPlayingTest timeouts on iOS
Reverted changeset:
"Enable USE_MEDIAREMOTE on iOS"
https://bugs.webkit.org/show_bug.cgi?id=189096
https://trac.webkit.org/changeset/235990
2018-09-13 Jer Noble <jer.noble@apple.com>
Enable USE_MEDIAREMOTE on iOS
https://bugs.webkit.org/show_bug.cgi?id=189096
Reviewed by Eric Carlson.
* wtf/Platform.h:
2018-09-13 Alex Christensen <achristensen@webkit.org>
Use a Variant instead of a union in CSSSelector
https://bugs.webkit.org/show_bug.cgi?id=188559
Reviewed by Antti Koivisto.
* wtf/Variant.h:
Add packing macros to make it so Variant-containing structures don't always have 7 bytes of padding per Variant.
2018-09-12 Guillaume Emont <guijemont@igalia.com>
Add IGNORE_WARNING_.* macros
https://bugs.webkit.org/show_bug.cgi?id=188996
Reviewed by Michael Catanzaro.
* wtf/Assertions.cpp:
* wtf/Assertions.h:
* wtf/Compiler.h:
* wtf/MD5.cpp:
(WTF::MD5::MD5):
(WTF::MD5::addBytes):
(WTF::MD5::checksum):
* wtf/PrintStream.cpp:
(WTF::PrintStream::printfVariableFormat):
* wtf/SHA1.cpp:
(WTF::SHA1::SHA1):
(WTF::SHA1::addBytes):
(WTF::SHA1::computeHash):
* wtf/ThreadingPthreads.cpp:
* wtf/Vector.h:
(WTF::VectorBuffer::endOfBuffer):
* wtf/text/WTFString.cpp:
(WTF::createWithFormatAndArguments):
== Rolled over to ChangeLog-2018-09-11 ==