| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 | 107 |
| 108 frame->animation()->resumeAnimationsForDocument(m_document.get()); | 108 frame->animation()->resumeAnimationsForDocument(m_document.get()); |
| 109 frame->eventHandler()->setMousePressNode(m_mousePressNode.get()); | 109 frame->eventHandler()->setMousePressNode(m_mousePressNode.get()); |
| 110 m_document->resumeActiveDOMObjects(); | 110 m_document->resumeActiveDOMObjects(); |
| 111 m_document->resumeScriptedAnimationControllerCallbacks(); | 111 m_document->resumeScriptedAnimationControllerCallbacks(); |
| 112 | 112 |
| 113 // It is necessary to update any platform script objects after restoring the | 113 // It is necessary to update any platform script objects after restoring the |
| 114 // cached page. | 114 // cached page. |
| 115 frame->script()->updatePlatformScriptObjects(); | 115 frame->script()->updatePlatformScriptObjects(); |
| 116 | 116 |
| 117 #if USE(ACCELERATED_COMPOSITING) | |
| 118 if (m_isComposited) | |
| 119 frame->view()->restoreBackingStores(); | |
| 120 #endif | |
| 121 | |
| 122 frame->loader()->client()->didRestoreFromPageCache(); | 117 frame->loader()->client()->didRestoreFromPageCache(); |
| 123 | 118 |
| 124 // Reconstruct the FrameTree | 119 // Reconstruct the FrameTree |
| 125 for (unsigned i = 0; i < m_childFrames.size(); ++i) | 120 for (unsigned i = 0; i < m_childFrames.size(); ++i) |
| 126 frame->tree()->appendChild(m_childFrames[i]->view()->frame()); | 121 frame->tree()->appendChild(m_childFrames[i]->view()->frame()); |
| 127 | 122 |
| 128 // Open the child CachedFrames in their respective FrameLoaders. | 123 // Open the child CachedFrames in their respective FrameLoaders. |
| 129 for (unsigned i = 0; i < m_childFrames.size(); ++i) | 124 for (unsigned i = 0; i < m_childFrames.size(); ++i) |
| 130 m_childFrames[i]->open(); | 125 m_childFrames[i]->open(); |
| 131 | 126 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 // those create more objects. | 166 // those create more objects. |
| 172 m_document->documentWillSuspendForPageCache(); | 167 m_document->documentWillSuspendForPageCache(); |
| 173 m_document->suspendScriptedAnimationControllerCallbacks(); | 168 m_document->suspendScriptedAnimationControllerCallbacks(); |
| 174 m_document->suspendActiveDOMObjects(ActiveDOMObject::DocumentWillBecomeInact
ive); | 169 m_document->suspendActiveDOMObjects(ActiveDOMObject::DocumentWillBecomeInact
ive); |
| 175 m_cachedFrameScriptData = adoptPtr(new ScriptCachedFrameData(frame)); | 170 m_cachedFrameScriptData = adoptPtr(new ScriptCachedFrameData(frame)); |
| 176 | 171 |
| 177 m_document->domWindow()->suspendForPageCache(); | 172 m_document->domWindow()->suspendForPageCache(); |
| 178 | 173 |
| 179 frame->loader()->client()->savePlatformDataToCachedFrame(this); | 174 frame->loader()->client()->savePlatformDataToCachedFrame(this); |
| 180 | 175 |
| 181 #if USE(ACCELERATED_COMPOSITING) | |
| 182 if (m_isComposited && pageCache()->shouldClearBackingStores()) | |
| 183 frame->view()->clearBackingStores(); | |
| 184 #endif | |
| 185 | |
| 186 // documentWillSuspendForPageCache() can set up a layout timer on the FrameV
iew, so clear timers after that. | 176 // documentWillSuspendForPageCache() can set up a layout timer on the FrameV
iew, so clear timers after that. |
| 187 frame->clearTimers(); | 177 frame->clearTimers(); |
| 188 | 178 |
| 189 // Deconstruct the FrameTree, to restore it later. | 179 // Deconstruct the FrameTree, to restore it later. |
| 190 // We do this for two reasons: | 180 // We do this for two reasons: |
| 191 // 1 - We reuse the main frame, so when it navigates to a new page load it n
eeds to start with a blank FrameTree. | 181 // 1 - We reuse the main frame, so when it navigates to a new page load it n
eeds to start with a blank FrameTree. |
| 192 // 2 - It's much easier to destroy a CachedFrame while it resides in the Pag
eCache if it is disconnected from its parent. | 182 // 2 - It's much easier to destroy a CachedFrame while it resides in the Pag
eCache if it is disconnected from its parent. |
| 193 for (unsigned i = 0; i < m_childFrames.size(); ++i) | 183 for (unsigned i = 0; i < m_childFrames.size(); ++i) |
| 194 frame->tree()->removeChild(m_childFrames[i]->view()->frame()); | 184 frame->tree()->removeChild(m_childFrames[i]->view()->frame()); |
| 195 | 185 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 int CachedFrame::descendantFrameCount() const | 281 int CachedFrame::descendantFrameCount() const |
| 292 { | 282 { |
| 293 int count = m_childFrames.size(); | 283 int count = m_childFrames.size(); |
| 294 for (size_t i = 0; i < m_childFrames.size(); ++i) | 284 for (size_t i = 0; i < m_childFrames.size(); ++i) |
| 295 count += m_childFrames[i]->descendantFrameCount(); | 285 count += m_childFrames[i]->descendantFrameCount(); |
| 296 | 286 |
| 297 return count; | 287 return count; |
| 298 } | 288 } |
| 299 | 289 |
| 300 } // namespace WebCore | 290 } // namespace WebCore |
| OLD | NEW |