Bug 199271

Summary: Avoid using WTF::Function for passing local function pointers and closures in URLHelpers.cpp
Product: WebKit Reporter: Konstantin Tokarev <annulen>
Component: Web Template FrameworkAssignee: Konstantin Tokarev <annulen>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, cdumez, cmarcelo, darin, dbates, ews-watchlist, keith_miller, mark.lam, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Konstantin Tokarev
Reported 2019-06-27 06:29:03 PDT
WTF::Function allocates memory on heap, which is totally redundant in this case. I've also tried using ScopedLambda, however its constructor doesn't allow conversion from non-lambda functions.
Attachments
Patch (1.46 KB, patch)
2019-06-27 06:30 PDT, Konstantin Tokarev
no flags
Patch (1.48 KB, patch)
2019-06-27 11:53 PDT, Konstantin Tokarev
no flags
Konstantin Tokarev
Comment 1 2019-06-27 06:30:07 PDT
Keith Miller
Comment 2 2019-06-27 11:13:25 PDT
Comment on attachment 373026 [details] Patch Why not change ScopedLambda to allow a function pointer?
Konstantin Tokarev
Comment 3 2019-06-27 11:34:54 PDT
I thought about that, but it won't be Scoped*Lambda* anymore...
Konstantin Tokarev
Comment 4 2019-06-27 11:53:37 PDT
Konstantin Tokarev
Comment 5 2019-06-27 11:54:32 PDT
Yusuke adviced me to change it to template (to avoid indirect call in a loop)
Yusuke Suzuki
Comment 6 2019-06-27 12:14:34 PDT
Comment on attachment 373041 [details] Patch r=me
Konstantin Tokarev
Comment 7 2019-06-27 14:36:14 PDT
Comment on attachment 373041 [details] Patch Clearing flags on attachment: 373041 Committed r246906: <https://trac.webkit.org/changeset/246906>
Konstantin Tokarev
Comment 8 2019-06-27 14:36:19 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 9 2019-06-27 14:37:28 PDT
Note You need to log in before you can comment on or make changes to this bug.