#ifndef SERVICES_NETWORK_THROTTLING_SCOPED_THROTTLING_TOKEN_H_
#define SERVICES_NETWORK_THROTTLING_SCOPED_THROTTLING_TOKEN_H_
#include <stdint.h>
#include <memory>
#include <optional>
#include "base/component_export.h"
namespace base {
class UnguessableToken;
}
namespace network {
class COMPONENT_EXPORT(NETWORK_SERVICE) ScopedThrottlingToken {
public:
static std::unique_ptr<ScopedThrottlingToken> MaybeCreate(
uint32_t net_log_source_id,
const std::optional<base::UnguessableToken>& throttling_profile_id);
ScopedThrottlingToken(const ScopedThrottlingToken&) = delete;
ScopedThrottlingToken& operator=(const ScopedThrottlingToken&) = delete;
~ScopedThrottlingToken();
uint32_t source_id() const { return net_log_source_id_; }
private:
ScopedThrottlingToken(uint32_t net_log_source_id,
const base::UnguessableToken& throttling_profile_id);
const uint32_t net_log_source_id_;
};
}
#endif