cef/libcef/common/breakpad_client.cc
Marshall Greenblatt ec8b64e88a Add breakpad support (issue #1131).
- General usage instructions are available at https://sites.google.com/a/chromium.org/dev/developers/testing/webkit-layout-tests/using-breakpad-with-content-shell.
- Mac: Generate "Chromium Embedded Framework.framework" using a new cef_framework target (the libcef target is now only used on Windows and Linux). Rename "Libraries/libcef.dylib" to "Chromium Embedded Framework". Distribute Release and Debug builds of the "Chromium Embedded Framework.framework" folder as part of the binary distribution.
- Mac: Fix the Xcode target compiler setting for the binary distribution so that it no longer needs to be set manually.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1524 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-11-21 22:43:36 +00:00

59 lines
1.8 KiB
C++

// Copyright 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.
#include "libcef/common/breakpad_client.h"
#include "libcef/common/cef_switches.h"
#include "include/cef_version.h"
#include "base/command_line.h"
#include "base/logging.h"
#include "base/files/file_path.h"
#include "base/strings/string16.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
CefBreakpadClient::CefBreakpadClient() {}
CefBreakpadClient::~CefBreakpadClient() {}
#if defined(OS_WIN)
void CefBreakpadClient::GetProductNameAndVersion(
const base::FilePath& exe_path,
base::string16* product_name,
base::string16* version,
base::string16* special_build,
base::string16* channel_name) {
*product_name = ASCIIToUTF16("cef");
*version = UTF8ToUTF16(base::StringPrintf(
"%d.%d.%d", CEF_VERSION_MAJOR, CHROME_VERSION_BUILD, CEF_REVISION));
*special_build = string16();
*channel_name = string16();
}
#endif
#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_IOS)
void CefBreakpadClient::GetProductNameAndVersion(std::string* product_name,
std::string* version) {
*product_name = "cef";
*version = base::StringPrintf(
"%d.%d.%d", CEF_VERSION_MAJOR, CHROME_VERSION_BUILD, CEF_REVISION);
}
base::FilePath CefBreakpadClient::GetReporterLogFilename() {
return base::FilePath(FILE_PATH_LITERAL("uploads.log"));
}
#endif
bool CefBreakpadClient::GetCrashDumpLocation(base::FilePath* crash_dir) {
#if !defined(OS_WIN)
if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kCrashDumpsDir))
return false;
*crash_dir = CommandLine::ForCurrentProcess()->GetSwitchValuePath(
switches::kCrashDumpsDir);
return true;
#else
NOTREACHED();
return false;
#endif
}