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

Unified Diff: Source/core/frame/PlatformEventDispatcher.cpp

Issue 1329863002: Fix flaky crashes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Early return Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/PlatformEventDispatcher.cpp
diff --git a/Source/core/frame/PlatformEventDispatcher.cpp b/Source/core/frame/PlatformEventDispatcher.cpp
index ef830041074bd43b1bae495015b1d10981c5ea2a..65909711fbfa4e1eddeeb78e780eab4a2acfb375 100644
--- a/Source/core/frame/PlatformEventDispatcher.cpp
+++ b/Source/core/frame/PlatformEventDispatcher.cpp
@@ -19,9 +19,13 @@ PlatformEventDispatcher::PlatformEventDispatcher()
void PlatformEventDispatcher::addController(PlatformEventController* controller)
{
ASSERT(controller);
- ASSERT(!m_controllers.contains(controller));
+ // TODO: If we can avoid to register a same controller twice, we can change
+ // this 'if' to ASSERT.
+ if (m_controllers.contains(controller))
+ return;
m_controllers.add(controller);
+
if (!m_isListening) {
startListening();
m_isListening = true;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698