Fix bug causing tab favicon media indicator to not turn off.
commitd4f416519ba6a07f05f429ae0221e4964ddf18a1
authormiu@chromium.org <miu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Wed, 30 Jan 2013 01:13:11 +0000 (30 01:13 +0000)
committermiu@chromium.org <miu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Wed, 30 Jan 2013 01:13:11 +0000 (30 01:13 +0000)
treedb5bd13059285d8eab615366278e7198102e030e
parent8821df9fb378bc9f2f1fff7cb68f65f11792af9a
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

Review URL: https://chromiumcodereview.appspot.com/12035046

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@179490 0039d316-1c4b-4281-b951-d872f2087c98
chrome/browser/media/media_stream_capture_indicator.cc
chrome/browser/media/media_stream_capture_indicator.h
chrome/browser/ui/tabs/tab_utils.cc