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

Unified Diff: util/win/exception_handler_server.cc

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/util_test.gyp ('k') | util/win/process_info_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/win/exception_handler_server.cc
diff --git a/util/win/exception_handler_server.cc b/util/win/exception_handler_server.cc
index 3a41a1deaef2222ee2fee90b6022af2fbf319422..e122cdbc83fad976f552e096b866322359432201 100644
--- a/util/win/exception_handler_server.cc
+++ b/util/win/exception_handler_server.cc
@@ -26,6 +26,7 @@
#include "snapshot/crashpad_info_client_options.h"
#include "snapshot/win/process_snapshot_win.h"
#include "util/file/file_writer.h"
+#include "util/misc/random_string.h"
#include "util/misc/tri_state.h"
#include "util/misc/uuid.h"
#include "util/win/get_function.h"
@@ -318,10 +319,7 @@ std::wstring ExceptionHandlerServer::CreatePipe() {
base::StringPrintf("\\\\.\\pipe\\crashpad_%d_", GetCurrentProcessId());
std::wstring pipe_name;
do {
- pipe_name = base::UTF8ToUTF16(pipe_name_base);
- for (int index = 0; index < 16; ++index) {
- pipe_name.append(1, static_cast<wchar_t>(base::RandInt('A', 'Z')));
- }
+ pipe_name = base::UTF8ToUTF16(pipe_name_base + RandomString());
first_pipe_instance_.reset(CreateNamedPipeInstance(pipe_name, true));
« no previous file with comments | « util/util_test.gyp ('k') | util/win/process_info_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698