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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Crashpad Authors. All rights reserved. 1 // Copyright 2015 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,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and 12 // See the License for the specific language governing permissions and
13 // limitations under the License. 13 // limitations under the License.
14 14
15 #ifndef CRASHPAD_HANDLER_HANDLER_MAIN_H_ 15 #ifndef CRASHPAD_UTIL_MISC_RANDOM_STRING_H_
16 #define CRASHPAD_HANDLER_HANDLER_MAIN_H_ 16 #define CRASHPAD_UTIL_MISC_RANDOM_STRING_H_
17
18 #include <string>
17 19
18 namespace crashpad { 20 namespace crashpad {
19 21
20 //! \brief The `main()` of the `crashpad_handler` binary. 22 //! \brief Returns a random string.
21 //! 23 //!
22 //! This is exposed so that `crashpad_handler` can be embedded into another 24 //! The string consists of 16 uppercase characters chosen at random. The
23 //! binary, but called and used as if it were a standalone executable. 25 //! returned string has over 75 bits of randomness (26<sup>16</sup> &gt;
24 int HandlerMain(int argc, char* argv[]); 26 //! 2<sup>75</sup>).
27 std::string RandomString();
25 28
26 } // namespace crashpad 29 } // namespace crashpad
27 30
28 #endif // CRASHPAD_HANDLER_HANDLER_MAIN_H_ 31 #endif // CRASHPAD_UTIL_MISC_RANDOM_STRING_H_
OLDNEW
« 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