diff options
author | ccameron@chromium.org <ccameron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-27 03:33:46 +0000 |
---|---|---|
committer | ccameron@chromium.org <ccameron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-27 03:33:46 +0000 |
commit | 1235c9cc8ab58d5ac6ea9e1a07e02c0338dcada6 (patch) | |
tree | 1c876f602664e3bc63c7686ea46853c5ff1d9e44 /cc | |
parent | 81951e62b0c372573312440a40deabe7c47410e2 (diff) | |
download | chromium_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')
-rw-r--r-- | cc/single_thread_proxy.cc | 16 | ||||
-rw-r--r-- | cc/thread_proxy.cc | 16 |
2 files changed, 22 insertions, 10 deletions
diff --git a/cc/single_thread_proxy.cc b/cc/single_thread_proxy.cc index 9433e1a..1089e30 100644 --- a/cc/single_thread_proxy.cc +++ b/cc/single_thread_proxy.cc @@ -295,11 +295,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) 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() |