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

Unified Diff: chrome/browser/chromeos/audio_handler.cc

Issue 3026028: Patch pulseaudio memory leak (Closed)
Patch Set: cleanup Created 10 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/audio_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/audio_handler.cc
diff --git a/chrome/browser/chromeos/audio_handler.cc b/chrome/browser/chromeos/audio_handler.cc
index e027d42b4e04f5ad9ecfaa61ea4e2fac958a9a1f..ed2841a2aa3902902eb6f583274d7307a7e6515f 100644
--- a/chrome/browser/chromeos/audio_handler.cc
+++ b/chrome/browser/chromeos/audio_handler.cc
@@ -95,18 +95,15 @@ void AudioHandler::SetMute(bool do_mute) {
mixer_->SetMute(do_mute);
}
-void AudioHandler::OnMixerInitialized(bool success) {
- connected_ = success;
- DLOG(INFO) << "OnMixerInitialized, success = " << success;
+bool AudioHandler::IsValid() {
+ return mixer_->CheckState() == PulseAudioMixer::READY;
}
AudioHandler::AudioHandler()
- : connected_(false),
- reconnect_tries_(0) {
+ : reconnect_tries_(0) {
mixer_.reset(new PulseAudioMixer());
- if (!mixer_->Init(NewCallback(this, &AudioHandler::OnMixerInitialized))) {
- LOG(ERROR) << "Unable to connect to PulseAudio";
- }
+ connected_ = mixer_->InitSync();
+ DLOG(INFO) << "Mixer connected = " << connected_;
}
AudioHandler::~AudioHandler() {
« no previous file with comments | « chrome/browser/chromeos/audio_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698