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

Side by Side Diff: third_party/WebKit/Source/core/frame/EventHandlerRegistry.cpp

Issue 2796163002: Migrate WTF::HashCountedSet::add() to ::insert() (Closed)
Patch Set: Created 3 years, 8 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/frame/EventHandlerRegistry.h" 5 #include "core/frame/EventHandlerRegistry.h"
6 6
7 #include "core/events/EventListenerOptions.h" 7 #include "core/events/EventListenerOptions.h"
8 #include "core/events/EventUtil.h" 8 #include "core/events/EventUtil.h"
9 #include "core/frame/LocalDOMWindow.h" 9 #include "core/frame/LocalDOMWindow.h"
10 #include "core/frame/LocalFrame.h" 10 #include "core/frame/LocalFrame.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 checkConsistency(handlerClass); 83 checkConsistency(handlerClass);
84 return m_targets[handlerClass].size(); 84 return m_targets[handlerClass].size();
85 } 85 }
86 86
87 bool EventHandlerRegistry::updateEventHandlerTargets( 87 bool EventHandlerRegistry::updateEventHandlerTargets(
88 ChangeOperation op, 88 ChangeOperation op,
89 EventHandlerClass handlerClass, 89 EventHandlerClass handlerClass,
90 EventTarget* target) { 90 EventTarget* target) {
91 EventTargetSet* targets = &m_targets[handlerClass]; 91 EventTargetSet* targets = &m_targets[handlerClass];
92 if (op == Add) { 92 if (op == Add) {
93 if (!targets->add(target).isNewEntry) { 93 if (!targets->insert(target).isNewEntry) {
94 // Just incremented refcount, no real change. 94 // Just incremented refcount, no real change.
95 return false; 95 return false;
96 } 96 }
97 } else { 97 } else {
98 ASSERT(op == Remove || op == RemoveAll); 98 ASSERT(op == Remove || op == RemoveAll);
99 ASSERT(op == RemoveAll || targets->contains(target)); 99 ASSERT(op == RemoveAll || targets->contains(target));
100 100
101 if (op == RemoveAll) { 101 if (op == RemoveAll) {
102 if (!targets->contains(target)) 102 if (!targets->contains(target))
103 return false; 103 return false;
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 // its handlers properly. 323 // its handlers properly.
324 DCHECK(window->frame()); 324 DCHECK(window->frame());
325 DCHECK(window->frame()->page()); 325 DCHECK(window->frame()->page());
326 DCHECK(window->frame()->page() == m_page); 326 DCHECK(window->frame()->page() == m_page);
327 } 327 }
328 } 328 }
329 #endif // DCHECK_IS_ON() 329 #endif // DCHECK_IS_ON()
330 } 330 }
331 331
332 } // namespace blink 332 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/CSSSelectorWatch.cpp ('k') | third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698