chromium/content/browser/browsing_data/clear_site_data_handler.cc

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

#include "content/browser/browsing_data/clear_site_data_handler.h"

#include <optional>

#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "content/browser/buckets/bucket_utils.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/storage_partition_config.h"
#include "content/public/browser/web_contents.h"
#include "net/base/load_flags.h"
#include "net/url_request/clear_site_data.h"
#include "services/network/public/cpp/is_potentially_trustworthy.h"
#include "third_party/blink/public/common/features_generated.h"

namespace content {

namespace {

// Pretty-printed log output.
const char kConsoleMessageTemplate[] =;
const char kConsoleMessageCleared[] =;
const char kConsoleMessageDatatypeSeparator[] =;

enum LoggableEventMask {};

void LogEvent(int event) {}

// Represents the parameters as a single number to be recorded in a histogram.
int ParametersMask(const ClearSiteDataTypeSet clear_site_data_types,
                   bool has_buckets) {}

// Outputs a single |formatted_message| on the UI thread.
void OutputFormattedMessage(WebContents* web_contents,
                            blink::mojom::ConsoleMessageLevel level,
                            const std::string& formatted_text) {}

}  // namespace

////////////////////////////////////////////////////////////////////////////////
// ConsoleMessagesDelegate

ClearSiteDataHandler::ConsoleMessagesDelegate::ConsoleMessagesDelegate()
    :{}

ClearSiteDataHandler::ConsoleMessagesDelegate::~ConsoleMessagesDelegate() {}

void ClearSiteDataHandler::ConsoleMessagesDelegate::AddMessage(
    const GURL& url,
    const std::string& text,
    blink::mojom::ConsoleMessageLevel level) {}

void ClearSiteDataHandler::ConsoleMessagesDelegate::OutputMessages(
    base::WeakPtr<WebContents> web_contents) {}

void ClearSiteDataHandler::ConsoleMessagesDelegate::
    SetOutputFormattedMessageFunctionForTesting(
        const OutputFormattedMessageFunction& function) {}

////////////////////////////////////////////////////////////////////////////////
// ClearSiteDataHandler

// static
void ClearSiteDataHandler::HandleHeader(
    base::WeakPtr<BrowserContext> browser_context,
    base::WeakPtr<WebContents> web_contents,
    const StoragePartitionConfig& storage_partition_config,
    const GURL& url,
    const std::string& header_value,
    int load_flags,
    const std::optional<net::CookiePartitionKey> cookie_partition_key,
    const std::optional<blink::StorageKey> storage_key,
    bool partitioned_state_allowed_only,
    base::OnceClosure callback) {}

// static
bool ClearSiteDataHandler::ParseHeaderForTesting(
    const std::string& header,
    ClearSiteDataTypeSet* clear_site_data_types,
    std::set<std::string>* storage_buckets_to_remove,
    ConsoleMessagesDelegate* delegate,
    const GURL& current_url) {}

ClearSiteDataHandler::ClearSiteDataHandler(
    base::WeakPtr<BrowserContext> browser_context,
    base::WeakPtr<WebContents> web_contents,
    const StoragePartitionConfig& storage_partition_config,
    const GURL& url,
    const std::string& header_value,
    int load_flags,
    const std::optional<net::CookiePartitionKey> cookie_partition_key,
    const std::optional<blink::StorageKey> storage_key,
    bool partitioned_state_allowed_only,
    base::OnceClosure callback,
    std::unique_ptr<ConsoleMessagesDelegate> delegate)
    :{}

ClearSiteDataHandler::~ClearSiteDataHandler() = default;

bool ClearSiteDataHandler::HandleHeaderAndOutputConsoleMessages() {}

bool ClearSiteDataHandler::Run() {}

// static
bool ClearSiteDataHandler::ParseHeader(
    const std::string& header,
    ClearSiteDataTypeSet* clear_site_data_types,
    std::set<std::string>* storage_buckets_to_remove,
    ConsoleMessagesDelegate* delegate,
    const GURL& current_url) {}

void ClearSiteDataHandler::ExecuteClearingTask(
    const url::Origin& origin,
    const ClearSiteDataTypeSet clear_site_data_types,
    const std::set<std::string>& storage_buckets_to_remove,
    base::OnceClosure callback) {}

// static
void ClearSiteDataHandler::TaskFinished(
    base::TimeTicks clearing_started,
    std::unique_ptr<ConsoleMessagesDelegate> delegate,
    base::WeakPtr<WebContents> web_contents,
    base::OnceClosure callback) {}

void ClearSiteDataHandler::OutputConsoleMessages() {}

void ClearSiteDataHandler::RunCallbackNotDeferred() {}

}  // namespace content