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

Unified Diff: content/renderer/pepper/pepper_audio_input_host.h

Issue 11411047: Introduce PPB_AudioInput_Dev v0.3 and refactor the device enumeration code: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/content_tests.gypi ('k') | content/renderer/pepper/pepper_audio_input_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/pepper_audio_input_host.h
diff --git a/content/renderer/pepper/pepper_audio_input_host.h b/content/renderer/pepper/pepper_audio_input_host.h
index c6f6bd90cea39512141b1f5c6cc1c40ab42513d7..70228f057089399a89c0dd08064a93ed26bde120 100644
--- a/content/renderer/pepper/pepper_audio_input_host.h
+++ b/content/renderer/pepper/pepper_audio_input_host.h
@@ -6,24 +6,19 @@
#define CONTENT_RENDERER_PEPPER_PEPPER_AUDIO_INPUT_HOST_H_
#include <string>
-#include <vector>
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
-#include "base/memory/weak_ptr.h"
#include "base/shared_memory.h"
#include "base/sync_socket.h"
+#include "content/renderer/pepper/pepper_device_enumeration_host_helper.h"
#include "ipc/ipc_platform_file.h"
#include "ppapi/c/ppb_audio_config.h"
#include "ppapi/host/host_message_context.h"
#include "ppapi/host/resource_host.h"
#include "webkit/plugins/ppapi/plugin_delegate.h"
-namespace ppapi {
-struct DeviceRefData;
-}
-
namespace content {
class RendererPpapiHost;
@@ -31,7 +26,7 @@ class RendererPpapiHost;
class PepperAudioInputHost
: public ppapi::host::ResourceHost,
public webkit::ppapi::PluginDelegate::PlatformAudioInputClient,
- public base::SupportsWeakPtr<PepperAudioInputHost> {
+ public PepperDeviceEnumerationHostHelper::Delegate {
public:
PepperAudioInputHost(RendererPpapiHost* host,
PP_Instance instance,
@@ -48,8 +43,10 @@ class PepperAudioInputHost
base::SyncSocket::Handle socket) OVERRIDE;
virtual void StreamCreationFailed() OVERRIDE;
+ // PepperDeviceEnumerationHostHelper::Delegate implementation.
+ virtual webkit::ppapi::PluginDelegate* GetPluginDelegate() OVERRIDE;
+
private:
- int32_t OnMsgEnumerateDevices(ppapi::host::HostMessageContext* context);
int32_t OnMsgOpen(ppapi::host::HostMessageContext* context,
const std::string& device_id,
PP_AudioSampleRate sample_rate,
@@ -58,11 +55,6 @@ class PepperAudioInputHost
bool capture);
int32_t OnMsgClose(ppapi::host::HostMessageContext* context);
- void EnumerateDevicesCallbackFunc(
- int request_id,
- bool succeeded,
- const std::vector<ppapi::DeviceRefData>& devices);
-
void OnOpenComplete(int32_t result,
base::SharedMemoryHandle shared_memory_handle,
size_t shared_memory_size,
@@ -76,20 +68,17 @@ class PepperAudioInputHost
void Close();
- // TODO(yzshen): Move the relevant functionality out of PluginDelegate and get
- // rid of this method.
- webkit::ppapi::PluginDelegate* GetDelegate() const;
-
// Non-owning pointer.
RendererPpapiHost* renderer_ppapi_host_;
- scoped_ptr<ppapi::host::ReplyMessageContext> enumerate_devices_context_;
scoped_ptr<ppapi::host::ReplyMessageContext> open_context_;
// PluginDelegate audio input object that we delegate audio IPC through.
// We don't own this pointer but are responsible for calling Shutdown on it.
webkit::ppapi::PluginDelegate::PlatformAudioInput* audio_input_;
+ PepperDeviceEnumerationHostHelper enumeration_helper_;
+
DISALLOW_COPY_AND_ASSIGN(PepperAudioInputHost);
};
« no previous file with comments | « content/content_tests.gypi ('k') | content/renderer/pepper/pepper_audio_input_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698