rate-limit: create ShouldRateLimit() and tests

This change moves the rate-limiting logic from ShouldRateLimitUpload()
into a separate helper function with its own tests. The logic itself
is unchanged.

This is a precursor to changes that will experimentally change the
rate limit. The new tests will help ensure that future changes don't
unexpectedly break existing logic that should be kept (e.g., the
CrashSkippedReason, which is emitted to a histogram).

Bug: 42310127
Change-Id: I68268ee6ea76aa31961f3791c595503a204ec5b4
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/7038272
Commit-Queue: Jesse McKenna <jessemckenna@google.com>
Reviewed-by: Mark Mentovai <mark@chromium.org>
5 files changed
tree: b5f623e4f608adfb088b892013fe7fdd86543537
  1. build/
  2. client/
  3. compat/
  4. doc/
  5. handler/
  6. infra/
  7. minidump/
  8. snapshot/
  9. test/
  10. third_party/
  11. tools/
  12. util/
  13. .clang-format
  14. .gitattributes
  15. .gitignore
  16. .gn
  17. .style.yapf
  18. .vpython3
  19. AUTHORS
  20. BUILD.gn
  21. codereview.settings
  22. CONTRIBUTORS
  23. DEPS
  24. LICENSE
  25. navbar.md
  26. OWNERS
  27. package.h
  28. README.md
README.md

Crashpad

Crashpad is a crash-reporting system.

Documentation

Source Code

Crashpad’s source code is hosted in a Git repository at https://chromium.googlesource.com/crashpad/crashpad.

Other Links