#include "remoting/base/telemetry_log_writer.h"
#include <utility>
#include "base/containers/adapters.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/json/json_string_value_serializer.h"
#include "base/logging.h"
#include "net/http/http_status_code.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "remoting/base/protobuf_http_client.h"
#include "remoting/base/protobuf_http_request.h"
#include "remoting/base/protobuf_http_request_config.h"
#include "remoting/base/service_urls.h"
#include "remoting/proto/remoting/v1/telemetry_messages.pb.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
namespace remoting {
namespace {
const net::BackoffEntry::Policy kBackoffPolicy = …;
constexpr net::NetworkTrafficAnnotationTag kTrafficAnnotation = …;
constexpr char kCreateEventPath[] = …;
}
const int kMaxSendAttempts = …;
TelemetryLogWriter::TelemetryLogWriter(
std::unique_ptr<OAuthTokenGetter> token_getter)
: … { … }
TelemetryLogWriter::~TelemetryLogWriter() { … }
void TelemetryLogWriter::Init(
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory) { … }
void TelemetryLogWriter::Log(const ChromotingEvent& entry) { … }
void TelemetryLogWriter::SendPendingEntries() { … }
void TelemetryLogWriter::DoSend(const apis::v1::CreateEventRequest& request) { … }
void TelemetryLogWriter::OnSendLogResult(
const ProtobufHttpStatus& status,
std::unique_ptr<apis::v1::CreateEventResponse> response) { … }
bool TelemetryLogWriter::IsIdleForTesting() { … }
}