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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
118 | 118 |
119 // Gets the next id in a circular sequence from 1 to 2^31-1. | 119 // Gets the next id in a circular sequence from 1 to 2^31-1. |
120 int circularSequentialID(); | 120 int circularSequentialID(); |
121 | 121 |
122 void didChangeTimerAlignmentInterval(); | 122 void didChangeTimerAlignmentInterval(); |
123 | 123 |
124 SandboxFlags sandboxFlags() const { return m_sandboxFlags; } | 124 SandboxFlags sandboxFlags() const { return m_sandboxFlags; } |
125 bool isSandboxed(SandboxFlags mask) const { return m_sandboxFlags & mask; } | 125 bool isSandboxed(SandboxFlags mask) const { return m_sandboxFlags & mask; } |
126 void enforceSandboxFlags(SandboxFlags mask); | 126 void enforceSandboxFlags(SandboxFlags mask); |
127 | 127 |
128 void enforceSuborigin(const String& name); | |
129 bool hasSuborigin() const { return m_client->securityContext().securityOrigi n()->hasSuborigin(); } | |
130 String suboriginName() const { return m_client->securityContext().securityOr igin()->suboriginName(); } | |
131 | |
128 PassOwnPtr<LifecycleNotifier<ExecutionContext> > createLifecycleNotifier(); | 132 PassOwnPtr<LifecycleNotifier<ExecutionContext> > createLifecycleNotifier(); |
129 | 133 |
130 virtual EventQueue* eventQueue() const = 0; | 134 virtual EventQueue* eventQueue() const = 0; |
131 | 135 |
132 protected: | 136 protected: |
133 void setClient(ExecutionContextClient* client) { m_client = client; } | 137 void setClient(ExecutionContextClient* client) { m_client = client; } |
134 | 138 |
135 ContextLifecycleNotifier& lifecycleNotifier(); | 139 ContextLifecycleNotifier& lifecycleNotifier(); |
136 | 140 |
137 private: | 141 private: |
138 friend class DOMTimer; // For installNewTimeout() and removeTimeoutByID() be low. | 142 friend class DOMTimer; // For installNewTimeout() and removeTimeoutByID() be low. |
139 | 143 |
140 bool dispatchErrorEvent(PassRefPtrWillBeRawPtr<ErrorEvent>, AccessControlSta tus); | 144 bool dispatchErrorEvent(PassRefPtrWillBeRawPtr<ErrorEvent>, AccessControlSta tus); |
141 | 145 |
142 #if !ENABLE(OILPAN) | 146 #if !ENABLE(OILPAN) |
143 virtual void refExecutionContext() = 0; | 147 virtual void refExecutionContext() = 0; |
144 virtual void derefExecutionContext() = 0; | 148 virtual void derefExecutionContext() = 0; |
145 #endif | 149 #endif |
146 // LifecycleContext implementation. | 150 // LifecycleContext implementation. |
147 | 151 |
148 // Implementation details for DOMTimer. No other classes should call these f unctions. | 152 // Implementation details for DOMTimer. No other classes should call these f unctions. |
149 int installNewTimeout(PassOwnPtr<ScheduledAction>, int timeout, bool singleS hot); | 153 int installNewTimeout(PassOwnPtr<ScheduledAction>, int timeout, bool singleS hot); |
150 void removeTimeoutByID(int timeoutID); // This makes underlying DOMTimer ins tance destructed. | 154 void removeTimeoutByID(int timeoutID); // This makes underlying DOMTimer ins tance destructed. |
151 | 155 |
152 ExecutionContextClient* m_client; | 156 ExecutionContextClient* m_client; |
153 SandboxFlags m_sandboxFlags; | 157 SandboxFlags m_sandboxFlags; |
158 String m_suboriginName; | |
abarth-chromium
2014/07/31 04:56:47
Why do we store the m_suboriginName here but have
jww
2014/10/21 23:51:06
Yup, this was totally unnecessary, made even more
| |
154 | 159 |
155 int m_circularSequentialID; | 160 int m_circularSequentialID; |
156 typedef HashMap<int, OwnPtr<DOMTimer> > TimeoutMap; | 161 typedef HashMap<int, OwnPtr<DOMTimer> > TimeoutMap; |
157 TimeoutMap m_timeouts; | 162 TimeoutMap m_timeouts; |
158 | 163 |
159 bool m_inDispatchErrorEvent; | 164 bool m_inDispatchErrorEvent; |
160 class PendingException; | 165 class PendingException; |
161 OwnPtrWillBeMember<WillBeHeapVector<OwnPtrWillBeMember<PendingException> > > m_pendingExceptions; | 166 OwnPtrWillBeMember<WillBeHeapVector<OwnPtrWillBeMember<PendingException> > > m_pendingExceptions; |
162 | 167 |
163 bool m_activeDOMObjectsAreSuspended; | 168 bool m_activeDOMObjectsAreSuspended; |
164 bool m_activeDOMObjectsAreStopped; | 169 bool m_activeDOMObjectsAreStopped; |
165 | 170 |
166 OwnPtr<PublicURLManager> m_publicURLManager; | 171 OwnPtr<PublicURLManager> m_publicURLManager; |
167 | 172 |
168 // The location of this member is important; to make sure contextDestroyed() notification on | 173 // The location of this member is important; to make sure contextDestroyed() notification on |
169 // ExecutionContext's members (notably m_timeouts) is called before they are destructed, | 174 // ExecutionContext's members (notably m_timeouts) is called before they are destructed, |
170 // m_lifecycleNotifer should be placed *after* such members. | 175 // m_lifecycleNotifer should be placed *after* such members. |
171 OwnPtr<ContextLifecycleNotifier> m_lifecycleNotifier; | 176 OwnPtr<ContextLifecycleNotifier> m_lifecycleNotifier; |
172 }; | 177 }; |
173 | 178 |
174 } // namespace WebCore | 179 } // namespace WebCore |
175 | 180 |
176 #endif // ExecutionContext_h | 181 #endif // ExecutionContext_h |
OLD | NEW |