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 #ifndef ScriptForbiddenScope_h | 5 #ifndef ScriptForbiddenScope_h |
6 #define ScriptForbiddenScope_h | 6 #define ScriptForbiddenScope_h |
7 | 7 |
8 #include "wtf/TemporaryChange.h" | 8 #include "wtf/TemporaryChange.h" |
9 | 9 |
10 namespace WebCore { | 10 namespace WebCore { |
11 | 11 |
12 #if ASSERT_DISABLED | 12 #if ASSERT_ENABLED |
13 | 13 |
14 class ScriptForbiddenScope { | 14 class ScriptForbiddenScope { |
15 public: | 15 public: |
16 ScriptForbiddenScope() { } | |
17 class AllowUserAgentScript { | |
18 public: | |
19 AllowUserAgentScript() { } | |
20 }; | |
21 static bool isScriptForbidden() { return false; } | |
22 }; | |
23 | |
24 #else | |
25 | |
26 class ScriptForbiddenScope { | |
27 public: | |
28 ScriptForbiddenScope(); | 16 ScriptForbiddenScope(); |
29 ~ScriptForbiddenScope(); | 17 ~ScriptForbiddenScope(); |
30 | 18 |
31 class AllowUserAgentScript { | 19 class AllowUserAgentScript { |
32 public: | 20 public: |
33 AllowUserAgentScript(); | 21 AllowUserAgentScript(); |
34 ~AllowUserAgentScript(); | 22 ~AllowUserAgentScript(); |
35 private: | 23 private: |
36 TemporaryChange<unsigned> m_change; | 24 TemporaryChange<unsigned> m_change; |
37 }; | 25 }; |
38 | 26 |
39 static bool isScriptForbidden(); | 27 static bool isScriptForbidden(); |
40 }; | 28 }; |
41 | 29 |
| 30 #else |
| 31 |
| 32 class ScriptForbiddenScope { |
| 33 public: |
| 34 ScriptForbiddenScope() { } |
| 35 class AllowUserAgentScript { |
| 36 public: |
| 37 AllowUserAgentScript() { } |
| 38 }; |
| 39 static bool isScriptForbidden() { return false; } |
| 40 }; |
| 41 |
42 #endif | 42 #endif |
43 | 43 |
44 } // namespace WebCore | 44 } // namespace WebCore |
45 | 45 |
46 #endif // ScriptForbiddenScope_h | 46 #endif // ScriptForbiddenScope_h |
OLD | NEW |