chromium/components/autofill/core/common/logging/log_buffer.cc

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

#include "components/autofill/core/common/logging/log_buffer.h"

#include <string>
#include <string_view>

#include "base/strings/strcat.h"
#include "base/strings/utf_string_conversions.h"

namespace autofill {

namespace {

bool IsElement(const base::Value::Dict& value) {}

bool IsTextNode(const base::Value::Dict& value) {}

bool IsFragment(const base::Value::Dict& value) {}

void AppendChildToLastNode(std::vector<base::Value::Dict>* buffer,
                           base::Value::Dict&& new_child) {}

// This is an optimization to reduce the number of text nodes in the DOM.
// Sequences of appended string_views are coalesced into one. If many strings
// are appended, this has quadratic runtime. But the number of strings
// and the lengths of strings should be relatively small and we reduce the
// memory consumption of the DOM, which may grow rather large.
//
// If the last child of the element in buffer is a text node, append |text| to
// it and return true (successful coalescing). Otherwise return false.
bool TryCoalesceString(std::vector<base::Value::Dict>* buffer,
                       std::string_view text) {}

base::Value::Dict CreateEmptyFragment() {}

}  // namespace

LogBuffer::LogBuffer(IsActive active) :{}

LogBuffer::LogBuffer(LogBuffer&& other) noexcept = default;
LogBuffer& LogBuffer::operator=(LogBuffer&& other) = default;
LogBuffer::~LogBuffer() = default;

std::optional<base::Value::Dict> LogBuffer::RetrieveResult() {}

LogBuffer& operator<<(LogBuffer& buf, Tag&& tag) {}

LogBuffer& operator<<(LogBuffer& buf, CTag&& tag) {}

LogBuffer& operator<<(LogBuffer& buf, Attrib&& attrib) {}

LogBuffer& operator<<(LogBuffer& buf, Br&& tag) {}

LogBuffer& operator<<(LogBuffer& buf, std::string_view text) {}

LogBuffer& operator<<(LogBuffer& buf, std::u16string_view text) {}

LogBuffer& operator<<(LogBuffer& buf, LogBuffer&& buffer) {}

LogBuffer& operator<<(LogBuffer& buf, const GURL& url) {}

LogTableRowBuffer::LogTableRowBuffer(LogBuffer* parent) :{}

LogTableRowBuffer::LogTableRowBuffer(LogTableRowBuffer&& buffer) noexcept
    :{}

LogTableRowBuffer::~LogTableRowBuffer() {}

LogTableRowBuffer operator<<(LogBuffer& buf, Tr&& tr) {}

LogTableRowBuffer&& operator<<(LogTableRowBuffer&& buf, Attrib&& attrib) {}

LogTableRowBuffer&& operator<<(LogTableRowBuffer&& buf,
                               SetParentTagContainsPII&& attrib) {}

namespace {
// Highlights the first |needle| in |haystack| by wrapping it in <b> tags.
template <typename T, typename CharT = typename T::value_type>
LogBuffer HighlightValueInternal(T haystack, T needle) {}
}  // namespace

LogBuffer HighlightValue(std::string_view haystack, std::string_view needle) {}

LogBuffer HighlightValue(std::u16string_view haystack,
                         std::u16string_view needle) {}

}  // namespace autofill