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

Unified Diff: chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc

Issue 23490017: Adds some debugging code to isolate a crash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc
diff --git a/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc b/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc
index ea9f2dc77a27cae88fe4a3191d4684905b481306..e7114af3b564bdb07a3c9b33a65308dab782dff4 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc
@@ -41,10 +41,18 @@ class OmniboxPopupContentsView::AutocompletePopupWidget
: public views::Widget,
public base::SupportsWeakPtr<AutocompletePopupWidget> {
public:
- AutocompletePopupWidget() {}
- virtual ~AutocompletePopupWidget() {}
+ AutocompletePopupWidget() : crash_if_destroyed_(false) {}
+ virtual ~AutocompletePopupWidget() {
+ CHECK(!crash_if_destroyed_);
+ }
+
+ void set_crash_if_destroyed(bool value) { crash_if_destroyed_ = value; }
private:
+ // For debugging a crash.
+ // TODO(sky): nuke this when we figure out 275794.
+ bool crash_if_destroyed_;
+
DISALLOW_COPY_AND_ASSIGN(AutocompletePopupWidget);
};
@@ -215,7 +223,9 @@ void OmniboxPopupContentsView::UpdatePopupAppearance() {
params.parent = popup_parent;
params.bounds = GetPopupBounds();
params.context = popup_parent;
+ popup_->set_crash_if_destroyed(true);
popup_->Init(params);
+ popup_->set_crash_if_destroyed(false);
#if defined(USE_AURA)
views::corewm::SetWindowVisibilityAnimationType(
popup_->GetNativeView(),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698