| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 // ActiveDOMObject may be inherited by a sub-class whose life-cycle | 45 // ActiveDOMObject may be inherited by a sub-class whose life-cycle |
| 46 // exceeds that of the associated ExecutionContext. In those cases, | 46 // exceeds that of the associated ExecutionContext. In those cases, |
| 47 // m_executionContext would/should have been nullified by | 47 // m_executionContext would/should have been nullified by |
| 48 // ContextLifecycleObserver::contextDestroyed() (which we implement / | 48 // ContextLifecycleObserver::contextDestroyed() (which we implement / |
| 49 // inherit). Hence, we should ensure that this is not 0 before use it | 49 // inherit). Hence, we should ensure that this is not 0 before use it |
| 50 // here. | 50 // here. |
| 51 if (!executionContext()) | 51 if (!executionContext()) |
| 52 return; | 52 return; |
| 53 | 53 |
| 54 ASSERT(m_suspendIfNeededCalled); | 54 ASSERT(m_suspendIfNeededCalled); |
| 55 #if !ENABLE(OILPAN) |
| 55 ASSERT(executionContext()->isContextThread()); | 56 ASSERT(executionContext()->isContextThread()); |
| 57 #endif |
| 56 } | 58 } |
| 57 | 59 |
| 58 void ActiveDOMObject::suspendIfNeeded() | 60 void ActiveDOMObject::suspendIfNeeded() |
| 59 { | 61 { |
| 60 #if ENABLE(ASSERT) | 62 #if ENABLE(ASSERT) |
| 61 ASSERT(!m_suspendIfNeededCalled); | 63 ASSERT(!m_suspendIfNeededCalled); |
| 62 m_suspendIfNeededCalled = true; | 64 m_suspendIfNeededCalled = true; |
| 63 #endif | 65 #endif |
| 64 if (ExecutionContext* context = executionContext()) | 66 if (ExecutionContext* context = executionContext()) |
| 65 context->suspendActiveDOMObjectIfNeeded(this); | 67 context->suspendActiveDOMObjectIfNeeded(this); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 93 | 95 |
| 94 if (context->activeDOMObjectsAreSuspended()) { | 96 if (context->activeDOMObjectsAreSuspended()) { |
| 95 suspend(); | 97 suspend(); |
| 96 return; | 98 return; |
| 97 } | 99 } |
| 98 | 100 |
| 99 resume(); | 101 resume(); |
| 100 } | 102 } |
| 101 | 103 |
| 102 } // namespace blink | 104 } // namespace blink |
| OLD | NEW |