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/browser/renderer_host/media/audio_input_sync_writer.h" | 5 #include "content/browser/renderer_host/media/audio_input_sync_writer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/process_util.h" | 9 #include "base/process_util.h" |
10 #include "base/shared_memory.h" | 10 #include "base/shared_memory.h" |
11 | 11 |
12 namespace media { | |
13 | |
14 AudioInputSyncWriter::AudioInputSyncWriter(base::SharedMemory* shared_memory) | 12 AudioInputSyncWriter::AudioInputSyncWriter(base::SharedMemory* shared_memory) |
15 : shared_memory_(shared_memory) { | 13 : shared_memory_(shared_memory) { |
16 } | 14 } |
17 | 15 |
18 AudioInputSyncWriter::~AudioInputSyncWriter() {} | 16 AudioInputSyncWriter::~AudioInputSyncWriter() {} |
19 | 17 |
20 // TODO(henrika): Combine into one method (including Write). | 18 // TODO(henrika): Combine into one method (including Write). |
21 void AudioInputSyncWriter::UpdateRecordedBytes(uint32 bytes) { | 19 void AudioInputSyncWriter::UpdateRecordedBytes(uint32 bytes) { |
22 socket_->Send(&bytes, sizeof(bytes)); | 20 socket_->Send(&bytes, sizeof(bytes)); |
23 } | 21 } |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 57 |
60 bool AudioInputSyncWriter::PrepareForeignSocketHandle( | 58 bool AudioInputSyncWriter::PrepareForeignSocketHandle( |
61 base::ProcessHandle process_handle, | 59 base::ProcessHandle process_handle, |
62 base::FileDescriptor* foreign_handle) { | 60 base::FileDescriptor* foreign_handle) { |
63 foreign_handle->fd = foreign_socket_->handle(); | 61 foreign_handle->fd = foreign_socket_->handle(); |
64 foreign_handle->auto_close = false; | 62 foreign_handle->auto_close = false; |
65 return (foreign_handle->fd != -1); | 63 return (foreign_handle->fd != -1); |
66 } | 64 } |
67 | 65 |
68 #endif | 66 #endif |
69 | |
70 } // namespace media | |
OLD | NEW |