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 24 matching lines...) Loading... |
35 : ContextLifecycleObserver(executionContext, ActiveDOMObjectType) | 35 : ContextLifecycleObserver(executionContext, ActiveDOMObjectType) |
36 #if ENABLE(ASSERT) | 36 #if ENABLE(ASSERT) |
37 , m_suspendIfNeededCalled(false) | 37 , m_suspendIfNeededCalled(false) |
38 #endif | 38 #endif |
39 { | 39 { |
40 ASSERT(!executionContext || executionContext->isContextThread()); | 40 ASSERT(!executionContext || executionContext->isContextThread()); |
41 } | 41 } |
42 | 42 |
43 ActiveDOMObject::~ActiveDOMObject() | 43 ActiveDOMObject::~ActiveDOMObject() |
44 { | 44 { |
| 45 #if !ENABLE(OILPAN) |
45 // ActiveDOMObject may be inherited by a sub-class whose life-cycle | 46 // ActiveDOMObject may be inherited by a sub-class whose life-cycle |
46 // exceeds that of the associated ExecutionContext. In those cases, | 47 // exceeds that of the associated ExecutionContext. In those cases, |
47 // m_executionContext would/should have been nullified by | 48 // m_executionContext would/should have been nullified by |
48 // ContextLifecycleObserver::contextDestroyed() (which we implement / | 49 // ContextLifecycleObserver::contextDestroyed() (which we implement / |
49 // inherit). Hence, we should ensure that this is not 0 before use it | 50 // inherit). Hence, we should ensure that this is not 0 before use it |
50 // here. | 51 // here. |
51 if (!executionContext()) | 52 if (!executionContext()) |
52 return; | 53 return; |
53 | 54 |
54 ASSERT(m_suspendIfNeededCalled); | 55 ASSERT(m_suspendIfNeededCalled); |
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...) 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 |