Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(274)

Side by Side Diff: third_party/WebKit/Source/core/page/TouchDisambiguation.cpp

Issue 2657443005: Migrate WTF::HashSet::add() to ::insert() [part 1 of N] (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 LayoutObject* layoutObject = hitResult.get()->layoutObject(); 114 LayoutObject* layoutObject = hitResult.get()->layoutObject();
115 if (!layoutObject || !hitResult.get()->willRespondToMouseClickEvents()) 115 if (!layoutObject || !hitResult.get()->willRespondToMouseClickEvents())
116 continue; 116 continue;
117 117
118 // Blacklist all of the Node's containers. 118 // Blacklist all of the Node's containers.
119 for (LayoutBlock* container = layoutObject->containingBlock(); container; 119 for (LayoutBlock* container = layoutObject->containingBlock(); container;
120 container = container->containingBlock()) { 120 container = container->containingBlock()) {
121 Node* containerNode = container->node(); 121 Node* containerNode = container->node();
122 if (!containerNode) 122 if (!containerNode)
123 continue; 123 continue;
124 if (!blackList.add(containerNode).isNewEntry) 124 if (!blackList.insert(containerNode).isNewEntry)
125 break; 125 break;
126 } 126 }
127 } 127 }
128 128
129 HeapHashMap<Member<Node>, TouchTargetData> touchTargets; 129 HeapHashMap<Member<Node>, TouchTargetData> touchTargets;
130 float bestScore = 0; 130 float bestScore = 0;
131 for (const auto& hitResult : hitResults) { 131 for (const auto& hitResult : hitResults) {
132 if (!hitResult) 132 if (!hitResult)
133 continue; 133 continue;
134 for (Node& node : NodeTraversal::inclusiveAncestorsOf(*hitResult)) { 134 for (Node& node : NodeTraversal::inclusiveAncestorsOf(*hitResult)) {
(...skipping 20 matching lines...) Expand all
155 // (we consider not really ambiguous enough) than the best candidate to 155 // (we consider not really ambiguous enough) than the best candidate to
156 // avoid excessive popups. 156 // avoid excessive popups.
157 if (touchTarget.value.score < bestScore * 0.5) 157 if (touchTarget.value.score < bestScore * 0.5)
158 continue; 158 continue;
159 goodTargets.push_back(touchTarget.value.windowBoundingBox); 159 goodTargets.push_back(touchTarget.value.windowBoundingBox);
160 highlightNodes.push_back(touchTarget.key); 160 highlightNodes.push_back(touchTarget.key);
161 } 161 }
162 } 162 }
163 163
164 } // namespace blink 164 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698