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

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

Issue 618673002: Oilpan: reliably track listening PlatformEventControllers. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Don't start updating in a stopped context Created 6 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
« no previous file with comments | « Source/core/frame/PlatformEventDispatcher.h ('k') | Source/modules/battery/BatteryManager.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "config.h" 5 #include "config.h"
6 #include "core/frame/PlatformEventDispatcher.h" 6 #include "core/frame/PlatformEventDispatcher.h"
7 7
8 #include "core/frame/PlatformEventController.h" 8 #include "core/frame/PlatformEventController.h"
9 #include "wtf/TemporaryChange.h" 9 #include "wtf/TemporaryChange.h"
10 10
(...skipping 23 matching lines...) Expand all
34 // Do not actually remove the controller from the vector, instead zero them out. 34 // Do not actually remove the controller from the vector, instead zero them out.
35 // The zeros are removed in these two cases: 35 // The zeros are removed in these two cases:
36 // 1. either immediately if we are not dispatching any events, 36 // 1. either immediately if we are not dispatching any events,
37 // 2. or after events to all controllers have dispatched (see notifyControll ers()). 37 // 2. or after events to all controllers have dispatched (see notifyControll ers()).
38 // This is to correctly handle the re-entrancy case when a controller is des troyed 38 // This is to correctly handle the re-entrancy case when a controller is des troyed
39 // while the events are still being dispatched. 39 // while the events are still being dispatched.
40 size_t index = m_controllers.find(controller); 40 size_t index = m_controllers.find(controller);
41 if (index == kNotFound) 41 if (index == kNotFound)
42 return; 42 return;
43 43
44 m_controllers[index] = 0; 44 m_controllers[index] = nullptr;
45 m_needsPurge = true; 45 m_needsPurge = true;
46 46
47 if (!m_isDispatching) 47 if (!m_isDispatching)
48 purgeControllers(); 48 purgeControllers();
49 } 49 }
50 50
51 void PlatformEventDispatcher::purgeControllers() 51 void PlatformEventDispatcher::purgeControllers()
52 { 52 {
53 ASSERT(m_needsPurge); 53 ASSERT(m_needsPurge);
54 54
(...skipping 23 matching lines...) Expand all
78 if (m_controllers[i]) 78 if (m_controllers[i])
79 m_controllers[i]->didUpdateData(); 79 m_controllers[i]->didUpdateData();
80 } 80 }
81 } 81 }
82 82
83 if (m_needsPurge) 83 if (m_needsPurge)
84 purgeControllers(); 84 purgeControllers();
85 } 85 }
86 86
87 } // namespace blink 87 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/PlatformEventDispatcher.h ('k') | Source/modules/battery/BatteryManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698