[webkit-reviews] review granted: [Bug 236209] REGRESSION(r286936): Crash in WebKit::OriginStorageManager::StorageBucket::deleteLocalStorageData : [Attachment 451055] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Sun Feb 6 19:43:13 PST 2022
Darin Adler <darin at apple.com> has granted Sihui Liu <sihui_liu at apple.com>'s
request for review:
Bug 236209: REGRESSION(r286936): Crash in
WebKit::OriginStorageManager::StorageBucket::deleteLocalStorageData
https://bugs.webkit.org/show_bug.cgi?id=236209
Attachment 451055: Patch
https://bugs.webkit.org/attachment.cgi?id=451055&action=review
--- Comment #2 from Darin Adler <darin at apple.com> ---
Comment on attachment 451055
--> https://bugs.webkit.org/attachment.cgi?id=451055
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=451055&action=review
> Source/WebKit/NetworkProcess/storage/OriginStorageManager.cpp:250
> - if (auto modificationTime =
FileSystem::fileModificationTime(m_localStoragePath); *modificationTime >=
time) {
> + auto modificationTime =
FileSystem::fileModificationTime(m_localStoragePath);
> + if (modificationTime && *modificationTime >= time) {
Since C++17, std::optional has a more economical way to write this. You can
just remove the "*". Also, no need for a local variable:
if (FileSystem::fileModificationTime(m_localStoragePath) >= time) {
The >= expression will evaluate to false if the optional is nullopt.
More information about the webkit-reviews
mailing list