// Copyright 2020 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. module mojom; import "url/mojom/origin.mojom"; // Struct containing stored data that will be sent in a future conversion // report. struct WebUIConversionReport { string impression_data; string conversion_data; url.mojom.Origin conversion_origin; url.mojom.Origin reporting_origin; double report_time; int32 attribution_credit; }; // Struct representing a stored impression that will be displayed by WebUI. struct WebUIImpression { string impression_data; url.mojom.Origin impression_origin; url.mojom.Origin conversion_destination; url.mojom.Origin reporting_origin; double impression_time; double expiry_time; }; // Mojo interface used for communication between a WebUI and the storage layer // for conversion measurement. interface ConversionInternalsHandler { // Returns whether conversion measurement is enabled in the browisng context // the WebUI is in. IsMeasurementEnabled() => (bool enabled); // Returns all active impressions that are persisted in storage. This does // not include expired impressions, or impressions that can no longer convert // due to reaching policy limits. GetActiveImpressions() => (array impressions); // Returns all reports contained in storage, including those that are actively // being sent. GetPendingReports() => (array reports); // Sends all stored reports, ignoring delay, returning when the // operation has been completed and all reports have been cleared from // storage. SendPendingReports() => (); // Deletes all persisted data for the Conversion API, returning when the // operation has been completed. ClearStorage() => (); };