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

Unified Diff: mojo/edk/embedder/embedder.cc

Issue 2039713004: [mojo-edk] Make the Mojo EDK compile under NaCl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 4 years, 6 months 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 | « mojo/edk/embedder/BUILD.gn ('k') | mojo/edk/embedder/platform_channel_pair_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/embedder/embedder.cc
diff --git a/mojo/edk/embedder/embedder.cc b/mojo/edk/embedder/embedder.cc
index 5d7e3455e11ed76862f4448947056a18c37c475d..235a7a4a78d5110e9f9907000fb91ba343023199 100644
--- a/mojo/edk/embedder/embedder.cc
+++ b/mojo/edk/embedder/embedder.cc
@@ -10,15 +10,19 @@
#include "base/location.h"
#include "base/logging.h"
#include "base/memory/ref_counted.h"
+#include "base/rand_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/task_runner.h"
#include "base/threading/thread_task_runner_handle.h"
-#include "crypto/random.h"
#include "mojo/edk/embedder/embedder_internal.h"
#include "mojo/edk/embedder/platform_channel_pair.h"
#include "mojo/edk/embedder/process_delegate.h"
#include "mojo/edk/system/core.h"
+#if !defined(OS_NACL)
+#include "crypto/random.h"
+#endif
+
namespace mojo {
namespace edk {
@@ -138,7 +142,12 @@ ScopedMessagePipeHandle CreateChildMessagePipe(const std::string& token) {
std::string GenerateRandomToken() {
char random_bytes[16];
+#if defined(OS_NACL)
+ // Not secure. For NaCl only!
+ base::RandBytes(random_bytes, 16);
+#else
crypto::RandBytes(random_bytes, 16);
+#endif
return base::HexEncode(random_bytes, 16);
}
« no previous file with comments | « mojo/edk/embedder/BUILD.gn ('k') | mojo/edk/embedder/platform_channel_pair_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698