Files
tubestation/toolkit/components/telemetry/geckoview/TelemetryGeckoViewPersistence.h
Alessio Placitelli 41d024043b Bug 1453591 - Add persistence support for GeckoView in the Telemetry core. r=bz,chutten,froydnj,gfritzsche,janerik
This implements the persistence timer and the logic to write measurements
to a persistence file off-the-main thread using JSONWriter. The code to
load persisted measurements off the disk uses the builtin JSON parsing
functions from JS (as we cannot use jsoncpp).
It additionally exposes the ClearProbes method to clear the probe storage and
trigger clearing the persisted data (GeckoView only).

MozReview-Commit-ID: 94FoZac47Cw
2018-04-16 11:15:48 +02:00

38 lines
1.1 KiB
C++

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef GeckoViewTelemetryPersistence_h__
#define GeckoViewTelemetryPersistence_h__
namespace TelemetryGeckoViewPersistence {
/**
* Initializes the GeckoView persistence.
* This loads any measure that was previously persisted and then kicks
* off the persistence timer that regularly serializes telemetry measurements
* to the disk (off the main thread).
*
* Note: while this code should only be used in GeckoView, it's also
* compiled on other platforms for test-coverage.
*/
void InitPersistence();
/**
* Shuts down the GeckoView persistence.
*/
void DeInitPersistence();
/**
* Clears any GeckoView persisted data.
* This physically deletes persisted data files.
*/
void ClearPersistenceData();
} // namespace TelemetryGeckoViewPersistence
#endif // GeckoViewTelemetryPersistence_h__