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

Side by Side Diff: Source/core/rendering/RenderFullScreen.cpp

Issue 414303006: Fix use-after-free related to RenderFullScreen (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: new deal Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/FullscreenElementStack.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) 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 if (child->isBox()) 162 if (child->isBox())
163 toRenderBox(child)->clearOverrideSize(); 163 toRenderBox(child)->clearOverrideSize();
164 child->remove(); 164 child->remove();
165 parent()->addChild(child, this); 165 parent()->addChild(child, this);
166 parent()->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation( ); 166 parent()->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation( );
167 } 167 }
168 } 168 }
169 if (placeholder()) 169 if (placeholder())
170 placeholder()->remove(); 170 placeholder()->remove();
171 remove(); 171 remove();
172 FullscreenElementStack::from(document()).setFullScreenRenderer(0); 172 destroy();
173 } 173 }
174 174
175 void RenderFullScreen::setPlaceholder(RenderBlock* placeholder) 175 void RenderFullScreen::setPlaceholder(RenderBlock* placeholder)
176 { 176 {
177 m_placeholder = placeholder; 177 m_placeholder = placeholder;
178 } 178 }
179 179
180 void RenderFullScreen::createPlaceholder(PassRefPtr<RenderStyle> style, const La youtRect& frameRect) 180 void RenderFullScreen::createPlaceholder(PassRefPtr<RenderStyle> style, const La youtRect& frameRect)
181 { 181 {
182 if (style->width().isAuto()) 182 if (style->width().isAuto())
183 style->setWidth(Length(frameRect.width(), Fixed)); 183 style->setWidth(Length(frameRect.width(), Fixed));
184 if (style->height().isAuto()) 184 if (style->height().isAuto())
185 style->setHeight(Length(frameRect.height(), Fixed)); 185 style->setHeight(Length(frameRect.height(), Fixed));
186 186
187 if (!m_placeholder) { 187 if (!m_placeholder) {
188 m_placeholder = new RenderFullScreenPlaceholder(this); 188 m_placeholder = new RenderFullScreenPlaceholder(this);
189 m_placeholder->setStyle(style); 189 m_placeholder->setStyle(style);
190 if (parent()) { 190 if (parent()) {
191 parent()->addChild(m_placeholder, this); 191 parent()->addChild(m_placeholder, this);
192 parent()->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation( ); 192 parent()->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation( );
193 } 193 }
194 } else 194 } else
195 m_placeholder->setStyle(style); 195 m_placeholder->setStyle(style);
196 } 196 }
OLDNEW
« no previous file with comments | « Source/core/dom/FullscreenElementStack.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698