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

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

Issue 2023033003: scheduler: Throttle timers in out-of-view frames (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased 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 4239 matching lines...) Expand 10 before | Expand all | Expand 10 after
4250 // If any of our parents are throttled, we must be too. 4250 // If any of our parents are throttled, we must be too.
4251 m_subtreeThrottled = false; 4251 m_subtreeThrottled = false;
4252 const SecurityOrigin* origin = frame().securityContext()->getSecurityOrigin( ); 4252 const SecurityOrigin* origin = frame().securityContext()->getSecurityOrigin( );
4253 for (Frame* parentFrame = m_frame->tree().parent(); parentFrame; parentFrame = parentFrame->tree().parent()) { 4253 for (Frame* parentFrame = m_frame->tree().parent(); parentFrame; parentFrame = parentFrame->tree().parent()) {
4254 const SecurityOrigin* parentOrigin = parentFrame->securityContext()->get SecurityOrigin(); 4254 const SecurityOrigin* parentOrigin = parentFrame->securityContext()->get SecurityOrigin();
4255 if (!origin->canAccess(parentOrigin)) 4255 if (!origin->canAccess(parentOrigin))
4256 m_crossOriginForThrottling = true; 4256 m_crossOriginForThrottling = true;
4257 if (parentFrame->isLocalFrame() && toLocalFrame(parentFrame)->view() && toLocalFrame(parentFrame)->view()->canThrottleRendering()) 4257 if (parentFrame->isLocalFrame() && toLocalFrame(parentFrame)->view() && toLocalFrame(parentFrame)->view()->canThrottleRendering())
4258 m_subtreeThrottled = true; 4258 m_subtreeThrottled = true;
4259 } 4259 }
4260 m_frame->frameScheduler()->setFrameVisible(!m_hiddenForThrottling);
4261 m_frame->frameScheduler()->setCrossOrigin(m_crossOriginForThrottling);
4260 } 4262 }
4261 4263
4262 void FrameView::notifyRenderThrottlingObserversForTesting() 4264 void FrameView::notifyRenderThrottlingObserversForTesting()
4263 { 4265 {
4264 DCHECK(m_renderThrottlingObserverNotificationFactory->isPending()); 4266 DCHECK(m_renderThrottlingObserverNotificationFactory->isPending());
4265 notifyRenderThrottlingObservers(); 4267 notifyRenderThrottlingObservers();
4266 } 4268 }
4267 4269
4268 void FrameView::notifyRenderThrottlingObservers() 4270 void FrameView::notifyRenderThrottlingObservers()
4269 { 4271 {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
4322 } 4324 }
4323 4325
4324 bool FrameView::canThrottleRendering() const 4326 bool FrameView::canThrottleRendering() const
4325 { 4327 {
4326 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) 4328 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled())
4327 return false; 4329 return false;
4328 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling); 4330 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling);
4329 } 4331 }
4330 4332
4331 } // namespace blink 4333 } // 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