| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 } | 61 } |
| 62 String m_errorMessage; | 62 String m_errorMessage; |
| 63 int m_lineNumber; | 63 int m_lineNumber; |
| 64 int m_columnNumber; | 64 int m_columnNumber; |
| 65 int m_scriptId; | 65 int m_scriptId; |
| 66 String m_sourceURL; | 66 String m_sourceURL; |
| 67 RefPtrWillBeMember<ScriptCallStack> m_callStack; | 67 RefPtrWillBeMember<ScriptCallStack> m_callStack; |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 ExecutionContext::ExecutionContext() | 70 ExecutionContext::ExecutionContext() |
| 71 : m_sandboxFlags(SandboxNone) | 71 : m_circularSequentialID(0) |
| 72 , m_circularSequentialID(0) | |
| 73 , m_timerNestingLevel(0) | 72 , m_timerNestingLevel(0) |
| 74 , m_inDispatchErrorEvent(false) | 73 , m_inDispatchErrorEvent(false) |
| 75 , m_activeDOMObjectsAreSuspended(false) | 74 , m_activeDOMObjectsAreSuspended(false) |
| 76 , m_activeDOMObjectsAreStopped(false) | 75 , m_activeDOMObjectsAreStopped(false) |
| 77 , m_windowFocusTokens(0) | 76 , m_windowFocusTokens(0) |
| 78 { | 77 { |
| 79 } | 78 } |
| 80 | 79 |
| 81 ExecutionContext::~ExecutionContext() | 80 ExecutionContext::~ExecutionContext() |
| 82 { | 81 { |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 ContextLifecycleNotifier& ExecutionContext::lifecycleNotifier() | 254 ContextLifecycleNotifier& ExecutionContext::lifecycleNotifier() |
| 256 { | 255 { |
| 257 return static_cast<ContextLifecycleNotifier&>(LifecycleContext<ExecutionCont
ext>::lifecycleNotifier()); | 256 return static_cast<ContextLifecycleNotifier&>(LifecycleContext<ExecutionCont
ext>::lifecycleNotifier()); |
| 258 } | 257 } |
| 259 | 258 |
| 260 bool ExecutionContext::isIteratingOverObservers() const | 259 bool ExecutionContext::isIteratingOverObservers() const |
| 261 { | 260 { |
| 262 return m_lifecycleNotifier && m_lifecycleNotifier->isIteratingOverObservers(
); | 261 return m_lifecycleNotifier && m_lifecycleNotifier->isIteratingOverObservers(
); |
| 263 } | 262 } |
| 264 | 263 |
| 265 void ExecutionContext::enforceSandboxFlags(SandboxFlags mask) | |
| 266 { | |
| 267 m_sandboxFlags |= mask; | |
| 268 | |
| 269 // The SandboxOrigin is stored redundantly in the security origin. | |
| 270 if (isSandboxed(SandboxOrigin) && securityContext().securityOrigin() && !sec
urityContext().securityOrigin()->isUnique()) { | |
| 271 securityContext().setSecurityOrigin(SecurityOrigin::createUnique()); | |
| 272 didUpdateSecurityOrigin(); | |
| 273 } | |
| 274 } | |
| 275 | |
| 276 void ExecutionContext::allowWindowFocus() | 264 void ExecutionContext::allowWindowFocus() |
| 277 { | 265 { |
| 278 ++m_windowFocusTokens; | 266 ++m_windowFocusTokens; |
| 279 } | 267 } |
| 280 | 268 |
| 281 void ExecutionContext::consumeWindowFocus() | 269 void ExecutionContext::consumeWindowFocus() |
| 282 { | 270 { |
| 283 if (m_windowFocusTokens == 0) | 271 if (m_windowFocusTokens == 0) |
| 284 return; | 272 return; |
| 285 --m_windowFocusTokens; | 273 --m_windowFocusTokens; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 298 #if ENABLE(OILPAN) | 286 #if ENABLE(OILPAN) |
| 299 visitor->trace(m_pendingExceptions); | 287 visitor->trace(m_pendingExceptions); |
| 300 visitor->trace(m_publicURLManager); | 288 visitor->trace(m_publicURLManager); |
| 301 visitor->trace(m_timeouts); | 289 visitor->trace(m_timeouts); |
| 302 HeapSupplementable<ExecutionContext>::trace(visitor); | 290 HeapSupplementable<ExecutionContext>::trace(visitor); |
| 303 #endif | 291 #endif |
| 304 LifecycleContext<ExecutionContext>::trace(visitor); | 292 LifecycleContext<ExecutionContext>::trace(visitor); |
| 305 } | 293 } |
| 306 | 294 |
| 307 } // namespace blink | 295 } // namespace blink |
| OLD | NEW |