#include "content/browser/metrics/histogram_synchronizer.h"
#include <utility>
#include "base/check_op.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/lazy_instance.h"
#include "base/location.h"
#include "base/metrics/histogram_delta_serialization.h"
#include "base/metrics/histogram_macros.h"
#include "base/pickle.h"
#include "base/task/single_thread_task_runner.h"
#include "base/threading/thread.h"
#include "components/metrics/histogram_controller.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/histogram_fetcher.h"
#include "content/public/common/content_constants.h"
namespace content {
Time;
TimeTicks;
namespace {
static const int kNeverUsableSequenceNumber = …;
}
class HistogramSynchronizer::RequestContext { … };
base::LazyInstance<HistogramSynchronizer::RequestContext::RequestContextMap>::
Leaky HistogramSynchronizer::RequestContext::outstanding_requests_ = …;
HistogramSynchronizer::HistogramSynchronizer()
: … { … }
HistogramSynchronizer::~HistogramSynchronizer() { … }
HistogramSynchronizer* HistogramSynchronizer::GetInstance() { … }
void HistogramSynchronizer::FetchHistograms() { … }
void FetchHistogramsAsynchronously(scoped_refptr<base::TaskRunner> task_runner,
base::OnceClosure callback,
base::TimeDelta wait_time) { … }
void HistogramSynchronizer::FetchHistogramsAsynchronously(
scoped_refptr<base::TaskRunner> task_runner,
base::OnceClosure callback,
base::TimeDelta wait_time) { … }
void HistogramSynchronizer::RegisterAndNotifyAllProcesses(
ProcessHistogramRequester requester,
base::TimeDelta wait_time) { … }
void HistogramSynchronizer::OnPendingProcesses(int sequence_number,
int pending_processes,
bool end) { … }
void HistogramSynchronizer::OnHistogramDataCollected(
int sequence_number,
const std::vector<std::string>& pickled_histograms) { … }
void HistogramSynchronizer::SetTaskRunnerAndCallback(
scoped_refptr<base::TaskRunner> task_runner,
base::OnceClosure callback) { … }
void HistogramSynchronizer::ForceHistogramSynchronizationDoneCallback(
int sequence_number) { … }
void HistogramSynchronizer::InternalPostTask(
scoped_refptr<base::TaskRunner> task_runner,
base::OnceClosure callback) { … }
int HistogramSynchronizer::GetNextAvailableSequenceNumber(
ProcessHistogramRequester requester) { … }
}