File indexing completed on 2025-01-26 04:57:21

0001 /*
0002    SPDX-FileCopyrightText: 2016-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "webengineviewer_export.h"
0010 #include <QObject>
0011 #include <memory>
0012 namespace WebEngineViewer
0013 {
0014 class BackOffModeManagerPrivate;
0015 // https://developers.google.com/safe-browsing/v4/request-frequency
0016 /**
0017  * @brief The BackOffModeManager class
0018  * @author Laurent Montel <montel@kde.org>
0019  */
0020 class WEBENGINEVIEWER_EXPORT BackOffModeManager : public QObject
0021 {
0022 public:
0023     explicit BackOffModeManager(QObject *parent = nullptr);
0024     ~BackOffModeManager() override;
0025 
0026     static BackOffModeManager *self();
0027     [[nodiscard]] bool isInBackOffMode() const;
0028 
0029     void startOffMode();
0030 
0031     [[nodiscard]] int numberOfHttpFailed() const;
0032 
0033     void slotTimerFinished();
0034 
0035 private:
0036     std::unique_ptr<BackOffModeManagerPrivate> const d;
0037 };
0038 }