RESOLVED FIXED 225435
Drop some unnecessary code in LocalStorageDatabase
https://bugs.webkit.org/show_bug.cgi?id=225435
Summary Drop some unnecessary code in LocalStorageDatabase
Sihui Liu
Reported 2021-05-05 23:25:40 PDT
...
Attachments
Patch (8.66 KB, patch)
2021-05-05 23:28 PDT, Sihui Liu
no flags
Patch (8.79 KB, patch)
2021-05-06 09:38 PDT, Sihui Liu
no flags
Sihui Liu
Comment 1 2021-05-05 23:28:38 PDT
youenn fablet
Comment 2 2021-05-06 00:37:10 PDT
Comment on attachment 427851 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=427851&action=review > Source/WebKit/NetworkProcess/WebStorage/LocalStorageDatabase.cpp:-83 > - m_tracker->didOpenDatabaseWithOrigin(m_securityOrigin); didOpenDatabaseWithOrigin callback is no longer called. It does not seem that it does much right now but maybe it will in the future? > Source/WebKit/NetworkProcess/WebStorage/LocalStorageDatabase.cpp:296 > + SQLiteFileSystem::deleteDatabaseFile(m_databasePath); Ditto here. Should we remove deleteDatabaseWithOrigin? > Source/WebKit/NetworkProcess/WebStorage/StorageArea.cpp:183 > + m_localStorageDatabase = LocalStorageDatabase::create(databasePath, m_quotaInBytes); Could use WTFMove and take a String&&
youenn fablet
Comment 3 2021-05-06 00:40:08 PDT
Might be good to provide additional details in change log as well
Chris Dumez
Comment 4 2021-05-06 08:00:51 PDT
Comment on attachment 427851 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=427851&action=review > Source/WebKit/NetworkProcess/WebStorage/LocalStorageDatabase.cpp:-151 > - transaction.rollback(); Why are we dropping this? This seems like a potential change in behavior but the ChangeLog says nothing about this. > Source/WebKit/NetworkProcess/WebStorage/StorageArea.cpp:181 > + auto* localStorageDatabaseTracker = m_localStorageNamespace->storageManager()->localStorageDatabaseTracker(); The previous code used to assume his was non-null but now you are null-checking it. Which is right?
Sihui Liu
Comment 5 2021-05-06 09:20:09 PDT
(In reply to youenn fablet from comment #2) > Comment on attachment 427851 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=427851&action=review > > > Source/WebKit/NetworkProcess/WebStorage/LocalStorageDatabase.cpp:-83 > > - m_tracker->didOpenDatabaseWithOrigin(m_securityOrigin); > > didOpenDatabaseWithOrigin callback is no longer called. > It does not seem that it does much right now but maybe it will in the future? > The function is a no-op, and LocalStorageDatabaseTracker does not have client (like the comment in LocalStorageDatabaseTracker::didOpenDatabaseWithOrigin). LocalStorageDatabaseTracker used to track all origins in memory so we had the function, but it does not any more. We may just remove that function in LocalStorageDatabaseTracker but want to limit this patch to LocalStorageDatabase. > > Source/WebKit/NetworkProcess/WebStorage/LocalStorageDatabase.cpp:296 > > + SQLiteFileSystem::deleteDatabaseFile(m_databasePath); > > Ditto here. Should we remove deleteDatabaseWithOrigin? > Since LocalStorageDatabaseTracker always traverses file folder for origins and data, I It seems Okay to untie LocalStorageDatabaseTracker and LocalStorageDatabase. > > Source/WebKit/NetworkProcess/WebStorage/StorageArea.cpp:183 > > + m_localStorageDatabase = LocalStorageDatabase::create(databasePath, m_quotaInBytes); > > Could use WTFMove and take a String&& Sure.
Sihui Liu
Comment 6 2021-05-06 09:29:12 PDT
(In reply to Chris Dumez from comment #4) > Comment on attachment 427851 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=427851&action=review > > > Source/WebKit/NetworkProcess/WebStorage/LocalStorageDatabase.cpp:-151 > > - transaction.rollback(); > > Why are we dropping this? This seems like a potential change in behavior but > the ChangeLog says nothing about this. > ~SQLiteTransaction will do the rollback. Will update changeling. > > Source/WebKit/NetworkProcess/WebStorage/StorageArea.cpp:181 > > + auto* localStorageDatabaseTracker = m_localStorageNamespace->storageManager()->localStorageDatabaseTracker(); > > The previous code used to assume his was non-null but now you are > null-checking it. Which is right? Technically it should be non-null. I just add the safe check because it returns a raw pointer; will change it back.
Sihui Liu
Comment 7 2021-05-06 09:38:42 PDT
Chris Dumez
Comment 8 2021-05-06 09:43:27 PDT
Comment on attachment 427893 [details] Patch r=me
EWS
Comment 9 2021-05-06 12:09:25 PDT
Committed r277106 (237408@main): <https://commits.webkit.org/237408@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 427893 [details].
Radar WebKit Bug Importer
Comment 10 2021-05-06 12:10:19 PDT
Note You need to log in before you can comment on or make changes to this bug.