Chromium Code Reviews| Index: handler/handler_main.cc |
| diff --git a/handler/handler_main.cc b/handler/handler_main.cc |
| index 19d0da7a8fb68726bc262a3292d07e1330bee974..c58e4e453beb5588cb4916301b5a58d7966b5bff 100644 |
| --- a/handler/handler_main.cc |
| +++ b/handler/handler_main.cc |
| @@ -73,11 +73,15 @@ void Usage(const base::FilePath& me) { |
| #if defined(OS_MACOSX) |
| " --handshake-fd=FD establish communication with the client over FD\n" |
| " --mach-service=SERVICE register SERVICE with the bootstrap server\n" |
| -" --reset-own-crash-exception-port-to-system-default\n" |
| -" reset the server's exception handler to default\n" |
| #elif defined(OS_WIN) |
| " --handshake-handle=HANDLE\n" |
| " create a new pipe and send its name via HANDLE\n" |
| +#endif // OS_MACOSX |
| +" --no-rate-limit don't rate limit crash uploads\n" |
| +#if defined(OS_MACOSX) |
| +" --reset-own-crash-exception-port-to-system-default\n" |
| +" reset the server's exception handler to default\n" |
| +#elif defined(OS_WIN) |
| " --pipe-name=PIPE communicate with the client over PIPE\n" |
| #endif // OS_MACOSX |
| " --url=URL send crash reports to this Breakpad server URL,\n" |
| @@ -128,9 +132,13 @@ int HandlerMain(int argc, char* argv[]) { |
| #if defined(OS_MACOSX) |
| kOptionHandshakeFD, |
| kOptionMachService, |
| - kOptionResetOwnCrashExceptionPortToSystemDefault, |
| #elif defined(OS_WIN) |
| kOptionHandshakeHandle, |
| +#endif // OS_MACOSX |
| + kOptionNoRateLimit, |
| +#if defined(OS_MACOSX) |
| + kOptionResetOwnCrashExceptionPortToSystemDefault, |
| +#elif defined(OS_WIN) |
| kOptionPipeName, |
| #endif // OS_MACOSX |
| kOptionURL, |
| @@ -152,12 +160,14 @@ int HandlerMain(int argc, char* argv[]) { |
| HANDLE handshake_handle; |
| std::string pipe_name; |
| #endif // OS_MACOSX |
| + bool rate_limit; |
| } options = {}; |
| #if defined(OS_MACOSX) |
| options.handshake_fd = -1; |
| #elif defined(OS_WIN) |
| options.handshake_handle = INVALID_HANDLE_VALUE; |
| #endif |
| + options.rate_limit = true; |
| const option long_options[] = { |
| {"annotation", required_argument, nullptr, kOptionAnnotation}, |
| @@ -174,6 +184,7 @@ int HandlerMain(int argc, char* argv[]) { |
| {"pipe-name", required_argument, nullptr, kOptionPipeName}, |
| #endif // OS_MACOSX |
| {"url", required_argument, nullptr, kOptionURL}, |
| + {"no-rate-limit", no_argument, nullptr, kOptionNoRateLimit}, |
|
Mark Mentovai
2016/01/06 17:51:50
Do the ugly dance with this one too.
scottmg
2016/01/06 17:55:37
Done.
|
| {"help", no_argument, nullptr, kOptionHelp}, |
| {"version", no_argument, nullptr, kOptionVersion}, |
| {nullptr, 0, nullptr, 0}, |
| @@ -214,10 +225,6 @@ int HandlerMain(int argc, char* argv[]) { |
| options.mach_service = optarg; |
| break; |
| } |
| - case kOptionResetOwnCrashExceptionPortToSystemDefault: { |
| - options.reset_own_crash_exception_port_to_system_default = true; |
| - break; |
| - } |
| #elif defined(OS_WIN) |
| case kOptionHandshakeHandle: { |
| // Use unsigned int, because the handle was presented by the client in |
| @@ -231,6 +238,17 @@ int HandlerMain(int argc, char* argv[]) { |
| } |
| break; |
| } |
| +#endif // OS_MACOSX |
| + case kOptionNoRateLimit: { |
| + options.rate_limit = false; |
| + break; |
| + } |
| +#if defined(OS_MACOSX) |
| + case kOptionResetOwnCrashExceptionPortToSystemDefault: { |
| + options.reset_own_crash_exception_port_to_system_default = true; |
| + break; |
| + } |
| +#elif defined(OS_WIN) |
| case kOptionPipeName: { |
| options.pipe_name = optarg; |
| break; |
| @@ -371,7 +389,11 @@ int HandlerMain(int argc, char* argv[]) { |
| return EXIT_FAILURE; |
| } |
| - CrashReportUploadThread upload_thread(database.get(), options.url); |
| + // TODO(scottmg): options.rate_limit should be removed when we have a |
| + // configurable database setting to control upload limiting. |
| + // https://bugs.chromium.org/p/crashpad/issues/detail?id=23 |
|
Mark Mentovai
2016/01/06 17:51:50
Short links, https://crashpad.chromium.org/bug/23
scottmg
2016/01/06 17:55:37
Ah, I can never remember what the shorter version
|
| + CrashReportUploadThread upload_thread( |
| + database.get(), options.url, options.rate_limit); |
| upload_thread.Start(); |
| PruneCrashReportThread prune_thread(database.get(), |