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

Issue 9491009: Show queued geolocation InfoBars when InfoBar is hidden. (Closed)

Created:
8 years, 9 months ago by John Knottenbelt
Modified:
8 years, 9 months ago
CC:
chromium-reviews, tfarina
Visibility:
Public.

Description

Show queued geolocation InfoBars when InfoBar is hidden. This change should fix a crash in GeolocationBrowserTest.TabDestroyed browser test. Instead of showing queued info bars when the GeolocationConfirmInfobarDelegate is destroyed, show it in response to the INFOBAR_REMOVED notification. This will enable InfoBarTabHelper to successfully close all infobars. Consequently, we don't need to listen on WEB_CONTENTS_DESTROYED notification. BUG=70588 TEST=GeolocationBrowserTest.TabDestroyed Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=128467 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=129186

Patch Set 1 #

Total comments: 14

Patch Set 2 : Requested changes. #

Total comments: 13

Patch Set 3 : Requested changes. #

Patch Set 4 : Fix the unit tests. #

Patch Set 5 : Prevent double notification. #

Patch Set 6 : Refactor to make logic clearer. #

Total comments: 10

Patch Set 7 : Marcus requested changes. #

Total comments: 14

Patch Set 8 : Requested changes. #

Patch Set 9 : Fix TabDestroyed memory management. #

Patch Set 10 : Fix memory leak in TabDestroyed unit test, suppress gtk memory leak. #

Total comments: 4

Patch Set 11 : Requested changes. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+166 lines, -120 lines) Patch
M chrome/browser/geolocation/chrome_geolocation_permission_context.cc View 1 2 3 4 5 6 7 11 chunks +142 lines, -109 lines 0 comments Download
M chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc View 1 2 3 4 5 6 7 8 9 10 9 chunks +16 lines, -11 lines 0 comments Download
M tools/valgrind/memcheck/suppressions.txt View 1 2 3 4 5 6 7 8 9 2 chunks +8 lines, -0 lines 0 comments Download

Messages

