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

Side by Side Diff: Source/core/frame/Frame.cpp

Issue 117703004: Free temporary GPU and memory resources held by inactive or hidden 2D canvases (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: improved test Created 6 years, 11 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Simon Hausmann <hausmann@kde.org> 5 * 2000 Simon Hausmann <hausmann@kde.org>
6 * 2000 Stefan Schimanski <1Stein@gmx.de> 6 * 2000 Stefan Schimanski <1Stein@gmx.de>
7 * 2001 George Staikos <staikos@kde.org> 7 * 2001 George Staikos <staikos@kde.org>
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> 9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com>
10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 return 0; 331 return 0;
332 // FIXME: If <object> is ever fixed to disassociate itself from frames 332 // FIXME: If <object> is ever fixed to disassociate itself from frames
333 // that it has started but canceled, then this can turn into an ASSERT 333 // that it has started but canceled, then this can turn into an ASSERT
334 // since ownerElement() would be 0 when the load is canceled. 334 // since ownerElement() would be 0 when the load is canceled.
335 // https://bugs.webkit.org/show_bug.cgi?id=18585 335 // https://bugs.webkit.org/show_bug.cgi?id=18585
336 if (!object->isRenderPart()) 336 if (!object->isRenderPart())
337 return 0; 337 return 0;
338 return toRenderPart(object); 338 return toRenderPart(object);
339 } 339 }
340 340
341 void Frame::dispatchVisibilityStateChangeEvent() 341 void Frame::didChangeVisibilityState()
342 { 342 {
343 if (document()) 343 if (document())
344 document()->dispatchVisibilityStateChangeEvent(); 344 document()->didChangeVisibilityState();
345 345
346 Vector<RefPtr<Frame> > childFrames; 346 Vector<RefPtr<Frame> > childFrames;
347 for (Frame* child = tree().firstChild(); child; child = child->tree().nextSi bling()) 347 for (Frame* child = tree().firstChild(); child; child = child->tree().nextSi bling())
348 childFrames.append(child); 348 childFrames.append(child);
349 349
350 for (size_t i = 0; i < childFrames.size(); ++i) 350 for (size_t i = 0; i < childFrames.size(); ++i)
351 childFrames[i]->dispatchVisibilityStateChangeEvent(); 351 childFrames[i]->didChangeVisibilityState();
352 } 352 }
353 353
354 void Frame::willDetachFrameHost() 354 void Frame::willDetachFrameHost()
355 { 355 {
356 // We should never be detatching the page during a Layout. 356 // We should never be detatching the page during a Layout.
357 RELEASE_ASSERT(!m_view || !m_view->isInPerformLayout()); 357 RELEASE_ASSERT(!m_view || !m_view->isInPerformLayout());
358 358
359 if (Frame* parent = tree().parent()) 359 if (Frame* parent = tree().parent())
360 parent->loader().checkLoadComplete(); 360 parent->loader().checkLoadComplete();
361 361
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 if (!m_host) 739 if (!m_host)
740 return 0; 740 return 0;
741 741
742 double ratio = m_host->deviceScaleFactor(); 742 double ratio = m_host->deviceScaleFactor();
743 if (RuntimeEnabledFeatures::devicePixelRatioIncludesZoomEnabled()) 743 if (RuntimeEnabledFeatures::devicePixelRatioIncludesZoomEnabled())
744 ratio *= pageZoomFactor(); 744 ratio *= pageZoomFactor();
745 return ratio; 745 return ratio;
746 } 746 }
747 747
748 } // namespace WebCore 748 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698