OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. |
6 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 6 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
7 * (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 7 * (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
8 * Copyright (C) 2011 Andreas Kling (kling@webkit.org) | 8 * Copyright (C) 2011 Andreas Kling (kling@webkit.org) |
9 * | 9 * |
10 * Redistribution and use in source and binary forms, with or without | 10 * Redistribution and use in source and binary forms, with or without |
(...skipping 23 matching lines...) Expand all Loading... |
34 | 34 |
35 #include "core/events/EventTarget.h" | 35 #include "core/events/EventTarget.h" |
36 #include "wtf/StdLibExtras.h" | 36 #include "wtf/StdLibExtras.h" |
37 #include "wtf/Vector.h" | 37 #include "wtf/Vector.h" |
38 | 38 |
39 #if DCHECK_IS_ON() | 39 #if DCHECK_IS_ON() |
40 #include "wtf/Threading.h" | 40 #include "wtf/Threading.h" |
41 #include "wtf/ThreadingPrimitives.h" | 41 #include "wtf/ThreadingPrimitives.h" |
42 #endif | 42 #endif |
43 | 43 |
44 using namespace WTF; | |
45 | |
46 namespace blink { | 44 namespace blink { |
47 | 45 |
48 #if DCHECK_IS_ON() | 46 #if DCHECK_IS_ON() |
49 static Mutex& activeIteratorCountMutex() { | 47 static Mutex& activeIteratorCountMutex() { |
50 DEFINE_THREAD_SAFE_STATIC_LOCAL(Mutex, mutex, new Mutex()); | 48 DEFINE_THREAD_SAFE_STATIC_LOCAL(Mutex, mutex, new Mutex()); |
51 return mutex; | 49 return mutex; |
52 } | 50 } |
53 | 51 |
54 void EventListenerMap::checkNoActiveIterators() { | 52 void EventListenerMap::checkNoActiveIterators() { |
55 MutexLocker locker(activeIteratorCountMutex()); | 53 MutexLocker locker(activeIteratorCountMutex()); |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 EventListenerVector& listeners = *m_map->m_entries[m_entryIndex].second; | 244 EventListenerVector& listeners = *m_map->m_entries[m_entryIndex].second; |
247 if (m_index < listeners.size()) | 245 if (m_index < listeners.size()) |
248 return listeners[m_index++].listener(); | 246 return listeners[m_index++].listener(); |
249 m_index = 0; | 247 m_index = 0; |
250 } | 248 } |
251 | 249 |
252 return nullptr; | 250 return nullptr; |
253 } | 251 } |
254 | 252 |
255 } // namespace blink | 253 } // namespace blink |
OLD | NEW |