shared-storage-helper-module.js (716B)
1 // Copyright 2023 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 class ContributeToHistogramOperation { 6 async run(urls, data) { 7 if (data.enableDebugMode) { 8 privateAggregation.enableDebugMode(data.enableDebugModeArgs); 9 10 if (data.enableDebugModeExtraTime) { 11 privateAggregation.enableDebugMode(data.enableDebugModeArgs); 12 } 13 } 14 for (const contribution of data.contributions) { 15 privateAggregation.contributeToHistogram(contribution); 16 } 17 18 // If an error occurs, the default URL will be picked instead. 19 return 1; 20 } 21 } 22 23 register('contribute-to-histogram', ContributeToHistogramOperation);