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

Side by Side Diff: third_party/WebKit/Source/core/frame/PlatformEventDispatcher.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 // 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/PlatformEventDispatcher.h" 5 #include "core/frame/PlatformEventDispatcher.h"
6 6
7 #include "core/frame/PlatformEventController.h" 7 #include "core/frame/PlatformEventController.h"
8 #include "wtf/AutoReset.h" 8 #include "wtf/AutoReset.h"
9 9
10 namespace blink { 10 namespace blink {
11 11
12 PlatformEventDispatcher::PlatformEventDispatcher() 12 PlatformEventDispatcher::PlatformEventDispatcher()
13 : m_isDispatching(false), m_isListening(false) {} 13 : m_isDispatching(false), m_isListening(false) {}
14 14
15 void PlatformEventDispatcher::addController( 15 void PlatformEventDispatcher::addController(
16 PlatformEventController* controller) { 16 PlatformEventController* controller) {
17 ASSERT(controller); 17 ASSERT(controller);
18 // TODO: If we can avoid to register a same controller twice, we can change 18 // TODO: If we can avoid to register a same controller twice, we can change
19 // this 'if' to ASSERT. 19 // this 'if' to ASSERT.
20 if (m_controllers.contains(controller)) 20 if (m_controllers.contains(controller))
21 return; 21 return;
22 22
23 m_controllers.add(controller); 23 m_controllers.insert(controller);
24 24
25 if (!m_isListening) { 25 if (!m_isListening) {
26 startListening(); 26 startListening();
27 m_isListening = true; 27 m_isListening = true;
28 } 28 }
29 } 29 }
30 30
31 void PlatformEventDispatcher::removeController( 31 void PlatformEventDispatcher::removeController(
32 PlatformEventController* controller) { 32 PlatformEventController* controller) {
33 ASSERT(m_controllers.contains(controller)); 33 ASSERT(m_controllers.contains(controller));
(...skipping 25 matching lines...) Expand all
59 stopListening(); 59 stopListening();
60 m_isListening = false; 60 m_isListening = false;
61 } 61 }
62 } 62 }
63 63
64 DEFINE_TRACE(PlatformEventDispatcher) { 64 DEFINE_TRACE(PlatformEventDispatcher) {
65 visitor->trace(m_controllers); 65 visitor->trace(m_controllers);
66 } 66 }
67 67
68 } // namespace blink 68 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp ('k') | third_party/WebKit/Source/core/frame/SubresourceIntegrity.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698