OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
3 * Copyright (C) 2012 Google Inc. All Rights Reserved. | 3 * Copyright (C) 2012 Google Inc. All Rights Reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 17 matching lines...) Expand all Loading... |
28 #ifndef ExecutionContext_h | 28 #ifndef ExecutionContext_h |
29 #define ExecutionContext_h | 29 #define ExecutionContext_h |
30 | 30 |
31 #include "core/dom/ContextLifecycleNotifier.h" | 31 #include "core/dom/ContextLifecycleNotifier.h" |
32 #include "core/dom/ContextLifecycleObserver.h" | 32 #include "core/dom/ContextLifecycleObserver.h" |
33 #include "core/dom/SecurityContext.h" | 33 #include "core/dom/SecurityContext.h" |
34 #include "core/fetch/AccessControlStatus.h" | 34 #include "core/fetch/AccessControlStatus.h" |
35 #include "platform/Supplementable.h" | 35 #include "platform/Supplementable.h" |
36 #include "platform/heap/Handle.h" | 36 #include "platform/heap/Handle.h" |
37 #include "platform/weborigin/KURL.h" | 37 #include "platform/weborigin/KURL.h" |
| 38 #include "platform/weborigin/SecurityOrigin.h" |
38 #include "wtf/OwnPtr.h" | 39 #include "wtf/OwnPtr.h" |
39 #include "wtf/PassOwnPtr.h" | 40 #include "wtf/PassOwnPtr.h" |
40 | 41 |
41 namespace blink { | 42 namespace blink { |
42 | 43 |
43 class ActiveDOMObject; | 44 class ActiveDOMObject; |
44 class ConsoleMessage; | 45 class ConsoleMessage; |
45 class DOMTimerCoordinator; | 46 class DOMTimerCoordinator; |
46 class ErrorEvent; | 47 class ErrorEvent; |
47 class EventQueue; | 48 class EventQueue; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 | 117 |
117 // Gets the next id in a circular sequence from 1 to 2^31-1. | 118 // Gets the next id in a circular sequence from 1 to 2^31-1. |
118 int circularSequentialID(); | 119 int circularSequentialID(); |
119 | 120 |
120 virtual EventTarget* errorEventTarget() = 0; | 121 virtual EventTarget* errorEventTarget() = 0; |
121 virtual EventQueue* eventQueue() const = 0; | 122 virtual EventQueue* eventQueue() const = 0; |
122 | 123 |
123 void enforceStrictMixedContentChecking() { m_strictMixedContentCheckingEnfor
ced = true; } | 124 void enforceStrictMixedContentChecking() { m_strictMixedContentCheckingEnfor
ced = true; } |
124 bool shouldEnforceStrictMixedContentChecking() const { return m_strictMixedC
ontentCheckingEnforced; } | 125 bool shouldEnforceStrictMixedContentChecking() const { return m_strictMixedC
ontentCheckingEnforced; } |
125 | 126 |
| 127 void enforceSuborigin(const String& name); |
| 128 bool hasSuborigin() { return securityContext().securityOrigin()->hasSuborigi
n(); } |
| 129 String suboriginName() { return securityContext().securityOrigin()->suborigi
nName(); } |
| 130 |
126 // Methods related to window interaction. It should be used to manage window | 131 // Methods related to window interaction. It should be used to manage window |
127 // focusing and window creation permission for an ExecutionContext. | 132 // focusing and window creation permission for an ExecutionContext. |
128 void allowWindowInteraction(); | 133 void allowWindowInteraction(); |
129 void consumeWindowInteraction(); | 134 void consumeWindowInteraction(); |
130 bool isWindowInteractionAllowed() const; | 135 bool isWindowInteractionAllowed() const; |
131 | 136 |
132 protected: | 137 protected: |
133 ExecutionContext(); | 138 ExecutionContext(); |
134 virtual ~ExecutionContext(); | 139 virtual ~ExecutionContext(); |
135 | 140 |
(...skipping 29 matching lines...) Expand all Loading... |
165 // Counter that keeps track of how many window interaction calls are allowed | 170 // Counter that keeps track of how many window interaction calls are allowed |
166 // for this ExecutionContext. Callers are expected to call | 171 // for this ExecutionContext. Callers are expected to call |
167 // |allowWindowInteraction()| and |consumeWindowInteraction()| in order to | 172 // |allowWindowInteraction()| and |consumeWindowInteraction()| in order to |
168 // increment and decrement the counter. | 173 // increment and decrement the counter. |
169 int m_windowInteractionTokens; | 174 int m_windowInteractionTokens; |
170 }; | 175 }; |
171 | 176 |
172 } // namespace blink | 177 } // namespace blink |
173 | 178 |
174 #endif // ExecutionContext_h | 179 #endif // ExecutionContext_h |
OLD | NEW |