summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/location_bar_view_gtk.cc
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-10 09:14:48 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-10 09:14:48 +0000
commitd57d13a6fbea0fc868f8a334857e228989cfbfdf (patch)
tree5f75615b9586493acbc08a74537063d033b2d54a /chrome/browser/gtk/location_bar_view_gtk.cc
parent88fc983023fd50fc762137f594c7198ff07889ff (diff)
downloadchromium_src-d57d13a6fbea0fc868f8a334857e228989cfbfdf.zip
chromium_src-d57d13a6fbea0fc868f8a334857e228989cfbfdf.tar.gz
chromium_src-d57d13a6fbea0fc868f8a334857e228989cfbfdf.tar.bz2
The test exposed similar problems on Linux and Mac as I fixed on Windows.
The test was failing because we get a call to UpdatePageActions while we are in the process of creating PageActions, which leads to an infinite loop (create vector, add page action, update page actions, delete vector, create vector, ...). BUG=58141 TEST=ExtensionApiTest.TestCrash57333 Review URL: http://codereview.chromium.org/3632001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62111 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/location_bar_view_gtk.cc')
-rw-r--r--chrome/browser/gtk/location_bar_view_gtk.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/chrome/browser/gtk/location_bar_view_gtk.cc b/chrome/browser/gtk/location_bar_view_gtk.cc
index 8d68fa5..6f02d2c 100644
--- a/chrome/browser/gtk/location_bar_view_gtk.cc
+++ b/chrome/browser/gtk/location_bar_view_gtk.cc
@@ -1240,7 +1240,7 @@ void LocationBarViewGtk::ContentSettingImageViewGtk::InfoBubbleClosing(
LocationBarViewGtk::PageActionViewGtk::PageActionViewGtk(
LocationBarViewGtk* owner, Profile* profile,
ExtensionAction* page_action)
- : owner_(owner),
+ : owner_(NULL),
profile_(profile),
page_action_(page_action),
last_icon_pixbuf_(NULL),
@@ -1278,6 +1278,10 @@ LocationBarViewGtk::PageActionViewGtk::PageActionViewGtk(
Extension::kPageActionIconMaxSize),
ImageLoadingTracker::DONT_CACHE);
}
+
+ // We set the owner last of all so that we can determine whether we are in
+ // the process of initializing this class or not.
+ owner_ = owner;
}
LocationBarViewGtk::PageActionViewGtk::~PageActionViewGtk() {
@@ -1377,7 +1381,11 @@ void LocationBarViewGtk::PageActionViewGtk::OnImageLoaded(
pixbufs_[page_action_->default_icon_path()] = pixbuf;
}
- owner_->UpdatePageActions();
+ // If we have no owner, that means this class is still being constructed and
+ // we should not UpdatePageActions, since it leads to the PageActions being
+ // destroyed again and new ones recreated (causing an infinite loop).
+ if (owner_)
+ owner_->UpdatePageActions();
}
void LocationBarViewGtk::PageActionViewGtk::TestActivatePageAction() {