Use std::optional in //content/browser/aggregation_service
I generated these changes with the following commands:
cd content/browser/aggregation_service/
git sed absl::nullopt std::nullopt
git sed absl::optional std::optional
git sed '"third_party/abseil-cpp/absl/types/optional.h"' '<optional>'
git cl format
This was not entirely automatic, as I had to manually move '#include
<optional>' into the correct block of includes.
Bug: 1503962
Low-Coverage-Reason: TRIVIAL_CHANGE
Change-Id: I4d7a89bfc5507e2dff395a85fead41a77c47f0d0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5047250
Auto-Submit: Dan McArdle <dmcardle@chromium.org>
Commit-Queue: Nan Lin <linnan@chromium.org>
Reviewed-by: Andrew Paseltiner <apaseltiner@chromium.org>
Reviewed-by: Nan Lin <linnan@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1227578}
diff --git a/content/browser/aggregation_service/report_scheduler_timer.h b/content/browser/aggregation_service/report_scheduler_timer.h
index 640d863..2e8fd720 100644
--- a/content/browser/aggregation_service/report_scheduler_timer.h
+++ b/content/browser/aggregation_service/report_scheduler_timer.h
@@ -6,6 +6,7 @@
#define CONTENT_BROWSER_AGGREGATION_SERVICE_REPORT_SCHEDULER_TIMER_H_
#include <memory>
+#include <optional>
#include "base/functional/callback_forward.h"
#include "base/memory/weak_ptr.h"
@@ -16,7 +17,6 @@
#include "content/common/content_export.h"
#include "services/network/public/cpp/network_connection_tracker.h"
#include "services/network/public/mojom/network_change_manager.mojom.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
namespace base {
class Time;
@@ -39,9 +39,9 @@
// Should be overridden with a method that gets the next report time that
// the timer should fire at and returns it via the callback. If there is no
- // next report time, `absl::nullopt` should be returned instead.
+ // next report time, `std::nullopt` should be returned instead.
virtual void GetNextReportTime(
- base::OnceCallback<void(absl::optional<base::Time>)>,
+ base::OnceCallback<void(std::optional<base::Time>)>,
base::Time now) = 0;
// Called when the timer is fired, with the current time `now`. `Refresh()`
@@ -61,7 +61,7 @@
// the given argument; this may be necessary after the report times were
// adjusted.
virtual void AdjustOfflineReportTimes(
- base::OnceCallback<void(absl::optional<base::Time>)>) = 0;
+ base::OnceCallback<void(std::optional<base::Time>)>) = 0;
};
explicit ReportSchedulerTimer(std::unique_ptr<Delegate> delegate);
@@ -77,7 +77,7 @@
// Schedules `reporting_time_reached_timer_` to fire at that time, unless the
// timer is already set to fire earlier.
- void MaybeSet(absl::optional<base::Time> reporting_time);
+ void MaybeSet(std::optional<base::Time> reporting_time);
private:
void OnTimerFired();