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

Unified Diff: util/misc/random_string.h

Issue 1451793002: Add RandomString() and its test, and use it everywhere it makes sense (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Fix tpyo Created 5 years, 1 month 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 | « util/mach/mach_extensions_test.cc ('k') | util/misc/random_string.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/misc/random_string.h
diff --git a/handler/handler_main.h b/util/misc/random_string.h
similarity index 63%
copy from handler/handler_main.h
copy to util/misc/random_string.h
index 5b5568ecde6085e7f5ec680a8e0ec85d80964547..93b3a7fa4620f149529c8af1e9b067b9a81ca4a4 100644
--- a/handler/handler_main.h
+++ b/util/misc/random_string.h
@@ -12,17 +12,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef CRASHPAD_HANDLER_HANDLER_MAIN_H_
-#define CRASHPAD_HANDLER_HANDLER_MAIN_H_
+#ifndef CRASHPAD_UTIL_MISC_RANDOM_STRING_H_
+#define CRASHPAD_UTIL_MISC_RANDOM_STRING_H_
+
+#include <string>
namespace crashpad {
-//! \brief The `main()` of the `crashpad_handler` binary.
+//! \brief Returns a random string.
//!
-//! This is exposed so that `crashpad_handler` can be embedded into another
-//! binary, but called and used as if it were a standalone executable.
-int HandlerMain(int argc, char* argv[]);
+//! The string consists of 16 uppercase characters chosen at random. The
+//! returned string has over 75 bits of randomness (26<sup>16</sup> &gt;
+//! 2<sup>75</sup>).
+std::string RandomString();
} // namespace crashpad
-#endif // CRASHPAD_HANDLER_HANDLER_MAIN_H_
+#endif // CRASHPAD_UTIL_MISC_RANDOM_STRING_H_
« no previous file with comments | « util/mach/mach_extensions_test.cc ('k') | util/misc/random_string.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698