RESOLVED FIXED 194294
Add a new DownloadMap type that manages taking an assertion automatically
https://bugs.webkit.org/show_bug.cgi?id=194294
Summary Add a new DownloadMap type that manages taking an assertion automatically
Brady Eidson
Reported 2019-02-05 10:51:20 PST
Add a new DownloadMap type that manages taking an assertion automatically This is to prevent mistakes in the future similar to https://bugs.webkit.org/show_bug.cgi?id=194239#c8
Attachments
Patch (16.07 KB, text/plain)
2019-02-05 10:53 PST, Brady Eidson
no flags
Patch (14.93 KB, patch)
2019-02-05 11:04 PST, Brady Eidson
no flags
Brady Eidson
Comment 1 2019-02-05 10:53:58 PST
Brady Eidson
Comment 2 2019-02-05 11:04:45 PST
Alex Christensen
Comment 3 2019-02-05 11:59:16 PST
Comment on attachment 361203 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=361203&action=review > Source/WebKit/NetworkProcess/Downloads/DownloadMap.h:40 > +#if !ENABLE(TAKE_DOWNLOAD_ASSERTION) > +typedef HashMap<DownloadID, std::unique_ptr<Download>> DownloadMap; > +#else > + > +class DownloadMap { I think it would be nicer to always use the DownloadMap class, and only protect the parts about assertion taking with ENABLE(TAKE_DOWNLOAD_ASSERTION)
Brady Eidson
Comment 4 2019-02-05 12:27:24 PST
(In reply to Alex Christensen from comment #3) > Comment on attachment 361203 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=361203&action=review > > > Source/WebKit/NetworkProcess/Downloads/DownloadMap.h:40 > > +#if !ENABLE(TAKE_DOWNLOAD_ASSERTION) > > +typedef HashMap<DownloadID, std::unique_ptr<Download>> DownloadMap; > > +#else > > + > > +class DownloadMap { > > I think it would be nicer to always use the DownloadMap class, and only > protect the parts about assertion taking with ENABLE(TAKE_DOWNLOAD_ASSERTION) Why? Always using it adds to size and runtime unnecessarily.
Alex Christensen
Comment 5 2019-02-05 12:28:30 PST
Comment on attachment 361203 [details] Patch That way we will be able to add functions to DownloadMap that are not in HashMap in the future. We can also cross that bridge if/when we come to it. r=me.
WebKit Commit Bot
Comment 6 2019-02-05 13:27:27 PST
Comment on attachment 361203 [details] Patch Clearing flags on attachment: 361203 Committed r240990: <https://trac.webkit.org/changeset/240990>
WebKit Commit Bot
Comment 7 2019-02-05 13:27:28 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 8 2019-02-05 13:28:30 PST
Note You need to log in before you can comment on or make changes to this bug.