Total messages: 33 (0 generated)
John Knottenbelt
I'm following Peter's suggested approach in http://code.google.com/p/chromium/issues/detail?id=70588 Please take a look, comments and suggestions very ...
8 years, 9 months ago (2012-02-28 14:19:45 UTC) #1
bulach
thanks john! a few comments below: https://chromiumcodereview.appspot.com/9491009/diff/1/chrome/browser/geolocation/chrome_geolocation_permission_context.cc File chrome/browser/geolocation/chrome_geolocation_permission_context.cc (left): https://chromiumcodereview.appspot.com/9491009/diff/1/chrome/browser/geolocation/chrome_geolocation_permission_context.cc#oldcode467 chrome/browser/geolocation/chrome_geolocation_permission_context.cc:467: registrar_.Remove(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, as ...
8 years, 9 months ago (2012-02-28 17:20:34 UTC) #2
Peter Kasting
https://chromiumcodereview.appspot.com/9491009/diff/1/chrome/browser/geolocation/chrome_geolocation_permission_context.cc File chrome/browser/geolocation/chrome_geolocation_permission_context.cc (left): https://chromiumcodereview.appspot.com/9491009/diff/1/chrome/browser/geolocation/chrome_geolocation_permission_context.cc#oldcode467 chrome/browser/geolocation/chrome_geolocation_permission_context.cc:467: registrar_.Remove(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, On 2012/02/28 17:20:34, bulach wrote: > as ...
8 years, 9 months ago (2012-02-28 19:34:59 UTC) #3
tfarina
http://codereview.chromium.org/9491009/diff/1/chrome/browser/geolocation/chrome_geolocation_permission_context.cc File chrome/browser/geolocation/chrome_geolocation_permission_context.cc (right): http://codereview.chromium.org/9491009/diff/1/chrome/browser/geolocation/chrome_geolocation_permission_context.cc#newcode25 chrome/browser/geolocation/chrome_geolocation_permission_context.cc:25: #include "chrome/common/chrome_notification_types.h" nit: sort, should be before extension.h
8 years, 9 months ago (2012-02-28 23:20:58 UTC) #4
bulach
clarifying peter's comments below, please let me know your thoughts: https://chromiumcodereview.appspot.com/9491009/diff/1/chrome/browser/geolocation/chrome_geolocation_permission_context.cc File chrome/browser/geolocation/chrome_geolocation_permission_context.cc (left): https://chromiumcodereview.appspot.com/9491009/diff/1/chrome/browser/geolocation/chrome_geolocation_permission_context.cc#oldcode467 ...
8 years, 9 months ago (2012-02-29 11:29:29 UTC) #5
Peter Kasting
https://chromiumcodereview.appspot.com/9491009/diff/1/chrome/browser/geolocation/chrome_geolocation_permission_context.cc File chrome/browser/geolocation/chrome_geolocation_permission_context.cc (left): https://chromiumcodereview.appspot.com/9491009/diff/1/chrome/browser/geolocation/chrome_geolocation_permission_context.cc#oldcode467 chrome/browser/geolocation/chrome_geolocation_permission_context.cc:467: registrar_.Remove(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, On 2012/02/29 11:29:29, bulach wrote: > On ...
8 years, 9 months ago (2012-02-29 20:47:54 UTC) #6
John Knottenbelt
https://chromiumcodereview.appspot.com/9491009/diff/1/chrome/browser/geolocation/chrome_geolocation_permission_context.cc File chrome/browser/geolocation/chrome_geolocation_permission_context.cc (right): https://chromiumcodereview.appspot.com/9491009/diff/1/chrome/browser/geolocation/chrome_geolocation_permission_context.cc#newcode25 chrome/browser/geolocation/chrome_geolocation_permission_context.cc:25: #include "chrome/common/chrome_notification_types.h" On 2012/02/28 23:20:58, tfarina wrote: > nit: ...
8 years, 9 months ago (2012-03-01 10:10:49 UTC) #7
bulach
https://chromiumcodereview.appspot.com/9491009/diff/1/chrome/browser/geolocation/chrome_geolocation_permission_context.cc File chrome/browser/geolocation/chrome_geolocation_permission_context.cc (left): https://chromiumcodereview.appspot.com/9491009/diff/1/chrome/browser/geolocation/chrome_geolocation_permission_context.cc#oldcode467 chrome/browser/geolocation/chrome_geolocation_permission_context.cc:467: registrar_.Remove(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, On 2012/02/29 20:47:54, Peter Kasting wrote: > ...
8 years, 9 months ago (2012-03-01 11:19:32 UTC) #8
John Knottenbelt
Patch set 2 makes the suggested changes.
8 years, 9 months ago (2012-03-01 15:41:38 UTC) #9
tfarina
https://chromiumcodereview.appspot.com/9491009/diff/8001/chrome/browser/geolocation/chrome_geolocation_permission_context.cc File chrome/browser/geolocation/chrome_geolocation_permission_context.cc (right): https://chromiumcodereview.appspot.com/9491009/diff/8001/chrome/browser/geolocation/chrome_geolocation_permission_context.cc#newcode93 chrome/browser/geolocation/chrome_geolocation_permission_context.cc:93: // content::NotificationObserver (NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED) nit: we usually don't specify in ...
8 years, 9 months ago (2012-03-01 16:14:23 UTC) #10
Peter Kasting
LGTM https://chromiumcodereview.appspot.com/9491009/diff/8001/chrome/browser/geolocation/chrome_geolocation_permission_context.cc File chrome/browser/geolocation/chrome_geolocation_permission_context.cc (right): https://chromiumcodereview.appspot.com/9491009/diff/8001/chrome/browser/geolocation/chrome_geolocation_permission_context.cc#newcode447 chrome/browser/geolocation/chrome_geolocation_permission_context.cc:447: DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); Nit: I don't think this DCHECK is ...
8 years, 9 months ago (2012-03-01 19:46:54 UTC) #11
John Knottenbelt
Thanks for all your help guys! https://chromiumcodereview.appspot.com/9491009/diff/8001/chrome/browser/geolocation/chrome_geolocation_permission_context.cc File chrome/browser/geolocation/chrome_geolocation_permission_context.cc (right): https://chromiumcodereview.appspot.com/9491009/diff/8001/chrome/browser/geolocation/chrome_geolocation_permission_context.cc#newcode93 chrome/browser/geolocation/chrome_geolocation_permission_context.cc:93: // content::NotificationObserver (NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED) ...
8 years, 9 months ago (2012-03-02 11:47:26 UTC) #12
John Knottenbelt
Looks like the change broke some Geolocation unit tests. Will investigate.
8 years, 9 months ago (2012-03-02 12:06:12 UTC) #13
John Knottenbelt
8 years, 9 months ago (2012-03-21 14:43:01 UTC) #14
John Knottenbelt
In this latest change, I have refactored things a little to make it easier to ...
8 years, 9 months ago (2012-03-22 15:21:41 UTC) #15
bulach
hi john, a few general comments, I'll look into more details tomorrow: https://chromiumcodereview.appspot.com/9491009/diff/27001/chrome/browser/geolocation/chrome_geolocation_permission_context.cc File chrome/browser/geolocation/chrome_geolocation_permission_context.cc ...
8 years, 9 months ago (2012-03-22 17:01:45 UTC) #16
John Knottenbelt
Thanks for review Marcus, I've made the requested changes. I actually removed CancelInfoBarRequestInternal altogether now, ...
8 years, 9 months ago (2012-03-22 18:09:02 UTC) #17
bulach
lgtm I like this flow, thanks john! a few more suggestions to help clarify it: ...
8 years, 9 months ago (2012-03-23 11:01:46 UTC) #18
John Knottenbelt
Thanks again. http://chromiumcodereview.appspot.com/9491009/diff/32002/chrome/browser/geolocation/chrome_geolocation_permission_context.cc File chrome/browser/geolocation/chrome_geolocation_permission_context.cc (right): http://chromiumcodereview.appspot.com/9491009/diff/32002/chrome/browser/geolocation/chrome_geolocation_permission_context.cc#newcode109 chrome/browser/geolocation/chrome_geolocation_permission_context.cc:109: // Removes any pending requests for a ...
8 years, 9 months ago (2012-03-23 11:45:50 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jknotten@chromium.org/9491009/35001
8 years, 9 months ago (2012-03-23 11:48:39 UTC) #20
commit-bot: I haz the power
Change committed as 128467
8 years, 9 months ago (2012-03-23 12:57:24 UTC) #21
John Knottenbelt
Looks like this has caused a leak: operator new(unsigned long) (m_replacemalloc/vg_replace_malloc.c:1074) GeolocationInfoBarQueueController::ShowQueuedInfoBar(int, int, InfoBarTabHelper*) (chrome/browser/geolocation/chrome_geolocation_permission_context.cc:564) ...
8 years, 9 months ago (2012-03-23 13:59:12 UTC) #22
John Knottenbelt
Am I right in thinking that the InfoBarDelegate will be destroyed naturally in InfoBar::MaybeDelete() called ...
8 years, 9 months ago (2012-03-23 17:31:21 UTC) #23
Peter Kasting
On 2012/03/23 17:31:21, John Knottenbelt wrote: > Can we fix up the GeolocationPermissionContextTests by creating ...
8 years, 9 months ago (2012-03-23 18:17:20 UTC) #24
John Knottenbelt
Sorry, I just read this message after uploading my latest patch. I didn't create an ...
8 years, 9 months ago (2012-03-23 18:44:44 UTC) #25
Peter Kasting
On 2012/03/23 18:44:44, John Knottenbelt wrote: > Sorry, I just read this message after uploading ...
8 years, 9 months ago (2012-03-23 19:00:41 UTC) #26
John Knottenbelt
This patch is patch 8 + fix for leaking delegate in TabDestroyed test. In running ...
8 years, 9 months ago (2012-03-26 10:34:35 UTC) #27
Peter Kasting
LGTM https://chromiumcodereview.appspot.com/9491009/diff/36001/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc File chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc (right): https://chromiumcodereview.appspot.com/9491009/diff/36001/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc#newcode43 chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc:43: FRIEND_TEST_ALL_PREFIXES(GeolocationPermissionContextTests, TabDestroyed); This doesn't go above the public ...
8 years, 9 months ago (2012-03-26 19:12:22 UTC) #28
John Knottenbelt
https://chromiumcodereview.appspot.com/9491009/diff/36001/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc File chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc (right): https://chromiumcodereview.appspot.com/9491009/diff/36001/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc#newcode43 chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc:43: FRIEND_TEST_ALL_PREFIXES(GeolocationPermissionContextTests, TabDestroyed); On 2012/03/26 19:12:22, Peter Kasting wrote: > ...
8 years, 9 months ago (2012-03-27 10:21:29 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jknotten@chromium.org/9491009/41001
8 years, 9 months ago (2012-03-27 10:22:01 UTC) #30
commit-bot: I haz the power
Try job failure for 9491009-41001 (retry) on win_rel for steps "ui_tests, browser_tests". It's a second ...
8 years, 9 months ago (2012-03-27 12:34:17 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jknotten@chromium.org/9491009/41001
8 years, 9 months ago (2012-03-27 12:55:40 UTC) #32
commit-bot: I haz the power
8 years, 9 months ago (2012-03-27 14:13:26 UTC) #33
Change committed as 129186

Powered by Google App Engine
This is Rietveld 408576698