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

Side by Side Diff: trunk/src/content/browser/renderer_host/media/audio_input_sync_writer.h

Issue 22871007: Revert 217768 "Adding key press detection in the browser process." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 4 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) 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 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_SYNC_WRITER_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_SYNC_WRITER_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_SYNC_WRITER_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_SYNC_WRITER_H_
7 7
8 #include "base/file_descriptor_posix.h" 8 #include "base/file_descriptor_posix.h"
9 #include "base/process/process.h" 9 #include "base/process/process.h"
10 #include "base/sync_socket.h" 10 #include "base/sync_socket.h"
(...skipping 10 matching lines...) Expand all
21 // process. 21 // process.
22 class AudioInputSyncWriter : public media::AudioInputController::SyncWriter { 22 class AudioInputSyncWriter : public media::AudioInputController::SyncWriter {
23 public: 23 public:
24 explicit AudioInputSyncWriter(base::SharedMemory* shared_memory, 24 explicit AudioInputSyncWriter(base::SharedMemory* shared_memory,
25 int shared_memory_segment_count); 25 int shared_memory_segment_count);
26 26
27 virtual ~AudioInputSyncWriter(); 27 virtual ~AudioInputSyncWriter();
28 28
29 // media::AudioOutputController::SyncWriter implementation. 29 // media::AudioOutputController::SyncWriter implementation.
30 virtual void UpdateRecordedBytes(uint32 bytes) OVERRIDE; 30 virtual void UpdateRecordedBytes(uint32 bytes) OVERRIDE;
31 virtual uint32 Write(const void* data, 31 virtual uint32 Write(const void* data, uint32 size, double volume) OVERRIDE;
32 uint32 size,
33 double volume,
34 bool key_pressed) OVERRIDE;
35 virtual void Close() OVERRIDE; 32 virtual void Close() OVERRIDE;
36 33
37 bool Init(); 34 bool Init();
38 bool PrepareForeignSocketHandle(base::ProcessHandle process_handle, 35 bool PrepareForeignSocketHandle(base::ProcessHandle process_handle,
39 #if defined(OS_WIN) 36 #if defined(OS_WIN)
40 base::SyncSocket::Handle* foreign_handle); 37 base::SyncSocket::Handle* foreign_handle);
41 #else 38 #else
42 base::FileDescriptor* foreign_handle); 39 base::FileDescriptor* foreign_handle);
43 #endif 40 #endif
44 41
45 private: 42 private:
46 base::SharedMemory* shared_memory_; 43 base::SharedMemory* shared_memory_;
47 uint32 shared_memory_segment_size_; 44 uint32 shared_memory_segment_size_;
48 uint32 shared_memory_segment_count_; 45 uint32 shared_memory_segment_count_;
49 uint32 current_segment_id_; 46 uint32 current_segment_id_;
50 47
51 // Socket for transmitting audio data. 48 // Socket for transmitting audio data.
52 scoped_ptr<base::CancelableSyncSocket> socket_; 49 scoped_ptr<base::CancelableSyncSocket> socket_;
53 50
54 // Socket to be used by the renderer. The reference is released after 51 // Socket to be used by the renderer. The reference is released after
55 // PrepareForeignSocketHandle() is called and ran successfully. 52 // PrepareForeignSocketHandle() is called and ran successfully.
56 scoped_ptr<base::CancelableSyncSocket> foreign_socket_; 53 scoped_ptr<base::CancelableSyncSocket> foreign_socket_;
57 54
58 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioInputSyncWriter); 55 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioInputSyncWriter);
59 }; 56 };
60 57
61 } // namespace content 58 } // namespace content
62 59
63 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_SYNC_WRITER_H_ 60 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_SYNC_WRITER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698