mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-17 14:25:49 +00:00
Bug 639707: Add telemetry to detect how often we are getting restored by macOS vs. users manually launching the application. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D167448
This commit is contained in:
parent
4ade4253ec
commit
30321e1b4f
@ -6094,6 +6094,26 @@ startup:
|
||||
record_in_processes:
|
||||
- main
|
||||
|
||||
is_restored_by_macos:
|
||||
bug_numbers:
|
||||
- 639707
|
||||
description: >
|
||||
Recorded on every launch of a Firefox install on macOS, with a boolean
|
||||
value indicating whether Firefox was restored by macOS or if it was
|
||||
manually launched by a user.
|
||||
expires: "116"
|
||||
keyed: false
|
||||
kind: boolean
|
||||
notification_emails:
|
||||
- spohl@mozilla.com
|
||||
operating_systems:
|
||||
- mac
|
||||
products:
|
||||
- 'firefox'
|
||||
record_in_processes:
|
||||
- 'main'
|
||||
release_channel_collection: opt-out
|
||||
|
||||
script.preloader:
|
||||
mainthread_recompile:
|
||||
bug_numbers:
|
||||
|
@ -549,6 +549,12 @@ class nsCocoaUtils {
|
||||
*/
|
||||
static BOOL WasLaunchedAtLogin();
|
||||
|
||||
/**
|
||||
* Should the application restore its state because it was launched by the OS
|
||||
* at login?
|
||||
*/
|
||||
static BOOL ShouldRestoreStateDueToLaunchAtLoginImpl();
|
||||
|
||||
/**
|
||||
* Array of promises waiting to be resolved due to a video capture request.
|
||||
*/
|
||||
|
@ -36,6 +36,7 @@
|
||||
#include "mozilla/Logging.h"
|
||||
#include "mozilla/MiscEvents.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/TextEvents.h"
|
||||
#include "mozilla/StaticMutex.h"
|
||||
#include "mozilla/StaticPrefs_media.h"
|
||||
@ -268,7 +269,7 @@ BOOL nsCocoaUtils::WasLaunchedAtLogin() {
|
||||
return NO;
|
||||
}
|
||||
|
||||
BOOL nsCocoaUtils::ShouldRestoreStateDueToLaunchAtLogin() {
|
||||
BOOL nsCocoaUtils::ShouldRestoreStateDueToLaunchAtLoginImpl() {
|
||||
// Check if we were launched by macOS as a result of having
|
||||
// "Reopen windows..." selected during a restart.
|
||||
if (!WasLaunchedAtLogin()) {
|
||||
@ -294,6 +295,12 @@ BOOL nsCocoaUtils::ShouldRestoreStateDueToLaunchAtLogin() {
|
||||
return NO;
|
||||
}
|
||||
|
||||
BOOL nsCocoaUtils::ShouldRestoreStateDueToLaunchAtLogin() {
|
||||
BOOL shouldRestore = ShouldRestoreStateDueToLaunchAtLoginImpl();
|
||||
Telemetry::ScalarSet(Telemetry::ScalarID::STARTUP_IS_RESTORED_BY_MACOS, !!shouldRestore);
|
||||
return shouldRestore;
|
||||
}
|
||||
|
||||
void nsCocoaUtils::PrepareForNativeAppModalDialog() {
|
||||
NS_OBJC_BEGIN_TRY_IGNORE_BLOCK;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user