chromium/third_party/blink/renderer/platform/media/resource_multi_buffer_data_provider.cc

// Copyright 2015 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/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "third_party/blink/renderer/platform/media/resource_multi_buffer_data_provider.h"

#include <stddef.h>

#include <utility>

#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/location.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/task/single_thread_task_runner.h"
#include "base/time/time.h"
#include "net/http/http_byte_range.h"
#include "net/http/http_request_headers.h"
#include "services/network/public/cpp/cors/cors.h"
#include "third_party/blink/public/mojom/fetch/fetch_api_request.mojom.h"
#include "third_party/blink/public/platform/web_network_state_notifier.h"
#include "third_party/blink/public/platform/web_url.h"
#include "third_party/blink/public/platform/web_url_error.h"
#include "third_party/blink/public/platform/web_url_response.h"
#include "third_party/blink/public/web/web_associated_url_loader.h"
#include "third_party/blink/renderer/platform/media/cache_util.h"
#include "third_party/blink/renderer/platform/media/resource_fetch_context.h"
#include "third_party/blink/renderer/platform/media/url_index.h"

namespace blink {

// The number of milliseconds to wait before retrying a failed load.
const int kLoaderFailedRetryDelayMs =;

// Each retry, add this many MS to the delay.
// total delay is:
// (kLoaderPartialRetryDelayMs +
//  kAdditionalDelayPerRetryMs * (kMaxRetries - 1) / 2) * kMaxretries = 29250 ms
const int kAdditionalDelayPerRetryMs =;

// The number of milliseconds to wait before retrying when the server
// decides to not give us all the data at once.
const int kLoaderPartialRetryDelayMs =;

const int kHttpOK =;
const int kHttpPartialContent =;
const int kHttpRangeNotSatisfiable =;

ResourceMultiBufferDataProvider::ResourceMultiBufferDataProvider(
    UrlData* url_data,
    MultiBufferBlockId pos,
    bool is_client_audio_element,
    scoped_refptr<base::SingleThreadTaskRunner> task_runner)
    :{}

ResourceMultiBufferDataProvider::~ResourceMultiBufferDataProvider() = default;

void ResourceMultiBufferDataProvider::Start() {}

/////////////////////////////////////////////////////////////////////////////
// MultiBuffer::DataProvider implementation.
MultiBufferBlockId ResourceMultiBufferDataProvider::Tell() const {}

bool ResourceMultiBufferDataProvider::Available() const {}

int64_t ResourceMultiBufferDataProvider::AvailableBytes() const {}

scoped_refptr<media::DataBuffer> ResourceMultiBufferDataProvider::Read() {}

void ResourceMultiBufferDataProvider::SetDeferred(bool deferred) {}

/////////////////////////////////////////////////////////////////////////////
// WebAssociatedURLLoaderClient implementation.

bool ResourceMultiBufferDataProvider::WillFollowRedirect(
    const WebURL& new_url,
    const WebURLResponse& redirect_response) {}

void ResourceMultiBufferDataProvider::DidSendData(
    uint64_t bytes_sent,
    uint64_t total_bytes_to_be_sent) {}

void ResourceMultiBufferDataProvider::DidReceiveResponse(
    const WebURLResponse& response) {}

void ResourceMultiBufferDataProvider::DidReceiveData(const char* data,
                                                     int data_length) {}

void ResourceMultiBufferDataProvider::DidDownloadData(uint64_t dataLength) {}

void ResourceMultiBufferDataProvider::DidFinishLoading() {}

void ResourceMultiBufferDataProvider::DidFail(const WebURLError& error) {}

bool ResourceMultiBufferDataProvider::ParseContentRange(
    const std::string& content_range_str,
    int64_t* first_byte_position,
    int64_t* last_byte_position,
    int64_t* instance_size) {}

void ResourceMultiBufferDataProvider::Terminate() {}

int64_t ResourceMultiBufferDataProvider::byte_pos() const {}

int64_t ResourceMultiBufferDataProvider::block_size() const {}

bool ResourceMultiBufferDataProvider::VerifyPartialResponse(
    const WebURLResponse& response,
    const scoped_refptr<UrlData>& url_data) {}

}  // namespace blink