Index: third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp |
diff --git a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp |
index 49a2d787ddd0905f4d6ca69cbd9aded38fa7b9a5..25df12691278e2dc1a0ef8e332c9130e38e93924 100644 |
--- a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp |
+++ b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp |
@@ -207,6 +207,9 @@ static void hibernateWrapper(WeakPtr<Canvas2DLayerBridge> bridge, double /*idleD |
void Canvas2DLayerBridge::hibernate() |
{ |
ASSERT(!isHibernating()); |
+ ASSERT(m_hibernationScheduled); |
+ |
+ m_hibernationScheduled = false; |
Stephen White
2016/02/26 20:16:04
For the future, it might be worth thinking about t
|
if (m_destructionInProgress) { |
m_logger->reportHibernationEvent(HibernationAbortedDueToPendingDestruction); |
@@ -421,10 +424,11 @@ void Canvas2DLayerBridge::setIsHidden(bool hidden) |
return; |
m_isHidden = newHiddenValue; |
- if (m_surface && isHidden() && !m_destructionInProgress) { |
+ if (m_surface && isHidden() && !m_destructionInProgress && !m_hibernationScheduled) { |
if (m_layer) |
m_layer->clearTexture(); |
m_logger->reportHibernationEvent(HibernationScheduled); |
+ m_hibernationScheduled = true; |
Platform::current()->currentThread()->scheduler()->postIdleTask(BLINK_FROM_HERE, WTF::bind<double>(&hibernateWrapper, m_weakPtrFactory.createWeakPtr())); |
} |
if (!isHidden() && m_softwareRenderingWhileHidden) { |