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

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 2294253002: scheduler: Throttle timers in out-of-view frames (Closed)
Patch Set: Created 4 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) 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 Dirk Mueller <mueller@kde.org> 5 * 2000 Dirk Mueller <mueller@kde.org>
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * Copyright (C) 2009 Google Inc. All rights reserved. 9 * Copyright (C) 2009 Google Inc. All rights reserved.
10 * 10 *
(...skipping 4240 matching lines...) Expand 10 before | Expand all | Expand 10 after
4251 // If any of our parents are throttled, we must be too. 4251 // If any of our parents are throttled, we must be too.
4252 m_subtreeThrottled = false; 4252 m_subtreeThrottled = false;
4253 const SecurityOrigin* origin = frame().securityContext()->getSecurityOrigin( ); 4253 const SecurityOrigin* origin = frame().securityContext()->getSecurityOrigin( );
4254 for (Frame* parentFrame = m_frame->tree().parent(); parentFrame; parentFrame = parentFrame->tree().parent()) { 4254 for (Frame* parentFrame = m_frame->tree().parent(); parentFrame; parentFrame = parentFrame->tree().parent()) {
4255 const SecurityOrigin* parentOrigin = parentFrame->securityContext()->get SecurityOrigin(); 4255 const SecurityOrigin* parentOrigin = parentFrame->securityContext()->get SecurityOrigin();
4256 if (!origin->canAccess(parentOrigin)) 4256 if (!origin->canAccess(parentOrigin))
4257 m_crossOriginForThrottling = true; 4257 m_crossOriginForThrottling = true;
4258 if (parentFrame->isLocalFrame() && toLocalFrame(parentFrame)->view() && toLocalFrame(parentFrame)->view()->canThrottleRendering()) 4258 if (parentFrame->isLocalFrame() && toLocalFrame(parentFrame)->view() && toLocalFrame(parentFrame)->view()->canThrottleRendering())
4259 m_subtreeThrottled = true; 4259 m_subtreeThrottled = true;
4260 } 4260 }
4261 m_frame->frameScheduler()->setFrameVisible(!m_hiddenForThrottling);
4262 m_frame->frameScheduler()->setCrossOrigin(m_crossOriginForThrottling);
4261 } 4263 }
4262 4264
4263 void FrameView::notifyRenderThrottlingObserversForTesting() 4265 void FrameView::notifyRenderThrottlingObserversForTesting()
4264 { 4266 {
4265 DCHECK(m_renderThrottlingObserverNotificationFactory->isPending()); 4267 DCHECK(m_renderThrottlingObserverNotificationFactory->isPending());
4266 notifyRenderThrottlingObservers(); 4268 notifyRenderThrottlingObservers();
4267 } 4269 }
4268 4270
4269 void FrameView::notifyRenderThrottlingObservers() 4271 void FrameView::notifyRenderThrottlingObservers()
4270 { 4272 {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
4323 } 4325 }
4324 4326
4325 bool FrameView::canThrottleRendering() const 4327 bool FrameView::canThrottleRendering() const
4326 { 4328 {
4327 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) 4329 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled())
4328 return false; 4330 return false;
4329 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling); 4331 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling);
4330 } 4332 }
4331 4333
4332 } // namespace blink 4334 } // namespace blink
OLDNEW
« no previous file with comments | « content/public/common/content_features.cc ('k') | third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698