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

Unified Diff: chrome/browser/google/google_url_tracker.h

Issue 11366075: Merge 165468 - Fix a crash that could occur if the user closed a tab with an uncommitted search nav… (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1312/src/
Patch Set: Created 8 years, 1 month 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 | chrome/browser/google/google_url_tracker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/google/google_url_tracker.h
===================================================================
--- chrome/browser/google/google_url_tracker.h (revision 165800)
+++ chrome/browser/google/google_url_tracker.h (working copy)
@@ -102,7 +102,7 @@
friend class GoogleURLTrackerTest;
typedef std::map<const InfoBarTabHelper*,
- GoogleURLTrackerMapEntry*> InfoBarMap;
+ GoogleURLTrackerMapEntry*> EntryMap;
// net::URLFetcherDelegate:
virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE;
@@ -152,26 +152,30 @@
InfoBarTabHelper* infobar_helper,
int pending_id);
- // Called by Observe() once a load we're watching commits, or the associated
- // tab is closed. |infobar_helper| is the same as for OnNavigationPending();
- // |search_url| is valid when this call is due to a successful navigation
- // (indicating that we should show or update the relevant infobar) as opposed
- // to tab closure (which means we should delete the infobar).
- void OnNavigationCommittedOrTabClosed(InfoBarTabHelper* infobar_helper,
- const GURL& search_url);
+ // Called by Observe() once a load we're watching commits. |infobar_helper|
+ // is the same as for OnNavigationPending(); |search_url| is guaranteed to be
+ // valid.
+ void OnNavigationCommitted(InfoBarTabHelper* infobar_helper,
+ const GURL& search_url);
+ // Called by Observe() when a tab closes. Because the InfoBarTabHelper may
+ // have already been torn down in this case, we look up the appropriate map
+ // entry by |web_contents_source| instead.
+ void OnTabClosed(const content::NotificationSource& web_contents_source);
+
// Called by Observe() when an instant navigation occurs. This will call
// OnNavigationPending(), and, depending on whether this is a search we were
- // listening for, may then also call OnNavigationCommittedOrTabClosed().
+ // listening for, may then also call OnNavigationCommitted().
void OnInstantCommitted(
const content::NotificationSource& navigation_controller_source,
const content::NotificationSource& web_contents_source,
InfoBarTabHelper* infobar_helper,
const GURL& search_url);
- // Closes all open infobars. If |redo_searches| is true, this also triggers
- // each tab to re-perform the user's search, but on the new Google TLD.
- void CloseAllInfoBars(bool redo_searches);
+ // Closes all map entries. If |redo_searches| is true, this also triggers
+ // each tab with an infobar to re-perform the user's search, but on the new
+ // Google TLD.
+ void CloseAllEntries(bool redo_searches);
// Unregisters any listeners for the notification sources in |map_entry|.
// This sanity-DCHECKs that these are registered (or not) in the specific
@@ -214,7 +218,7 @@
// nor the last prompted Google URL.
bool search_committed_; // True when we're expecting a notification of a new
// pending search navigation.
- InfoBarMap infobar_map_;
+ EntryMap entry_map_;
DISALLOW_COPY_AND_ASSIGN(GoogleURLTracker);
};
« no previous file with comments | « no previous file | chrome/browser/google/google_url_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698