#include "components/net_log/net_export_file_writer.h"
#include <memory>
#include <set>
#include <string_view>
#include <utility>
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_file.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
#include "base/observer_list.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/single_thread_task_runner.h"
#include "base/task/thread_pool.h"
#include "base/values.h"
#include "build/build_config.h"
#include "components/net_log/chrome_net_log.h"
#include "services/network/public/mojom/network_context.mojom.h"
namespace net_log {
namespace {
const base::FilePath::CharType kLogRelativePath[] = …);
NetExportFileWriter::DefaultLogPathResults SetUpDefaultLogPath(
const NetExportFileWriter::DirectoryGetter& default_log_base_dir_getter) { … }
base::FilePath GetPathIfExists(const base::FilePath& path) { … }
scoped_refptr<base::SequencedTaskRunner> CreateFileTaskRunner() { … }
}
NetExportFileWriter::NetExportFileWriter()
: … { … }
NetExportFileWriter::~NetExportFileWriter() { … }
void NetExportFileWriter::AddObserver(StateObserver* observer) { … }
void NetExportFileWriter::RemoveObserver(StateObserver* observer) { … }
void NetExportFileWriter::Initialize() { … }
void NetExportFileWriter::StartNetLog(
const base::FilePath& log_path,
net::NetLogCaptureMode capture_mode,
uint64_t max_file_size,
const base::CommandLine::StringType& command_line_string,
const std::string& channel_string,
network::mojom::NetworkContext* network_context) { … }
void NetExportFileWriter::StartNetLogAfterCreateFile(
net::NetLogCaptureMode capture_mode,
uint64_t max_file_size,
base::Value::Dict custom_constants,
base::File output_file) { … }
void NetExportFileWriter::OnStartResult(net::NetLogCaptureMode capture_mode,
int result) { … }
void NetExportFileWriter::StopNetLog(base::Value::Dict polled_data) { … }
void NetExportFileWriter::OnStopResult(int result) { … }
void NetExportFileWriter::OnConnectionError() { … }
base::Value::Dict NetExportFileWriter::GetState() const { … }
void NetExportFileWriter::GetFilePathToCompletedLog(
FilePathCallback path_callback) const { … }
std::string NetExportFileWriter::CaptureModeToString(
net::NetLogCaptureMode capture_mode) { … }
net::NetLogCaptureMode NetExportFileWriter::CaptureModeFromString(
const std::string& capture_mode_string) { … }
void NetExportFileWriter::SetDefaultLogBaseDirectoryGetterForTest(
const DirectoryGetter& getter) { … }
void NetExportFileWriter::NotifyStateObservers() { … }
void NetExportFileWriter::NotifyStateObserversAsync() { … }
void NetExportFileWriter::SetStateAfterSetUpDefaultLogPath(
const DefaultLogPathResults& set_up_default_log_path_results) { … }
void NetExportFileWriter::ResetExporterThenSetStateNotLogging() { … }
base::File NetExportFileWriter::CreateOutputFile(base::FilePath path) { … }
}