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

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

Issue 517043003: Move Frame to the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Back out non-Oilpan experiment + tidy up by adding frame() ref accessors Created 6 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
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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 } 55 }
56 } 56 }
57 57
58 size_t count = m_deferredFrames.size(); 58 size_t count = m_deferredFrames.size();
59 for (size_t i = 0; i < count; ++i) { 59 for (size_t i = 0; i < count; ++i) {
60 if (Page* page = m_deferredFrames[i]->page()) 60 if (Page* page = m_deferredFrames[i]->page())
61 page->setDefersLoading(true); 61 page->setDefersLoading(true);
62 } 62 }
63 } 63 }
64 64
65 ScopedPageLoadDeferrer::~ScopedPageLoadDeferrer() 65 void ScopedPageLoadDeferrer::detach()
66 { 66 {
67 for (size_t i = 0; i < m_deferredFrames.size(); ++i) { 67 for (size_t i = 0; i < m_deferredFrames.size(); ++i) {
68 if (Page* page = m_deferredFrames[i]->page()) { 68 if (Page* page = m_deferredFrames[i]->page()) {
69 page->setDefersLoading(false); 69 page->setDefersLoading(false);
70 70
71 for (Frame* frame = page->mainFrame(); frame; frame = frame->tree(). traverseNext()) { 71 for (Frame* frame = page->mainFrame(); frame; frame = frame->tree(). traverseNext()) {
72 if (frame->isLocalFrame()) 72 if (frame->isLocalFrame())
73 toLocalFrame(frame)->document()->resumeScheduledTasks(); 73 toLocalFrame(frame)->document()->resumeScheduledTasks();
74 } 74 }
75 } 75 }
76 } 76 }
77 } 77 }
78 78
79 #if ENABLE(OILPAN)
80 void ScopedPageLoadDeferrer::dispose()
81 {
82 detach();
83 m_deferredFrames.clear();
84 }
85 #endif
86
87 ScopedPageLoadDeferrer::~ScopedPageLoadDeferrer()
88 {
89 detach();
90 }
91
92 void ScopedPageLoadDeferrer::trace(Visitor* visitor)
93 {
94 #if ENABLE(OILPAN)
95 visitor->trace(m_deferredFrames);
96 #endif
97 }
98
79 } // namespace blink 99 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698