| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 Page* otherPage = *it; | 41 Page* otherPage = *it; |
| 42 if ((deferSelf || otherPage != page)) { | 42 if ((deferSelf || otherPage != page)) { |
| 43 if (!otherPage->defersLoading()) { | 43 if (!otherPage->defersLoading()) { |
| 44 m_deferredFrames.append(otherPage->mainFrame()); | 44 m_deferredFrames.append(otherPage->mainFrame()); |
| 45 | 45 |
| 46 // This code is not logically part of load deferring, but we do
not want JS code executed beneath modal | 46 // This code is not logically part of load deferring, but we do
not want JS code executed beneath modal |
| 47 // windows or sheets, which is exactly when PageGroupLoadDeferre
r is used. | 47 // windows or sheets, which is exactly when PageGroupLoadDeferre
r is used. |
| 48 // NOTE: if PageGroupLoadDeferrer is ever used for tasks other t
han showing a modal window or sheet, | 48 // NOTE: if PageGroupLoadDeferrer is ever used for tasks other t
han showing a modal window or sheet, |
| 49 // the constructor will need to take a ActiveDOMObject::ReasonFo
rSuspension. | 49 // the constructor will need to take a ActiveDOMObject::ReasonFo
rSuspension. |
| 50 for (Frame* frame = otherPage->mainFrame(); frame; frame = frame
->tree()->traverseNext()) { | 50 for (Frame* frame = otherPage->mainFrame(); frame; frame = frame
->tree()->traverseNext()) { |
| 51 frame->document()->suspendScriptedAnimationControllerCallbac
ks(); |
| 51 frame->document()->suspendActiveDOMObjects(ActiveDOMObject::
WillShowDialog); | 52 frame->document()->suspendActiveDOMObjects(ActiveDOMObject::
WillShowDialog); |
| 52 frame->document()->asyncScriptRunner()->suspend(); | 53 frame->document()->asyncScriptRunner()->suspend(); |
| 53 if (DocumentParser* parser = frame->document()->parser()) | 54 if (DocumentParser* parser = frame->document()->parser()) |
| 54 parser->suspendScheduledTasks(); | 55 parser->suspendScheduledTasks(); |
| 55 } | 56 } |
| 56 } | 57 } |
| 57 } | 58 } |
| 58 } | 59 } |
| 59 | 60 |
| 60 size_t count = m_deferredFrames.size(); | 61 size_t count = m_deferredFrames.size(); |
| 61 for (size_t i = 0; i < count; ++i) | 62 for (size_t i = 0; i < count; ++i) |
| 62 if (Page* page = m_deferredFrames[i]->page()) | 63 if (Page* page = m_deferredFrames[i]->page()) |
| 63 page->setDefersLoading(true); | 64 page->setDefersLoading(true); |
| 64 } | 65 } |
| 65 | 66 |
| 66 PageGroupLoadDeferrer::~PageGroupLoadDeferrer() | 67 PageGroupLoadDeferrer::~PageGroupLoadDeferrer() |
| 67 { | 68 { |
| 68 for (size_t i = 0; i < m_deferredFrames.size(); ++i) { | 69 for (size_t i = 0; i < m_deferredFrames.size(); ++i) { |
| 69 if (Page* page = m_deferredFrames[i]->page()) { | 70 if (Page* page = m_deferredFrames[i]->page()) { |
| 70 page->setDefersLoading(false); | 71 page->setDefersLoading(false); |
| 71 | 72 |
| 72 for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()-
>traverseNext()) { | 73 for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()-
>traverseNext()) { |
| 73 frame->document()->resumeActiveDOMObjects(); | 74 frame->document()->resumeActiveDOMObjects(); |
| 75 frame->document()->resumeScriptedAnimationControllerCallbacks(); |
| 74 frame->document()->asyncScriptRunner()->resume(); | 76 frame->document()->asyncScriptRunner()->resume(); |
| 75 if (DocumentParser* parser = frame->document()->parser()) | 77 if (DocumentParser* parser = frame->document()->parser()) |
| 76 parser->resumeScheduledTasks(); | 78 parser->resumeScheduledTasks(); |
| 77 } | 79 } |
| 78 } | 80 } |
| 79 } | 81 } |
| 80 } | 82 } |
| 81 | 83 |
| 82 | 84 |
| 83 } // namespace WebCore | 85 } // namespace WebCore |
| OLD | NEW |