| 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 25 matching lines...) Expand all Loading... |
| 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 "platform/weborigin/ReferrerPolicy.h" |
| 41 #include "wtf/Deque.h" | 41 #include "wtf/Deque.h" |
| 42 #include "wtf/Noncopyable.h" | 42 #include "wtf/Noncopyable.h" |
| 43 #include "wtf/OwnPtr.h" | 43 #include "wtf/OwnPtr.h" |
| 44 #include "wtf/PassOwnPtr.h" | 44 #include "wtf/PassOwnPtr.h" |
| 45 | 45 |
| 46 namespace mojo { |
| 47 class ServiceProvider; |
| 48 } |
| 49 |
| 46 namespace blink { | 50 namespace blink { |
| 47 | 51 |
| 48 class ActiveDOMObject; | 52 class ActiveDOMObject; |
| 49 class ConsoleMessage; | 53 class ConsoleMessage; |
| 50 class DOMTimerCoordinator; | 54 class DOMTimerCoordinator; |
| 51 class ErrorEvent; | 55 class ErrorEvent; |
| 52 class EventQueue; | 56 class EventQueue; |
| 53 class EventTarget; | 57 class EventTarget; |
| 54 class ExecutionContextTask; | 58 class ExecutionContextTask; |
| 55 class LocalDOMWindow; | 59 class LocalDOMWindow; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 void consumeWindowInteraction(); | 158 void consumeWindowInteraction(); |
| 155 bool isWindowInteractionAllowed() const; | 159 bool isWindowInteractionAllowed() const; |
| 156 | 160 |
| 157 // Decides whether this context is privileged, as described in | 161 // Decides whether this context is privileged, as described in |
| 158 // https://w3c.github.io/webappsec/specs/powerfulfeatures/#settings-privileg
ed. | 162 // https://w3c.github.io/webappsec/specs/powerfulfeatures/#settings-privileg
ed. |
| 159 virtual bool isPrivilegedContext(String& errorMessage, const PrivilegeContex
tCheck = StandardPrivilegeCheck) const = 0; | 163 virtual bool isPrivilegedContext(String& errorMessage, const PrivilegeContex
tCheck = StandardPrivilegeCheck) const = 0; |
| 160 | 164 |
| 161 virtual void setReferrerPolicy(ReferrerPolicy); | 165 virtual void setReferrerPolicy(ReferrerPolicy); |
| 162 ReferrerPolicy referrerPolicy() const { return m_referrerPolicy; } | 166 ReferrerPolicy referrerPolicy() const { return m_referrerPolicy; } |
| 163 | 167 |
| 168 void setServiceProvider(mojo::ServiceProvider*); |
| 169 mojo::ServiceProvider* serviceProvider() { return m_serviceProvider; } |
| 170 |
| 164 protected: | 171 protected: |
| 165 ExecutionContext(); | 172 ExecutionContext(); |
| 166 virtual ~ExecutionContext(); | 173 virtual ~ExecutionContext(); |
| 167 | 174 |
| 168 virtual const KURL& virtualURL() const = 0; | 175 virtual const KURL& virtualURL() const = 0; |
| 169 virtual KURL virtualCompleteURL(const String&) const = 0; | 176 virtual KURL virtualCompleteURL(const String&) const = 0; |
| 170 | 177 |
| 171 private: | 178 private: |
| 172 bool dispatchErrorEvent(PassRefPtrWillBeRawPtr<ErrorEvent>, AccessControlSta
tus); | 179 bool dispatchErrorEvent(PassRefPtrWillBeRawPtr<ErrorEvent>, AccessControlSta
tus); |
| 173 void runSuspendableTasks(); | 180 void runSuspendableTasks(); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 194 // Counter that keeps track of how many window interaction calls are allowed | 201 // Counter that keeps track of how many window interaction calls are allowed |
| 195 // for this ExecutionContext. Callers are expected to call | 202 // for this ExecutionContext. Callers are expected to call |
| 196 // |allowWindowInteraction()| and |consumeWindowInteraction()| in order to | 203 // |allowWindowInteraction()| and |consumeWindowInteraction()| in order to |
| 197 // increment and decrement the counter. | 204 // increment and decrement the counter. |
| 198 int m_windowInteractionTokens; | 205 int m_windowInteractionTokens; |
| 199 | 206 |
| 200 Deque<OwnPtr<SuspendableTask>> m_suspendedTasks; | 207 Deque<OwnPtr<SuspendableTask>> m_suspendedTasks; |
| 201 bool m_isRunSuspendableTasksScheduled; | 208 bool m_isRunSuspendableTasksScheduled; |
| 202 | 209 |
| 203 ReferrerPolicy m_referrerPolicy; | 210 ReferrerPolicy m_referrerPolicy; |
| 211 |
| 212 mojo::ServiceProvider* m_serviceProvider; |
| 204 }; | 213 }; |
| 205 | 214 |
| 206 } // namespace blink | 215 } // namespace blink |
| 207 | 216 |
| 208 #endif // ExecutionContext_h | 217 #endif // ExecutionContext_h |
| OLD | NEW |