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

Issue 12035046: Fix bug causing tab favicon media indicator to not turn off. (Closed)

Created:
7 years, 11 months ago by miu
Modified:
7 years, 10 months ago
CC:
chromium-reviews, feature-media-reviews_chromium.org
Visibility:
Public.

Description

Fix bug causing tab favicon media indicator to not turn off. Root cause: MediaStreamCaptureIndicator::CaptureDevicesClosed() is being called with the original render_process_id/render_view_id, rather than the current ones associated with a WebContents instance. This is because media capture was launched by an extension, and MediaStreamManager only knows what the ID pair was at the time the media capture was started. Changes include: 1. Tore-out the existing "find a tab" code. 2. Added an alias mapping with a LookUp function that finds a WebContents instance by current or any previously-known ID pair. 3. Fixed possible de-refs of WebContents pointers after the instance is destroyed. 4. Clean-ups of comments/naming, and minor code reorganization. BUG=171077 TEST=Confirmed, by manually running a debug-build browser (on Win7 and Linux), that existing functionality is not broken and that the bug is fixed. TBR=ben Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=179490

Patch Set 1 #

Total comments: 13

Patch Set 2 : Better naming for methods called from tab_utils. #

Patch Set 3 : Remove a DCHECK: During browser shutdown, CaptureDevicesClosed() may not have been called and that'… #

Total comments: 14

Patch Set 4 : Fix issue with de-ref'ing WebContents after destruction. #

Total comments: 16

Patch Set 5 : Tweaks. #

Total comments: 2

Patch Set 6 : #

Patch Set 7 : Fix issue with browser shutdown race condition. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+267 lines, -265 lines) Patch
M chrome/browser/media/media_stream_capture_indicator.h View 1 2 3 4 4 chunks +57 lines, -72 lines 2 comments Download
M chrome/browser/media/media_stream_capture_indicator.cc View 1 2 3 4 5 6 14 chunks +205 lines, -185 lines 0 comments Download
M chrome/browser/ui/tabs/tab_utils.cc View 1 2 3 1 chunk +5 lines, -8 lines 0 comments Download

Messages

Total messages: 18 (0 generated)
miu
Hi all, Please take a look. Thanks, Yuri
7 years, 11 months ago (2013-01-23 05:26:07 UTC) #1
miu
Added ben@ for OWNERS approval.
7 years, 11 months ago (2013-01-23 05:31:09 UTC) #2
justinlin
Hmm.. nice cleanup/refactoring, but I think the bug could be fixed with roughly a ~2 ...
7 years, 11 months ago (2013-01-23 19:30:43 UTC) #3
miu
Yep, the 2-line change also fixes the bug. ;-) The weirdness in all this is ...
7 years, 11 months ago (2013-01-23 20:33:28 UTC) #4
justinlin
Cool, yea overall this looks fine to me, but I'm not too familiar with a ...
7 years, 11 months ago (2013-01-23 21:34:20 UTC) #5
miu
On 2013/01/23 21:34:20, justinlin wrote: > Do you think it would make sense to just ...
7 years, 11 months ago (2013-01-23 23:51:41 UTC) #6
justinlin
Oh, I didn't mean to rush it in. My concern was mostly just to separate ...
7 years, 11 months ago (2013-01-24 07:04:44 UTC) #7
no longer working on chromium
https://codereview.chromium.org/12035046/diff/8001/chrome/browser/media/media_stream_capture_indicator.cc File chrome/browser/media/media_stream_capture_indicator.cc (left): https://codereview.chromium.org/12035046/diff/8001/chrome/browser/media/media_stream_capture_indicator.cc#oldcode137 chrome/browser/media/media_stream_capture_indicator.cc:137: DCHECK(tabs_.empty()); please add back DCHECKs for aliases_ and usage_map. ...
7 years, 11 months ago (2013-01-24 14:09:06 UTC) #8
no longer working on chromium
https://codereview.chromium.org/12035046/diff/8001/chrome/browser/media/media_stream_capture_indicator.cc File chrome/browser/media/media_stream_capture_indicator.cc (right): https://codereview.chromium.org/12035046/diff/8001/chrome/browser/media/media_stream_capture_indicator.cc#newcode494 chrome/browser/media/media_stream_capture_indicator.cc:494: web_contents->NotifyNavigationStateChanged(content::INVALIDATE_TYPE_TAB); Note, you should do the test on Mac ...
7 years, 11 months ago (2013-01-24 14:45:55 UTC) #9
miu
Justin/Shijing, Addressed comments and fixed de-ref'ing of WebContents after destruction. PTAL. Thanks, Yuri https://codereview.chromium.org/12035046/diff/1/chrome/browser/media/media_stream_capture_indicator.cc File ...
7 years, 10 months ago (2013-01-28 19:36:51 UTC) #10
justinlin
mostly nits, thanks for the fix and cleanup! lgtm for the tab capture parts and ...
7 years, 10 months ago (2013-01-28 22:31:21 UTC) #11
miu
https://codereview.chromium.org/12035046/diff/14002/chrome/browser/media/media_stream_capture_indicator.cc File chrome/browser/media/media_stream_capture_indicator.cc (right): https://codereview.chromium.org/12035046/diff/14002/chrome/browser/media/media_stream_capture_indicator.cc#newcode115 chrome/browser/media/media_stream_capture_indicator.cc:115: bool IsWebContentsDestroyed() const { return web_contents() == NULL; } ...
7 years, 10 months ago (2013-01-28 23:57:13 UTC) #12
no longer working on chromium
one more nit. lgtm if you also test the CL on Mac and Windows. https://codereview.chromium.org/12035046/diff/16002/chrome/browser/media/media_stream_capture_indicator.cc ...
7 years, 10 months ago (2013-01-29 10:07:24 UTC) #13
justinlin
shutdown change lgtm https://codereview.chromium.org/12035046/diff/22002/chrome/browser/media/media_stream_capture_indicator.h File chrome/browser/media/media_stream_capture_indicator.h (right): https://codereview.chromium.org/12035046/diff/22002/chrome/browser/media/media_stream_capture_indicator.h#newcode135 chrome/browser/media/media_stream_capture_indicator.h:135: typedef std::map<content::WebContents*, WebContentsDeviceUsage*> UsageMap; would it ...
7 years, 10 months ago (2013-01-29 21:32:07 UTC) #14
miu
Thanks for the review, everyone. :) https://codereview.chromium.org/12035046/diff/16002/chrome/browser/media/media_stream_capture_indicator.cc File chrome/browser/media/media_stream_capture_indicator.cc (right): https://codereview.chromium.org/12035046/diff/16002/chrome/browser/media/media_stream_capture_indicator.cc#newcode502 chrome/browser/media/media_stream_capture_indicator.cc:502: web_contents->NotifyNavigationStateChanged(content::INVALIDATE_TYPE_TAB); On 2013/01/29 ...
7 years, 10 months ago (2013-01-29 21:41:41 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/miu@chromium.org/12035046/22002
7 years, 10 months ago (2013-01-29 21:56:54 UTC) #16
Ben Goodger (Google)
lgtm
7 years, 10 months ago (2013-01-29 22:20:14 UTC) #17
commit-bot: I haz the power
7 years, 10 months ago (2013-01-30 01:13:14 UTC) #18
Message was sent while issue was closed.
Change committed as 179490

Powered by Google App Engine
This is Rietveld 408576698