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 15 matching lines...) Expand all Loading... |
26 | 26 |
27 #include "config.h" | 27 #include "config.h" |
28 #include "core/dom/ActiveDOMObject.h" | 28 #include "core/dom/ActiveDOMObject.h" |
29 | 29 |
30 #include "core/dom/ScriptExecutionContext.h" | 30 #include "core/dom/ScriptExecutionContext.h" |
31 #include "core/dom/WebCoreMemoryInstrumentation.h" | 31 #include "core/dom/WebCoreMemoryInstrumentation.h" |
32 | 32 |
33 namespace WebCore { | 33 namespace WebCore { |
34 | 34 |
35 ActiveDOMObject::ActiveDOMObject(ScriptExecutionContext* scriptExecutionContext) | 35 ActiveDOMObject::ActiveDOMObject(ScriptExecutionContext* scriptExecutionContext) |
36 : ContextDestructionObserver(scriptExecutionContext, ActiveDOMObjectType) | 36 : ContextLifecycleObserver(scriptExecutionContext, ActiveDOMObjectType) |
37 , m_pendingActivityCount(0) | 37 , m_pendingActivityCount(0) |
38 #if !ASSERT_DISABLED | 38 #if !ASSERT_DISABLED |
39 , m_suspendIfNeededCalled(false) | 39 , m_suspendIfNeededCalled(false) |
40 #endif | 40 #endif |
41 { | 41 { |
42 if (!m_scriptExecutionContext) | 42 if (!m_scriptExecutionContext) |
43 return; | 43 return; |
44 | 44 |
45 ASSERT(m_scriptExecutionContext->isContextThread()); | 45 ASSERT(m_scriptExecutionContext->isContextThread()); |
46 } | 46 } |
47 | 47 |
48 ActiveDOMObject::~ActiveDOMObject() | 48 ActiveDOMObject::~ActiveDOMObject() |
49 { | 49 { |
50 // ActiveDOMObject may be inherited by a sub-class whose life-cycle | 50 // ActiveDOMObject may be inherited by a sub-class whose life-cycle |
51 // exceeds that of the associated ScriptExecutionContext. In those cases, | 51 // exceeds that of the associated ScriptExecutionContext. In those cases, |
52 // m_scriptExecutionContext would/should have been nullified by | 52 // m_scriptExecutionContext would/should have been nullified by |
53 // ContextDestructionObserver::contextDestroyed() (which we implement / | 53 // ContextLifecycleObserver::contextDestroyed() (which we implement / |
54 // inherit). Hence, we should ensure that this is not 0 before use it | 54 // inherit). Hence, we should ensure that this is not 0 before use it |
55 // here. | 55 // here. |
56 if (!m_scriptExecutionContext) | 56 if (!m_scriptExecutionContext) |
57 return; | 57 return; |
58 | 58 |
59 ASSERT(m_suspendIfNeededCalled); | 59 ASSERT(m_suspendIfNeededCalled); |
60 ASSERT(m_scriptExecutionContext->isContextThread()); | 60 ASSERT(m_scriptExecutionContext->isContextThread()); |
61 observeContext(0, ActiveDOMObjectType); | 61 observeContext(0, ActiveDOMObjectType); |
62 } | 62 } |
63 | 63 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 { | 95 { |
96 } | 96 } |
97 | 97 |
98 void ActiveDOMObject::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) cons
t | 98 void ActiveDOMObject::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) cons
t |
99 { | 99 { |
100 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); | 100 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); |
101 } | 101 } |
102 | 102 |
103 | 103 |
104 } // namespace WebCore | 104 } // namespace WebCore |
OLD | NEW |