chromium/extensions/browser/json_file_sanitizer.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.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "extensions/browser/json_file_sanitizer.h"

#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/json/json_string_value_serializer.h"
#include "base/task/sequenced_task_runner.h"
#include "extensions/browser/extension_file_task_runner.h"
#include "services/data_decoder/public/cpp/data_decoder.h"

namespace extensions {

namespace {

// Reads the file in |path| and then deletes it.
// Returns a tuple containing: the file content, whether the read was
// successful, whether the delete was successful.
std::tuple<std::string, bool, bool> ReadAndDeleteTextFile(
    const base::FilePath& path) {}

bool WriteStringToFile(const std::string& contents,
                       const base::FilePath& file_path) {}

}  // namespace

// static
std::unique_ptr<JsonFileSanitizer> JsonFileSanitizer::CreateAndStart(
    data_decoder::DataDecoder* decoder,
    const std::set<base::FilePath>& file_paths,
    Callback callback,
    const scoped_refptr<base::SequencedTaskRunner>& io_task_runner) {}

JsonFileSanitizer::JsonFileSanitizer(
    const std::set<base::FilePath>& file_paths,
    Callback callback,
    const scoped_refptr<base::SequencedTaskRunner>& io_task_runner)
    :{}

JsonFileSanitizer::~JsonFileSanitizer() = default;

void JsonFileSanitizer::Start(data_decoder::DataDecoder* decoder) {}

void JsonFileSanitizer::JsonFileRead(
    const base::FilePath& file_path,
    std::tuple<std::string, bool, bool> read_and_delete_result) {}

void JsonFileSanitizer::JsonParsingDone(
    const base::FilePath& file_path,
    std::optional<base::Value> json_value,
    const std::optional<std::string>& error) {}

void JsonFileSanitizer::JsonFileWritten(const base::FilePath& file_path,
                                        bool success) {}

void JsonFileSanitizer::ReportSuccess() {}

void JsonFileSanitizer::ReportError(Status status, const std::string& error) {}

}  // namespace extensions