Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: Source/WebCore/page/PageGroupLoadDeferrer.cpp

Issue 6537003: Merge 78648 - 2011-02-15 James Robinson <jamesr@chromium.org>... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/648/
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/WebCore/history/CachedFrame.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « Source/WebCore/history/CachedFrame.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698