Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / platform / ScriptForbiddenScope.h
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.
4
5 #ifndef ScriptForbiddenScope_h
6 #define ScriptForbiddenScope_h
7
8 #include "platform/PlatformExport.h"
9 #include "wtf/Assertions.h"
10 #include "wtf/TemporaryChange.h"
11
12 namespace blink {
13
14 class PLATFORM_EXPORT ScriptForbiddenScope {
15 public:
16     ScriptForbiddenScope();
17     ~ScriptForbiddenScope();
18
19     class PLATFORM_EXPORT AllowUserAgentScript {
20     public:
21         AllowUserAgentScript();
22         ~AllowUserAgentScript();
23     private:
24         TemporaryChange<unsigned> m_change;
25     };
26
27     static void enter();
28     static void exit();
29     static bool isScriptForbidden();
30 };
31
32 } // namespace blink
33
34 #endif // ScriptForbiddenScope_h