blob: 0054011fb818143f63e5c9798eb7c2a30013c82b [file] [log] [blame]
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_COMMON_CRASH_KEYS_H_
#define CHROME_COMMON_CRASH_KEYS_H_
#include <set>
#include <string>
#include "base/debug/crash_logging.h"
namespace crash_keys {
// Registers all of the potential crash keys that can be sent to the crash
// reporting server. Returns the size of the union of all keys.
size_t RegisterChromeCrashKeys();
// Sets the list of "active" extensions in this process. We overload "active" to
// mean different things depending on the process type:
// - browser: all enabled extensions
// - renderer: the unique set of extension ids from all content scripts
// - extension: the id of each extension running in this process (there can be
// multiple because of process collapsing).
void SetActiveExtensions(const std::set<std::string>& extensions);
// Crash Key Name Constants ////////////////////////////////////////////////////
// The URL of the active tab.
extern const char kActiveURL[];
// Installed extensions. |kExtensionID| should be formatted with an integer,
// in the range [0, kExtensionIDMaxCount).
const size_t kExtensionIDMaxCount = 10;
extern const char kExtensionID[];
// The total number of installed extensions, recorded in case it exceeds
// kExtensionIDMaxCount. Also used in chrome/app, but defined here to avoid
// a common->app dependency.
extern const char kNumExtensionsCount[];
// GPU information.
#if !defined(OS_ANDROID)
extern const char kGPUVendorID[];
extern const char kGPUDeviceID[];
#endif
extern const char kGPUDriverVersion[];
extern const char kGPUPixelShaderVersion[];
extern const char kGPUVertexShaderVersion[];
#if defined(OS_LINUX)
extern const char kGPUVendor[];
extern const char kGPURenderer[];
#elif defined(OS_MACOSX)
extern const char kGPUGLVersion[];
#endif
#if defined(OS_MACOSX)
namespace mac {
// Used to report the first Cocoa/Mac NSException and its backtrace.
extern const char kFirstNSException[];
extern const char kFirstNSExceptionTrace[];
// Used to report the last Cocoa/Mac NSException and its backtrace.
extern const char kLastNSException[];
extern const char kLastNSExceptionTrace[];
// Records the current NSException as it is being created, and its backtrace.
extern const char kNSException[];
extern const char kNSExceptionTrace[];
// In the CrApplication, records information about the current event's
// target-action.
extern const char kSendAction[];
// Records Cocoa zombie/used-after-freed objects that resulted in a
// deliberate crash.
extern const char kZombie[];
extern const char kZombieTrace[];
} // namespace mac
#endif
} // namespace crash_keys
#endif // CHROME_COMMON_CRASH_KEYS_H_