RESOLVED FIXED 199423
Make sure to cross-thread copy in StorageManager when hopping back to the main thread
https://bugs.webkit.org/show_bug.cgi?id=199423
Summary Make sure to cross-thread copy in StorageManager when hopping back to the mai...
youenn fablet
Reported 2019-07-02 14:46:56 PDT
Make sure to cross-thread copy in StorageManager when hopping back to the main thread
Attachments
Patch (7.06 KB, patch)
2019-07-02 14:59 PDT, youenn fablet
no flags
Patch (7.05 KB, patch)
2019-07-02 15:46 PDT, youenn fablet
no flags
Patch (6.02 KB, patch)
2019-07-02 16:58 PDT, youenn fablet
no flags
youenn fablet
Comment 1 2019-07-02 14:59:20 PDT
youenn fablet
Comment 2 2019-07-02 15:46:39 PDT
Chris Dumez
Comment 3 2019-07-02 16:37:35 PDT
Comment on attachment 373367 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=373367&action=review > Source/WebKit/NetworkProcess/WebStorage/LocalStorageDatabaseTracker.cpp:132 > +Vector<LocalStorageDatabaseTracker::OriginDetails> LocalStorageDatabaseTracker::originDetailsIsolatedCopy() What's getting isolatedCopied here? It is not obvious to me from looking at the implementation.
youenn fablet
Comment 4 2019-07-02 16:43:10 PDT
Comment on attachment 373367 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=373367&action=review >> Source/WebKit/NetworkProcess/WebStorage/LocalStorageDatabaseTracker.cpp:132 >> +Vector<LocalStorageDatabaseTracker::OriginDetails> LocalStorageDatabaseTracker::originDetailsIsolatedCopy() > > What's getting isolatedCopied here? It is not obvious to me from looking at the implementation. There is nothing getting copied but I want to make it clear that this method is generating already isolated strings here. Initially, when reading the code, I thought there might be an issue and was thinking of isolating-copy at call site. Maybe another name might be better or adding an ASSERT at call site?
Chris Dumez
Comment 5 2019-07-02 16:51:49 PDT
Comment on attachment 373367 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=373367&action=review >>> Source/WebKit/NetworkProcess/WebStorage/LocalStorageDatabaseTracker.cpp:132 >>> +Vector<LocalStorageDatabaseTracker::OriginDetails> LocalStorageDatabaseTracker::originDetailsIsolatedCopy() >> >> What's getting isolatedCopied here? It is not obvious to me from looking at the implementation. > > There is nothing getting copied but I want to make it clear that this method is generating already isolated strings here. > Initially, when reading the code, I thought there might be an issue and was thinking of isolating-copy at call site. > Maybe another name might be better or adding an ASSERT at call site? Why not isolateCopy() at call site? Nothing guarantees that origin.databaseIdentifier() returns a String that is isolated. It might be safe now but no guarantee that origin.databaseIdentifier() does not get updated in the future.
youenn fablet
Comment 6 2019-07-02 16:55:35 PDT
(In reply to Chris Dumez from comment #5) > Comment on attachment 373367 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=373367&action=review > > >>> Source/WebKit/NetworkProcess/WebStorage/LocalStorageDatabaseTracker.cpp:132 > >>> +Vector<LocalStorageDatabaseTracker::OriginDetails> LocalStorageDatabaseTracker::originDetailsIsolatedCopy() > >> > >> What's getting isolatedCopied here? It is not obvious to me from looking at the implementation. > > > > There is nothing getting copied but I want to make it clear that this method is generating already isolated strings here. > > Initially, when reading the code, I thought there might be an issue and was thinking of isolating-copy at call site. > > Maybe another name might be better or adding an ASSERT at call site? > > Why not isolateCopy() at call site? Nothing guarantees that > origin.databaseIdentifier() returns a String that is isolated. It might be > safe now but no guarantee that origin.databaseIdentifier() does not get > updated in the future. Yeah, this should not be called that often so let's do it.
youenn fablet
Comment 7 2019-07-02 16:58:37 PDT
WebKit Commit Bot
Comment 8 2019-07-03 10:28:59 PDT
Comment on attachment 373372 [details] Patch Clearing flags on attachment: 373372 Committed r247092: <https://trac.webkit.org/changeset/247092>
WebKit Commit Bot
Comment 9 2019-07-03 10:29:00 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 10 2019-07-03 10:29:17 PDT
Note You need to log in before you can comment on or make changes to this bug.