Commit f0e23cfa authored by Ian Barkley-Yeung's avatar Ian Barkley-Yeung Committed by Commit Bot

Update Crashpad to 558b7ea43ff5c9ccda03ce946364cdff15401575

c2978022d178 Update comment to match current state of
             MemorySnapshotGeneric
558b7ea43ff5 Pass --always_allow_feedback during integration tests

Bug: chromium:1037656
Change-Id: I3c95e30aa585cf6782b6c66c0ce8bc3e063d1ff9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1985123
Auto-Submit: Ian Barkley-Yeung <iby@chromium.org>
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#728202}
parent 5c46dcf8
......@@ -2,7 +2,7 @@ Name: Crashpad
Short Name: crashpad
URL: https://crashpad.chromium.org/
Version: unknown
Revision: 38f4bae3ad841821a83abe979892cbcab69e2e02
Revision: 558b7ea43ff5c9ccda03ce946364cdff15401575
License: Apache 2.0
License File: crashpad/LICENSE
Security Critical: yes
......
......@@ -168,6 +168,10 @@ void Usage(const base::FilePath& me) {
" --minidump-dir-for-tests=TEST_MINIDUMP_DIR\n"
" causes /sbin/crash_reporter to leave dumps in\n"
" this directory instead of the normal location\n"
" --always-allow-feedback\n"
" pass the --always_allow_feedback flag to\n"
" crash_reporter, thus skipping metrics consent\n"
" checks\n"
#endif // OS_CHROMEOS
" --help display this help and exit\n"
" --version output version information and exit\n",
......@@ -201,8 +205,9 @@ struct Options {
bool rate_limit;
bool upload_gzip;
#if defined(OS_CHROMEOS)
bool use_cros_crash_reporter;
bool use_cros_crash_reporter = false;
base::FilePath minidump_dir_for_tests;
bool always_allow_feedback = false;
#endif // OS_CHROMEOS
};
......@@ -561,6 +566,7 @@ int HandlerMain(int argc,
#if defined(OS_CHROMEOS)
kOptionUseCrosCrashReporter,
kOptionMinidumpDirForTests,
kOptionAlwaysAllowFeedback,
#endif // OS_CHROMEOS
// Standard options.
......@@ -636,6 +642,10 @@ int HandlerMain(int argc,
required_argument,
nullptr,
kOptionMinidumpDirForTests},
{"always-allow-feedback",
no_argument,
nullptr,
kOptionAlwaysAllowFeedback},
#endif // OS_CHROMEOS
{"help", no_argument, nullptr, kOptionHelp},
{"version", no_argument, nullptr, kOptionVersion},
......@@ -788,6 +798,10 @@ int HandlerMain(int argc,
ToolSupport::CommandLineArgumentToFilePathStringType(optarg));
break;
}
case kOptionAlwaysAllowFeedback: {
options.always_allow_feedback = true;
break;
}
#endif // OS_CHROMEOS
case kOptionHelp: {
Usage(me);
......@@ -931,6 +945,10 @@ int HandlerMain(int argc,
cros_handler->SetDumpDir(options.minidump_dir_for_tests);
}
if (options.always_allow_feedback) {
cros_handler->SetAlwaysAllowFeedback();
}
exception_handler = std::move(cros_handler);
} else {
exception_handler = std::make_unique<CrashReportExceptionHandler>(
......
......@@ -133,7 +133,8 @@ CrosCrashReportExceptionHandler::CrosCrashReportExceptionHandler(
const UserStreamDataSources* user_stream_data_sources)
: database_(database),
process_annotations_(process_annotations),
user_stream_data_sources_(user_stream_data_sources) {}
user_stream_data_sources_(user_stream_data_sources),
always_allow_feedback_(false) {}
CrosCrashReportExceptionHandler::~CrosCrashReportExceptionHandler() = default;
......@@ -258,6 +259,9 @@ bool CrosCrashReportExceptionHandler::HandleExceptionWithConnection(
if (!dump_dir_.empty()) {
argv.push_back("--chrome_dump_dir=" + dump_dir_.value());
}
if (always_allow_feedback_) {
argv.push_back("--always_allow_feedback");
}
if (!DoubleForkAndExec(argv,
nullptr /* envp */,
......
......@@ -77,6 +77,7 @@ class CrosCrashReportExceptionHandler
UUID* local_report_id = nullptr) override;
void SetDumpDir(const base::FilePath& dump_dir) { dump_dir_ = dump_dir; }
void SetAlwaysAllowFeedback() { always_allow_feedback_ = true; }
private:
bool HandleExceptionWithConnection(
PtraceConnection* connection,
......@@ -90,6 +91,7 @@ class CrosCrashReportExceptionHandler
const std::map<std::string, std::string>* process_annotations_; // weak
const UserStreamDataSources* user_stream_data_sources_; // weak
base::FilePath dump_dir_;
bool always_allow_feedback_;
DISALLOW_COPY_AND_ASSIGN(CrosCrashReportExceptionHandler);
};
......
......@@ -29,8 +29,8 @@ namespace crashpad {
namespace internal {
//! \brief A MemorySnapshot of a memory region in a process on the running
//! system. Used on Mac, Linux, Android, and Fuchsia, templated on the
//! platform-specific ProcessReader type.
//! system. Works on multiple platforms by using a platform-specific
//! ProcessMemory object.
class MemorySnapshotGeneric final : public MemorySnapshot {
public:
MemorySnapshotGeneric() = default;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment