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

Side by Side Diff: components/nacl/loader/nonsfi/irt_random.cc

Issue 1409633002: Non-SFI mode: Remove old Non-SFI code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include <errno.h>
6 #include <unistd.h>
7
8 #include "base/logging.h"
9 #include "components/nacl/loader/nonsfi/irt_interfaces.h"
10 #include "components/nacl/loader/nonsfi/irt_util.h"
11
12 namespace nacl {
13 namespace nonsfi {
14 namespace {
15
16 // FD for urandom.
17 int secure_random_fd = -1;
18
19 int IrtGetRandomBytes(void* buf, size_t count, size_t* nread) {
20 DCHECK_NE(secure_random_fd, -1);
21 return CheckErrorWithResult(read(secure_random_fd, buf, count),
22 nread);
23 }
24
25 } // namespace
26
27 const nacl_irt_random kIrtRandom = {
28 IrtGetRandomBytes
29 };
30
31 void SetUrandomFd(int fd) {
32 DCHECK_EQ(secure_random_fd, -1);
33 secure_random_fd = fd;
34 }
35
36 } // namespace nonsfi
37 } // namespace nacl
OLDNEW
« no previous file with comments | « components/nacl/loader/nonsfi/irt_random.h ('k') | components/nacl/loader/nonsfi/irt_resource_open.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698