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

Issue 10829190: Resolve the problems where we can leak the system tray UI (Closed)

Created:
8 years, 4 months ago by no longer working on chromium
Modified:
8 years, 4 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, feature-media-reviews_chromium.org, jam, darin-cc_chromium.org
Visibility:
Public.

Description

We can leak the system tray UI when closing down the tab due to several possibilities: # An error happens on the video_capture_device and we erase the request without notifying the UI. # When the tab is shutting down, it goes away before we we delete its entry in tabs_ in media_stream_capture_indicator # When canceling a request in media_stream_device_settings, we search the next request and bring it up the UI before we delete the old request, in this case we might bring the the old request back to UI again. And this patch also fixed a problem when hitting a DCHECK in media_stream_device_settings.cc(196)] Check failed: request->devices_full.count(stream_type) == static_cast<size_t>(0) (1 vs. 0) This happened because calling devices_full[type].empty() will create an empty entry to the map. BUG=140441 Test=content_unittests,chrome/test/functional/webrtc_brutality_test.py Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=151486

Patch Set 1 #

Patch Set 2 : addressed more relevant problems, ready for review now. #

Total comments: 33

Patch Set 3 : added dispatcher_host_unittests and addressed Perk's and Magnus' comments. #

Total comments: 27

Patch Set 4 : addressed the comments and added unit tests to media_stream_device_settings_unittest #

Total comments: 8

Patch Set 5 : rebased and addressed the comments. #

Total comments: 18

Patch Set 6 : addressed Andrew's comments. #

Patch Set 7 : fixed testbots. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+300 lines, -198 lines) Patch
M chrome/browser/media/media_stream_capture_indicator.cc View 1 2 3 4 5 5 chunks +9 lines, -9 lines 0 comments Download
M content/browser/renderer_host/media/media_stream_device_settings.h View 1 2 3 4 5 6 2 chunks +9 lines, -6 lines 0 comments Download
M content/browser/renderer_host/media/media_stream_device_settings.cc View 1 2 3 4 5 12 chunks +97 lines, -101 lines 0 comments Download
M content/browser/renderer_host/media/media_stream_device_settings_unittest.cc View 1 2 3 4 5 4 chunks +90 lines, -12 lines 0 comments Download
M content/browser/renderer_host/media/media_stream_dispatcher_host.cc View 1 2 3 4 2 chunks +8 lines, -6 lines 0 comments Download
M content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc View 1 2 3 1 chunk +48 lines, -0 lines 0 comments Download
M content/browser/renderer_host/media/media_stream_manager.h View 1 2 3 4 1 chunk +0 lines, -4 lines 0 comments Download
M content/browser/renderer_host/media/media_stream_manager.cc View 1 2 3 4 5 7 chunks +39 lines, -60 lines 0 comments Download

Messages

