#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include <iostream>
#include <memory>
#include <string_view>
#include <unordered_map>
#include "base/at_exit.h"
#include "base/command_line.h"
#include "base/containers/span.h"
#include "base/files/file_path.h"
#include "base/format_macros.h"
#include "base/hash/md5.h"
#include "base/logging.h"
#include "base/message_loop/message_pump_type.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "base/task/single_thread_task_executor.h"
#include "base/task/thread_pool/thread_pool_instance.h"
#include "net/base/io_buffer.h"
#include "net/base/test_completion_callback.h"
#include "net/disk_cache/disk_cache.h"
#include "net/disk_cache/disk_cache_test_util.h"
#include "net/http/http_cache.h"
#include "net/http/http_response_headers.h"
#include "net/http/http_response_info.h"
#include "net/http/http_util.h"
Backend;
BackendResult;
Entry;
EntryResult;
namespace {
struct EntryData { … };
constexpr int kResponseInfoIndex = …;
constexpr int kResponseContentIndex = …;
const char* const kCommandNames[] = …;
void PrintHelp() { … }
class CommandMarshal { … };
class ProgramArgumentCommandMarshal final : public CommandMarshal { … };
class StreamCommandMarshal final : public CommandMarshal { … };
void GetSize(CommandMarshal* command_marshal) { … }
bool ListKeys(CommandMarshal* command_marshal) { … }
bool GetResponseInfoForEntry(disk_cache::Entry* entry,
net::HttpResponseInfo* response_info) { … }
std::string GetMD5ForResponseBody(disk_cache::Entry* entry) { … }
void PersistResponseInfo(CommandMarshal* command_marshal,
const std::string& key,
const net::HttpResponseInfo& response_info) { … }
void ListDups(CommandMarshal* command_marshal) { … }
scoped_refptr<net::GrowableIOBuffer> GetStreamForKeyBuffer(
CommandMarshal* command_marshal,
const std::string& key,
int index) { … }
void GetStreamForKey(CommandMarshal* command_marshal) { … }
void UpdateRawResponseHeaders(CommandMarshal* command_marshal) { … }
void SetHeader(CommandMarshal* command_marshal) { … }
void DeleteStreamForKey(CommandMarshal* command_marshal) { … }
void DeleteKey(CommandMarshal* command_marshal) { … }
bool ExecuteCommands(CommandMarshal* command_marshal) { … }
}
int main(int argc, char* argv[]) { … }