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

Side by Side Diff: content/browser/renderer_host/media/audio_sync_reader.h

Issue 9317001: Revert 119769 - Switch AudioDevice classes from SyncSocket to CancelableSyncSocket. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1025/src/
Patch Set: Created 8 years, 10 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_SYNC_READER_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_SYNC_READER_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_SYNC_READER_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_SYNC_READER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/file_descriptor_posix.h" 9 #include "base/file_descriptor_posix.h"
10 #include "base/process.h" 10 #include "base/process.h"
11 #include "base/sync_socket.h" 11 #include "base/sync_socket.h"
(...skipping 26 matching lines...) Expand all
38 #if defined(OS_WIN) 38 #if defined(OS_WIN)
39 base::SyncSocket::Handle* foreign_handle); 39 base::SyncSocket::Handle* foreign_handle);
40 #else 40 #else
41 base::FileDescriptor* foreign_handle); 41 base::FileDescriptor* foreign_handle);
42 #endif 42 #endif
43 43
44 private: 44 private:
45 base::SharedMemory* shared_memory_; 45 base::SharedMemory* shared_memory_;
46 base::Time previous_call_time_; 46 base::Time previous_call_time_;
47 47
48 // Socket for transmitting audio data. 48 // A pair of SyncSocket for transmitting audio data.
49 scoped_ptr<base::CancelableSyncSocket> socket_; 49 scoped_ptr<base::SyncSocket> socket_;
50 50
51 // Socket to be used by the renderer. The reference is released after 51 // SyncSocket to be used by the renderer. The reference is released after
52 // PrepareForeignSocketHandle() is called and ran successfully. 52 // PrepareForeignSocketHandle() is called and ran successfully.
53 scoped_ptr<base::CancelableSyncSocket> foreign_socket_; 53 scoped_ptr<base::SyncSocket> foreign_socket_;
54 54
55 // Protect socket_ access by lock to prevent race condition when audio 55 // Protect socket_ access by lock to prevent race condition when audio
56 // controller thread closes the reader and hardware audio thread is reading 56 // controller thread closes the reader and hardware audio thread is reading
57 // data. This way we know that socket would not be deleted while we are 57 // data. This way we know that socket would not be deleted while we are
58 // writing data to it. 58 // writing data to it.
59 base::Lock lock_; 59 base::Lock lock_;
60 60
61 DISALLOW_COPY_AND_ASSIGN(AudioSyncReader); 61 DISALLOW_COPY_AND_ASSIGN(AudioSyncReader);
62 }; 62 };
63 63
64 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_SYNC_READER_H_ 64 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_SYNC_READER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698