chromium/components/domain_reliability/monitor.cc

// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "components/domain_reliability/monitor.h"

#include <memory>
#include <string_view>
#include <utility>

#include "base/check.h"
#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/notreached.h"
#include "components/domain_reliability/baked_in_configs.h"
#include "components/domain_reliability/features.h"
#include "components/domain_reliability/google_configs.h"
#include "components/domain_reliability/quic_error_mapping.h"
#include "net/base/isolation_info.h"
#include "net/base/load_flags.h"
#include "net/base/net_errors.h"
#include "net/base/network_anonymization_key.h"
#include "net/http/http_connection_info.h"
#include "net/http/http_response_headers.h"
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_context.h"

namespace domain_reliability {

namespace {

// Creates a new beacon based on |beacon_template| but fills in the status,
// chrome_error, and server_ip fields based on the endpoint and result of
// |attempt|.
//
// If there is no matching status for the result, returns nullptr (which
// means the attempt should not result in a beacon being reported).
std::unique_ptr<DomainReliabilityBeacon> CreateBeaconFromAttempt(
    const DomainReliabilityBeacon& beacon_template,
    const net::ConnectionAttempt& attempt) {}

}  // namespace

DomainReliabilityMonitor::DomainReliabilityMonitor(
    net::URLRequestContext* url_request_context,
    const std::string& upload_reporter_string,
    const DomainReliabilityContext::UploadAllowedCallback&
        upload_allowed_callback)
    :{}

DomainReliabilityMonitor::DomainReliabilityMonitor(
    net::URLRequestContext* url_request_context,
    const std::string& upload_reporter_string,
    const DomainReliabilityContext::UploadAllowedCallback&
        upload_allowed_callback,
    std::unique_ptr<MockableTime> time)
    :{}

DomainReliabilityMonitor::~DomainReliabilityMonitor() {}

void DomainReliabilityMonitor::Shutdown() {}

void DomainReliabilityMonitor::AddBakedInConfigs() {}

void DomainReliabilityMonitor::SetDiscardUploads(bool discard_uploads) {}

void DomainReliabilityMonitor::OnBeforeRedirect(net::URLRequest* request) {}

void DomainReliabilityMonitor::OnCompleted(net::URLRequest* request,
                                           bool started,
                                           int net_error) {}

void DomainReliabilityMonitor::OnNetworkChanged(
    net::NetworkChangeNotifier::ConnectionType type) {}

void DomainReliabilityMonitor::ClearBrowsingData(
    DomainReliabilityClearMode mode,
    const base::RepeatingCallback<bool(const url::Origin&)>& origin_filter) {}

const DomainReliabilityContext* DomainReliabilityMonitor::AddContextForTesting(
    std::unique_ptr<const DomainReliabilityConfig> config) {}

void DomainReliabilityMonitor::ForceUploadsForTesting() {}

void DomainReliabilityMonitor::OnRequestLegCompleteForTesting(
    const RequestInfo& request) {}

const DomainReliabilityContext*
DomainReliabilityMonitor::LookupContextForTesting(
    const std::string& hostname) const {}

DomainReliabilityMonitor::RequestInfo::RequestInfo() = default;

DomainReliabilityMonitor::RequestInfo::RequestInfo(
    const net::URLRequest& request,
    int net_error)
    :{}

DomainReliabilityMonitor::RequestInfo::RequestInfo(const RequestInfo& other) =
    default;

DomainReliabilityMonitor::RequestInfo::~RequestInfo() {}

// static
bool DomainReliabilityMonitor::RequestInfo::ShouldReportRequest(
    const DomainReliabilityMonitor::RequestInfo& request) {}

void DomainReliabilityMonitor::OnRequestLegComplete(
    const RequestInfo& request) {}

}  // namespace domain_reliability