Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1525)

Unified Diff: chrome/browser/metrics/chrome_metrics_service_client.cc

Issue 2957383002: [Cleanup] Use a sequence checker rather than a thread checker for the metrics service. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/metrics/chrome_metrics_service_client.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/metrics/chrome_metrics_service_client.cc
diff --git a/chrome/browser/metrics/chrome_metrics_service_client.cc b/chrome/browser/metrics/chrome_metrics_service_client.cc
index d14ba61230f17213dc16157e97c0bcef217a365e..9da2ed183ea67ba1f69176a85f0d7039b8f1bfef 100644
--- a/chrome/browser/metrics/chrome_metrics_service_client.cc
+++ b/chrome/browser/metrics/chrome_metrics_service_client.cc
@@ -316,13 +316,13 @@ ChromeMetricsServiceClient::ChromeMetricsServiceClient(
start_time_(base::TimeTicks::Now()),
has_uploaded_profiler_data_(false),
weak_ptr_factory_(this) {
- DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
RecordCommandLineMetrics();
RegisterForNotifications();
}
ChromeMetricsServiceClient::~ChromeMetricsServiceClient() {
- DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
base::GlobalHistogramAllocator* allocator =
base::GlobalHistogramAllocator::Get();
if (allocator) {
@@ -517,7 +517,7 @@ void ChromeMetricsServiceClient::OnInitNextTask() {
void ChromeMetricsServiceClient::CollectFinalMetricsForLog(
const base::Closure& done_callback) {
- DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
collect_final_metrics_done_callback_ = done_callback;
@@ -790,7 +790,7 @@ void ChromeMetricsServiceClient::FinishedReceivingProfilerData() {
}
void ChromeMetricsServiceClient::CollectFinalHistograms() {
- DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
// Begin the multi-step process of collecting memory usage histograms:
// First spawn a task to collect the memory details; when that task is
@@ -814,7 +814,7 @@ void ChromeMetricsServiceClient::CollectFinalHistograms() {
}
void ChromeMetricsServiceClient::OnMemoryDetailCollectionDone() {
- DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
// This function should only be called as the callback from an ansynchronous
// step.
@@ -859,7 +859,7 @@ void ChromeMetricsServiceClient::OnMemoryDetailCollectionDone() {
}
void ChromeMetricsServiceClient::OnHistogramSynchronizationDone() {
- DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
// This function should only be called as the callback from an ansynchronous
// step.
@@ -957,7 +957,7 @@ void ChromeMetricsServiceClient::Observe(
int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
- DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
switch (type) {
case chrome::NOTIFICATION_BROWSER_OPENED:
« no previous file with comments | « chrome/browser/metrics/chrome_metrics_service_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698