RESOLVED WONTFIX 140881
[WK2] Replace AsyncTask with C++ lambdas
https://bugs.webkit.org/show_bug.cgi?id=140881
Summary [WK2] Replace AsyncTask with C++ lambdas
Zan Dobersek
Reported 2015-01-26 01:13:31 PST
[WK2] Replace AsyncTask with C++ lambdas
Attachments
WIP (76.05 KB, patch)
2015-01-26 01:16 PST, Zan Dobersek
no flags
Patch (76.26 KB, patch)
2015-01-29 12:43 PST, Zan Dobersek
darin: review-
Zan Dobersek
Comment 1 2015-01-26 01:16:33 PST
WebKit Commit Bot
Comment 2 2015-01-26 03:48:55 PST
Attachment 245332 [details] did not pass style-queue: ERROR: Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:352: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:1349: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:1371: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:1388: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:1414: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebKit2/DatabaseProcess/DatabaseProcess.h:68: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebKit2/DatabaseProcess/DatabaseProcess.h:108: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:122: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:135: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:139: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:205: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:208: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebCore/WebCore.exp.in:0: Source/WebCore/WebCore.exp.in should be sorted, use Tools/Scripts/sort-export-file script [list/order] [5] ERROR: Source/WebCore/ChangeLog:8: You should remove the 'No new tests' and either add and list tests, or explain why no new tests were possible. [changelog/nonewtests] [5] ERROR: Source/WebKit2/DatabaseProcess/DatabaseProcess.cpp:154: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebKit2/DatabaseProcess/DatabaseProcess.cpp:171: Extra space before ( in function call [whitespace/parens] [4] Total errors found: 16 in 13 files If any of these errors are false positives, please file a bug against check-webkit-style.
Carlos Garcia Campos
Comment 3 2015-01-27 08:13:52 PST
Comment on attachment 245332 [details] WIP Is this really wip? what's missing? EWS is green for all ports.
Carlos Garcia Campos
Comment 4 2015-01-29 01:12:00 PST
Darin, Anders, what do you think about this? it makes the code simpler and more compatible with the compilers.
Zan Dobersek
Comment 5 2015-01-29 12:43:34 PST
WebKit Commit Bot
Comment 6 2015-01-29 12:46:09 PST
Attachment 245638 [details] did not pass style-queue: ERROR: Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:352: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:1349: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:1371: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:1388: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:1414: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebKit2/DatabaseProcess/DatabaseProcess.h:68: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebKit2/DatabaseProcess/DatabaseProcess.h:110: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:122: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:135: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:139: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:205: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:208: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebCore/WebCore.exp.in:0: Source/WebCore/WebCore.exp.in should be sorted, use Tools/Scripts/sort-export-file script [list/order] [5] ERROR: Source/WebKit2/DatabaseProcess/DatabaseProcess.cpp:154: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebKit2/DatabaseProcess/DatabaseProcess.cpp:171: Extra space before ( in function call [whitespace/parens] [4] Total errors found: 15 in 13 files If any of these errors are false positives, please file a bug against check-webkit-style.
Darin Adler
Comment 7 2015-01-30 22:28:15 PST
Comment on attachment 245638 [details] Patch I prefer this style; proofreading all the call sites to makes sure they are all correct is a bit of a challenge.
Carlos Garcia Campos
Comment 8 2015-02-03 01:06:07 PST
(In reply to comment #7) > Comment on attachment 245638 [details] > Patch > > I prefer this style; proofreading all the call sites to makes sure they are > all correct is a bit of a challenge. I have reviewed them and everything looks correct. Mac EWS would have caught any issue anyway, I guess.
Darin Adler
Comment 9 2015-02-07 08:03:39 PST
Comment on attachment 245638 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=245638&action=review > Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:305 > + IDBIdentifier capturedIdentifier(transactionIdentifier.isolatedCopy()); This idiom isn’t great. right now, the isolatedCopy function does nothing special. If it did, we still might have a race condition on deref like the one we have in String, so isolatedCopy might be insufficient. I’m not sure it’s all that helpful to write the code this way instead of just using straight construction; it’s not really future proof to have a function need isolatedCopy. > Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:416 > + IDBIdentifier capturedIdentifier = transactionIdentifier.isolatedCopy(); Strange that this uses "=" syntax where the other call sites use construction syntax. I don’t have a strong preference, but I do prefer consistency. > Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:650 > + IDBObjectStoreMetadata capturedMetadata(m_metadata->objectStores.get(objectStoreID).isolatedCopy()); This won’t work. We have a race condition where the main thread will deref capturedMetadata.name and the database task thread will also deref it. And String does not have a thread-safe reference count. > Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:651 > + IDBKeyData capturedKeyData(keyData.isolatedCopy()); Same problem here with capturedKeyData.stringValue.
Carlos Garcia Campos
Comment 10 2015-05-25 00:08:15 PDT
This no longer blocks #98932 , since we bumped GCC requirements in the end, but I think it would still be desirable if we manage to fix the thread-safety issues
Zan Dobersek
Comment 11 2017-09-25 01:23:40 PDT
AsyncTask doesn't exist anymore.
Note You need to log in before you can comment on or make changes to this bug.