diff options
Diffstat (limited to 'chrome/browser/alternate_nav_url_fetcher.h')
| -rw-r--r-- | chrome/browser/alternate_nav_url_fetcher.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/chrome/browser/alternate_nav_url_fetcher.h b/chrome/browser/alternate_nav_url_fetcher.h index 94833a4..b28b48f0 100644 --- a/chrome/browser/alternate_nav_url_fetcher.h +++ b/chrome/browser/alternate_nav_url_fetcher.h @@ -18,6 +18,13 @@ class NavigationController; // tell if the entry was a search or an intranet hostname. The autocomplete bar // assumes it's a query and issues an AlternateNavURLFetcher to display a "did // you mean" infobar suggesting a navigation. +// +// The memory management of this object is a bit tricky. The location bar view +// will create us and be responsible for us until we attach as an observer +// after a pending load starts (it will delete us if this doesn't happen). +// Once this pending load starts, we're responsible for deleting ourselves. +// We'll do this when the load commits, or when the navigation controller +// itself is deleted. class AlternateNavURLFetcher : public NotificationObserver, public URLFetcher::Delegate { public: @@ -29,7 +36,6 @@ class AlternateNavURLFetcher : public NotificationObserver, }; explicit AlternateNavURLFetcher(const std::wstring& alternate_nav_url); - virtual ~AlternateNavURLFetcher(); State state() const { return state_; } @@ -48,7 +54,8 @@ class AlternateNavURLFetcher : public NotificationObserver, private: // Displays the infobar if all conditions are met (the page has loaded and - // the fetch of the alternate URL succeeded). + // the fetch of the alternate URL succeeded). If the infobar is displayed, + // this object is no longer necessary and this function WILL DELETE |this|!. void ShowInfobarIfPossible(); std::wstring alternate_nav_url_; |
