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

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

Issue 2490653002: Make Pepper use Mojo-based support for media-device enumeration and monitoring. (Closed)
Patch Set: address bbudge's comments Created 4 years, 1 month 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
Index: content/renderer/pepper/pepper_media_device_manager.h
diff --git a/content/renderer/pepper/pepper_media_device_manager.h b/content/renderer/pepper/pepper_media_device_manager.h
index e0343bbd19762afe0ec4c79355dfa106f625f579..8580459d82a232c18c7dbb81143d626695cb23e6 100644
--- a/content/renderer/pepper/pepper_media_device_manager.h
+++ b/content/renderer/pepper/pepper_media_device_manager.h
@@ -6,9 +6,13 @@
#define CONTENT_RENDERER_PEPPER_PEPPER_MEDIA_DEVICE_MANAGER_H_
#include <map>
+#include <string>
+#include <vector>
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
+#include "content/common/media/media_devices.h"
+#include "content/common/media/media_devices.mojom.h"
#include "content/public/renderer/render_frame_observer.h"
#include "content/public/renderer/render_frame_observer_tracker.h"
#include "content/renderer/media/media_stream_dispatcher_eventhandler.h"
@@ -29,10 +33,14 @@ class PepperMediaDeviceManager
~PepperMediaDeviceManager() override;
// PepperDeviceEnumerationHostHelper::Delegate implementation:
- int EnumerateDevices(PP_DeviceType_Dev type,
- const GURL& document_url,
- const EnumerateDevicesCallback& callback) override;
- void StopEnumerateDevices(int request_id) override;
+ void EnumerateDevices(PP_DeviceType_Dev type,
+ const GURL& document_url,
+ const DevicesCallback& callback) override;
+ uint32_t StartMonitoringDevices(PP_DeviceType_Dev type,
+ const GURL& document_url,
+ const DevicesCallback& callback) override;
+ void StopMonitoringDevices(PP_DeviceType_Dev type,
+ uint32_t subscription_id) override;
typedef base::Callback<void(int /* request_id */,
bool /* succeeded */,
@@ -76,7 +84,6 @@ class PepperMediaDeviceManager
// Stream type conversion.
static MediaStreamType FromPepperDeviceType(PP_DeviceType_Dev type);
- static PP_DeviceType_Dev FromMediaStreamType(MediaStreamType type);
private:
explicit PepperMediaDeviceManager(RenderFrame* render_frame);
@@ -92,17 +99,24 @@ class PepperMediaDeviceManager
bool succeeded,
const std::string& label);
+ void DevicesEnumerated(const DevicesCallback& callback,
+ MediaDeviceType type,
+ const std::vector<MediaDeviceInfoArray>& enumeration);
+
+ void DevicesChanged(const DevicesCallback& callback,
+ MediaDeviceType type,
+ const MediaDeviceInfoArray& enumeration);
MediaStreamDispatcher* GetMediaStreamDispatcher() const;
+ const ::mojom::MediaDevicesDispatcherHostPtr& GetMediaDevicesDispatcher();
int next_id_;
- typedef std::map<int, EnumerateDevicesCallback> EnumerateCallbackMap;
- EnumerateCallbackMap enumerate_callbacks_;
-
typedef std::map<int, OpenDeviceCallback> OpenCallbackMap;
OpenCallbackMap open_callbacks_;
+ ::mojom::MediaDevicesDispatcherHostPtr media_devices_dispatcher_;
+
DISALLOW_COPY_AND_ASSIGN(PepperMediaDeviceManager);
};

Powered by Google App Engine
This is Rietveld 408576698