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

Issue 11339060: Fix a crash that could occur if the user closed a tab with an uncommitted search navigation that we… (Closed)

Created:
8 years, 1 month ago by Peter Kasting
Modified:
8 years, 1 month ago
Reviewers:
Ilya Sherman
CC:
chromium-reviews
Visibility:
Public.

Description

Fix a crash that could occur if the user closed a tab with an uncommitted search navigation that we were planning to show a GoogleURLTracker infobar for. In this case the WebContents being destroyed does not necessarily have a valid InfoBarTabHelper anymore. This also fixes names and comments relating to the EntryMap (nee InfoBarMap) that probably should have been changed when I added GoogleURLTrackerMapEntry. BUG=158201 TEST=none Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=165468

Patch Set 1 #

Total comments: 4

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+124 lines, -103 lines) Patch
M chrome/browser/google/google_url_tracker.h View 3 chunks +17 lines, -13 lines 0 comments Download
M chrome/browser/google/google_url_tracker.cc View 1 14 chunks +88 lines, -73 lines 0 comments Download
M chrome/browser/google/google_url_tracker_map_entry.cc View 1 chunk +5 lines, -2 lines 0 comments Download
M chrome/browser/google/google_url_tracker_unittest.cc View 1 5 chunks +14 lines, -15 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Peter Kasting
8 years, 1 month ago (2012-10-30 23:27:46 UTC) #1
Ilya Sherman
Can you add a test for this? Otherwise LGTM. https://codereview.chromium.org/11339060/diff/1/chrome/browser/google/google_url_tracker.cc File chrome/browser/google/google_url_tracker.cc (right): https://codereview.chromium.org/11339060/diff/1/chrome/browser/google/google_url_tracker.cc#newcode256 chrome/browser/google/google_url_tracker.cc:256: ...
8 years, 1 month ago (2012-10-30 23:49:40 UTC) #2
Peter Kasting
8 years, 1 month ago (2012-10-30 23:55:04 UTC) #3
There isn't a way to test this with the current system that I know of, because
we don't actually create a real WebContents and thus we don't fire real
notifications, have a real InfoBarTabHelper, etc.  We just call the handlers
directly from the test framework.

Even if we did create the real objects, we'd have to guarantee the notification
observers were called in the appropriate order to reproduce the original bug
conditions, and then I'm not sure what we'd actually test -- just that the test
didn't crash?

https://codereview.chromium.org/11339060/diff/1/chrome/browser/google/google_...
File chrome/browser/google/google_url_tracker.cc (right):

https://codereview.chromium.org/11339060/diff/1/chrome/browser/google/google_...
chrome/browser/google/google_url_tracker.cc:256:
&web_contents->GetController()),
On 2012/10/30 23:49:40, Ilya Sherman wrote:
> nit: Re-indent this line as well

Done.

https://codereview.chromium.org/11339060/diff/1/chrome/browser/google/google_...
File chrome/browser/google/google_url_tracker.h (right):

https://codereview.chromium.org/11339060/diff/1/chrome/browser/google/google_...
chrome/browser/google/google_url_tracker.h:178: void CloseAllEntries(bool
redo_searches);
On 2012/10/30 23:49:40, Ilya Sherman wrote:
> nit: Perhaps "CloseAllMappedInfoBars"?  Closing an "entry" doesn't seem like a
> very intuitive notion to me.

I called it this because the MapEntry function is called Close(), and it's
meaningful even in the absence of an infobar.

I am not really sure how to name that function better :/

Powered by Google App Engine
This is Rietveld 408576698