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

Side by Side Diff: webkit/plugins/ppapi/ppb_audio_input_impl.h

Issue 10081020: PPAPI: Make blocking completion callbacks work. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated TestURLLoader to test blocking callbacks. Created 8 years, 8 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 WEBKIT_PLUGINS_PPAPI_PPB_AUDIO_INPUT_IMPL_H_ 5 #ifndef WEBKIT_PLUGINS_PPAPI_PPB_AUDIO_INPUT_IMPL_H_
6 #define WEBKIT_PLUGINS_PPAPI_PPB_AUDIO_INPUT_IMPL_H_ 6 #define WEBKIT_PLUGINS_PPAPI_PPB_AUDIO_INPUT_IMPL_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 21 matching lines...) Expand all
32 // and will return 0 on failure. 32 // and will return 0 on failure.
33 static PP_Resource Create0_1(PP_Instance instance, 33 static PP_Resource Create0_1(PP_Instance instance,
34 PP_Resource config, 34 PP_Resource config,
35 PPB_AudioInput_Callback audio_input_callback, 35 PPB_AudioInput_Callback audio_input_callback,
36 void* user_data); 36 void* user_data);
37 37
38 // Implementation of PPB_AudioInput_API trusted methods. 38 // Implementation of PPB_AudioInput_API trusted methods.
39 virtual int32_t OpenTrusted( 39 virtual int32_t OpenTrusted(
40 const std::string& device_id, 40 const std::string& device_id,
41 PP_Resource config, 41 PP_Resource config,
42 const PP_CompletionCallback& create_callback) OVERRIDE; 42 ::ppapi::ApiCallbackType create_callback) OVERRIDE;
43 virtual int32_t GetSyncSocket(int* sync_socket) OVERRIDE; 43 virtual int32_t GetSyncSocket(int* sync_socket) OVERRIDE;
44 virtual int32_t GetSharedMemory(int* shm_handle, uint32_t* shm_size) OVERRIDE; 44 virtual int32_t GetSharedMemory(int* shm_handle, uint32_t* shm_size) OVERRIDE;
45 virtual const DeviceRefDataVector& GetDeviceRefData() const OVERRIDE; 45 virtual const DeviceRefDataVector& GetDeviceRefData() const OVERRIDE;
46 46
47 // PluginDelegate::PlatformAudioInputClient implementation. 47 // PluginDelegate::PlatformAudioInputClient implementation.
48 virtual void StreamCreated(base::SharedMemoryHandle shared_memory_handle, 48 virtual void StreamCreated(base::SharedMemoryHandle shared_memory_handle,
49 size_t shared_memory_size, 49 size_t shared_memory_size,
50 base::SyncSocket::Handle socket) OVERRIDE; 50 base::SyncSocket::Handle socket) OVERRIDE;
51 virtual void StreamCreationFailed() OVERRIDE; 51 virtual void StreamCreationFailed() OVERRIDE;
52 52
53 private: 53 private:
54 // PPB_AudioInput_Shared implementation. 54 // PPB_AudioInput_Shared implementation.
55 virtual int32_t InternalEnumerateDevices( 55 virtual int32_t InternalEnumerateDevices(
56 PP_Resource* devices, 56 PP_Resource* devices,
57 PP_CompletionCallback callback) OVERRIDE; 57 ::ppapi::ApiCallbackType callback) OVERRIDE;
58 virtual int32_t InternalOpen(const std::string& device_id, 58 virtual int32_t InternalOpen(const std::string& device_id,
59 PP_AudioSampleRate sample_rate, 59 PP_AudioSampleRate sample_rate,
60 uint32_t sample_frame_count, 60 uint32_t sample_frame_count,
61 PP_CompletionCallback callback) OVERRIDE; 61 ::ppapi::ApiCallbackType callback) OVERRIDE;
62 virtual PP_Bool InternalStartCapture() OVERRIDE; 62 virtual PP_Bool InternalStartCapture() OVERRIDE;
63 virtual PP_Bool InternalStopCapture() OVERRIDE; 63 virtual PP_Bool InternalStopCapture() OVERRIDE;
64 virtual void InternalClose() OVERRIDE; 64 virtual void InternalClose() OVERRIDE;
65 65
66 void EnumerateDevicesCallbackFunc(int request_id, 66 void EnumerateDevicesCallbackFunc(int request_id,
67 bool succeeded, 67 bool succeeded,
68 const DeviceRefDataVector& devices); 68 const DeviceRefDataVector& devices);
69 69
70 // PluginDelegate audio input object that we delegate audio IPC through. 70 // PluginDelegate audio input object that we delegate audio IPC through.
71 // We don't own this pointer but are responsible for calling Shutdown on it. 71 // We don't own this pointer but are responsible for calling Shutdown on it.
72 PluginDelegate::PlatformAudioInput* audio_input_; 72 PluginDelegate::PlatformAudioInput* audio_input_;
73 73
74 DeviceRefDataVector devices_data_; 74 DeviceRefDataVector devices_data_;
75 75
76 DISALLOW_COPY_AND_ASSIGN(PPB_AudioInput_Impl); 76 DISALLOW_COPY_AND_ASSIGN(PPB_AudioInput_Impl);
77 }; 77 };
78 78
79 } // namespace ppapi 79 } // namespace ppapi
80 } // namespace webkit 80 } // namespace webkit
81 81
82 #endif // WEBKIT_PLUGINS_PPAPI_PPB_AUDIO_INPUT_IMPL_H_ 82 #endif // WEBKIT_PLUGINS_PPAPI_PPB_AUDIO_INPUT_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698