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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 virtual DOMTimerCoordinator* timers() = 0; | 99 virtual DOMTimerCoordinator* timers() = 0; |
100 | 100 |
101 virtual SecurityContext& securityContext() = 0; | 101 virtual SecurityContext& securityContext() = 0; |
102 KURL contextURL() const { return virtualURL(); } | 102 KURL contextURL() const { return virtualURL(); } |
103 KURL contextCompleteURL(const String& url) const { return virtualCompleteURL
(url); } | 103 KURL contextCompleteURL(const String& url) const { return virtualCompleteURL
(url); } |
104 | 104 |
105 bool shouldSanitizeScriptError(const String& sourceURL, AccessControlStatus)
; | 105 bool shouldSanitizeScriptError(const String& sourceURL, AccessControlStatus)
; |
106 void reportException(ErrorEvent*, AccessControlStatus); | 106 void reportException(ErrorEvent*, AccessControlStatus); |
107 | 107 |
108 virtual void addConsoleMessage(ConsoleMessage*) = 0; | 108 virtual void addConsoleMessage(ConsoleMessage*) = 0; |
109 virtual void exceptionThrown(const String& errorMessage, std::unique_ptr<Sou
rceLocation>) = 0; | 109 virtual void exceptionThrown(ErrorEvent*) = 0; |
110 | 110 |
111 PublicURLManager& publicURLManager(); | 111 PublicURLManager& publicURLManager(); |
112 | 112 |
113 virtual void removeURLFromMemoryCache(const KURL&); | 113 virtual void removeURLFromMemoryCache(const KURL&); |
114 | 114 |
115 void suspendActiveDOMObjects(); | 115 void suspendActiveDOMObjects(); |
116 void resumeActiveDOMObjects(); | 116 void resumeActiveDOMObjects(); |
117 void stopActiveDOMObjects(); | 117 void stopActiveDOMObjects(); |
118 void postSuspendableTask(std::unique_ptr<SuspendableTask>); | 118 void postSuspendableTask(std::unique_ptr<SuspendableTask>); |
119 void notifyContextDestroyed() override; | 119 void notifyContextDestroyed() override; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 virtual const KURL& virtualURL() const = 0; | 163 virtual const KURL& virtualURL() const = 0; |
164 virtual KURL virtualCompleteURL(const String&) const = 0; | 164 virtual KURL virtualCompleteURL(const String&) const = 0; |
165 | 165 |
166 private: | 166 private: |
167 bool dispatchErrorEvent(ErrorEvent*, AccessControlStatus); | 167 bool dispatchErrorEvent(ErrorEvent*, AccessControlStatus); |
168 void runSuspendableTasks(); | 168 void runSuspendableTasks(); |
169 | 169 |
170 unsigned m_circularSequentialID; | 170 unsigned m_circularSequentialID; |
171 | 171 |
172 bool m_inDispatchErrorEvent; | 172 bool m_inDispatchErrorEvent; |
173 class PendingException; | 173 HeapVector<Member<ErrorEvent>> m_pendingExceptions; |
174 std::unique_ptr<Vector<std::unique_ptr<PendingException>>> m_pendingExceptio
ns; | |
175 | 174 |
176 bool m_activeDOMObjectsAreSuspended; | 175 bool m_activeDOMObjectsAreSuspended; |
177 bool m_activeDOMObjectsAreStopped; | 176 bool m_activeDOMObjectsAreStopped; |
178 | 177 |
179 Member<PublicURLManager> m_publicURLManager; | 178 Member<PublicURLManager> m_publicURLManager; |
180 | 179 |
181 // Counter that keeps track of how many window interaction calls are allowed | 180 // Counter that keeps track of how many window interaction calls are allowed |
182 // for this ExecutionContext. Callers are expected to call | 181 // for this ExecutionContext. Callers are expected to call |
183 // |allowWindowInteraction()| and |consumeWindowInteraction()| in order to | 182 // |allowWindowInteraction()| and |consumeWindowInteraction()| in order to |
184 // increment and decrement the counter. | 183 // increment and decrement the counter. |
185 int m_windowInteractionTokens; | 184 int m_windowInteractionTokens; |
186 | 185 |
187 Deque<std::unique_ptr<SuspendableTask>> m_suspendedTasks; | 186 Deque<std::unique_ptr<SuspendableTask>> m_suspendedTasks; |
188 bool m_isRunSuspendableTasksScheduled; | 187 bool m_isRunSuspendableTasksScheduled; |
189 | 188 |
190 ReferrerPolicy m_referrerPolicy; | 189 ReferrerPolicy m_referrerPolicy; |
191 }; | 190 }; |
192 | 191 |
193 } // namespace blink | 192 } // namespace blink |
194 | 193 |
195 #endif // ExecutionContext_h | 194 #endif // ExecutionContext_h |
OLD | NEW |