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

Side by Side Diff: chrome/browser/media/audio_stream_indicator.cc

Issue 12260035: Fix typo in AudioStreamIndicator causing hangs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/media/audio_stream_indicator.h" 5 #include "chrome/browser/media/audio_stream_indicator.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "chrome/browser/tab_contents/tab_util.h" 8 #include "chrome/browser/tab_contents/tab_util.h"
9 #include "content/public/browser/browser_thread.h" 9 #include "content/public/browser/browser_thread.h"
10 #include "content/public/browser/invalidate_type.h" 10 #include "content/public/browser/invalidate_type.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 int render_view_id, 57 int render_view_id,
58 int stream_id, 58 int stream_id,
59 bool playing) { 59 bool playing) {
60 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 60 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
61 RenderViewId id(render_process_id, render_view_id); 61 RenderViewId id(render_process_id, render_view_id);
62 if (playing) { 62 if (playing) {
63 audio_streams_[id].insert(stream_id); 63 audio_streams_[id].insert(stream_id);
64 } else { 64 } else {
65 std::map<RenderViewId, std::set<int> >::iterator it = 65 std::map<RenderViewId, std::set<int> >::iterator it =
66 audio_streams_.find(id); 66 audio_streams_.find(id);
67 if (it != audio_streams_.end()) 67 if (it == audio_streams_.end())
68 return; 68 return;
69 69
70 it->second.erase(stream_id); 70 it->second.erase(stream_id);
71 if (it->second.empty()) 71 if (it->second.empty())
72 audio_streams_.erase(it); 72 audio_streams_.erase(it);
73 } 73 }
74 74
75 WebContents* web_contents = tab_util::GetWebContentsByID(render_process_id, 75 WebContents* web_contents = tab_util::GetWebContentsByID(render_process_id,
76 render_view_id); 76 render_view_id);
77 if (web_contents) 77 if (web_contents)
78 web_contents->NotifyNavigationStateChanged(content::INVALIDATE_TYPE_TAB); 78 web_contents->NotifyNavigationStateChanged(content::INVALIDATE_TYPE_TAB);
79 } 79 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698