| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 String m_sourceURL; | 65 String m_sourceURL; |
| 66 RefPtrWillBeMember<ScriptCallStack> m_callStack; | 66 RefPtrWillBeMember<ScriptCallStack> m_callStack; |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 ExecutionContext::ExecutionContext() | 69 ExecutionContext::ExecutionContext() |
| 70 : m_circularSequentialID(0) | 70 : m_circularSequentialID(0) |
| 71 , m_inDispatchErrorEvent(false) | 71 , m_inDispatchErrorEvent(false) |
| 72 , m_activeDOMObjectsAreSuspended(false) | 72 , m_activeDOMObjectsAreSuspended(false) |
| 73 , m_activeDOMObjectsAreStopped(false) | 73 , m_activeDOMObjectsAreStopped(false) |
| 74 , m_strictMixedContentCheckingEnforced(false) | 74 , m_strictMixedContentCheckingEnforced(false) |
| 75 , m_windowFocusTokens(0) | 75 , m_windowInteractionTokens(0) |
| 76 { | 76 { |
| 77 } | 77 } |
| 78 | 78 |
| 79 ExecutionContext::~ExecutionContext() | 79 ExecutionContext::~ExecutionContext() |
| 80 { | 80 { |
| 81 } | 81 } |
| 82 | 82 |
| 83 bool ExecutionContext::hasPendingActivity() | 83 bool ExecutionContext::hasPendingActivity() |
| 84 { | 84 { |
| 85 return lifecycleNotifier().hasPendingActivity(); | 85 return lifecycleNotifier().hasPendingActivity(); |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 ContextLifecycleNotifier& ExecutionContext::lifecycleNotifier() | 219 ContextLifecycleNotifier& ExecutionContext::lifecycleNotifier() |
| 220 { | 220 { |
| 221 return static_cast<ContextLifecycleNotifier&>(LifecycleContext<ExecutionCont
ext>::lifecycleNotifier()); | 221 return static_cast<ContextLifecycleNotifier&>(LifecycleContext<ExecutionCont
ext>::lifecycleNotifier()); |
| 222 } | 222 } |
| 223 | 223 |
| 224 bool ExecutionContext::isIteratingOverObservers() const | 224 bool ExecutionContext::isIteratingOverObservers() const |
| 225 { | 225 { |
| 226 return m_lifecycleNotifier && m_lifecycleNotifier->isIteratingOverObservers(
); | 226 return m_lifecycleNotifier && m_lifecycleNotifier->isIteratingOverObservers(
); |
| 227 } | 227 } |
| 228 | 228 |
| 229 void ExecutionContext::allowWindowFocus() | 229 void ExecutionContext::allowWindowInteraction() |
| 230 { | 230 { |
| 231 ++m_windowFocusTokens; | 231 ++m_windowInteractionTokens; |
| 232 } | 232 } |
| 233 | 233 |
| 234 void ExecutionContext::consumeWindowFocus() | 234 void ExecutionContext::consumeWindowInteraction() |
| 235 { | 235 { |
| 236 if (m_windowFocusTokens == 0) | 236 if (m_windowInteractionTokens == 0) |
| 237 return; | 237 return; |
| 238 --m_windowFocusTokens; | 238 --m_windowInteractionTokens; |
| 239 } | 239 } |
| 240 | 240 |
| 241 bool ExecutionContext::isWindowFocusAllowed() const | 241 bool ExecutionContext::isWindowInteractionAllowed() const |
| 242 { | 242 { |
| 243 // FIXME: WindowFocusAllowedIndicator::windowFocusAllowed() is temporary, | 243 // FIXME: WindowFocusAllowedIndicator::windowFocusAllowed() is temporary, |
| 244 // it will be removed as soon as WebScopedWindowFocusAllowedIndicator will | 244 // it will be removed as soon as WebScopedWindowFocusAllowedIndicator will |
| 245 // be updated to not use WindowFocusAllowedIndicator. | 245 // be updated to not use WindowFocusAllowedIndicator. |
| 246 return m_windowFocusTokens > 0 || WindowFocusAllowedIndicator::windowFocusAl
lowed(); | 246 return m_windowInteractionTokens > 0 || WindowFocusAllowedIndicator::windowF
ocusAllowed(); |
| 247 } | 247 } |
| 248 | 248 |
| 249 void ExecutionContext::trace(Visitor* visitor) | 249 void ExecutionContext::trace(Visitor* visitor) |
| 250 { | 250 { |
| 251 #if ENABLE(OILPAN) | 251 #if ENABLE(OILPAN) |
| 252 visitor->trace(m_pendingExceptions); | 252 visitor->trace(m_pendingExceptions); |
| 253 visitor->trace(m_publicURLManager); | 253 visitor->trace(m_publicURLManager); |
| 254 HeapSupplementable<ExecutionContext>::trace(visitor); | 254 HeapSupplementable<ExecutionContext>::trace(visitor); |
| 255 #endif | 255 #endif |
| 256 LifecycleContext<ExecutionContext>::trace(visitor); | 256 LifecycleContext<ExecutionContext>::trace(visitor); |
| 257 } | 257 } |
| 258 | 258 |
| 259 } // namespace blink | 259 } // namespace blink |
| OLD | NEW |