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

Unified Diff: Source/platform/exported/WebMediaDeviceInfo.cpp

Issue 145583015: MediaStream API: Implement Navigator.getMediaDevices Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed review comments and added a simple test Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/blink_platform.gypi ('k') | Source/web/UserMediaClientImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/exported/WebMediaDeviceInfo.cpp
diff --git a/Source/platform/exported/WebSourceInfo.cpp b/Source/platform/exported/WebMediaDeviceInfo.cpp
similarity index 51%
copy from Source/platform/exported/WebSourceInfo.cpp
copy to Source/platform/exported/WebMediaDeviceInfo.cpp
index d96a5f8693d17296bdfb2686efc8b00bbeb4e986..3737035cfa57184c1169edcbedd861bb164229df 100644
--- a/Source/platform/exported/WebSourceInfo.cpp
+++ b/Source/platform/exported/WebMediaDeviceInfo.cpp
@@ -25,7 +25,7 @@
#include "config.h"
-#include "public/platform/WebSourceInfo.h"
+#include "public/platform/WebMediaDeviceInfo.h"
#include "public/platform/WebString.h"
#include "wtf/PassRefPtr.h"
@@ -33,74 +33,74 @@
namespace blink {
-class WebSourceInfoPrivate FINAL : public RefCounted<WebSourceInfoPrivate> {
+class WebMediaDeviceInfoPrivate FINAL : public RefCounted<WebMediaDeviceInfoPrivate> {
public:
- static PassRefPtr<WebSourceInfoPrivate> create(const WebString& id, WebSourceInfo::SourceKind, const WebString& label, WebSourceInfo::VideoFacingMode);
+ static PassRefPtr<WebMediaDeviceInfoPrivate> create(const WebString& deviceId, WebMediaDeviceInfo::MediaDeviceKind, const WebString& label, const WebString& groupId);
- const WebString& id() const { return m_id; }
- WebSourceInfo::SourceKind kind() const { return m_kind; }
+ const WebString& deviceId() const { return m_deviceId; }
+ WebMediaDeviceInfo::MediaDeviceKind kind() const { return m_kind; }
const WebString& label() const { return m_label; }
- WebSourceInfo::VideoFacingMode facing() const { return m_facing; }
+ const WebString& groupId() const { return m_groupId; }
private:
- WebSourceInfoPrivate(const WebString& id, WebSourceInfo::SourceKind, const WebString& label, WebSourceInfo::VideoFacingMode);
+ WebMediaDeviceInfoPrivate(const WebString& deviceId, WebMediaDeviceInfo::MediaDeviceKind, const WebString& label, const WebString& groupId);
- WebString m_id;
- WebSourceInfo::SourceKind m_kind;
+ WebString m_deviceId;
+ WebMediaDeviceInfo::MediaDeviceKind m_kind;
WebString m_label;
- WebSourceInfo::VideoFacingMode m_facing;
+ WebString m_groupId;
};
-PassRefPtr<WebSourceInfoPrivate> WebSourceInfoPrivate::create(const WebString& id, WebSourceInfo::SourceKind kind, const WebString& label, WebSourceInfo::VideoFacingMode facing)
+PassRefPtr<WebMediaDeviceInfoPrivate> WebMediaDeviceInfoPrivate::create(const WebString& deviceId, WebMediaDeviceInfo::MediaDeviceKind kind, const WebString& label, const WebString& groupId)
{
- return adoptRef(new WebSourceInfoPrivate(id, kind, label, facing));
+ return adoptRef(new WebMediaDeviceInfoPrivate(deviceId, kind, label, groupId));
}
-WebSourceInfoPrivate::WebSourceInfoPrivate(const WebString& id, WebSourceInfo::SourceKind kind, const WebString& label, WebSourceInfo::VideoFacingMode facing)
- : m_id(id)
+WebMediaDeviceInfoPrivate::WebMediaDeviceInfoPrivate(const WebString& deviceId, WebMediaDeviceInfo::MediaDeviceKind kind, const WebString& label, const WebString& groupId)
+ : m_deviceId(deviceId)
, m_kind(kind)
, m_label(label)
- , m_facing(facing)
+ , m_groupId(groupId)
{
}
-void WebSourceInfo::assign(const WebSourceInfo& other)
+void WebMediaDeviceInfo::assign(const WebMediaDeviceInfo& other)
{
m_private = other.m_private;
}
-void WebSourceInfo::reset()
+void WebMediaDeviceInfo::reset()
{
m_private.reset();
}
-void WebSourceInfo::initialize(const WebString& id, WebSourceInfo::SourceKind kind, const WebString& label, WebSourceInfo::VideoFacingMode facing)
+void WebMediaDeviceInfo::initialize(const WebString& deviceId, WebMediaDeviceInfo::MediaDeviceKind kind, const WebString& label, const WebString& groupId)
{
- m_private = WebSourceInfoPrivate::create(id, kind, label, facing);
+ m_private = WebMediaDeviceInfoPrivate::create(deviceId, kind, label, groupId);
}
-WebString WebSourceInfo::id() const
+WebString WebMediaDeviceInfo::deviceId() const
{
ASSERT(!m_private.isNull());
- return m_private->id();
+ return m_private->deviceId();
}
-WebSourceInfo::SourceKind WebSourceInfo::kind() const
+WebMediaDeviceInfo::MediaDeviceKind WebMediaDeviceInfo::kind() const
{
ASSERT(!m_private.isNull());
return m_private->kind();
}
-WebString WebSourceInfo::label() const
+WebString WebMediaDeviceInfo::label() const
{
ASSERT(!m_private.isNull());
return m_private->label();
}
-WebSourceInfo::VideoFacingMode WebSourceInfo::facing() const
+WebString WebMediaDeviceInfo::groupId() const
{
ASSERT(!m_private.isNull());
- return m_private->facing();
+ return m_private->groupId();
}
} // namespace blink
« no previous file with comments | « Source/platform/blink_platform.gypi ('k') | Source/web/UserMediaClientImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698