Bug 1741018 - Use uint32_t for bfcache flags and MOZ_LOG for ACTIVE_LOCK r=peterv

Differential Revision: https://phabricator.services.mozilla.com/D131523
This commit is contained in:
Kagami Sascha Rosylight 2021-11-22 12:14:15 +00:00
Родитель f4b6c6413c
Коммит 36ca2b283d
3 изменённых файлов: 7 добавлений и 4 удалений

Просмотреть файл

@ -2459,7 +2459,7 @@ void CanonicalBrowsingContext::ShowSubframeCrashedUI(
}
static void LogBFCacheBlockingForDoc(BrowsingContext* aBrowsingContext,
uint16_t aBFCacheCombo, bool aIsSubDoc) {
uint32_t aBFCacheCombo, bool aIsSubDoc) {
if (aIsSubDoc) {
nsAutoCString uri("[no uri]");
nsCOMPtr<nsIURI> currentURI =
@ -2504,6 +2504,9 @@ static void LogBFCacheBlockingForDoc(BrowsingContext* aBrowsingContext,
if (aBFCacheCombo & BFCacheStatus::BEFOREUNLOAD_LISTENER) {
MOZ_LOG(gSHIPBFCacheLog, LogLevel::Debug, (" * beforeunload listener"));
}
if (aBFCacheCombo & BFCacheStatus::ACTIVE_LOCK) {
MOZ_LOG(gSHIPBFCacheLog, LogLevel::Debug, (" * has active Web Locks"));
}
}
bool CanonicalBrowsingContext::AllowedInBFCache(

Просмотреть файл

@ -6804,13 +6804,13 @@ bool nsDocShell::CanSavePresentation(uint32_t aLoadType,
}
/* static */
void nsDocShell::ReportBFCacheComboTelemetry(uint16_t aCombo) {
void nsDocShell::ReportBFCacheComboTelemetry(uint32_t aCombo) {
// There are 11 possible reasons to make a request fails to use BFCache
// (see BFCacheStatus in dom/base/Document.h), and we'd like to record
// the common combinations for reasons which make requests fail to use
// BFCache. These combinations are generated based on some local browsings,
// we need to adjust them when necessary.
enum BFCacheStatusCombo : uint16_t {
enum BFCacheStatusCombo : uint32_t {
BFCACHE_SUCCESS,
NOT_ONLY_TOPLEVEL = mozilla::dom::BFCacheStatus::NOT_ONLY_TOPLEVEL_IN_BCG,
// If both unload and beforeunload listeners are presented, it'll be

Просмотреть файл

@ -867,7 +867,7 @@ class nsDocShell final : public nsDocLoader,
bool CanSavePresentation(uint32_t aLoadType, nsIRequest* aNewRequest,
mozilla::dom::Document* aNewDocument);
static void ReportBFCacheComboTelemetry(uint16_t aCombo);
static void ReportBFCacheComboTelemetry(uint32_t aCombo);
// Captures the state of the supporting elements of the presentation
// (the "window" object, docshell tree, meta-refresh loads, and security