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

Side by Side Diff: Source/core/page/ScopedPageLoadDeferrer.cpp

Issue 302213002: Convert page-level classes to handle RemoteFrames from FrameTree (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: bug fix Created 6 years, 6 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/core/page/PageSerializer.cpp ('k') | Source/core/page/SpatialNavigation.cpp » ('j') | 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 continue; 42 continue;
43 43
44 m_deferredFrames.append(page->mainFrame()); 44 m_deferredFrames.append(page->mainFrame());
45 45
46 // Ensure that we notify the client if the initial empty document is acc essed before 46 // Ensure that we notify the client if the initial empty document is acc essed before
47 // showing anything modal, to prevent spoofs while the modal window or s heet is visible. 47 // showing anything modal, to prevent spoofs while the modal window or s heet is visible.
48 page->mainFrame()->loader().notifyIfInitialDocumentAccessed(); 48 page->mainFrame()->loader().notifyIfInitialDocumentAccessed();
49 49
50 // This code is not logically part of load deferring, but we do not want JS code executed 50 // 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. 51 // beneath modal windows or sheets, which is exactly when ScopedPageLoad Deferrer is used.
52 for (LocalFrame* frame = page->mainFrame(); frame; frame = frame->tree() .traverseNext()) 52 for (Frame* frame = page->mainFrame(); frame; frame = frame->tree().trav erseNext()) {
53 frame->document()->suspendScheduledTasks(); 53 if (frame->isLocalFrame())
54 toLocalFrame(frame)->document()->suspendScheduledTasks();
55 }
54 } 56 }
55 57
56 size_t count = m_deferredFrames.size(); 58 size_t count = m_deferredFrames.size();
57 for (size_t i = 0; i < count; ++i) { 59 for (size_t i = 0; i < count; ++i) {
58 if (Page* page = m_deferredFrames[i]->page()) 60 if (Page* page = m_deferredFrames[i]->page())
59 page->setDefersLoading(true); 61 page->setDefersLoading(true);
60 } 62 }
61 } 63 }
62 64
63 ScopedPageLoadDeferrer::~ScopedPageLoadDeferrer() 65 ScopedPageLoadDeferrer::~ScopedPageLoadDeferrer()
64 { 66 {
65 for (size_t i = 0; i < m_deferredFrames.size(); ++i) { 67 for (size_t i = 0; i < m_deferredFrames.size(); ++i) {
66 if (Page* page = m_deferredFrames[i]->page()) { 68 if (Page* page = m_deferredFrames[i]->page()) {
67 page->setDefersLoading(false); 69 page->setDefersLoading(false);
68 70
69 for (LocalFrame* frame = page->mainFrame(); frame; frame = frame->tr ee().traverseNext()) 71 for (Frame* frame = page->mainFrame(); frame; frame = frame->tree(). traverseNext()) {
70 frame->document()->resumeScheduledTasks(); 72 if (frame->isLocalFrame())
73 toLocalFrame(frame)->document()->resumeScheduledTasks();
74 }
71 } 75 }
72 } 76 }
73 } 77 }
74 78
75 } // namespace WebCore 79 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/page/PageSerializer.cpp ('k') | Source/core/page/SpatialNavigation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698