chromium/chrome/common/crash_keys.cc

// Copyright 2013 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/40285824): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "chrome/common/crash_keys.h"

#include <deque>
#include <string_view>

#include "base/base_switches.h"
#include "base/command_line.h"
#include "base/format_macros.h"
#include "base/no_destructor.h"
#include "base/strings/strcat.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/common/chrome_switches.h"
#include "components/crash/core/common/crash_key.h"
#include "components/crash/core/common/crash_keys.h"
#include "components/flags_ui/flags_ui_switches.h"
#include "content/public/common/content_switches.h"

#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "components/crash/core/app/crash_switches.h"
#include "gpu/command_buffer/service/gpu_switches.h"
#include "ui/gl/gl_switches.h"
#endif

namespace crash_keys {
namespace {

constexpr std::string_view kStringAnnotationsSwitch =;

// A convenient wrapper around a crash key and its name.
//
// The CrashKey contract requires that CrashKeyStrings are never
// moved, copied, or deleted (see
// third_party/crashpad/crashpad/client/annotation.h); since this class holds
// a CrashKeyString, it likewise cannot be moved, copied, or deleted.
class CrashKeyWithName {};

void SplitAndPopulateCrashKeys(std::deque<CrashKeyWithName>& crash_keys,
                               std::string_view comma_separated_feature_list,
                               std::string crash_key_name_prefix) {}

// --enable-features and --disable-features often contain a long list not
// fitting into 64 bytes, hiding important information when analysing crashes.
// Therefore they are separated out in a list of CrashKeys, one for each enabled
// or disabled feature.
// They are also excluded from the default "switches".
void HandleEnableDisableFeatures(const base::CommandLine& command_line) {}

// Return true if we DON'T want to upload this flag to the crash server.
bool IsBoringSwitch(const std::string& flag) {}

std::deque<CrashKeyWithName>& GetCommandLineStringAnnotations() {}

void SetStringAnnotations(const base::CommandLine& command_line) {}

}  // namespace

void AllocateCrashKeyInBrowserAndChildren(std::string_view key,
                                          std::string_view value) {}

void AppendStringAnnotationsCommandLineSwitch(base::CommandLine* command_line) {}

void SetCrashKeysFromCommandLine(const base::CommandLine& command_line) {}

}  // namespace crash_keys