| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 | 126 |
| 127 SandboxFlags sandboxFlags() const { return m_sandboxFlags; } | 127 SandboxFlags sandboxFlags() const { return m_sandboxFlags; } |
| 128 bool isSandboxed(SandboxFlags mask) const { return m_sandboxFlags & mask; } | 128 bool isSandboxed(SandboxFlags mask) const { return m_sandboxFlags & mask; } |
| 129 void enforceSandboxFlags(SandboxFlags mask); | 129 void enforceSandboxFlags(SandboxFlags mask); |
| 130 | 130 |
| 131 PassOwnPtr<LifecycleNotifier<ExecutionContext> > createLifecycleNotifier(); | 131 PassOwnPtr<LifecycleNotifier<ExecutionContext> > createLifecycleNotifier(); |
| 132 | 132 |
| 133 virtual EventTarget* errorEventTarget() = 0; | 133 virtual EventTarget* errorEventTarget() = 0; |
| 134 virtual EventQueue* eventQueue() const = 0; | 134 virtual EventQueue* eventQueue() const = 0; |
| 135 | 135 |
| 136 void allowWindowFocus(); | |
| 137 void consumeWindowFocus(); | |
| 138 bool isWindowFocusAllowed() const; | |
| 139 | |
| 140 protected: | 136 protected: |
| 141 ExecutionContext(); | 137 ExecutionContext(); |
| 142 virtual ~ExecutionContext(); | 138 virtual ~ExecutionContext(); |
| 143 | 139 |
| 144 virtual const KURL& virtualURL() const = 0; | 140 virtual const KURL& virtualURL() const = 0; |
| 145 virtual KURL virtualCompleteURL(const String&) const = 0; | 141 virtual KURL virtualCompleteURL(const String&) const = 0; |
| 146 | 142 |
| 147 ContextLifecycleNotifier& lifecycleNotifier(); | 143 ContextLifecycleNotifier& lifecycleNotifier(); |
| 148 | 144 |
| 149 private: | 145 private: |
| (...skipping 24 matching lines...) Expand all Loading... |
| 174 | 170 |
| 175 bool m_activeDOMObjectsAreSuspended; | 171 bool m_activeDOMObjectsAreSuspended; |
| 176 bool m_activeDOMObjectsAreStopped; | 172 bool m_activeDOMObjectsAreStopped; |
| 177 | 173 |
| 178 OwnPtrWillBeMember<PublicURLManager> m_publicURLManager; | 174 OwnPtrWillBeMember<PublicURLManager> m_publicURLManager; |
| 179 | 175 |
| 180 // The location of this member is important; to make sure contextDestroyed()
notification on | 176 // The location of this member is important; to make sure contextDestroyed()
notification on |
| 181 // ExecutionContext's members (notably m_timeouts) is called before they are
destructed, | 177 // ExecutionContext's members (notably m_timeouts) is called before they are
destructed, |
| 182 // m_lifecycleNotifer should be placed *after* such members. | 178 // m_lifecycleNotifer should be placed *after* such members. |
| 183 OwnPtr<ContextLifecycleNotifier> m_lifecycleNotifier; | 179 OwnPtr<ContextLifecycleNotifier> m_lifecycleNotifier; |
| 184 | |
| 185 // Counter that keeps track of how many window focus calls are allowed for | |
| 186 // this ExecutionContext. Callers are expected to call |allowWindowFocus()| | |
| 187 // and |consumeWindowFocus()| in order to increment and decrement the | |
| 188 // counter. | |
| 189 int m_windowFocusTokens; | |
| 190 }; | 180 }; |
| 191 | 181 |
| 192 } // namespace blink | 182 } // namespace blink |
| 193 | 183 |
| 194 #endif // ExecutionContext_h | 184 #endif // ExecutionContext_h |
| OLD | NEW |