summaryrefslogtreecommitdiffstats
path: root/cc/thread_proxy.cc
diff options
context:
space:
mode:
authorccameron@chromium.org <ccameron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-27 03:33:46 +0000
committerccameron@chromium.org <ccameron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-27 03:33:46 +0000
commit1235c9cc8ab58d5ac6ea9e1a07e02c0338dcada6 (patch)
tree1c876f602664e3bc63c7686ea46853c5ff1d9e44 /cc/thread_proxy.cc
parent81951e62b0c372573312440a40deabe7c47410e2 (diff)
downloadchromium_src-1235c9cc8ab58d5ac6ea9e1a07e02c0338dcada6.zip
chromium_src-1235c9cc8ab58d5ac6ea9e1a07e02c0338dcada6.tar.gz
chromium_src-1235c9cc8ab58d5ac6ea9e1a07e02c0338dcada6.tar.bz2
Verify that contentsTextureManager is non-NULL before dereferencing it.
BUG=158135 Review URL: https://chromiumcodereview.appspot.com/11311017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164498 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/thread_proxy.cc')
-rw-r--r--cc/thread_proxy.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/cc/thread_proxy.cc b/cc/thread_proxy.cc
index e8229ca..e110f5a 100644
--- a/cc/thread_proxy.cc
+++ b/cc/thread_proxy.cc
@@ -375,11 +375,17 @@ bool ThreadProxy::reduceContentsTextureMemoryOnImplThread(size_t limitBytes, int
void ThreadProxy::sendManagedMemoryStats()
{
DCHECK(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());
}
void ThreadProxy::setNeedsRedraw()