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

Unified Diff: Source/core/inspector/InspectorOverlay.cpp

Issue 777213002: Fix for InspectorOverlay violating document lifecycle expectations (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Oops removing files meant for a different CL. Created 6 years 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 | « Source/core/inspector/InspectorOverlay.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorOverlay.cpp
diff --git a/Source/core/inspector/InspectorOverlay.cpp b/Source/core/inspector/InspectorOverlay.cpp
index 32016f3b1f56f21c13adb4c2c7a4e42263f4ecd1..d5ab4f36bd97dd7b02b247660d3a58468389f63f 100644
--- a/Source/core/inspector/InspectorOverlay.cpp
+++ b/Source/core/inspector/InspectorOverlay.cpp
@@ -345,6 +345,7 @@ InspectorOverlay::InspectorOverlay(Page* page, InspectorClient* client)
, m_omitTooltip(false)
, m_timer(this, &InspectorOverlay::onTimer)
, m_activeProfilerCount(0)
+ , m_updating(false)
{
}
@@ -365,6 +366,11 @@ void InspectorOverlay::paint(GraphicsContext& context)
void InspectorOverlay::invalidate()
{
+ // Don't invalidate during an update, because that will lead to Document::scheduleRenderTreeUpdate
+ // being called within Document::updateRenderTree which violates document lifecycle expectations.
+ if (m_updating)
+ return;
+
m_client->highlight();
}
@@ -477,6 +483,8 @@ bool InspectorOverlay::isEmpty()
void InspectorOverlay::update()
{
+ TemporaryChange<bool> scoped(m_updating, true);
+
if (isEmpty()) {
m_client->hideHighlight();
return;
« no previous file with comments | « Source/core/inspector/InspectorOverlay.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698