| 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 "media/audio/audio_device_thread.h" | 5 #include "media/audio/audio_device_thread.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 // a task to join (close) the thread handle later instead of waiting for | 38 // a task to join (close) the thread handle later instead of waiting for |
| 39 // the thread. If loop_for_join is NULL, then the function waits | 39 // the thread. If loop_for_join is NULL, then the function waits |
| 40 // synchronously for the thread to terminate. | 40 // synchronously for the thread to terminate. |
| 41 void Stop(base::MessageLoop* loop_for_join); | 41 void Stop(base::MessageLoop* loop_for_join); |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 friend class base::RefCountedThreadSafe<AudioDeviceThread::Thread>; | 44 friend class base::RefCountedThreadSafe<AudioDeviceThread::Thread>; |
| 45 virtual ~Thread(); | 45 virtual ~Thread(); |
| 46 | 46 |
| 47 // Overrides from PlatformThread::Delegate. | 47 // Overrides from PlatformThread::Delegate. |
| 48 virtual void ThreadMain() OVERRIDE; | 48 virtual void ThreadMain() override; |
| 49 | 49 |
| 50 // Runs the loop that reads from the socket. | 50 // Runs the loop that reads from the socket. |
| 51 void Run(); | 51 void Run(); |
| 52 | 52 |
| 53 private: | 53 private: |
| 54 base::PlatformThreadHandle thread_; | 54 base::PlatformThreadHandle thread_; |
| 55 AudioDeviceThread::Callback* callback_; | 55 AudioDeviceThread::Callback* callback_; |
| 56 base::CancelableSyncSocket socket_; | 56 base::CancelableSyncSocket socket_; |
| 57 base::Lock callback_lock_; | 57 base::Lock callback_lock_; |
| 58 const char* thread_name_; | 58 const char* thread_name_; |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 } | 217 } |
| 218 | 218 |
| 219 AudioDeviceThread::Callback::~Callback() {} | 219 AudioDeviceThread::Callback::~Callback() {} |
| 220 | 220 |
| 221 void AudioDeviceThread::Callback::InitializeOnAudioThread() { | 221 void AudioDeviceThread::Callback::InitializeOnAudioThread() { |
| 222 MapSharedMemory(); | 222 MapSharedMemory(); |
| 223 CHECK(shared_memory_.memory()); | 223 CHECK(shared_memory_.memory()); |
| 224 } | 224 } |
| 225 | 225 |
| 226 } // namespace media. | 226 } // namespace media. |
| OLD | NEW |