Total messages: 19 (0 generated)
no longer working on chromium
Hi Wei and Magnus, could you please take a quick look at the CL? BR, ...
8 years, 4 months ago (2012-08-06 13:13:04 UTC) #1
no longer working on chromium
Please review. FYI, we need to merge the code to the branch.
8 years, 4 months ago (2012-08-08 16:16:59 UTC) #2
perkj_chrome
Looks good. Can you please also add unit tests. Ex Test OnChannelClosing in MediaStreamDispatcherHostTest when ...
8 years, 4 months ago (2012-08-09 07:31:14 UTC) #3
mflodman_chromium_OOO
http://codereview.chromium.org/10829190/diff/2002/content/browser/renderer_host/media/media_stream_device_settings.cc File content/browser/renderer_host/media/media_stream_device_settings.cc (right): http://codereview.chromium.org/10829190/diff/2002/content/browser/renderer_host/media/media_stream_device_settings.cc#newcode104 content/browser/renderer_host/media/media_stream_device_settings.cc:104: !devices_full.count(content::MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE)) Since it is counting, I would prefer '== ...
8 years, 4 months ago (2012-08-09 09:57:05 UTC) #4
no longer working on chromium
Hi, I think I have already addressed Per and Magnus' comments. And also added unittests ...
8 years, 4 months ago (2012-08-09 15:54:54 UTC) #5
wjia(left Chromium)
http://codereview.chromium.org/10829190/diff/1003/content/browser/renderer_host/media/media_stream_device_settings.cc File content/browser/renderer_host/media/media_stream_device_settings.cc (right): http://codereview.chromium.org/10829190/diff/1003/content/browser/renderer_host/media/media_stream_device_settings.cc#newcode109 content/browser/renderer_host/media/media_stream_device_settings.cc:109: return false; combine both if above. http://codereview.chromium.org/10829190/diff/1003/content/browser/renderer_host/media/media_stream_device_settings.cc#newcode283 content/browser/renderer_host/media/media_stream_device_settings.cc:283: it->second->posted_task_) ...
8 years, 4 months ago (2012-08-10 01:23:13 UTC) #6
perkj_chrome
http://codereview.chromium.org/10829190/diff/1003/content/browser/renderer_host/media/media_stream_device_settings.cc File content/browser/renderer_host/media/media_stream_device_settings.cc (right): http://codereview.chromium.org/10829190/diff/1003/content/browser/renderer_host/media/media_stream_device_settings.cc#newcode229 content/browser/renderer_host/media/media_stream_device_settings.cc:229: PostRequestToFakeUI(label); nit: usually you should do the short exit ...
8 years, 4 months ago (2012-08-10 07:09:30 UTC) #7
mflodman_chromium_OOO
http://codereview.chromium.org/10829190/diff/2002/content/browser/renderer_host/media/media_stream_manager.cc File content/browser/renderer_host/media/media_stream_manager.cc (right): http://codereview.chromium.org/10829190/diff/2002/content/browser/renderer_host/media/media_stream_manager.cc#newcode664 content/browser/renderer_host/media/media_stream_manager.cc:664: for (StreamDeviceInfoArray::const_iterator it = Agree with Per. It should ...
8 years, 4 months ago (2012-08-10 07:15:44 UTC) #8
no longer working on chromium
Please take another look. http://codereview.chromium.org/10829190/diff/1003/content/browser/renderer_host/media/media_stream_device_settings.cc File content/browser/renderer_host/media/media_stream_device_settings.cc (right): http://codereview.chromium.org/10829190/diff/1003/content/browser/renderer_host/media/media_stream_device_settings.cc#newcode109 content/browser/renderer_host/media/media_stream_device_settings.cc:109: return false; On 2012/08/10 01:23:13, ...
8 years, 4 months ago (2012-08-10 11:50:56 UTC) #9
perkj_chrome
Awsome (except for MediaStreamManager::DevicesAccepted that I don't get. Consider writing a TODO and explain why ...
8 years, 4 months ago (2012-08-10 12:26:58 UTC) #10
mflodman_chromium_OOO
LGTM, nice CL Shijing!
8 years, 4 months ago (2012-08-12 09:13:56 UTC) #11
wjia(left Chromium)
looks good so far. http://codereview.chromium.org/10829190/diff/1004/content/browser/renderer_host/media/media_stream_device_settings.cc File content/browser/renderer_host/media/media_stream_device_settings.cc (right): http://codereview.chromium.org/10829190/diff/1004/content/browser/renderer_host/media/media_stream_device_settings.cc#newcode229 content/browser/renderer_host/media/media_stream_device_settings.cc:229: return; No need to have ...
8 years, 4 months ago (2012-08-12 16:05:45 UTC) #12
no longer working on chromium
Andrew, could you please take a quick look at the media_stream_capture_indicator.cc? http://codereview.chromium.org/10829190/diff/1004/content/browser/renderer_host/media/media_stream_device_settings.cc File content/browser/renderer_host/media/media_stream_device_settings.cc (right): ...
8 years, 4 months ago (2012-08-13 11:39:53 UTC) #13
wjia(left Chromium)
lgtm
8 years, 4 months ago (2012-08-13 14:22:58 UTC) #14
scherkus (not reviewing)
LGTM w/ nits (I admit I'm not entirely familiar w/ this code so I'm assuming ...
8 years, 4 months ago (2012-08-13 19:51:22 UTC) #15
no longer working on chromium
Great thanks to Andrew. I am going to land it now. http://codereview.chromium.org/10829190/diff/13003/chrome/browser/media/media_stream_capture_indicator.cc File chrome/browser/media/media_stream_capture_indicator.cc (right): ...
8 years, 4 months ago (2012-08-14 11:17:03 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/xians@chromium.org/10829190/7005
8 years, 4 months ago (2012-08-14 11:17:24 UTC) #17
commit-bot: I haz the power
Try job failure for 10829190-7005 (retry) on mac_rel for step "compile" (clobber build). It's a ...
8 years, 4 months ago (2012-08-14 11:42:29 UTC) #18
commit-bot: I haz the power
8 years, 4 months ago (2012-08-14 12:08:06 UTC) #19

Powered by Google App Engine
This is Rietveld 408576698