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

Side by Side Diff: Source/platform/EventDispatchForbiddenScope.h

Issue 446063007: Rename NoEventDispatchAssertion to EventDispatchForbiddenScope and move it to platform/ (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/svg/graphics/SVGImage.cpp ('k') | Source/platform/blink_platform.gypi » ('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 #ifndef NoEventDispatchAssertion_h 5 #ifndef EventDispatchForbiddenScope_h
6 #define NoEventDispatchAssertion_h 6 #define EventDispatchForbiddenScope_h
7 7
8 #include "wtf/MainThread.h" 8 #include "wtf/MainThread.h"
9 #include "wtf/TemporaryChange.h" 9 #include "wtf/TemporaryChange.h"
10 10
11 namespace blink { 11 namespace blink {
12 12
13 #if ENABLE(ASSERT) 13 #if ENABLE(ASSERT)
14 14
15 class NoEventDispatchAssertion { 15 class EventDispatchForbiddenScope {
16 public: 16 public:
17 NoEventDispatchAssertion() 17 EventDispatchForbiddenScope()
18 { 18 {
19 if (!isMainThread()) 19 if (!isMainThread())
20 return; 20 return;
21 ++s_count; 21 ++s_count;
22 } 22 }
23 23
24 ~NoEventDispatchAssertion() 24 ~EventDispatchForbiddenScope()
25 { 25 {
26 if (!isMainThread()) 26 if (!isMainThread())
27 return; 27 return;
28 ASSERT(s_count); 28 ASSERT(s_count);
29 --s_count; 29 --s_count;
30 } 30 }
31 31
32 static bool isEventDispatchForbidden() 32 static bool isEventDispatchForbidden()
33 { 33 {
34 if (!isMainThread()) 34 if (!isMainThread())
(...skipping 15 matching lines...) Expand all
50 50
51 TemporaryChange<unsigned> m_change; 51 TemporaryChange<unsigned> m_change;
52 }; 52 };
53 53
54 private: 54 private:
55 static unsigned s_count; 55 static unsigned s_count;
56 }; 56 };
57 57
58 #else 58 #else
59 59
60 class NoEventDispatchAssertion { 60 class EventDispatchForbiddenScope {
61 public: 61 public:
62 NoEventDispatchAssertion() { } 62 EventDispatchForbiddenScope() { }
63 63
64 class AllowUserAgentEvents { 64 class AllowUserAgentEvents {
65 public: 65 public:
66 AllowUserAgentEvents() { } 66 AllowUserAgentEvents() { }
67 }; 67 };
68 }; 68 };
69 69
70 #endif // ENABLE(ASSERT) 70 #endif // ENABLE(ASSERT)
71 71
72 } // namespace blink 72 } // namespace blink
73 73
74 #endif // NoEventDispatchAssertion_h 74 #endif // EventDispatchForbiddenScope_h
OLDNEW
« no previous file with comments | « Source/core/svg/graphics/SVGImage.cpp ('k') | Source/platform/blink_platform.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698