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
3 // found in the LICENSE file.
5 #ifndef NoEventDispatchAssertion_h
6 #define NoEventDispatchAssertion_h
8 #include "wtf/MainThread.h"
9 #include "wtf/TemporaryChange.h"
15 class NoEventDispatchAssertion {
17 NoEventDispatchAssertion()
24 ~NoEventDispatchAssertion()
32 static bool isEventDispatchForbidden()
39 // It's safe to dispatch events in SVGImage since there can't be any script
41 class AllowSVGImageEvents {
44 : m_change(s_count, 0)
48 ~AllowSVGImageEvents()
53 TemporaryChange<unsigned> m_change;
57 static unsigned s_count;
62 class NoEventDispatchAssertion {
64 NoEventDispatchAssertion() { }
66 class AllowSVGImageEvents {
68 AllowSVGImageEvents() { }
74 } // namespace WebCore
76 #endif // NoEventDispatchAssertion_h