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

Side by Side Diff: content/browser/media/capture/web_contents_audio_muter.cc

Issue 1815363002: Add RetainedRef uses where needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "content/browser/media/capture/web_contents_audio_muter.h" 5 #include "content/browser/media/capture/web_contents_audio_muter.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "content/browser/media/capture/audio_mirroring_manager.h" 10 #include "content/browser/media/capture/audio_mirroring_manager.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 DCHECK_CURRENTLY_ON(BrowserThread::UI); 126 DCHECK_CURRENTLY_ON(BrowserThread::UI);
127 StopMuting(); 127 StopMuting();
128 } 128 }
129 129
130 void WebContentsAudioMuter::StartMuting() { 130 void WebContentsAudioMuter::StartMuting() {
131 DCHECK_CURRENTLY_ON(BrowserThread::UI); 131 DCHECK_CURRENTLY_ON(BrowserThread::UI);
132 if (is_muting_) 132 if (is_muting_)
133 return; 133 return;
134 is_muting_ = true; 134 is_muting_ = true;
135 BrowserThread::PostTask( 135 BrowserThread::PostTask(
136 BrowserThread::IO, 136 BrowserThread::IO, FROM_HERE,
137 FROM_HERE,
138 base::Bind(&AudioMirroringManager::StartMirroring, 137 base::Bind(&AudioMirroringManager::StartMirroring,
139 base::Unretained(AudioMirroringManager::GetInstance()), 138 base::Unretained(AudioMirroringManager::GetInstance()),
140 destination_)); 139 base::RetainedRef(destination_)));
141 } 140 }
142 141
143 void WebContentsAudioMuter::StopMuting() { 142 void WebContentsAudioMuter::StopMuting() {
144 DCHECK_CURRENTLY_ON(BrowserThread::UI); 143 DCHECK_CURRENTLY_ON(BrowserThread::UI);
145 if (!is_muting_) 144 if (!is_muting_)
146 return; 145 return;
147 is_muting_ = false; 146 is_muting_ = false;
148 BrowserThread::PostTask( 147 BrowserThread::PostTask(
149 BrowserThread::IO, 148 BrowserThread::IO, FROM_HERE,
150 FROM_HERE,
151 base::Bind(&AudioMirroringManager::StopMirroring, 149 base::Bind(&AudioMirroringManager::StopMirroring,
152 base::Unretained(AudioMirroringManager::GetInstance()), 150 base::Unretained(AudioMirroringManager::GetInstance()),
153 destination_)); 151 base::RetainedRef(destination_)));
154 } 152 }
155 153
156 } // namespace content 154 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/media/capture/web_contents_audio_input_stream.cc ('k') | content/browser/plugin_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698