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

Issue 144010: Cache the file descriptor for /dev/urandom to avoid needing to reopen it. (Closed)

Created:
11 years, 6 months ago by Mike Mammarella [gmail]
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com, John Grabowski
Visibility:
Public.

Description

Cache the file descriptor for /dev/urandom to avoid needing to reopen it for every call. Patch by Mike Mammarella. BUG=none TEST=none

Patch Set 1 #

Total comments: 1

Patch Set 2 : '' #

Total comments: 14

Patch Set 3 : '' #

Total comments: 2

Patch Set 4 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+30 lines, -3 lines) Patch
M base/rand_util_posix.cc View 1 2 3 1 chunk +30 lines, -3 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
Mike Mammarella [gmail]
Once the renderers are sandboxed on Linux, they won't be able to reopen /dev/urandom. So ...
11 years, 6 months ago (2009-06-22 22:23:57 UTC) #1
Mark Mentovai
+dean
11 years, 6 months ago (2009-06-23 03:28:53 UTC) #2
Dean McNamee
http://codereview.chromium.org/144010/diff/1/2 File base/rand_util_posix.cc (right): http://codereview.chromium.org/144010/diff/1/2#newcode31 Line 31: uint64 number; I would use a lazy_instance to ...
11 years, 6 months ago (2009-06-23 14:59:25 UTC) #3
Mike Mammarella [gmail]
Do you really think that's necessary here though? It involves additional synchronization and a pointer ...
11 years, 6 months ago (2009-06-23 19:46:03 UTC) #4
Paweł Hajdan Jr.
+agl, who also works on sandboxing I think This is not the only way to ...
11 years, 6 months ago (2009-06-23 19:50:38 UTC) #5
Mike Mammarella [gmail]
Actually it was agl who suggested this from among the possible approaches. The sandbox does ...
11 years, 6 months ago (2009-06-23 19:55:36 UTC) #6
Dean McNamee
Yes, LazyInstance is the right thing to do here. I promise you that the extra ...
11 years, 6 months ago (2009-06-24 11:41:34 UTC) #7
Mike Mammarella [gmail]
Updated the patch to use LazyInstance.
11 years, 6 months ago (2009-06-24 17:34:34 UTC) #8
Mark Mentovai
http://codereview.chromium.org/144010/diff/2005/2006 File base/rand_util_posix.cc (right): http://codereview.chromium.org/144010/diff/2005/2006#newcode9 Line 9: #include <errno.h> Sort alphabetically - errno.h before fcntl.h. ...
11 years, 6 months ago (2009-06-24 17:55:15 UTC) #9
Paweł Hajdan Jr.
Few nits, but after fixing them LGTM (please wait for Dean's comments). There should probably ...
11 years, 6 months ago (2009-06-24 17:55:33 UTC) #10
Mike Mammarella [gmail]
http://codereview.chromium.org/144010/diff/2005/2006 File base/rand_util_posix.cc (right): http://codereview.chromium.org/144010/diff/2005/2006#newcode9 Line 9: #include <errno.h> On 2009/06/24 17:55:15, Mark Mentovai wrote: ...
11 years, 6 months ago (2009-06-25 01:12:21 UTC) #11
Dean McNamee
The static is good in the anonymous namespace, we don't usually and probably shouldn't put ...
11 years, 6 months ago (2009-06-25 10:08:11 UTC) #12
Dean McNamee
Hi, I was going to commit this and realized you're not in the AUTHORS. Can ...
11 years, 6 months ago (2009-06-25 11:11:25 UTC) #13
Mike Mammarella [gmail]
11 years, 6 months ago (2009-06-26 00:28:44 UTC) #14
http://codereview.chromium.org/144010/diff/2009/1006
File base/rand_util_posix.cc (right):

http://codereview.chromium.org/144010/diff/2009/1006#newcode32
Line 32: inline int fd() const { return fd_; }
On 2009/06/25 10:08:11, Dean McNamee wrote:
> no inline keyword.

Done.

Powered by Google App Engine
This is Rietveld 408576698