| 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 11 matching lines...) Expand all Loading... |
| 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 25 * | 25 * |
| 26 */ | 26 */ |
| 27 | 27 |
| 28 #ifndef ExecutionContext_h | 28 #ifndef ExecutionContext_h |
| 29 #define ExecutionContext_h | 29 #define ExecutionContext_h |
| 30 | 30 |
| 31 #include "core/CoreExport.h" | 31 #include "core/CoreExport.h" |
| 32 #include "core/css/CSSValuePool.h" |
| 32 #include "core/dom/ContextLifecycleNotifier.h" | 33 #include "core/dom/ContextLifecycleNotifier.h" |
| 33 #include "core/dom/ContextLifecycleObserver.h" | 34 #include "core/dom/ContextLifecycleObserver.h" |
| 34 #include "core/dom/SecurityContext.h" | 35 #include "core/dom/SecurityContext.h" |
| 35 #include "core/dom/SuspendableTask.h" | 36 #include "core/dom/SuspendableTask.h" |
| 36 #include "core/fetch/AccessControlStatus.h" | 37 #include "core/fetch/AccessControlStatus.h" |
| 37 #include "platform/Supplementable.h" | 38 #include "platform/Supplementable.h" |
| 38 #include "platform/heap/Handle.h" | 39 #include "platform/heap/Handle.h" |
| 39 #include "platform/weborigin/KURL.h" | 40 #include "platform/weborigin/KURL.h" |
| 40 #include "platform/weborigin/ReferrerPolicy.h" | 41 #include "platform/weborigin/ReferrerPolicy.h" |
| 41 #include "wtf/Deque.h" | 42 #include "wtf/Deque.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 | 150 |
| 150 // Decides whether this context is privileged, as described in | 151 // Decides whether this context is privileged, as described in |
| 151 // https://w3c.github.io/webappsec/specs/powerfulfeatures/#settings-privileg
ed. | 152 // https://w3c.github.io/webappsec/specs/powerfulfeatures/#settings-privileg
ed. |
| 152 virtual bool isSecureContext(String& errorMessage, const SecureContextCheck
= StandardSecureContextCheck) const = 0; | 153 virtual bool isSecureContext(String& errorMessage, const SecureContextCheck
= StandardSecureContextCheck) const = 0; |
| 153 virtual bool isSecureContext(const SecureContextCheck = StandardSecureContex
tCheck) const; | 154 virtual bool isSecureContext(const SecureContextCheck = StandardSecureContex
tCheck) const; |
| 154 | 155 |
| 155 virtual String outgoingReferrer() const; | 156 virtual String outgoingReferrer() const; |
| 156 void setReferrerPolicy(ReferrerPolicy); | 157 void setReferrerPolicy(ReferrerPolicy); |
| 157 ReferrerPolicy getReferrerPolicy() const { return m_referrerPolicy; } | 158 ReferrerPolicy getReferrerPolicy() const { return m_referrerPolicy; } |
| 158 | 159 |
| 160 // Each worker thread has its own CSS values caches. |
| 161 CSSValuePool* localCssValuePool(); |
| 162 |
| 159 protected: | 163 protected: |
| 160 ExecutionContext(); | 164 ExecutionContext(); |
| 161 virtual ~ExecutionContext(); | 165 virtual ~ExecutionContext(); |
| 162 | 166 |
| 163 virtual const KURL& virtualURL() const = 0; | 167 virtual const KURL& virtualURL() const = 0; |
| 164 virtual KURL virtualCompleteURL(const String&) const = 0; | 168 virtual KURL virtualCompleteURL(const String&) const = 0; |
| 165 | 169 |
| 166 private: | 170 private: |
| 167 bool dispatchErrorEvent(RawPtr<ErrorEvent>, AccessControlStatus); | 171 bool dispatchErrorEvent(RawPtr<ErrorEvent>, AccessControlStatus); |
| 168 void runSuspendableTasks(); | 172 void runSuspendableTasks(); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 187 // Counter that keeps track of how many window interaction calls are allowed | 191 // Counter that keeps track of how many window interaction calls are allowed |
| 188 // for this ExecutionContext. Callers are expected to call | 192 // for this ExecutionContext. Callers are expected to call |
| 189 // |allowWindowInteraction()| and |consumeWindowInteraction()| in order to | 193 // |allowWindowInteraction()| and |consumeWindowInteraction()| in order to |
| 190 // increment and decrement the counter. | 194 // increment and decrement the counter. |
| 191 int m_windowInteractionTokens; | 195 int m_windowInteractionTokens; |
| 192 | 196 |
| 193 Deque<OwnPtr<SuspendableTask>> m_suspendedTasks; | 197 Deque<OwnPtr<SuspendableTask>> m_suspendedTasks; |
| 194 bool m_isRunSuspendableTasksScheduled; | 198 bool m_isRunSuspendableTasksScheduled; |
| 195 | 199 |
| 196 ReferrerPolicy m_referrerPolicy; | 200 ReferrerPolicy m_referrerPolicy; |
| 201 |
| 202 Member<CSSValuePool> m_localCssValuePool; |
| 197 }; | 203 }; |
| 198 | 204 |
| 199 } // namespace blink | 205 } // namespace blink |
| 200 | 206 |
| 201 #endif // ExecutionContext_h | 207 #endif // ExecutionContext_h |
| OLD | NEW |