summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/WebKit/Source/core/dom/ScriptForbiddenScope.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/WebKit/Source/core/dom/ScriptForbiddenScope.h')
-rw-r--r--chromium/third_party/WebKit/Source/core/dom/ScriptForbiddenScope.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/chromium/third_party/WebKit/Source/core/dom/ScriptForbiddenScope.h b/chromium/third_party/WebKit/Source/core/dom/ScriptForbiddenScope.h
new file mode 100644
index 00000000000..7425b6cb943
--- /dev/null
+++ b/chromium/third_party/WebKit/Source/core/dom/ScriptForbiddenScope.h
@@ -0,0 +1,47 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ScriptForbiddenScope_h
+#define ScriptForbiddenScope_h
+
+#include "wtf/Assertions.h"
+#include "wtf/TemporaryChange.h"
+
+namespace WebCore {
+
+#if ASSERT_ENABLED
+
+class ScriptForbiddenScope {
+public:
+ ScriptForbiddenScope();
+ ~ScriptForbiddenScope();
+
+ class AllowUserAgentScript {
+ public:
+ AllowUserAgentScript();
+ ~AllowUserAgentScript();
+ private:
+ TemporaryChange<unsigned> m_change;
+ };
+
+ static bool isScriptForbidden();
+};
+
+#else
+
+class ScriptForbiddenScope {
+public:
+ ScriptForbiddenScope() { }
+ class AllowUserAgentScript {
+ public:
+ AllowUserAgentScript() { }
+ };
+ static bool isScriptForbidden() { return false; }
+};
+
+#endif
+
+} // namespace WebCore
+
+#endif // ScriptForbiddenScope_h