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

Unified Diff: util/mach/child_port_handshake.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/mac/service_management_test.mm ('k') | util/mach/mach_extensions_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/mach/child_port_handshake.cc
diff --git a/util/mach/child_port_handshake.cc b/util/mach/child_port_handshake.cc
index ff779df2a7eaab486bb11ead99ce4254839b2b2d..e7cc7eed38343716d292d4eac2f89d91ef9d00fc 100644
--- a/util/mach/child_port_handshake.cc
+++ b/util/mach/child_port_handshake.cc
@@ -37,6 +37,7 @@
#include "util/mach/mach_message.h"
#include "util/mach/mach_message_server.h"
#include "util/misc/implicit_cast.h"
+#include "util/misc/random_string.h"
namespace crashpad {
namespace {
@@ -97,10 +98,10 @@ mach_port_t ChildPortHandshakeServer::RunServer(
errno = pthread_threadid_np(pthread_self(), &thread_id);
PCHECK(errno == 0) << "pthread_threadid_np";
std::string service_name = base::StringPrintf(
- "org.chromium.crashpad.child_port_handshake.%d.%llu.%016llx",
+ "org.chromium.crashpad.child_port_handshake.%d.%llu.%s",
getpid(),
thread_id,
- base::RandUint64());
+ RandomString().c_str());
// Check the new service in with the bootstrap server, obtaining a receive
// right for it.
« no previous file with comments | « util/mac/service_management_test.mm ('k') | util/mach/mach_extensions_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698