chromium/net/nqe/throughput_analyzer.cc

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

#include "net/nqe/throughput_analyzer.h"

#include <cmath>

#include "base/functional/bind.h"
#include "base/location.h"
#include "base/metrics/histogram_macros.h"
#include "base/numerics/safe_conversions.h"
#include "base/task/single_thread_task_runner.h"
#include "base/time/tick_clock.h"
#include "net/base/host_port_pair.h"
#include "net/base/network_activity_monitor.h"
#include "net/base/url_util.h"
#include "net/nqe/network_quality_estimator.h"
#include "net/nqe/network_quality_estimator_params.h"
#include "net/nqe/network_quality_estimator_util.h"
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_context.h"

namespace net {

class HostResolver;

namespace {

// Maximum number of accuracy degrading requests, and requests that do not
// degrade accuracy held in the memory.
static const size_t kMaxRequestsSize =;

// Returns true if the request should be discarded because it does not provide
// meaningful observation.
bool ShouldDiscardRequest(const URLRequest& request) {}

}  // namespace

namespace nqe::internal {
// The default content size of a HTML response body. It is set to the median
// HTML response content size, i.e. 1.8kB.
constexpr int64_t kDefaultContentSizeBytes =;

ThroughputAnalyzer::ThroughputAnalyzer(
    const NetworkQualityEstimator* network_quality_estimator,
    const NetworkQualityEstimatorParams* params,
    scoped_refptr<base::SingleThreadTaskRunner> task_runner,
    ThroughputObservationCallback throughput_observation_callback,
    const base::TickClock* tick_clock,
    const NetLogWithSource& net_log)
    :{}

ThroughputAnalyzer::~ThroughputAnalyzer() {}

void ThroughputAnalyzer::MaybeStartThroughputObservationWindow() {}

void ThroughputAnalyzer::EndThroughputObservationWindow() {}

bool ThroughputAnalyzer::IsCurrentlyTrackingThroughput() const {}

void ThroughputAnalyzer::SetTickClockForTesting(
    const base::TickClock* tick_clock) {}

void ThroughputAnalyzer::UpdateResponseContentSize(const URLRequest* request,
                                                   int64_t response_size) {}

void ThroughputAnalyzer::NotifyStartTransaction(const URLRequest& request) {}

void ThroughputAnalyzer::NotifyBytesRead(const URLRequest& request) {}

void ThroughputAnalyzer::NotifyRequestCompleted(const URLRequest& request) {}

void ThroughputAnalyzer::NotifyExpectedResponseContentSize(
    const URLRequest& request,
    int64_t expected_content_size) {}

bool ThroughputAnalyzer::IsHangingWindow(int64_t bits_received,
                                         base::TimeDelta duration) const {}

bool ThroughputAnalyzer::MaybeGetThroughputObservation(
    int32_t* downstream_kbps) {}

void ThroughputAnalyzer::OnConnectionTypeChanged() {}

void ThroughputAnalyzer::SetUseLocalHostRequestsForTesting(
    bool use_localhost_requests) {}

int64_t ThroughputAnalyzer::GetBitsReceived() const {}

size_t ThroughputAnalyzer::CountActiveInFlightRequests() const {}

size_t ThroughputAnalyzer::CountTotalInFlightRequests() const {}

int64_t ThroughputAnalyzer::CountTotalContentSizeBytes() const {}

bool ThroughputAnalyzer::DegradesAccuracy(const URLRequest& request) const {}

void ThroughputAnalyzer::BoundRequestsSize() {}

void ThroughputAnalyzer::EraseHangingRequests(const URLRequest& request) {}

}  // namespace nqe::internal

}  // namespace net