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

Side by Side Diff: media/audio/alsa/alsa_input.h

Issue 193303002: WeakPtr destruction order cleanup: media edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 6 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 | Annotate | Revision Log
« no previous file with comments | « content/renderer/media/webaudiosourceprovider_impl.cc ('k') | media/audio/alsa/alsa_input.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef MEDIA_AUDIO_ALSA_ALSA_INPUT_H_ 5 #ifndef MEDIA_AUDIO_ALSA_ALSA_INPUT_H_
6 #define MEDIA_AUDIO_ALSA_ALSA_INPUT_H_ 6 #define MEDIA_AUDIO_ALSA_ALSA_INPUT_H_
7 7
8 #include <alsa/asoundlib.h> 8 #include <alsa/asoundlib.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 std::string device_name_; 73 std::string device_name_;
74 AudioParameters params_; 74 AudioParameters params_;
75 int bytes_per_buffer_; 75 int bytes_per_buffer_;
76 AlsaWrapper* wrapper_; 76 AlsaWrapper* wrapper_;
77 base::TimeDelta buffer_duration_; // Length of each recorded buffer. 77 base::TimeDelta buffer_duration_; // Length of each recorded buffer.
78 AudioInputCallback* callback_; // Valid during a recording session. 78 AudioInputCallback* callback_; // Valid during a recording session.
79 base::TimeTicks next_read_time_; // Scheduled time for next read callback. 79 base::TimeTicks next_read_time_; // Scheduled time for next read callback.
80 snd_pcm_t* device_handle_; // Handle to the ALSA PCM recording device. 80 snd_pcm_t* device_handle_; // Handle to the ALSA PCM recording device.
81 snd_mixer_t* mixer_handle_; // Handle to the ALSA microphone mixer. 81 snd_mixer_t* mixer_handle_; // Handle to the ALSA microphone mixer.
82 snd_mixer_elem_t* mixer_element_handle_; // Handle to the capture element. 82 snd_mixer_elem_t* mixer_element_handle_; // Handle to the capture element.
83 base::WeakPtrFactory<AlsaPcmInputStream> weak_factory_;
84 scoped_ptr<uint8[]> audio_buffer_; // Buffer used for reading audio data. 83 scoped_ptr<uint8[]> audio_buffer_; // Buffer used for reading audio data.
85 bool read_callback_behind_schedule_; 84 bool read_callback_behind_schedule_;
86 85
86 // NOTE: Weak pointers must be invalidated before all other member variables.
87 base::WeakPtrFactory<AlsaPcmInputStream> weak_factory_;
88
87 DISALLOW_COPY_AND_ASSIGN(AlsaPcmInputStream); 89 DISALLOW_COPY_AND_ASSIGN(AlsaPcmInputStream);
88 }; 90 };
89 91
90 } // namespace media 92 } // namespace media
91 93
92 #endif // MEDIA_AUDIO_ALSA_ALSA_INPUT_H_ 94 #endif // MEDIA_AUDIO_ALSA_ALSA_INPUT_H_
OLDNEW
« no previous file with comments | « content/renderer/media/webaudiosourceprovider_impl.cc ('k') | media/audio/alsa/alsa_input.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698