| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include "platform/weborigin/SecurityPolicy.h" | 42 #include "platform/weborigin/SecurityPolicy.h" |
| 43 #include "wtf/PtrUtil.h" | 43 #include "wtf/PtrUtil.h" |
| 44 #include <memory> | 44 #include <memory> |
| 45 | 45 |
| 46 namespace blink { | 46 namespace blink { |
| 47 | 47 |
| 48 ExecutionContext::ExecutionContext() | 48 ExecutionContext::ExecutionContext() |
| 49 : m_circularSequentialID(0), | 49 : m_circularSequentialID(0), |
| 50 m_inDispatchErrorEvent(false), | 50 m_inDispatchErrorEvent(false), |
| 51 m_activeDOMObjectsAreSuspended(false), | 51 m_activeDOMObjectsAreSuspended(false), |
| 52 m_activeDOMObjectsAreStopped(false), | 52 m_isContextDestroyed(false), |
| 53 m_windowInteractionTokens(0), | 53 m_windowInteractionTokens(0), |
| 54 m_referrerPolicy(ReferrerPolicyDefault) {} | 54 m_referrerPolicy(ReferrerPolicyDefault) {} |
| 55 | 55 |
| 56 ExecutionContext::~ExecutionContext() {} | 56 ExecutionContext::~ExecutionContext() {} |
| 57 | 57 |
| 58 void ExecutionContext::suspendActiveDOMObjects() { | 58 void ExecutionContext::suspendActiveDOMObjects() { |
| 59 DCHECK(!m_activeDOMObjectsAreSuspended); | 59 DCHECK(!m_activeDOMObjectsAreSuspended); |
| 60 notifySuspendingActiveDOMObjects(); | 60 notifySuspendingActiveDOMObjects(); |
| 61 m_activeDOMObjectsAreSuspended = true; | 61 m_activeDOMObjectsAreSuspended = true; |
| 62 } | 62 } |
| 63 | 63 |
| 64 void ExecutionContext::resumeActiveDOMObjects() { | 64 void ExecutionContext::resumeActiveDOMObjects() { |
| 65 DCHECK(m_activeDOMObjectsAreSuspended); | 65 DCHECK(m_activeDOMObjectsAreSuspended); |
| 66 m_activeDOMObjectsAreSuspended = false; | 66 m_activeDOMObjectsAreSuspended = false; |
| 67 notifyResumingActiveDOMObjects(); | 67 notifyResumingActiveDOMObjects(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void ExecutionContext::notifyContextDestroyed() { | 70 void ExecutionContext::notifyContextDestroyed() { |
| 71 m_activeDOMObjectsAreStopped = true; | 71 m_isContextDestroyed = true; |
| 72 ContextLifecycleNotifier::notifyContextDestroyed(); | 72 ContextLifecycleNotifier::notifyContextDestroyed(); |
| 73 } | 73 } |
| 74 | 74 |
| 75 void ExecutionContext::suspendScheduledTasks() { | 75 void ExecutionContext::suspendScheduledTasks() { |
| 76 suspendActiveDOMObjects(); | 76 suspendActiveDOMObjects(); |
| 77 tasksWereSuspended(); | 77 tasksWereSuspended(); |
| 78 } | 78 } |
| 79 | 79 |
| 80 void ExecutionContext::resumeScheduledTasks() { | 80 void ExecutionContext::resumeScheduledTasks() { |
| 81 resumeActiveDOMObjects(); | 81 resumeActiveDOMObjects(); |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 } | 245 } |
| 246 | 246 |
| 247 DEFINE_TRACE(ExecutionContext) { | 247 DEFINE_TRACE(ExecutionContext) { |
| 248 visitor->trace(m_publicURLManager); | 248 visitor->trace(m_publicURLManager); |
| 249 visitor->trace(m_pendingExceptions); | 249 visitor->trace(m_pendingExceptions); |
| 250 ContextLifecycleNotifier::trace(visitor); | 250 ContextLifecycleNotifier::trace(visitor); |
| 251 Supplementable<ExecutionContext>::trace(visitor); | 251 Supplementable<ExecutionContext>::trace(visitor); |
| 252 } | 252 } |
| 253 | 253 |
| 254 } // namespace blink | 254 } // namespace blink |
| OLD | NEW |