зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1284683 - add unanonymized nsIMediaDevice.rawId for browser-chrome use. r=jesup
MozReview-Commit-ID: A4RDfdZAF21 --HG-- extra : rebase_source : 0c1ca7b5a413daad31a95dd7eb42277a4e984f2f
This commit is contained in:
Родитель
0ea5b6e30b
Коммит
9e4998ef79
|
@ -862,12 +862,25 @@ MediaDevice::GetId(nsAString& aID)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
MediaDevice::GetRawId(nsAString& aID)
|
||||
{
|
||||
aID.Assign(mRawID);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
MediaDevice::SetId(const nsAString& aID)
|
||||
{
|
||||
mID.Assign(aID);
|
||||
}
|
||||
|
||||
void
|
||||
MediaDevice::SetRawId(const nsAString& aID)
|
||||
{
|
||||
mRawID.Assign(aID);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
MediaDevice::GetMediaSource(nsAString& aMediaSource)
|
||||
{
|
||||
|
@ -2465,6 +2478,7 @@ MediaManager::AnonymizeDevices(SourceSet& aDevices, const nsACString& aOriginKey
|
|||
for (auto& device : aDevices) {
|
||||
nsString id;
|
||||
device->GetId(id);
|
||||
device->SetRawId(id);
|
||||
AnonymizeId(id, aOriginKey);
|
||||
device->SetId(id);
|
||||
}
|
||||
|
|
|
@ -70,6 +70,7 @@ public:
|
|||
NS_DECL_NSIMEDIADEVICE
|
||||
|
||||
void SetId(const nsAString& aID);
|
||||
void SetRawId(const nsAString& aID);
|
||||
virtual uint32_t GetBestFitnessDistance(
|
||||
const nsTArray<const NormalizedConstraintSet*>& aConstraintSets);
|
||||
virtual Source* GetSource() = 0;
|
||||
|
@ -95,6 +96,7 @@ private:
|
|||
protected:
|
||||
nsString mName;
|
||||
nsString mID;
|
||||
nsString mRawID;
|
||||
dom::MediaSourceEnum mMediaSource;
|
||||
RefPtr<MediaEngineSource> mSource;
|
||||
RefPtr<MediaEngineSource::AllocationHandle> mAllocationHandle;
|
||||
|
|
|
@ -5,13 +5,14 @@
|
|||
#include "nsISupports.idl"
|
||||
#include "nsIVariant.idl"
|
||||
|
||||
[scriptable, builtinclass, uuid(cebcefca-2de1-460d-b253-d0582c50b40f)]
|
||||
[scriptable, builtinclass, uuid(ba3b2e08-1c07-4cd3-8822-f4d7e35ff2ae)]
|
||||
interface nsIMediaDevice : nsISupports
|
||||
{
|
||||
readonly attribute DOMString type;
|
||||
readonly attribute DOMString name;
|
||||
readonly attribute DOMString id;
|
||||
readonly attribute DOMString mediaSource;
|
||||
readonly attribute DOMString rawId;
|
||||
};
|
||||
|
||||
[scriptable, function, uuid(24544878-d35e-4962-8c5f-fb84e97bdfee)]
|
||||
|
|
Загрузка…
Ссылка в новой задаче