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

Side by Side 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: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Crashpad Authors. All rights reserved. 1 // Copyright 2014 The Crashpad Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 13 matching lines...) Expand all
24 #include "base/logging.h" 24 #include "base/logging.h"
25 #include "base/memory/scoped_ptr.h" 25 #include "base/memory/scoped_ptr.h"
26 #include "client/crash_report_database.h" 26 #include "client/crash_report_database.h"
27 #include "tools/tool_support.h" 27 #include "tools/tool_support.h"
28 #include "handler/mac/crash_report_exception_handler.h" 28 #include "handler/mac/crash_report_exception_handler.h"
29 #include "handler/mac/crash_report_upload_thread.h" 29 #include "handler/mac/crash_report_upload_thread.h"
30 #include "handler/mac/exception_handler_server.h" 30 #include "handler/mac/exception_handler_server.h"
31 #include "util/mach/child_port_handshake.h" 31 #include "util/mach/child_port_handshake.h"
32 #include "util/posix/close_stdio.h" 32 #include "util/posix/close_stdio.h"
33 #include "util/stdlib/string_number_conversion.h" 33 #include "util/stdlib/string_number_conversion.h"
34 #include "util/string/split_string.h"
34 #include "util/synchronization/semaphore.h" 35 #include "util/synchronization/semaphore.h"
35 36
36 namespace crashpad { 37 namespace crashpad {
37 namespace { 38 namespace {
38 39
39 bool SplitString(const std::string& string,
40 std::string* left,
41 std::string* right) {
42 size_t equals_pos = string.find('=');
43 if (equals_pos == 0 || equals_pos == std::string::npos) {
44 return false;
45 }
46
47 left->assign(string, 0, equals_pos);
48 right->assign(string, equals_pos + 1, std::string::npos);
49 return true;
50 }
51
52 void Usage(const std::string& me) { 40 void Usage(const std::string& me) {
53 fprintf(stderr, 41 fprintf(stderr,
54 "Usage: %s [OPTION]...\n" 42 "Usage: %s [OPTION]...\n"
55 "Crashpad's exception handler server.\n" 43 "Crashpad's exception handler server.\n"
56 "\n" 44 "\n"
57 " --annotation=KEY=VALUE set a process annotation in each crash report\n" 45 " --annotation=KEY=VALUE set a process annotation in each crash report\n"
58 " --database=PATH store the crash report database at PATH\n" 46 " --database=PATH store the crash report database at PATH\n"
59 " --handshake-fd=FD establish communication with the client over FD\n " 47 " --handshake-fd=FD establish communication with the client over FD\n "
48 " --url=URL send crash reports to the Breakpad server at URL\ n"
Robert Sesek 2015/03/12 18:01:09 "to this Breakpad server URL" would be 80cols
Mark Mentovai 2015/03/12 18:14:04 Robert Sesek wrote:
60 " --help display this help and exit\n" 49 " --help display this help and exit\n"
61 " --version output version information and exit\n", 50 " --version output version information and exit\n",
62 me.c_str()); 51 me.c_str());
63 ToolSupport::UsageTail(me); 52 ToolSupport::UsageTail(me);
64 } 53 }
65 54
66 int HandlerMain(int argc, char* argv[]) { 55 int HandlerMain(int argc, char* argv[]) {
67 const std::string me(basename(argv[0])); 56 const std::string me(basename(argv[0]));
68 57
69 enum OptionFlags { 58 enum OptionFlags {
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 181
193 return EXIT_SUCCESS; 182 return EXIT_SUCCESS;
194 } 183 }
195 184
196 } // namespace 185 } // namespace
197 } // namespace crashpad 186 } // namespace crashpad
198 187
199 int main(int argc, char* argv[]) { 188 int main(int argc, char* argv[]) {
200 return crashpad::HandlerMain(argc, argv); 189 return crashpad::HandlerMain(argc, argv);
201 } 190 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698