| // 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"; |
| |
| // Represents StorableImpression::SourceType. |
| enum SourceType { |
| kNavigation, |
| kEvent, |
| }; |
| |
| // 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; |
| SourceType source_type; |
| }; |
| |
| // 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; |
| SourceType source_type; |
| string priority; |
| }; |
| |
| // Mojo interface used for communication between a WebUI and the storage layer |
| // for conversion measurement. |
| interface ConversionInternalsHandler { |
| // Returns whether conversion measurement and the debug mode are enabled in |
| // the browsing context the WebUI is in. |
| IsMeasurementEnabled() => (bool enabled, bool debug_mode); |
| |
| // 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<WebUIImpression> impressions); |
| |
| // Returns all reports contained in storage, including those that are actively |
| // being sent. |
| GetPendingReports() => (array<WebUIConversionReport> 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() => (); |
| }; |