-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace std::isnan/isinf/isfinite UB overloads for time classes with …
…member functions https://bugs.webkit.org/show_bug.cgi?id=264241 rdar://problem/117986797 Reviewed by Dan Glastonbury. Time types under WTF (MonotonicTime, etc.) add overloads of std::isnan, isinf, and isfinite, but it is generally UB to add declarations&definitions to `namespace std`: https://en.cppreference.com/w/cpp/language/extending_std Instead, these functions should be class member functions, or free functions outside of `std`. I don't believe these functions are used in generic code, so I think member functions are more appropriate here. * Source/JavaScriptCore/inspector/agents/InspectorHeapAgent.cpp: (Inspector::InspectorHeapAgent::didGarbageCollect): * Source/WTF/wtf/ApproximateTime.cpp: (WTF::ApproximateTime::approximateWallTime const): (WTF::ApproximateTime::approximateMonotonicTime const): * Source/WTF/wtf/ApproximateTime.h: (WTF::ApproximateTime::MarkableTraits::isEmptyValue): (std::isnan): Deleted. (std::isinf): Deleted. (std::isfinite): Deleted. * Source/WTF/wtf/GenericTimeMixin.h: (WTF::GenericTimeMixin::isNaN const): (WTF::GenericTimeMixin::isInfinity const): (WTF::GenericTimeMixin::isFinite const): (WTF::GenericTimeMixin::timePointFromNow): * Source/WTF/wtf/MonotonicTime.cpp: (WTF::MonotonicTime::approximateWallTime const): * Source/WTF/wtf/MonotonicTime.h: (std::isnan): Deleted. (std::isinf): Deleted. (std::isfinite): Deleted. * Source/WTF/wtf/Seconds.h: (WTF::Seconds::MarkableTraits::isEmptyValue): (std::isnan): Deleted. (std::isinf): Deleted. (std::isfinite): Deleted. * Source/WTF/wtf/Stopwatch.h: (WTF::Stopwatch::start): (WTF::Stopwatch::stop): (WTF::Stopwatch::fromMonotonicTime const): * Source/WTF/wtf/TimeWithDynamicClockType.cpp: (WTF::hasElapsed): * Source/WTF/wtf/TimeWithDynamicClockType.h: (std::isnan): Deleted. (std::isinf): Deleted. (std::isfinite): Deleted. * Source/WTF/wtf/WallTime.cpp: (WTF::WallTime::approximateMonotonicTime const): * Source/WTF/wtf/WallTime.h: (WTF::WallTime::MarkableTraits::isEmptyValue): (std::isnan): Deleted. (std::isinf): Deleted. (std::isfinite): Deleted. * Source/WTF/wtf/WorkerPool.cpp: (WTF::WorkerPool::shouldSleep): * Source/WTF/wtf/posix/ThreadingPOSIX.cpp: (WTF::ThreadCondition::timedWait): * Source/WTF/wtf/win/ThreadingWin.cpp: (WTF::absoluteTimeToWaitTimeoutInterval): * Source/WebCore/Modules/applepay/ApplePaySession.cpp: (WebCore::ApplePayDeferredPaymentRequest::validate const): * Source/WebCore/Modules/applepay/cocoa/PaymentSummaryItemsCocoa.mm: (WebCore::platformRecurringSummaryItem): (WebCore::platformDeferredSummaryItem): * Source/WebCore/bindings/IDLTypes.h: (WebCore::IDLDate::isNullValue): * Source/WebCore/bindings/js/IDBBindingUtilities.cpp: (WebCore::createIDBKeyFromValue): * Source/WebCore/fileapi/FileReader.cpp: (WebCore::FileReader::didReceiveData): * Source/WebCore/inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::finalizeFrame): * Source/WebCore/page/LocalDOMWindow.cpp: (WebCore::LocalDOMWindow::consumeLastActivationIfNecessary): * Source/WebCore/page/cocoa/ResourceUsageOverlayCocoa.mm: (WebCore::gcTimerString): * Source/WebCore/page/linux/ResourceUsageOverlayLinux.cpp: (WebCore::gcTimerString): * Source/WebCore/platform/Timer.cpp: (WebCore::TimerBase::setNextFireTime): (WebCore::TimerBase::nextUnalignedFireInterval const): * Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (CachedResourceStreamingClient::dataReceived): * Source/WebCore/platform/mediastream/cocoa/DisplayCaptureSourceCocoa.cpp: (WebCore::DisplayCaptureSourceCocoa::elapsedTime): * Source/WebCore/platform/mock/MockRealtimeAudioSource.cpp: (WebCore::MockRealtimeAudioSource::tick): * Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::elapsedTime): * Source/WebKit/Platform/IPC/Timeout.h: (IPC::Timeout::Timeout): (IPC::Timeout::isInfinity const): * Source/WebKit/Platform/cocoa/CocoaHelpers.mm: (WebKit::toAPI): * Source/WebKit/Shared/ApplePay/cocoa/DeferredPaymentRequestCocoa.mm: (WebKit::platformDeferredPaymentRequest): * Tools/TestWebKitAPI/Tests/WTF/Time.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/270366@main
- Loading branch information
Showing
33 changed files
with
55 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.