RESOLVED FIXED 82784
Rename first/second to key/value in HashMap iterators
https://bugs.webkit.org/show_bug.cgi?id=82784
Summary Rename first/second to key/value in HashMap iterators
Caio Marcelo de Oliveira Filho
Reported 2012-03-30 14:51:53 PDT
As suggested in comment https://bugs.webkit.org/show_bug.cgi?id=71063#c2 it would be better (more readable at callsites) to have 'it->key' and 'it->value' instead of 'it->first' and 'it->second'.
Attachments
Patch (599.70 KB, patch)
2012-03-30 15:56 PDT, Caio Marcelo de Oliveira Filho
no flags
Patch (606.69 KB, patch)
2012-04-02 09:02 PDT, Caio Marcelo de Oliveira Filho
no flags
Patch (606.68 KB, patch)
2012-04-02 09:08 PDT, Caio Marcelo de Oliveira Filho
no flags
Patch (610.42 KB, patch)
2012-04-02 09:49 PDT, Caio Marcelo de Oliveira Filho
no flags
Patch (617.92 KB, patch)
2012-04-25 14:31 PDT, Caio Marcelo de Oliveira Filho
no flags
Patch for the EWS, not ready for review (552.79 KB, patch)
2012-07-27 16:20 PDT, Caio Marcelo de Oliveira Filho
buildbot: commit-queue-
Patch for EWS (575.97 KB, patch)
2012-07-30 06:00 PDT, Caio Marcelo de Oliveira Filho
no flags
Patch (668.21 KB, patch)
2012-07-30 10:42 PDT, Caio Marcelo de Oliveira Filho
no flags
For EWS (681.88 KB, patch)
2012-08-27 08:57 PDT, Caio Marcelo de Oliveira Filho
no flags
Patch (685.84 KB, patch)
2012-08-27 15:13 PDT, Caio Marcelo de Oliveira Filho
no flags
Patch for landing (685.83 KB, patch)
2012-08-27 16:22 PDT, Caio Marcelo de Oliveira Filho
no flags
Patch for landing (685.79 KB, patch)
2012-08-27 16:23 PDT, Caio Marcelo de Oliveira Filho
no flags
For EWS consumption (700.36 KB, patch)
2012-09-14 14:09 PDT, Caio Marcelo de Oliveira Filho
no flags
Patch (701.54 KB, patch)
2012-09-20 12:18 PDT, Caio Marcelo de Oliveira Filho
no flags
Patch (679.00 KB, patch)
2012-10-05 14:37 PDT, Caio Marcelo de Oliveira Filho
no flags
Patch (680.21 KB, patch)
2012-10-07 14:09 PDT, Benjamin Poulain
no flags
Caio Marcelo de Oliveira Filho
Comment 1 2012-03-30 15:56:27 PDT
Caio Marcelo de Oliveira Filho
Comment 2 2012-03-30 15:59:01 PDT
Darin Adler, could you take a look at this one? The most interesting bits are in Source/WTF, in particular HashTraits.h.
WebKit Review Bot
Comment 3 2012-03-30 15:59:37 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
WebKit Review Bot
Comment 4 2012-03-30 16:01:45 PDT
Attachment 134905 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/API/JSCallbackObject..." exit_code: 1 Tools/DumpRenderTree/win/AccessibilityControllerWin.cpp:319: Use 0 instead of NULL. [readability/null] [5] Total errors found: 1 in 352 files If any of these errors are false positives, please file a bug against check-webkit-style.
Build Bot
Comment 5 2012-03-30 16:25:39 PDT
Build Bot
Comment 6 2012-03-30 17:04:23 PDT
Ryosuke Niwa
Comment 7 2012-04-02 00:32:11 PDT
The patch looks great in general but it seems like you still have to fix some builds. And I'd differ the review of traits changes to veteran WTF reviewers :)
Caio Marcelo de Oliveira Filho
Comment 8 2012-04-02 09:02:45 PDT
Caio Marcelo de Oliveira Filho
Comment 9 2012-04-02 09:08:20 PDT
Build Bot
Comment 10 2012-04-02 09:43:20 PDT
Caio Marcelo de Oliveira Filho
Comment 11 2012-04-02 09:49:29 PDT
Eric Seidel (no email)
Comment 12 2012-04-12 10:39:43 PDT
Ideally maciej/darin would take a look at this.
Maciej Stachowiak
Comment 13 2012-04-20 14:29:26 PDT
Comment on attachment 135122 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=135122&action=review > Source/WTF/ChangeLog:9 > + HashMapEntry. In HashMap the ValueType serve as "contents" of the iterators. I would suggest naming this KeyValuePair instead of HashMapEntry. It seems like in principle it could be useful in other contexts where you have a key/value pair and want better names than first/second.
Caio Marcelo de Oliveira Filho
Comment 14 2012-04-25 14:31:54 PDT
Caio Marcelo de Oliveira Filho
Comment 15 2012-04-25 14:35:28 PDT
New rebased version of the patch. I also changed HashMapEntry to KeyValuePair, but kept it defined in HashTraits.h for now. If we decided to go with it, I can create a separate file for KeyValuePair in this or a different patch
Caio Marcelo de Oliveira Filho
Comment 16 2012-07-04 11:49:09 PDT
Ping?
Ryosuke Niwa
Comment 17 2012-07-04 12:31:27 PDT
(In reply to comment #16) > Ping? You probably need to update the patch for ToT.
Caio Marcelo de Oliveira Filho
Comment 18 2012-07-05 13:23:55 PDT
Comment on attachment 138874 [details] Patch Removing r? until I upload a new rebased version.
Caio Marcelo de Oliveira Filho
Comment 19 2012-07-24 10:46:00 PDT
Created bug 92137 for the non-mechanical bits of this change. I hope that bug is more "reviewable" :-)
Caio Marcelo de Oliveira Filho
Comment 20 2012-07-27 16:20:40 PDT
Created attachment 155084 [details] Patch for the EWS, not ready for review
WebKit Review Bot
Comment 21 2012-07-27 16:24:36 PDT
Attachment 155084 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/API/JSCallbackObject..." exit_code: 1 Tools/DumpRenderTree/win/AccessibilityControllerWin.cpp:319: Use 0 instead of NULL. [readability/null] [5] Total errors found: 1 in 363 files If any of these errors are false positives, please file a bug against check-webkit-style.
Build Bot
Comment 22 2012-07-27 17:05:07 PDT
Comment on attachment 155084 [details] Patch for the EWS, not ready for review Attachment 155084 [details] did not pass mac-ews (mac): Output: http://queues.webkit.org/results/13372755
Gyuyoung Kim
Comment 23 2012-07-27 19:13:03 PDT
Comment on attachment 155084 [details] Patch for the EWS, not ready for review Attachment 155084 [details] did not pass efl-ews (efl): Output: http://queues.webkit.org/results/13381108
Gyuyoung Kim
Comment 24 2012-07-27 19:57:31 PDT
Comment on attachment 155084 [details] Patch for the EWS, not ready for review Attachment 155084 [details] did not pass efl-ews (efl): Output: http://queues.webkit.org/results/13380489
Build Bot
Comment 25 2012-07-28 02:16:40 PDT
Comment on attachment 155084 [details] Patch for the EWS, not ready for review Attachment 155084 [details] did not pass win-ews (win): Output: http://queues.webkit.org/results/13368931
Caio Marcelo de Oliveira Filho
Comment 26 2012-07-30 06:00:02 PDT
Created attachment 155275 [details] Patch for EWS
WebKit Review Bot
Comment 27 2012-07-30 06:19:47 PDT
Attachment 155275 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/API/JSCallbackObject..." exit_code: 1 Tools/DumpRenderTree/win/AccessibilityControllerWin.cpp:319: Use 0 instead of NULL. [readability/null] [5] Total errors found: 1 in 371 files If any of these errors are false positives, please file a bug against check-webkit-style.
Build Bot
Comment 28 2012-07-30 06:59:57 PDT
Comment on attachment 155275 [details] Patch for EWS Attachment 155275 [details] did not pass win-ews (win): Output: http://queues.webkit.org/results/13392340
WebKit Review Bot
Comment 29 2012-07-30 10:31:54 PDT
Comment on attachment 155275 [details] Patch for EWS Attachment 155275 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/13396337
Caio Marcelo de Oliveira Filho
Comment 30 2012-07-30 10:42:40 PDT
Caio Marcelo de Oliveira Filho
Comment 31 2012-07-30 13:58:08 PDT
Comment on attachment 155317 [details] Patch These are the mechanical changes only now, the most important thing to review is whether this API change for HashMap iterators is something we want or not.
Caio Marcelo de Oliveira Filho
Comment 32 2012-07-30 14:28:06 PDT
Maciej, ping?
Eric Seidel (no email)
Comment 33 2012-08-22 15:50:27 PDT
Comment on attachment 155317 [details] Patch LGTM.
WebKit Review Bot
Comment 34 2012-08-22 15:53:14 PDT
Comment on attachment 155317 [details] Patch Rejecting attachment 155317 [details] from commit-queue. Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2 Last 500 characters of output: ndle.cpp patching file Tools/TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionNoCache_Bundle.cpp patching file Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp Hunk #1 FAILED at 452. Hunk #2 FAILED at 467. 2 out of 2 hunks FAILED -- saving rejects to file Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp.rej Failed to run "[u'/mnt/git/webkit-commit-queue/Tools/Scripts/svn-apply', u'--force', u'--reviewer', u'Eric Seidel']" exit_code: 1 cwd: /mnt/git/webkit-commit-queue/ Full output: http://queues.webkit.org/results/13574146
Caio Marcelo de Oliveira Filho
Comment 35 2012-08-27 08:57:31 PDT
Caio Marcelo de Oliveira Filho
Comment 36 2012-08-27 08:58:25 PDT
Comment on attachment 160729 [details] For EWS Rebased patch to trunk, double checking builds with EWSs.
Build Bot
Comment 37 2012-08-27 09:36:16 PDT
Gyuyoung Kim
Comment 38 2012-08-27 10:31:05 PDT
Gyuyoung Kim
Comment 39 2012-08-27 10:35:13 PDT
Caio Marcelo de Oliveira Filho
Comment 40 2012-08-27 15:13:03 PDT
WebKit Review Bot
Comment 41 2012-08-27 16:13:54 PDT
Comment on attachment 160821 [details] Patch Rejecting attachment 160821 [details] from commit-queue. Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2 Last 500 characters of output: commit-queue/Source/WebKit/chromium/third_party/v8-i18n --revision 117 --non-interactive --force --accept theirs-conflict --ignore-externals' in '/mnt/git/webkit-commit-queue/Source/WebKit/chromium' 48>At revision 117. ________ running '/usr/bin/python tools/clang/scripts/update.py --mac-only' in '/mnt/git/webkit-commit-queue/Source/WebKit/chromium' ________ running '/usr/bin/python gyp_webkit' in '/mnt/git/webkit-commit-queue/Source/WebKit/chromium' Updating webkit projects from gyp files... Full output: http://queues.webkit.org/results/13641065
Caio Marcelo de Oliveira Filho
Comment 42 2012-08-27 16:22:11 PDT
Created attachment 160850 [details] Patch for landing
Caio Marcelo de Oliveira Filho
Comment 43 2012-08-27 16:23:32 PDT
Created attachment 160852 [details] Patch for landing
WebKit Review Bot
Comment 44 2012-08-27 17:46:10 PDT
Comment on attachment 160852 [details] Patch for landing Rejecting attachment 160852 [details] from commit-queue. Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2 Last 500 characters of output: /ChangeLog Failed to merge in the changes. Patch failed at 0001 Gardening: skipping tests due to WebCore::JSEventListener::jsFunction(WebCore::ScriptExecutionContext*) crashes. When you have resolved this problem run "git rebase --continue". If you would prefer to skip this patch, instead run "git rebase --skip". To restore the original branch and stop rebasing run "git rebase --abort". rebase refs/remotes/origin/master: command returned error: 1 Died at Tools/Scripts/update-webkit line 164. Full output: http://queues.webkit.org/results/13636116
WebKit Review Bot
Comment 45 2012-08-27 19:14:06 PDT
Comment on attachment 160852 [details] Patch for landing Clearing flags on attachment: 160852 Committed r126836: <http://trac.webkit.org/changeset/126836>
WebKit Review Bot
Comment 46 2012-08-27 19:14:14 PDT
All reviewed patches have been landed. Closing bug.
WebKit Review Bot
Comment 47 2012-08-27 19:30:01 PDT
Re-opened since this is blocked by 95163
Benjamin Poulain
Comment 48 2012-08-27 19:42:23 PDT
Looks like there are also many more hidden behind #ifdefs. Please grep for ->first, ->second, ).first, ).second and check if they come from maps or pairs.
Eric Seidel (no email)
Comment 49 2012-08-27 19:47:35 PDT
Sorry, we should have let the EWS chew on it first. My bad.
Gyuyoung Kim
Comment 50 2012-08-27 19:58:58 PDT
Comment on attachment 160852 [details] Patch for landing Attachment 160852 [details] did not pass efl-ews (efl): Output: http://queues.webkit.org/results/13651040
Caio Marcelo de Oliveira Filho
Comment 51 2012-08-27 20:09:17 PDT
This patch gets outdated too quickly, in this case a patch added code to JSC using first/second while CQ was processing it. I'll land this manually tomorrow, and double check the potential cases behind development flags.
Early Warning System Bot
Comment 52 2012-08-27 20:34:50 PDT
Comment on attachment 160852 [details] Patch for landing Attachment 160852 [details] did not pass qt-wk2-ews (qt): Output: http://queues.webkit.org/results/13646189
Early Warning System Bot
Comment 53 2012-08-27 21:30:16 PDT
Comment on attachment 160852 [details] Patch for landing Attachment 160852 [details] did not pass qt-ews (qt): Output: http://queues.webkit.org/results/13656027
Benjamin Poulain
Comment 54 2012-08-27 23:32:37 PDT
> This patch gets outdated too quickly, in this case a patch added code to JSC using first/second while CQ was processing it. > > I'll land this manually tomorrow, and double check the potential cases behind development flags. You can ping me before your land. I'll help you if the patch breaks the Mac bots again.
Caio Marcelo de Oliveira Filho
Comment 55 2012-08-28 12:42:43 PDT
Simon Fraser (smfr)
Comment 56 2012-08-28 13:28:26 PDT
How can this massive patch have been landed with zero justification described in the changelog and commit message?
WebKit Review Bot
Comment 57 2012-08-28 13:28:40 PDT
Re-opened since this is blocked by 95239
Caio Marcelo de Oliveira Filho
Comment 58 2012-09-14 08:50:16 PDT
For the record, there was a discussion in the mailing list after the rollout. http://lists.webkit.org/pipermail/webkit-dev/2012-August/022095.html
Caio Marcelo de Oliveira Filho
Comment 59 2012-09-14 14:09:41 PDT
Created attachment 164222 [details] For EWS consumption
Caio Marcelo de Oliveira Filho
Comment 60 2012-09-14 14:11:26 PDT
Chromium is expected to fail in this last patch since now there's code in chromium repo (outside WebKit) that uses WTF::HashMap.
WebKit Review Bot
Comment 61 2012-09-14 14:36:53 PDT
Comment on attachment 164222 [details] For EWS consumption Attachment 164222 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/13841908
Build Bot
Comment 62 2012-09-14 14:43:11 PDT
Comment on attachment 164222 [details] For EWS consumption Attachment 164222 [details] did not pass mac-ews (mac): Output: http://queues.webkit.org/results/13845730
Eric Seidel (no email)
Comment 63 2012-09-14 15:34:06 PDT
Comment on attachment 164222 [details] For EWS consumption View in context: https://bugs.webkit.org/attachment.cgi?id=164222&action=review > Source/WTF/wtf/HashTraits.h:209 > - // TODO: Rename these to key and value. See https://bugs.webkit.org/show_bug.cgi?id=82784. > - KeyTypeArg first; > - ValueTypeArg second; > + KeyTypeArg key; > + ValueTypeArg value; No luck with the fancy anonymous union stuff?
Caio Marcelo de Oliveira Filho
Comment 64 2012-09-14 15:44:13 PDT
Comment on attachment 164222 [details] For EWS consumption View in context: https://bugs.webkit.org/attachment.cgi?id=164222&action=review >> Source/WTF/wtf/HashTraits.h:209 >> + ValueTypeArg value; > > No luck with the fancy anonymous union stuff? It works but requires C++11 feature called "unrestricted unions". For Apple builds it is supported only in Clang >= 3.1. Since they still use a previous version, the union solution wouldn't help. The current plan is: Benjamin will help me probably next week to land this.
Peter Beverloo (cr-android ews)
Comment 65 2012-09-14 15:55:11 PDT
Comment on attachment 164222 [details] For EWS consumption Attachment 164222 [details] did not pass cr-android-ews (chromium-android): Output: http://queues.webkit.org/results/13841918
Adrienne Walker
Comment 66 2012-09-17 16:27:38 PDT
(In reply to comment #60) > Chromium is expected to fail in this last patch since now there's code in chromium repo (outside WebKit) that uses WTF::HashMap. If you add "#define WTF_NEW_HASHMAP_ITERATORS_INTERFACE 1" to your patch, Chromium should compile after http://codereview.chromium.org/10914327/ lands. Once this lands, and that revision rolls into Chromium, I'll take care of removing the #define.
Caio Marcelo de Oliveira Filho
Comment 67 2012-09-20 12:18:49 PDT
WebKit Review Bot
Comment 68 2012-09-20 13:09:46 PDT
Comment on attachment 164965 [details] Patch Attachment 164965 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/13955297
Peter Beverloo (cr-android ews)
Comment 69 2012-09-20 13:21:20 PDT
Comment on attachment 164965 [details] Patch Attachment 164965 [details] did not pass cr-android-ews (chromium-android): Output: http://queues.webkit.org/results/13975025
James Robinson
Comment 70 2012-09-20 13:29:58 PDT
http://codereview.chromium.org/10914327/ has landed but hasn't rolled into WebKit yet, so this won't compile yet. See Source/WebKit/chromium/DEPS
Benjamin Poulain
Comment 71 2012-09-23 12:53:18 PDT
(In reply to comment #70) > http://codereview.chromium.org/10914327/ has landed but hasn't rolled into WebKit yet, so this won't compile yet. See Source/WebKit/chromium/DEPS I am considering fixing this on Apple side today. Can the patch be landed as is without breaking the Google side of the Universe?
Adrienne Walker
Comment 72 2012-09-24 08:49:09 PDT
(In reply to comment #71) > (In reply to comment #70) > > http://codereview.chromium.org/10914327/ has landed but hasn't rolled into WebKit yet, so this won't compile yet. See Source/WebKit/chromium/DEPS > > I am considering fixing this on Apple side today. > Can the patch be landed as is without breaking the Google side of the Universe? The DEPS revision for Chromium has rolled past this change, so this patch should theoretically build cleanly on Chromium. Please run it by the cr-linux EWS bot first.
Benjamin Poulain
Comment 73 2012-09-24 12:03:10 PDT
> The DEPS revision for Chromium has rolled past this change, so this patch should theoretically build cleanly on Chromium. > > Please run it by the cr-linux EWS bot first. Next weekend I guess.
Caio Marcelo de Oliveira Filho
Comment 74 2012-10-05 14:37:21 PDT
WebKit Review Bot
Comment 75 2012-10-05 14:41:28 PDT
Attachment 167381 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/API/JSCallbackObject..." exit_code: 1 Source/WebCore/svg/graphics/filters/SVGFilterBuilder.h:70: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Source/JavaScriptCore/dfg/DFGStructureCheckHoistingPhase.cpp:210: When wrapping a line, only indent 4 spaces. [whitespace/indent] [3] Source/WebCore/page/SpeechInput.cpp:65: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Tools/DumpRenderTree/chromium/NotificationPresenter.cpp:92: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Source/WebCore/inspector/InspectorMemoryAgent.cpp:238: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Source/WebCore/inspector/InspectorMemoryAgent.cpp:249: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Total errors found: 6 in 400 files If any of these errors are false positives, please file a bug against check-webkit-style.
Build Bot
Comment 76 2012-10-05 15:27:47 PDT
Benjamin Poulain
Comment 77 2012-10-07 14:09:31 PDT
WebKit Review Bot
Comment 78 2012-10-07 14:24:15 PDT
Attachment 167488 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/API/JSCallbackObject..." exit_code: 1 Source/WebCore/svg/graphics/filters/SVGFilterBuilder.h:70: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Source/JavaScriptCore/dfg/DFGStructureCheckHoistingPhase.cpp:210: When wrapping a line, only indent 4 spaces. [whitespace/indent] [3] Source/WebCore/page/SpeechInput.cpp:65: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Tools/DumpRenderTree/chromium/NotificationPresenter.cpp:92: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Source/WebCore/inspector/InspectorMemoryAgent.cpp:238: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Source/WebCore/inspector/InspectorMemoryAgent.cpp:249: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Total errors found: 6 in 401 files If any of these errors are false positives, please file a bug against check-webkit-style.
Benjamin Poulain
Comment 79 2012-10-07 16:11:55 PDT
Comment on attachment 167488 [details] Patch Clearing flags on attachment: 167488 Committed r130612: <http://trac.webkit.org/changeset/130612>
Benjamin Poulain
Comment 80 2012-10-07 16:12:09 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.