| 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 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 #include "core/CoreExport.h" | 31 #include "core/CoreExport.h" |
| 32 #include "core/dom/ContextLifecycleNotifier.h" | 32 #include "core/dom/ContextLifecycleNotifier.h" |
| 33 #include "core/dom/ContextLifecycleObserver.h" | 33 #include "core/dom/ContextLifecycleObserver.h" |
| 34 #include "core/dom/SecurityContext.h" | 34 #include "core/dom/SecurityContext.h" |
| 35 #include "core/dom/SuspendableTask.h" | 35 #include "core/dom/SuspendableTask.h" |
| 36 #include "core/fetch/AccessControlStatus.h" | 36 #include "core/fetch/AccessControlStatus.h" |
| 37 #include "platform/Supplementable.h" | 37 #include "platform/Supplementable.h" |
| 38 #include "platform/heap/Handle.h" | 38 #include "platform/heap/Handle.h" |
| 39 #include "platform/weborigin/KURL.h" | 39 #include "platform/weborigin/KURL.h" |
| 40 #include "platform/weborigin/ReferrerPolicy.h" |
| 40 #include "wtf/Deque.h" | 41 #include "wtf/Deque.h" |
| 41 #include "wtf/Noncopyable.h" | 42 #include "wtf/Noncopyable.h" |
| 42 #include "wtf/OwnPtr.h" | 43 #include "wtf/OwnPtr.h" |
| 43 #include "wtf/PassOwnPtr.h" | 44 #include "wtf/PassOwnPtr.h" |
| 44 | 45 |
| 45 namespace blink { | 46 namespace blink { |
| 46 | 47 |
| 47 class ActiveDOMObject; | 48 class ActiveDOMObject; |
| 48 class ConsoleMessage; | 49 class ConsoleMessage; |
| 49 class DOMTimerCoordinator; | 50 class DOMTimerCoordinator; |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 // Methods related to window interaction. It should be used to manage window | 147 // Methods related to window interaction. It should be used to manage window |
| 147 // focusing and window creation permission for an ExecutionContext. | 148 // focusing and window creation permission for an ExecutionContext. |
| 148 void allowWindowInteraction(); | 149 void allowWindowInteraction(); |
| 149 void consumeWindowInteraction(); | 150 void consumeWindowInteraction(); |
| 150 bool isWindowInteractionAllowed() const; | 151 bool isWindowInteractionAllowed() const; |
| 151 | 152 |
| 152 // Decides whether this context is privileged, as described in | 153 // Decides whether this context is privileged, as described in |
| 153 // https://w3c.github.io/webappsec/specs/powerfulfeatures/#settings-privileg
ed. | 154 // https://w3c.github.io/webappsec/specs/powerfulfeatures/#settings-privileg
ed. |
| 154 virtual bool isPrivilegedContext(String& errorMessage, const PrivilegeContex
tCheck = StandardPrivilegeCheck) = 0; | 155 virtual bool isPrivilegedContext(String& errorMessage, const PrivilegeContex
tCheck = StandardPrivilegeCheck) = 0; |
| 155 | 156 |
| 157 virtual void setReferrerPolicy(ReferrerPolicy); |
| 158 ReferrerPolicy referrerPolicy() const { return m_referrerPolicy; } |
| 159 |
| 156 protected: | 160 protected: |
| 157 ExecutionContext(); | 161 ExecutionContext(); |
| 158 virtual ~ExecutionContext(); | 162 virtual ~ExecutionContext(); |
| 159 | 163 |
| 160 virtual const KURL& virtualURL() const = 0; | 164 virtual const KURL& virtualURL() const = 0; |
| 161 virtual KURL virtualCompleteURL(const String&) const = 0; | 165 virtual KURL virtualCompleteURL(const String&) const = 0; |
| 162 | 166 |
| 163 private: | 167 private: |
| 164 bool dispatchErrorEvent(PassRefPtrWillBeRawPtr<ErrorEvent>, AccessControlSta
tus); | 168 bool dispatchErrorEvent(PassRefPtrWillBeRawPtr<ErrorEvent>, AccessControlSta
tus); |
| 165 void runSuspendableTasks(); | 169 void runSuspendableTasks(); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 184 bool m_strictMixedContentCheckingEnforced; | 188 bool m_strictMixedContentCheckingEnforced; |
| 185 | 189 |
| 186 // Counter that keeps track of how many window interaction calls are allowed | 190 // Counter that keeps track of how many window interaction calls are allowed |
| 187 // for this ExecutionContext. Callers are expected to call | 191 // for this ExecutionContext. Callers are expected to call |
| 188 // |allowWindowInteraction()| and |consumeWindowInteraction()| in order to | 192 // |allowWindowInteraction()| and |consumeWindowInteraction()| in order to |
| 189 // increment and decrement the counter. | 193 // increment and decrement the counter. |
| 190 int m_windowInteractionTokens; | 194 int m_windowInteractionTokens; |
| 191 | 195 |
| 192 Deque<OwnPtr<SuspendableTask>> m_suspendedTasks; | 196 Deque<OwnPtr<SuspendableTask>> m_suspendedTasks; |
| 193 bool m_isRunSuspendableTasksScheduled; | 197 bool m_isRunSuspendableTasksScheduled; |
| 198 |
| 199 ReferrerPolicy m_referrerPolicy; |
| 194 }; | 200 }; |
| 195 | 201 |
| 196 } // namespace blink | 202 } // namespace blink |
| 197 | 203 |
| 198 #endif // ExecutionContext_h | 204 #endif // ExecutionContext_h |
| OLD | NEW |