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

Unified Diff: cc/single_thread_proxy.cc

Issue 11311017: Verify that contentsTextureManager is non-NULL before dereferencing it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cc/thread_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/single_thread_proxy.cc
diff --git a/cc/single_thread_proxy.cc b/cc/single_thread_proxy.cc
index 5cbe3d209ee02c12ca53ca783e982eb4137f8fa5..b4d673aff94e6bc816568d967cbc8a8e038aa4f0 100644
--- a/cc/single_thread_proxy.cc
+++ b/cc/single_thread_proxy.cc
@@ -289,11 +289,17 @@ bool SingleThreadProxy::reduceContentsTextureMemoryOnImplThread(size_t limitByte
void SingleThreadProxy::sendManagedMemoryStats()
{
DCHECK(Proxy::isImplThread());
- if (m_layerTreeHostImpl.get() && m_layerTreeHostImpl->renderer())
- m_layerTreeHostImpl->renderer()->sendManagedMemoryStats(
- m_layerTreeHost->contentsTextureManager()->memoryVisibleBytes(),
- m_layerTreeHost->contentsTextureManager()->memoryVisibleAndNearbyBytes(),
- m_layerTreeHost->contentsTextureManager()->memoryUseBytes());
+ if (!m_layerTreeHostImpl.get())
+ return;
+ if (!m_layerTreeHostImpl->renderer())
+ return;
+ if (!m_layerTreeHost->contentsTextureManager())
+ return;
+
+ m_layerTreeHostImpl->renderer()->sendManagedMemoryStats(
+ m_layerTreeHost->contentsTextureManager()->memoryVisibleBytes(),
+ m_layerTreeHost->contentsTextureManager()->memoryVisibleAndNearbyBytes(),
+ m_layerTreeHost->contentsTextureManager()->memoryUseBytes());
}
// Called by the legacy scheduling path (e.g. where render_widget does the scheduling)
« no previous file with comments | « no previous file | cc/thread_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698