|
@@ -4665,7 +4665,7 @@
|
|
|
}
|
|
|
|
|
|
void SafeBrowsingMetricsCollector::LogMetricsAndScheduleNextLogging() {
|
|
|
-@@ -90,38 +73,11 @@ void SafeBrowsingMetricsCollector::LogMe
|
|
|
+@@ -90,59 +73,11 @@ void SafeBrowsingMetricsCollector::LogMe
|
|
|
MaybeLogDailyEsbProtegoPingSentLast24Hours();
|
|
|
RemoveOldEventsFromPref();
|
|
|
|
|
@@ -4701,10 +4701,31 @@
|
|
|
- "SafeBrowsing.Enhanced.ProtegoRequestSentInLast24Hours",
|
|
|
- sent_ping_since_last_collector_run ? most_recent_ping_type
|
|
|
- : ProtegoPingType::kNone);
|
|
|
+-
|
|
|
+- auto logged_ping_type = ProtegoPingType::kNone;
|
|
|
+-
|
|
|
+- if (base::Time::Now() - last_ping_with_token < base::Hours(24)) {
|
|
|
+- // If a ping with token was sent within the last 24 hours,
|
|
|
+- // the most recent ping type is kWithToken.
|
|
|
+- // If both last_ping_with_token and last_ping_without_token are present,
|
|
|
+- // we log kWithToken instead of kWithoutToken because if a token has been
|
|
|
+- // sent before, we are certain that this account is a signed in account
|
|
|
+- // and the server has received the token.
|
|
|
+- // The kWithoutToken ping could be sent after the account logged out.
|
|
|
+- logged_ping_type = ProtegoPingType::kWithToken;
|
|
|
+- } else if (base::Time::Now() - last_ping_without_token < base::Hours(24)) {
|
|
|
+- // If no ping with token was sent but a ping without token was sent within
|
|
|
+- // the last 24 hours, the most recent ping type is kWithoutToken.
|
|
|
+- // Otherwise, it is the default value, kNone.
|
|
|
+- logged_ping_type = ProtegoPingType::kWithoutToken;
|
|
|
+- }
|
|
|
+- base::UmaHistogramEnumeration(
|
|
|
+- "SafeBrowsing.Enhanced.ProtegoRequestSentInLast24Hours2",
|
|
|
+- logged_ping_type);
|
|
|
}
|
|
|
|
|
|
void SafeBrowsingMetricsCollector::ScheduleNextLoggingAfterInterval(
|
|
|
-@@ -133,76 +89,16 @@ void SafeBrowsingMetricsCollector::Sched
|
|
|
+@@ -154,76 +89,16 @@ void SafeBrowsingMetricsCollector::Sched
|
|
|
}
|
|
|
|
|
|
void SafeBrowsingMetricsCollector::LogDailyOptInMetrics() {
|
|
@@ -4781,7 +4802,7 @@
|
|
|
}
|
|
|
|
|
|
void SafeBrowsingMetricsCollector::AddBypassEventToPref(
|
|
|
-@@ -245,15 +141,7 @@ absl::optional<base::Time>
|
|
|
+@@ -266,15 +141,7 @@ absl::optional<base::Time>
|
|
|
SafeBrowsingMetricsCollector::GetLatestEventTimestamp(
|
|
|
EventTypeFilter event_type_filter) {
|
|
|
// Events are not logged when Safe Browsing is disabled.
|
|
@@ -4797,7 +4818,7 @@
|
|
|
}
|
|
|
|
|
|
absl::optional<base::Time>
|
|
|
-@@ -265,45 +153,15 @@ SafeBrowsingMetricsCollector::GetLatestS
|
|
|
+@@ -286,45 +153,15 @@ SafeBrowsingMetricsCollector::GetLatestS
|
|
|
void SafeBrowsingMetricsCollector::AddSafeBrowsingEventAndUserStateToPref(
|
|
|
UserState user_state,
|
|
|
EventType event_type) {
|
|
@@ -4844,7 +4865,7 @@
|
|
|
}
|
|
|
|
|
|
absl::optional<SafeBrowsingMetricsCollector::Event>
|
|
|
-@@ -431,23 +289,6 @@ int SafeBrowsingMetricsCollector::GetEve
|
|
|
+@@ -452,23 +289,6 @@ int SafeBrowsingMetricsCollector::GetEve
|
|
|
});
|
|
|
}
|
|
|
|