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

Side by Side Diff: remoting/host/ipc_audio_capturer.cc

Issue 14522010: remoting: Remove use of ALLOW_THIS_IN_INITIALIZER_LIST. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 7 years, 8 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 | « remoting/host/host_window_proxy.cc ('k') | remoting/host/ipc_desktop_environment.cc » ('j') | 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 "remoting/host/ipc_audio_capturer.h" 5 #include "remoting/host/ipc_audio_capturer.h"
6 6
7 #include "remoting/host/desktop_session_proxy.h" 7 #include "remoting/host/desktop_session_proxy.h"
8 #include "remoting/proto/audio.pb.h" 8 #include "remoting/proto/audio.pb.h"
9 9
10 namespace remoting { 10 namespace remoting {
11 11
12 IpcAudioCapturer::IpcAudioCapturer( 12 IpcAudioCapturer::IpcAudioCapturer(
13 scoped_refptr<DesktopSessionProxy> desktop_session_proxy) 13 scoped_refptr<DesktopSessionProxy> desktop_session_proxy)
14 : desktop_session_proxy_(desktop_session_proxy), 14 : desktop_session_proxy_(desktop_session_proxy),
15 weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { 15 weak_factory_(this) {
16 } 16 }
17 17
18 IpcAudioCapturer::~IpcAudioCapturer() { 18 IpcAudioCapturer::~IpcAudioCapturer() {
19 } 19 }
20 20
21 bool IpcAudioCapturer::Start(const PacketCapturedCallback& callback) { 21 bool IpcAudioCapturer::Start(const PacketCapturedCallback& callback) {
22 DCHECK(callback_.is_null()); 22 DCHECK(callback_.is_null());
23 DCHECK(!callback.is_null()); 23 DCHECK(!callback.is_null());
24 24
25 callback_ = callback; 25 callback_ = callback;
26 desktop_session_proxy_->SetAudioCapturer(weak_factory_.GetWeakPtr()); 26 desktop_session_proxy_->SetAudioCapturer(weak_factory_.GetWeakPtr());
27 return true; 27 return true;
28 } 28 }
29 29
30 void IpcAudioCapturer::Stop() { 30 void IpcAudioCapturer::Stop() {
31 callback_.Reset(); 31 callback_.Reset();
32 weak_factory_.InvalidateWeakPtrs(); 32 weak_factory_.InvalidateWeakPtrs();
33 } 33 }
34 34
35 bool IpcAudioCapturer::IsStarted() { 35 bool IpcAudioCapturer::IsStarted() {
36 return !callback_.is_null(); 36 return !callback_.is_null();
37 } 37 }
38 38
39 void IpcAudioCapturer::OnAudioPacket(scoped_ptr<AudioPacket> packet) { 39 void IpcAudioCapturer::OnAudioPacket(scoped_ptr<AudioPacket> packet) {
40 callback_.Run(packet.Pass()); 40 callback_.Run(packet.Pass());
41 } 41 }
42 42
43 } // namespace remoting 43 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/host_window_proxy.cc ('k') | remoting/host/ipc_desktop_environment.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698