OLD | NEW |
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/dom/ScriptForbiddenScope.h" | 6 #include "core/dom/ScriptForbiddenScope.h" |
7 | 7 |
8 #include "wtf/Assertions.h" | 8 #include "wtf/Assertions.h" |
9 #include "wtf/MainThread.h" | 9 #include "wtf/MainThread.h" |
10 | 10 |
11 namespace WebCore { | 11 namespace WebCore { |
12 | 12 |
13 #if !ASSERT_DISABLED | 13 #if ASSERT_ENABLED |
14 | 14 |
15 static unsigned s_scriptForbiddenCount = 0; | 15 static unsigned s_scriptForbiddenCount = 0; |
16 | 16 |
17 ScriptForbiddenScope::ScriptForbiddenScope() | 17 ScriptForbiddenScope::ScriptForbiddenScope() |
18 { | 18 { |
19 ASSERT(isMainThread()); | 19 ASSERT(isMainThread()); |
20 ++s_scriptForbiddenCount; | 20 ++s_scriptForbiddenCount; |
21 } | 21 } |
22 | 22 |
23 ScriptForbiddenScope::~ScriptForbiddenScope() | 23 ScriptForbiddenScope::~ScriptForbiddenScope() |
(...skipping 13 matching lines...) Expand all Loading... |
37 } | 37 } |
38 | 38 |
39 ScriptForbiddenScope::AllowUserAgentScript::~AllowUserAgentScript() | 39 ScriptForbiddenScope::AllowUserAgentScript::~AllowUserAgentScript() |
40 { | 40 { |
41 ASSERT(!s_scriptForbiddenCount); | 41 ASSERT(!s_scriptForbiddenCount); |
42 } | 42 } |
43 | 43 |
44 #endif | 44 #endif |
45 | 45 |
46 } // namespace WebCore | 46 } // namespace WebCore |
OLD | NEW |