| 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 23 matching lines...) Expand all Loading... |
| 34 ScopedPageLoadDeferrer::ScopedPageLoadDeferrer(Page* exclusion) | 34 ScopedPageLoadDeferrer::ScopedPageLoadDeferrer(Page* exclusion) |
| 35 { | 35 { |
| 36 const HashSet<Page*>& pages = Page::ordinaryPages(); | 36 const HashSet<Page*>& pages = Page::ordinaryPages(); |
| 37 | 37 |
| 38 HashSet<Page*>::const_iterator end = pages.end(); | 38 HashSet<Page*>::const_iterator end = pages.end(); |
| 39 for (HashSet<Page*>::const_iterator it = pages.begin(); it != end; ++it) { | 39 for (HashSet<Page*>::const_iterator it = pages.begin(); it != end; ++it) { |
| 40 Page* page = *it; | 40 Page* page = *it; |
| 41 if (page == exclusion || page->defersLoading()) | 41 if (page == exclusion || page->defersLoading()) |
| 42 continue; | 42 continue; |
| 43 | 43 |
| 44 m_deferredFrames.append(page->mainFrame()); | 44 if (page->mainFrame()->isLocalFrame()) { |
| 45 m_deferredFrames.append(toLocalFrame(page->mainFrame())); |
| 45 | 46 |
| 46 // Ensure that we notify the client if the initial empty document is acc
essed before | 47 // Ensure that we notify the client if the initial empty document is
accessed before |
| 47 // showing anything modal, to prevent spoofs while the modal window or s
heet is visible. | 48 // showing anything modal, to prevent spoofs while the modal window
or sheet is visible. |
| 48 page->mainFrame()->loader().notifyIfInitialDocumentAccessed(); | 49 toLocalFrame(page->mainFrame())->loader().notifyIfInitialDocumentAcc
essed(); |
| 50 } |
| 49 | 51 |
| 50 // This code is not logically part of load deferring, but we do not want
JS code executed | 52 // This code is not logically part of load deferring, but we do not want
JS code executed |
| 51 // beneath modal windows or sheets, which is exactly when ScopedPageLoad
Deferrer is used. | 53 // beneath modal windows or sheets, which is exactly when ScopedPageLoad
Deferrer is used. |
| 52 for (Frame* frame = page->mainFrame(); frame; frame = frame->tree().trav
erseNext()) { | 54 for (Frame* frame = page->mainFrame(); frame; frame = frame->tree().trav
erseNext()) { |
| 53 if (frame->isLocalFrame()) | 55 if (frame->isLocalFrame()) |
| 54 toLocalFrame(frame)->document()->suspendScheduledTasks(); | 56 toLocalFrame(frame)->document()->suspendScheduledTasks(); |
| 55 } | 57 } |
| 56 } | 58 } |
| 57 | 59 |
| 58 size_t count = m_deferredFrames.size(); | 60 size_t count = m_deferredFrames.size(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 70 | 72 |
| 71 for (Frame* frame = page->mainFrame(); frame; frame = frame->tree().
traverseNext()) { | 73 for (Frame* frame = page->mainFrame(); frame; frame = frame->tree().
traverseNext()) { |
| 72 if (frame->isLocalFrame()) | 74 if (frame->isLocalFrame()) |
| 73 toLocalFrame(frame)->document()->resumeScheduledTasks(); | 75 toLocalFrame(frame)->document()->resumeScheduledTasks(); |
| 74 } | 76 } |
| 75 } | 77 } |
| 76 } | 78 } |
| 77 } | 79 } |
| 78 | 80 |
| 79 } // namespace WebCore | 81 } // namespace WebCore |
| OLD | NEW |