| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 virtual double timerAlignmentInterval() const = 0; | 92 virtual double timerAlignmentInterval() const = 0; |
| 93 | 93 |
| 94 // Gets the DOMTimerCoordinator which maintains the "active timer | 94 // Gets the DOMTimerCoordinator which maintains the "active timer |
| 95 // list" of tasks created by setTimeout and setInterval. The | 95 // list" of tasks created by setTimeout and setInterval. The |
| 96 // DOMTimerCoordinator is owned by the ExecutionContext and should | 96 // DOMTimerCoordinator is owned by the ExecutionContext and should |
| 97 // not be used after the ExecutionContext is destroyed. | 97 // not be used after the ExecutionContext is destroyed. |
| 98 virtual DOMTimerCoordinator* timers() = 0; | 98 virtual DOMTimerCoordinator* timers() = 0; |
| 99 | 99 |
| 100 virtual void reportBlockedScriptExecutionToInspector(const String& directive
Text) = 0; | 100 virtual void reportBlockedScriptExecutionToInspector(const String& directive
Text) = 0; |
| 101 | 101 |
| 102 virtual SecurityContext& securityContext() = 0; | 102 virtual const SecurityContext& securityContext() const = 0; |
| 103 KURL contextURL() const { return virtualURL(); } | 103 KURL contextURL() const { return virtualURL(); } |
| 104 KURL contextCompleteURL(const String& url) const { return virtualCompleteURL
(url); } | 104 KURL contextCompleteURL(const String& url) const { return virtualCompleteURL
(url); } |
| 105 | 105 |
| 106 bool shouldSanitizeScriptError(const String& sourceURL, AccessControlStatus)
; | 106 bool shouldSanitizeScriptError(const String& sourceURL, AccessControlStatus)
; |
| 107 void reportException(PassRefPtrWillBeRawPtr<ErrorEvent>, int scriptId, PassR
efPtrWillBeRawPtr<ScriptCallStack>, AccessControlStatus); | 107 void reportException(PassRefPtrWillBeRawPtr<ErrorEvent>, int scriptId, PassR
efPtrWillBeRawPtr<ScriptCallStack>, AccessControlStatus); |
| 108 | 108 |
| 109 virtual void addConsoleMessage(PassRefPtrWillBeRawPtr<ConsoleMessage>) = 0; | 109 virtual void addConsoleMessage(PassRefPtrWillBeRawPtr<ConsoleMessage>) = 0; |
| 110 virtual void logExceptionToConsole(const String& errorMessage, int scriptId,
const String& sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawP
tr<ScriptCallStack>) = 0; | 110 virtual void logExceptionToConsole(const String& errorMessage, int scriptId,
const String& sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawP
tr<ScriptCallStack>) = 0; |
| 111 | 111 |
| 112 PublicURLManager& publicURLManager(); | 112 PublicURLManager& publicURLManager(); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 bool shouldEnforceStrictMixedContentChecking() const { return m_strictMixedC
ontentCheckingEnforced; } | 145 bool shouldEnforceStrictMixedContentChecking() const { return m_strictMixedC
ontentCheckingEnforced; } |
| 146 | 146 |
| 147 // 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 |
| 148 // focusing and window creation permission for an ExecutionContext. | 148 // focusing and window creation permission for an ExecutionContext. |
| 149 void allowWindowInteraction(); | 149 void allowWindowInteraction(); |
| 150 void consumeWindowInteraction(); | 150 void consumeWindowInteraction(); |
| 151 bool isWindowInteractionAllowed() const; | 151 bool isWindowInteractionAllowed() const; |
| 152 | 152 |
| 153 // Decides whether this context is privileged, as described in | 153 // Decides whether this context is privileged, as described in |
| 154 // https://w3c.github.io/webappsec/specs/powerfulfeatures/#settings-privileg
ed. | 154 // https://w3c.github.io/webappsec/specs/powerfulfeatures/#settings-privileg
ed. |
| 155 virtual bool isPrivilegedContext(String& errorMessage, const PrivilegeContex
tCheck = StandardPrivilegeCheck) = 0; | 155 virtual bool isPrivilegedContext(String& errorMessage, const PrivilegeContex
tCheck = StandardPrivilegeCheck) const = 0; |
| 156 | 156 |
| 157 virtual void setReferrerPolicy(ReferrerPolicy); | 157 virtual void setReferrerPolicy(ReferrerPolicy); |
| 158 ReferrerPolicy referrerPolicy() const { return m_referrerPolicy; } | 158 ReferrerPolicy referrerPolicy() const { return m_referrerPolicy; } |
| 159 | 159 |
| 160 protected: | 160 protected: |
| 161 ExecutionContext(); | 161 ExecutionContext(); |
| 162 virtual ~ExecutionContext(); | 162 virtual ~ExecutionContext(); |
| 163 | 163 |
| 164 virtual const KURL& virtualURL() const = 0; | 164 virtual const KURL& virtualURL() const = 0; |
| 165 virtual KURL virtualCompleteURL(const String&) const = 0; | 165 virtual KURL virtualCompleteURL(const String&) const = 0; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 195 | 195 |
| 196 Deque<OwnPtr<SuspendableTask>> m_suspendedTasks; | 196 Deque<OwnPtr<SuspendableTask>> m_suspendedTasks; |
| 197 bool m_isRunSuspendableTasksScheduled; | 197 bool m_isRunSuspendableTasksScheduled; |
| 198 | 198 |
| 199 ReferrerPolicy m_referrerPolicy; | 199 ReferrerPolicy m_referrerPolicy; |
| 200 }; | 200 }; |
| 201 | 201 |
| 202 } // namespace blink | 202 } // namespace blink |
| 203 | 203 |
| 204 #endif // ExecutionContext_h | 204 #endif // ExecutionContext_h |
| OLD | NEW |