Index: content/renderer/pepper_plugin_delegate_impl.h |
diff --git a/content/renderer/pepper_plugin_delegate_impl.h b/content/renderer/pepper_plugin_delegate_impl.h |
index 22f5ab273b90a4d154aacb263be3958616dc6c55..4f27e4ba3abbbe96a94e036e4b04ffdc1cc0538c 100644 |
--- a/content/renderer/pepper_plugin_delegate_impl.h |
+++ b/content/renderer/pepper_plugin_delegate_impl.h |
@@ -13,6 +13,7 @@ |
#include "base/basictypes.h" |
#include "base/id_map.h" |
#include "base/memory/ref_counted.h" |
+#include "base/memory/scoped_ptr.h" |
#include "base/memory/weak_ptr.h" |
#include "content/common/content_export.h" |
#include "content/public/renderer/render_view_observer.h" |
@@ -233,7 +234,8 @@ class PepperPluginDelegateImpl |
virtual PlatformImage2D* CreateImage2D(int width, int height) OVERRIDE; |
virtual PlatformContext3D* CreateContext3D() OVERRIDE; |
virtual PlatformVideoCapture* CreateVideoCapture( |
- media::VideoCapture::EventHandler* handler) OVERRIDE; |
+ const std::string& device_id, |
+ PlatformVideoCaptureEventHandler* handler) OVERRIDE; |
virtual PlatformVideoDecoder* CreateVideoDecoder( |
media::VideoDecodeAccelerator::Client* client, |
int32 command_buffer_route_id) OVERRIDE; |
@@ -392,6 +394,9 @@ class PepperPluginDelegateImpl |
virtual bool IsInFullscreenMode() OVERRIDE; |
virtual void SampleGamepads(WebKit::WebGamepads* data) OVERRIDE; |
virtual bool IsPageVisible() const OVERRIDE; |
+ virtual int EnumerateDevices( |
+ PP_DeviceType_Dev type, |
+ const EnumerateDevicesCallback& callback) OVERRIDE; |
// RenderViewObserver implementation. |
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
@@ -428,7 +433,22 @@ class PepperPluginDelegateImpl |
CONTENT_EXPORT int GetRoutingId() const; |
+ typedef base::Callback<void (int /* request_id */, |
+ bool /* succeeded */, |
+ const std::string& /* label */)> |
+ OpenDeviceCallback; |
+ |
+ // Opens the specified device. The request ID passed into the callback will be |
+ // the same as the return value. |
+ int OpenDevice(PP_DeviceType_Dev type, |
+ const std::string& device_id, |
+ const OpenDeviceCallback& callback); |
+ void CloseDevice(const std::string& label); |
+ int GetSessionID(PP_DeviceType_Dev type, const std::string& label); |
brettw
2012/02/10 23:46:23
I don't understand this function, can it have docu
yzshen1
2012/02/13 20:55:41
Done.
|
+ |
private: |
+ class DeviceEnumerationEventHandler; |
+ |
// Asynchronously attempts to create a PPAPI broker for the given plugin. |
scoped_refptr<PpapiBrokerImpl> CreatePpapiBroker( |
webkit::ppapi::PluginModule* plugin_module); |
@@ -504,6 +524,8 @@ class PepperPluginDelegateImpl |
scoped_ptr<content::GamepadSharedMemoryReader> gamepad_shared_memory_reader_; |
+ scoped_ptr<DeviceEnumerationEventHandler> device_enumeration_event_handler_; |
+ |
DISALLOW_COPY_AND_ASSIGN(PepperPluginDelegateImpl); |
}; |