| OLD | NEW |
| 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 "content/renderer/pepper/pepper_platform_audio_output.h" | 5 #include "content/renderer/pepper/pepper_platform_audio_output.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 // occurred while the request was in-flight, so we need to NULL check. | 90 // occurred while the request was in-flight, so we need to NULL check. |
| 91 if (client_) | 91 if (client_) |
| 92 client_->StreamCreated(handle, length, socket_handle); | 92 client_->StreamCreated(handle, length, socket_handle); |
| 93 } else { | 93 } else { |
| 94 main_task_runner_->PostTask( | 94 main_task_runner_->PostTask( |
| 95 FROM_HERE, base::Bind(&PepperPlatformAudioOutput::OnStreamCreated, this, | 95 FROM_HERE, base::Bind(&PepperPlatformAudioOutput::OnStreamCreated, this, |
| 96 handle, socket_handle, length)); | 96 handle, socket_handle, length)); |
| 97 } | 97 } |
| 98 } | 98 } |
| 99 | 99 |
| 100 void PepperPlatformAudioOutput::OnOutputDeviceSwitched( |
| 101 int request_id, |
| 102 media::SwitchOutputDeviceResult result) {} |
| 103 |
| 100 void PepperPlatformAudioOutput::OnIPCClosed() { ipc_.reset(); } | 104 void PepperPlatformAudioOutput::OnIPCClosed() { ipc_.reset(); } |
| 101 | 105 |
| 102 PepperPlatformAudioOutput::~PepperPlatformAudioOutput() { | 106 PepperPlatformAudioOutput::~PepperPlatformAudioOutput() { |
| 103 // Make sure we have been shut down. Warning: this will usually happen on | 107 // Make sure we have been shut down. Warning: this will usually happen on |
| 104 // the I/O thread! | 108 // the I/O thread! |
| 105 DCHECK(!ipc_); | 109 DCHECK(!ipc_); |
| 106 DCHECK(!client_); | 110 DCHECK(!client_); |
| 107 } | 111 } |
| 108 | 112 |
| 109 PepperPlatformAudioOutput::PepperPlatformAudioOutput() | 113 PepperPlatformAudioOutput::PepperPlatformAudioOutput() |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 return; | 168 return; |
| 165 | 169 |
| 166 ipc_->CloseStream(); | 170 ipc_->CloseStream(); |
| 167 ipc_.reset(); | 171 ipc_.reset(); |
| 168 | 172 |
| 169 Release(); // Release for the delegate, balances out the reference taken in | 173 Release(); // Release for the delegate, balances out the reference taken in |
| 170 // PepperPlatformAudioOutput::Create. | 174 // PepperPlatformAudioOutput::Create. |
| 171 } | 175 } |
| 172 | 176 |
| 173 } // namespace content | 177 } // namespace content |
| OLD | NEW |