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

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

Issue 21183002: Adding key press detection in the browser process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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
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, uint32 size, double volume) OVERRIDE; 31 virtual uint32 Write(const void* data,
32 uint32 size,
33 double volume,
34 bool key_pressed) OVERRIDE;
32 virtual void Close() OVERRIDE; 35 virtual void Close() OVERRIDE;
33 36
34 bool Init(); 37 bool Init();
35 bool PrepareForeignSocketHandle(base::ProcessHandle process_handle, 38 bool PrepareForeignSocketHandle(base::ProcessHandle process_handle,
36 #if defined(OS_WIN) 39 #if defined(OS_WIN)
37 base::SyncSocket::Handle* foreign_handle); 40 base::SyncSocket::Handle* foreign_handle);
38 #else 41 #else
39 base::FileDescriptor* foreign_handle); 42 base::FileDescriptor* foreign_handle);
40 #endif 43 #endif
41 44
42 private: 45 private:
43 base::SharedMemory* shared_memory_; 46 base::SharedMemory* shared_memory_;
44 uint32 shared_memory_segment_size_; 47 uint32 shared_memory_segment_size_;
45 uint32 shared_memory_segment_count_; 48 uint32 shared_memory_segment_count_;
46 uint32 current_segment_id_; 49 uint32 current_segment_id_;
47 50
48 // Socket for transmitting audio data. 51 // Socket for transmitting audio data.
49 scoped_ptr<base::CancelableSyncSocket> socket_; 52 scoped_ptr<base::CancelableSyncSocket> socket_;
50 53
51 // Socket to be used by the renderer. The reference is released after 54 // Socket to be used by the renderer. The reference is released after
52 // PrepareForeignSocketHandle() is called and ran successfully. 55 // PrepareForeignSocketHandle() is called and ran successfully.
53 scoped_ptr<base::CancelableSyncSocket> foreign_socket_; 56 scoped_ptr<base::CancelableSyncSocket> foreign_socket_;
54 57
55 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioInputSyncWriter); 58 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioInputSyncWriter);
56 }; 59 };
57 60
58 } // namespace content 61 } // namespace content
59 62
60 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_SYNC_WRITER_H_ 63 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_SYNC_WRITER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698