summaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
authorccameron@chromium.org <ccameron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-27 05:39:40 +0000
committerccameron@chromium.org <ccameron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-27 05:39:40 +0000
commit79cda4bec24d368b8ae5fa6eaac4175a72f439c0 (patch)
treebeedf5cbd6ea957d90497216c4e4db2d5ecaff15 /cc
parente275aa4ab41d51be8a7e209711bb04a1309e9897 (diff)
downloadchromium_src-79cda4bec24d368b8ae5fa6eaac4175a72f439c0.zip
chromium_src-79cda4bec24d368b8ae5fa6eaac4175a72f439c0.tar.gz
chromium_src-79cda4bec24d368b8ae5fa6eaac4175a72f439c0.tar.bz2
Add crash instrumentation to help diagnose issue 151428.
This data is preserved in minidumps. Once I have some samples, I will revert this checkin. BUG=151428 Review URL: https://chromiumcodereview.appspot.com/10993051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@158980 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r--cc/CCResourceProvider.cpp29
-rw-r--r--cc/CCResourceProvider.h9
-rw-r--r--cc/CCThreadProxy.cpp6
3 files changed, 43 insertions, 1 deletions
diff --git a/cc/CCResourceProvider.cpp b/cc/CCResourceProvider.cpp
index 97e692f..8b580ea 100644
--- a/cc/CCResourceProvider.cpp
+++ b/cc/CCResourceProvider.cpp
@@ -11,6 +11,7 @@
#include <limits.h>
+#include "base/debug/alias.h"
#include "base/string_split.h"
#include "base/string_util.h"
#include "CCProxy.h"
@@ -319,7 +320,14 @@ const CCResourceProvider::Resource* CCResourceProvider::lockForRead(ResourceId i
{
ASSERT(CCProxy::isImplThread());
ResourceMap::iterator it = m_resources.find(id);
- CHECK(it != m_resources.end());
+ if (it == m_resources.end()) {
+ int commitsSinceLastEviction = m_commitsSinceLastEviction;
+ int commitsSinceLastContextLost = m_commitsSinceLastContextLost;
+ base::debug::Alias(&commitsSinceLastEviction);
+ base::debug::Alias(&commitsSinceLastContextLost);
+ CHECK(it != m_resources.end());
+ }
+
#if WTF_NEW_HASHMAP_ITERATORS_INTERFACE
Resource* resource = &it->value;
#else
@@ -702,4 +710,23 @@ void CCResourceProvider::trimMailboxDeque()
m_mailboxes.removeFirst();
}
+int CCResourceProvider::m_commitsSinceLastEviction = 1000;
+int CCResourceProvider::m_commitsSinceLastContextLost = 1000;
+
+void CCResourceProvider::debugNotifyEviction()
+{
+ m_commitsSinceLastEviction = 0;
+}
+
+void CCResourceProvider::debugNotifyContextLost()
+{
+ m_commitsSinceLastContextLost = 0;
+}
+
+void CCResourceProvider::debugIncrementCommitCount()
+{
+ m_commitsSinceLastEviction = std::min(m_commitsSinceLastEviction + 1, 1000);
+ m_commitsSinceLastContextLost = std::min(m_commitsSinceLastContextLost + 1, 1000);
+}
+
}
diff --git a/cc/CCResourceProvider.h b/cc/CCResourceProvider.h
index 9aa9c85..a81e496 100644
--- a/cc/CCResourceProvider.h
+++ b/cc/CCResourceProvider.h
@@ -146,6 +146,11 @@ public:
// Only for testing
size_t mailboxCount() const { return m_mailboxes.size(); }
+ // Temporary functions for debugging crashes in issue 151428 in canary
+ static void debugNotifyEviction();
+ static void debugNotifyContextLost();
+ static void debugIncrementCommitCount();
+
// The following lock classes are part of the CCResourceProvider API and are
// needed to read and write the resource contents. The user must ensure
// that they only use GL locks on GL resources, etc, and this is enforced
@@ -263,6 +268,10 @@ private:
OwnPtr<TextureUploader> m_textureUploader;
OwnPtr<AcceleratedTextureCopier> m_textureCopier;
int m_maxTextureSize;
+
+ static int m_commitsSinceLastEviction;
+ static int m_commitsSinceLastContextLost;
+
};
}
diff --git a/cc/CCThreadProxy.cpp b/cc/CCThreadProxy.cpp
index f2d831f..752ea2a 100644
--- a/cc/CCThreadProxy.cpp
+++ b/cc/CCThreadProxy.cpp
@@ -353,6 +353,9 @@ void CCThreadProxy::postAnimationEventsToMainThreadOnImplThread(PassOwnPtr<CCAni
void CCThreadProxy::releaseContentsTexturesOnImplThread()
{
ASSERT(isImplThread());
+
+ CCResourceProvider::debugNotifyEviction();
+
m_layerTreeHost->reduceContentsTexturesMemoryOnImplThread(0, m_layerTreeHostImpl->resourceProvider());
// Make sure that we get a new commit before drawing again.
m_resetContentsTexturesPurgedAfterCommitOnImplThread = false;
@@ -660,6 +663,8 @@ void CCThreadProxy::scheduledActionCommit()
m_layerTreeHostImpl->commitComplete();
+ CCResourceProvider::debugIncrementCommitCount();
+
m_nextFrameIsNewlyCommittedFrameOnImplThread = true;
m_commitCompletionEventOnImplThread->signal();
@@ -923,6 +928,7 @@ void CCThreadProxy::recreateContextOnImplThread(CCCompletionEvent* completion, C
{
TRACE_EVENT0("cc", "CCThreadProxy::recreateContextOnImplThread");
ASSERT(isImplThread());
+ CCResourceProvider::debugNotifyContextLost();
m_layerTreeHost->deleteContentsTexturesOnImplThread(m_layerTreeHostImpl->resourceProvider());
*recreateSucceeded = m_layerTreeHostImpl->initializeRenderer(adoptPtr(contextPtr));
if (*recreateSucceeded) {