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

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

Issue 3446004: Merge 66813 - 2010-08-31 Yury Semikhatsky <yurys@chromium.org>... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/517/
Patch Set: Created 10 years, 3 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 | « LayoutTests/inspector/debugger-suspend-active-dom-objects-expected.txt ('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 21 matching lines...) Expand all
32 using namespace std; 32 using namespace std;
33 33
34 PageGroupLoadDeferrer::PageGroupLoadDeferrer(Page* page, bool deferSelf) 34 PageGroupLoadDeferrer::PageGroupLoadDeferrer(Page* page, bool deferSelf)
35 { 35 {
36 const HashSet<Page*>& pages = page->group().pages(); 36 const HashSet<Page*>& pages = page->group().pages();
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* otherPage = *it; 40 Page* otherPage = *it;
41 if ((deferSelf || otherPage != page)) { 41 if ((deferSelf || otherPage != page)) {
42 if (!otherPage->defersLoading()) 42 if (!otherPage->defersLoading()) {
43 m_deferredFrames.append(otherPage->mainFrame()); 43 m_deferredFrames.append(otherPage->mainFrame());
44 44
45 // This code is not logically part of load deferring, but we do not want JS code executed beneath modal 45 // This code is not logically part of load deferring, but we do not want JS code executed beneath modal
46 // windows or sheets, which is exactly when PageGroupLoadDeferrer is used. 46 // windows or sheets, which is exactly when PageGroupLoadDeferre r is used.
47 for (Frame* frame = otherPage->mainFrame(); frame; frame = frame->tr ee()->traverseNext()) { 47 for (Frame* frame = otherPage->mainFrame(); frame; frame = frame ->tree()->traverseNext()) {
48 frame->document()->suspendActiveDOMObjects(); 48 frame->document()->suspendActiveDOMObjects();
49 frame->document()->asyncScriptRunner()->suspend(); 49 frame->document()->asyncScriptRunner()->suspend();
50 }
50 } 51 }
51 } 52 }
52 } 53 }
53 54
54 size_t count = m_deferredFrames.size(); 55 size_t count = m_deferredFrames.size();
55 for (size_t i = 0; i < count; ++i) 56 for (size_t i = 0; i < count; ++i)
56 if (Page* page = m_deferredFrames[i]->page()) 57 if (Page* page = m_deferredFrames[i]->page())
57 page->setDefersLoading(true); 58 page->setDefersLoading(true);
58 } 59 }
59 60
60 PageGroupLoadDeferrer::~PageGroupLoadDeferrer() 61 PageGroupLoadDeferrer::~PageGroupLoadDeferrer()
61 { 62 {
62 for (size_t i = 0; i < m_deferredFrames.size(); ++i) { 63 for (size_t i = 0; i < m_deferredFrames.size(); ++i) {
63 if (Page* page = m_deferredFrames[i]->page()) { 64 if (Page* page = m_deferredFrames[i]->page()) {
64 page->setDefersLoading(false); 65 page->setDefersLoading(false);
65 66
66 for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()- >traverseNext()) { 67 for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()- >traverseNext()) {
67 frame->document()->resumeActiveDOMObjects(); 68 frame->document()->resumeActiveDOMObjects();
68 frame->document()->asyncScriptRunner()->resume(); 69 frame->document()->asyncScriptRunner()->resume();
69 } 70 }
70 } 71 }
71 } 72 }
72 } 73 }
73 74
74 75
75 } // namespace WebCore 76 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/inspector/debugger-suspend-active-dom-objects-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698