зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1305552 - Add telemetry to track uses of MediaKeySession.generateRequest. r=francois,gerald
This allows us to track how often EME CDMs are used, rather than just created. The telemetry I added in bug 1304207 is reports whenever a CDM is created, but some sites, such as the Shaka Player demo site, create CDMs without using them, so that telemetry isn't a great measure in helping us detect when CDMs aren't being used. Whereas the telemetry added here will report when the CDMs are used to negotiate a license, i.e. when the CDMs are actually being used. MozReview-Commit-ID: ExMIcIIBvS1
This commit is contained in:
Родитель
1748bfae57
Коммит
f40bbc42f7
|
@ -154,4 +154,17 @@ IsClearkeyKeySystem(const nsAString& aKeySystem)
|
|||
return !CompareUTF8toUTF16(kEMEKeySystemClearkey, aKeySystem);
|
||||
}
|
||||
|
||||
CDMType
|
||||
ToCDMTypeTelemetryEnum(const nsString& aKeySystem)
|
||||
{
|
||||
if (!CompareUTF8toUTF16(kEMEKeySystemWidevine, aKeySystem)) {
|
||||
return CDMType::eWidevine;
|
||||
} else if (!CompareUTF8toUTF16(kEMEKeySystemClearkey, aKeySystem)) {
|
||||
return CDMType::eClearKey;
|
||||
} else if (!CompareUTF8toUTF16(kEMEKeySystemPrimetime, aKeySystem)) {
|
||||
return CDMType::ePrimetime;
|
||||
}
|
||||
return CDMType::eUnknown;
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -106,6 +106,16 @@ KeySystemToGMPName(const nsAString& aKeySystem);
|
|||
bool
|
||||
IsClearkeyKeySystem(const nsAString& aKeySystem);
|
||||
|
||||
enum CDMType {
|
||||
eClearKey = 0,
|
||||
ePrimetime = 1,
|
||||
eWidevine = 2,
|
||||
eUnknown = 3
|
||||
};
|
||||
|
||||
CDMType
|
||||
ToCDMTypeTelemetryEnum(const nsString& aKeySystem);
|
||||
|
||||
} // namespace mozilla
|
||||
|
||||
#endif // EME_LOG_H_
|
||||
|
|
|
@ -199,6 +199,9 @@ MediaKeySession::GenerateRequest(const nsAString& aInitDataType,
|
|||
return promise.forget();
|
||||
}
|
||||
|
||||
Telemetry::Accumulate(Telemetry::VIDEO_CDM_GENERATE_REQUEST_CALLED,
|
||||
ToCDMTypeTelemetryEnum(mKeySystem));
|
||||
|
||||
// Convert initData to base64 for easier logging.
|
||||
// Note: CreateSession() Move()s the data out of the array, so we have
|
||||
// to copy it here.
|
||||
|
|
|
@ -401,26 +401,6 @@ MediaKeys::Init(ErrorResult& aRv)
|
|||
return promise.forget();
|
||||
}
|
||||
|
||||
enum CDMCreatedType {
|
||||
eClearKey = 0,
|
||||
ePrimetime = 1,
|
||||
eWidevine = 2,
|
||||
eUnknown = 3
|
||||
};
|
||||
|
||||
static CDMCreatedType
|
||||
ToCDMCreatedTelemetryEnum(const nsString& aKeySystem)
|
||||
{
|
||||
if (!CompareUTF8toUTF16(kEMEKeySystemWidevine, aKeySystem)) {
|
||||
return CDMCreatedType::eWidevine;
|
||||
} else if (!CompareUTF8toUTF16(kEMEKeySystemClearkey, aKeySystem)) {
|
||||
return CDMCreatedType::eClearKey;
|
||||
} else if (!CompareUTF8toUTF16(kEMEKeySystemPrimetime, aKeySystem)) {
|
||||
return CDMCreatedType::ePrimetime;
|
||||
}
|
||||
return CDMCreatedType::eUnknown;
|
||||
}
|
||||
|
||||
void
|
||||
MediaKeys::OnCDMCreated(PromiseId aId, const nsACString& aNodeId, const uint32_t aPluginId)
|
||||
{
|
||||
|
@ -440,7 +420,7 @@ MediaKeys::OnCDMCreated(PromiseId aId, const nsACString& aNodeId, const uint32_t
|
|||
mKeySystem,
|
||||
MediaKeySystemStatus::Cdm_created);
|
||||
|
||||
Telemetry::Accumulate(Telemetry::VIDEO_CDM_CREATED, ToCDMCreatedTelemetryEnum(mKeySystem));
|
||||
Telemetry::Accumulate(Telemetry::VIDEO_CDM_CREATED, ToCDMTypeTelemetryEnum(mKeySystem));
|
||||
}
|
||||
|
||||
already_AddRefed<MediaKeySession>
|
||||
|
|
|
@ -8716,6 +8716,15 @@
|
|||
"description": "Note the type of CDM (0=ClearKey, 1=Primetime, 2=Widevine, 3=unknown) every time we successfully instantiate an EME MediaKeys object.",
|
||||
"releaseChannelCollection": "opt-out"
|
||||
},
|
||||
"VIDEO_CDM_GENERATE_REQUEST_CALLED": {
|
||||
"alert_emails": ["cpearce@mozilla.com"],
|
||||
"expires_in_version": "58",
|
||||
"bug_numbers": [1305552],
|
||||
"kind": "enumerated",
|
||||
"n_values": 6,
|
||||
"description": "Note the type of CDM (0=ClearKey, 1=Primetime, 2=Widevine, 3=unknown) every time we call MediaKeySession.generateRequest().",
|
||||
"releaseChannelCollection": "opt-out"
|
||||
},
|
||||
"MEDIA_CODEC_USED": {
|
||||
"alert_emails": ["cpearce@mozilla.com"],
|
||||
"expires_in_version": "never",
|
||||
|
|
Загрузка…
Ссылка в новой задаче