Skip to content

Commit

Permalink
Add LAZY_INSTANCE_INITIALIZER where necessary.
Browse files Browse the repository at this point in the history
This fixes compile errors in C++20 mode.

Bug: 1284275
Change-Id: I645cd1c1d1e75167549e5d99c47af4514f5b9cad
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3773637
Commit-Queue: danakj <danakj@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Owners-Override: danakj <danakj@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1025992}
NOKEYCHECK=True
GitOrigin-RevId: 0ba0e18f3135142fc380775a2f81b975ec82aac7
  • Loading branch information
pkasting authored and Copybara-Service committed Jul 19, 2022
1 parent 288fe6f commit d3414cf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion android/java_exception_reporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ void (*g_java_exception_callback)(const char*);
using JavaExceptionFilter =
base::RepeatingCallback<bool(const JavaRef<jthrowable>&)>;

LazyInstance<JavaExceptionFilter>::Leaky g_java_exception_filter;
LazyInstance<JavaExceptionFilter>::Leaky g_java_exception_filter =
LAZY_INSTANCE_INITIALIZER;

} // namespace

Expand Down
2 changes: 1 addition & 1 deletion android/native_uma_recorder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class HistogramCache {
}
};

LazyInstance<HistogramCache>::Leaky g_histograms;
LazyInstance<HistogramCache>::Leaky g_histograms = LAZY_INSTANCE_INITIALIZER;

struct ActionCallbackWrapper {
base::ActionCallback action_callback;
Expand Down
2 changes: 1 addition & 1 deletion metrics/statistics_recorder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ bool HistogramNameLesser(const base::HistogramBase* a,
} // namespace

// static
LazyInstance<Lock>::Leaky StatisticsRecorder::lock_;
LazyInstance<Lock>::Leaky StatisticsRecorder::lock_ = LAZY_INSTANCE_INITIALIZER;

// static
StatisticsRecorder* StatisticsRecorder::top_ = nullptr;
Expand Down

0 comments on commit d3414cf

Please sign in to comment.