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

Unified Diff: ui/views/widget/widget.cc

Issue 2703933002: Fix a crash due to reentrancy in the widget while processing a theme changed notification after com… (Closed)
Patch Set: Created 3 years, 10 months 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 | « ui/views/widget/widget.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/widget.cc
diff --git a/ui/views/widget/widget.cc b/ui/views/widget/widget.cc
index 6063a224684cb38ec980a29621197060167065c1..7641cdfc996bd52818c9d1bcc678c93347db0f03 100644
--- a/ui/views/widget/widget.cc
+++ b/ui/views/widget/widget.cc
@@ -174,7 +174,8 @@ Widget::Widget()
auto_release_capture_(true),
views_with_layers_dirty_(false),
movement_disabled_(false),
- observer_manager_(this) {}
+ observer_manager_(this),
+ processing_theme_changed_(false) {}
Widget::~Widget() {
DestroyRootView();
@@ -898,6 +899,8 @@ void Widget::DebugToggleFrameType() {
}
void Widget::FrameTypeChanged() {
+ if (processing_theme_changed_)
+ return;
native_widget_->FrameTypeChanged();
}
@@ -1401,7 +1404,10 @@ void Widget::OnNativeThemeUpdated(ui::NativeTheme* observed_theme) {
observer_manager_.Add(current_native_theme);
}
+ DCHECK_EQ(processing_theme_changed_, false);
+ processing_theme_changed_ = true;
sky 2017/02/17 22:50:03 Use AutoReset.
ananta 2017/02/17 22:55:04 Done.
root_view_->PropagateNativeThemeChanged(current_native_theme);
+ processing_theme_changed_ = false;
}
////////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « ui/views/widget/widget.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698