mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-03 17:58:55 +02:00
Bug 1923741 - Add telemetry to measure how many users have read only system temporary folders. r=jrmuizel a=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D225139
This commit is contained in:
parent
31851c35b2
commit
037f26be8c
2 changed files with 28 additions and 0 deletions
|
|
@ -1051,6 +1051,16 @@ void gfxPlatform::Init() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool IsOsTempDirWritable() {
|
||||||
|
nsCOMPtr<nsIFile> file;
|
||||||
|
nsresult rv = NS_GetSpecialDirectory(NS_OS_TEMP_DIR, getter_AddRefs(file));
|
||||||
|
NS_ENSURE_SUCCESS(rv, false);
|
||||||
|
bool writable = false;
|
||||||
|
rv = file->IsWritable(&writable);
|
||||||
|
NS_ENSURE_SUCCESS(rv, false);
|
||||||
|
return writable;
|
||||||
|
}
|
||||||
|
|
||||||
void gfxPlatform::ReportTelemetry() {
|
void gfxPlatform::ReportTelemetry() {
|
||||||
MOZ_RELEASE_ASSERT(XRE_IsParentProcess(),
|
MOZ_RELEASE_ASSERT(XRE_IsParentProcess(),
|
||||||
"GFX: Only allowed to be called from parent process.");
|
"GFX: Only allowed to be called from parent process.");
|
||||||
|
|
@ -1073,6 +1083,9 @@ void gfxPlatform::ReportTelemetry() {
|
||||||
supportsHDR |= screen->GetIsHDR();
|
supportsHDR |= screen->GetIsHDR();
|
||||||
}
|
}
|
||||||
Telemetry::ScalarSet(Telemetry::ScalarID::GFX_SUPPORTS_HDR, supportsHDR);
|
Telemetry::ScalarSet(Telemetry::ScalarID::GFX_SUPPORTS_HDR, supportsHDR);
|
||||||
|
|
||||||
|
bool tmpWritable = IsOsTempDirWritable();
|
||||||
|
Telemetry::ScalarSet(Telemetry::ScalarID::GFX_TMP_WRITABLE, tmpWritable);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsString adapterDesc;
|
nsString adapterDesc;
|
||||||
|
|
|
||||||
|
|
@ -4484,6 +4484,21 @@ gfx:
|
||||||
record_in_processes:
|
record_in_processes:
|
||||||
- 'main'
|
- 'main'
|
||||||
release_channel_collection: opt-out
|
release_channel_collection: opt-out
|
||||||
|
tmp_writable:
|
||||||
|
bug_numbers:
|
||||||
|
- 1923741
|
||||||
|
description: >
|
||||||
|
Is the system temporary directory writable
|
||||||
|
expires: "134"
|
||||||
|
kind: boolean
|
||||||
|
notification_emails:
|
||||||
|
- gfx-telemetry-alerts@mozilla.com
|
||||||
|
- aosmond@mozilla.com
|
||||||
|
products:
|
||||||
|
- 'firefox'
|
||||||
|
record_in_processes:
|
||||||
|
- 'main'
|
||||||
|
release_channel_collection: opt-out
|
||||||
|
|
||||||
apz:
|
apz:
|
||||||
scrollwheel_overshoot:
|
scrollwheel_overshoot:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue