Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(274)

Unified Diff: handler/mac/main.cc

Issue 1001993002: CrashpadClient::StartHandler(): accept database, url, and annotations arguments (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: 80 Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « client/crashpad_client_mac.cc ('k') | tools/mac/run_with_crashpad.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: handler/mac/main.cc
diff --git a/handler/mac/main.cc b/handler/mac/main.cc
index c8f825c56e51cbbbceefc7e02f5605fb51953af8..2642a8add521cd3a95a50a3315a73cb43b83a3e7 100644
--- a/handler/mac/main.cc
+++ b/handler/mac/main.cc
@@ -31,24 +31,12 @@
#include "util/mach/child_port_handshake.h"
#include "util/posix/close_stdio.h"
#include "util/stdlib/string_number_conversion.h"
+#include "util/string/split_string.h"
#include "util/synchronization/semaphore.h"
namespace crashpad {
namespace {
-bool SplitString(const std::string& string,
- std::string* left,
- std::string* right) {
- size_t equals_pos = string.find('=');
- if (equals_pos == 0 || equals_pos == std::string::npos) {
- return false;
- }
-
- left->assign(string, 0, equals_pos);
- right->assign(string, equals_pos + 1, std::string::npos);
- return true;
-}
-
void Usage(const std::string& me) {
fprintf(stderr,
"Usage: %s [OPTION]...\n"
@@ -57,6 +45,7 @@ void Usage(const std::string& me) {
" --annotation=KEY=VALUE set a process annotation in each crash report\n"
" --database=PATH store the crash report database at PATH\n"
" --handshake-fd=FD establish communication with the client over FD\n"
+" --url=URL send crash reports to this Breakpad server URL\n"
" --help display this help and exit\n"
" --version output version information and exit\n",
me.c_str());
@@ -103,7 +92,7 @@ int HandlerMain(int argc, char* argv[]) {
case kOptionAnnotation: {
std::string key;
std::string value;
- if (!SplitString(optarg, &key, &value)) {
+ if (!SplitString(optarg, '=', &key, &value)) {
ToolSupport::UsageHint(me, "--annotation requires KEY=VALUE");
return EXIT_FAILURE;
}
« no previous file with comments | « client/crashpad_client_mac.cc ('k') | tools/mac/run_with_crashpad.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698