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

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

Issue 2393313002: reflow comments in core/frame (Closed)
Patch Set: tweak Created 4 years, 2 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 {
(...skipping 27 matching lines...) Expand all
38 m_isListening = false; 38 m_isListening = false;
39 } 39 }
40 } 40 }
41 41
42 void PlatformEventDispatcher::notifyControllers() { 42 void PlatformEventDispatcher::notifyControllers() {
43 if (m_controllers.isEmpty()) 43 if (m_controllers.isEmpty())
44 return; 44 return;
45 45
46 { 46 {
47 AutoReset<bool> changeIsDispatching(&m_isDispatching, true); 47 AutoReset<bool> changeIsDispatching(&m_isDispatching, true);
48 // HashSet m_controllers can be updated during an iteration, and it stops th e iteration. 48 // HashSet m_controllers can be updated during an iteration, and it stops
49 // Thus we store it into a Vector to access all elements. 49 // the iteration. Thus we store it into a Vector to access all elements.
50 HeapVector<Member<PlatformEventController>> snapshotVector; 50 HeapVector<Member<PlatformEventController>> snapshotVector;
51 copyToVector(m_controllers, snapshotVector); 51 copyToVector(m_controllers, snapshotVector);
52 for (PlatformEventController* controller : snapshotVector) { 52 for (PlatformEventController* controller : snapshotVector) {
53 if (m_controllers.contains(controller)) 53 if (m_controllers.contains(controller))
54 controller->didUpdateData(); 54 controller->didUpdateData();
55 } 55 }
56 } 56 }
57 57
58 if (m_controllers.isEmpty()) { 58 if (m_controllers.isEmpty()) {
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/PlatformEventController.h ('k') | third_party/WebKit/Source/core/frame/RemoteFrame.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698