chromium/base/json/json_reader.cc

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

#include "base/json/json_reader.h"

#include <string_view>
#include <utility>

#include "base/features.h"
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
#include "base/rust_buildflags.h"

#if BUILDFLAG(BUILD_RUST_JSON_READER)
#include "base/strings/string_view_rust.h"
#include "third_party/rust/serde_json_lenient/v0_2/wrapper/functions.h"
#include "third_party/rust/serde_json_lenient/v0_2/wrapper/lib.rs.h"
#endif  // BUILDFLAG(BUILD_RUST_JSON_READER)
#include "base/json/json_parser.h"

namespace base {

#if BUILDFLAG(BUILD_RUST_JSON_READER)

namespace {
ContextPointer;

const char kSecurityJsonParsingTime[] =;

ContextPointer& ListAppendList(ContextPointer& ctx, size_t reserve) {}

ContextPointer& ListAppendDict(ContextPointer& ctx) {}

void ListAppendNone(ContextPointer& ctx) {}

template <class T, class As = T>
void ListAppendValue(ContextPointer& ctx, T v) {}

ContextPointer& DictSetList(ContextPointer& ctx,
                            rust::Str key,
                            size_t reserve) {}

ContextPointer& DictSetDict(ContextPointer& ctx, rust::Str key) {}

void DictSetNone(ContextPointer& ctx, rust::Str key) {}

template <class T, class As = T>
void DictSetValue(ContextPointer& ctx, rust::Str key, T v) {}

JSONReader::Result DecodeJSONInRust(std::string_view json,
                                    int options,
                                    size_t max_depth) {}

}  // anonymous namespace

#endif  // BUILDFLAG(BUILD_RUST_JSON_READER)

// static
std::optional<Value> JSONReader::Read(std::string_view json,
                                      int options,
                                      size_t max_depth) {}

// static
std::optional<Value::Dict> JSONReader::ReadDict(std::string_view json,
                                                int options,
                                                size_t max_depth) {}

// static
JSONReader::Result JSONReader::ReadAndReturnValueWithError(
    std::string_view json,
    int options) {}

// static
bool JSONReader::UsingRust() {}

}  // namespace base