summaryrefslogtreecommitdiffstats
path: root/base/rand_util.cc
Commit message (Collapse)AuthorAgeFilesLines
* Fixes to get base compiling on VS2013scottmg@chromium.org2013-10-151-0/+1
| | | | | | | | | | | | | | - Missing includes of <algorithm> for std::min/std::max. - Update prep_libc.py for different obj path in runtime library. - Disable optimization in a couple files that currently fail in /O2. Upstream bugs filed that are supposedly fixed in the next release. R=thakis@chromium.org BUG=288948 Review URL: https://codereview.chromium.org/26885007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228754 0039d316-1c4b-4281-b951-d872f2087c98
* Use a direct include of strings headers in base/.avi@chromium.org2013-06-101-1/+1
| | | | | | | | | | BUG=247723 TEST=none TBR=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/16320009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205284 0039d316-1c4b-4281-b951-d872f2087c98
* ake string_util::WriteInto() DCHECK() that the supplied |length_with_null| > ↵pkasting@chromium.org2011-11-291-0/+1
| | | | | | | | | | | | 1, meaning that the without-'\0' string is non-empty. This replaces the conditional code added recently that makes this case return NULL. It's easier to understand if it's simply an error to call WriteInto() in this case at all. Add DCHECK()s or conditionals as appropriate to callers in order to ensure this assertion holds. BUG=none TEST=none Review URL: http://codereview.chromium.org/8418034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112005 0039d316-1c4b-4281-b951-d872f2087c98
* Fix variable names and comments in RandGenerator.dilmah@chromium.org2011-08-241-8/+7
| | | | | | | | | | | | (No semantic change intended). BUG=None TEST=None Review URL: http://codereview.chromium.org/7685053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98098 0039d316-1c4b-4281-b951-d872f2087c98
* Fix base::RandGenerator bug (it had non-uniform random distribution). Add ↵joi@chromium.org2011-05-301-1/+14
| | | | | | | | | | | test that would have caught bug. Also add a test to verify that our random generators are at least somewhat random. BUG=84221 TEST=base_unittests --gtest_filter=RandUtilTest.* Review URL: http://codereview.chromium.org/7080005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87244 0039d316-1c4b-4281-b951-d872f2087c98
* Add one-time randomization support for FieldTrial, and the ability tojoi@chromium.org2011-05-101-1/+5
| | | | | | | | | | | | | | | | | | | | | | | disable field trials. I am going to have a need for both soon. Update some documentation about empty trial names, add TrialExists() method and update many call-sites to use this (it simplifies the previous logic which checked for existence and then for non-empty name, which can no longer happen). Refactor a bit in browser_main. While I'm in there and needing base/OWNERS approval, add an OWNERS file for base/metrics that adds jar@chromium.org as an owner for that directory. Initially committed as r84197. Rolled back due to DCHECK in official builds, r84373. Will re-submit with fix. BUG=81750 TEST=base_unittests Review URL: http://codereview.chromium.org/6883102 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84801 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 84197 - Add one-time randomization support for FieldTrial, and the ↵joi@chromium.org2011-05-061-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | ability to disable field trials. I am going to have a need for both soon. Cleaning up some comments about empty trial names, adding static method TrialExists() and simplifying many call sites by using this method. While I'm in there and needing base/OWNERS approval, add an OWNERS file for base/metrics that adds jar@chromium.org as an owner for that directory. BUG=none TEST=base_unittests TBR=jam@chromium.org R=jar@chromium.org,phajdan.jr@chromium.org,mark@chromium.org,wtc@chromium.org Reason for revert: See http://crbug.com/81750 BUG=81750 TBR=joi@chromium.org Review URL: http://codereview.chromium.org/6931048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84373 0039d316-1c4b-4281-b951-d872f2087c98
* Move crypto_helpers from sync to cryptoqsr@google.com2011-05-051-11/+12
| | | | | | | | | | | | | crypto_helpers only depends on resources in base and is used by sync and password_manager. BUG= TEST= Review URL: http://codereview.chromium.org/6873156 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84223 0039d316-1c4b-4281-b951-d872f2087c98
* Add one-time randomization support for FieldTrial, and the ability tojoi@chromium.org2011-05-051-1/+5
| | | | | | | | | | | | | | | | | | disable field trials. I am going to have a need for both soon. Cleaning up some comments about empty trial names, adding static method TrialExists() and simplifying many call sites by using this method. While I'm in there and needing base/OWNERS approval, add an OWNERS file for base/metrics that adds jar@chromium.org as an owner for that directory. BUG=none TEST=base_unittests TBR=jam@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84197 0039d316-1c4b-4281-b951-d872f2087c98
* Updating logging in src/base/. Using DCHECK_NE/EQ/LE/GE/GT() where possiblekushi.p@gmail.com2011-05-041-2/+4
| | | | | | | | | BUG=58409 Review URL: http://codereview.chromium.org/6883295 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84016 0039d316-1c4b-4281-b951-d872f2087c98
* Add a rand_util method for generating a random string.abarth@chromium.org2011-04-291-0/+16
| | | | | | | | We need this function to generate a nonce for MAC cookies. Review URL: http://codereview.chromium.org/6904118 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83588 0039d316-1c4b-4281-b951-d872f2087c98
* Update DCHECK() usage to utilize the more expressive debugging functions.kushi.p@gmail.com2011-04-221-2/+2
| | | | | | | | BUG=58409 Review URL: http://codereview.chromium.org/6891008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82639 0039d316-1c4b-4281-b951-d872f2087c98
* Continuing with DCHECK() replacement. Switching to DCHECK_GT for better ↵kushi.p@gmail.com2011-03-131-1/+1
| | | | | | | | | | | debug of broken contracts BUG=58409 Review URL: http://codereview.chromium.org/6690002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77977 0039d316-1c4b-4281-b951-d872f2087c98
* Add RandomNumberGenerator adapter to base/rand_util.hisherman@chromium.org2010-08-301-4/+8
| | | | | | | | | BUG=46679 TEST=none (yet...) Review URL: http://codereview.chromium.org/3053050 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57904 0039d316-1c4b-4281-b951-d872f2087c98
* RandUInt -> RandUint to match the style of other Uint functions.deanm@chromium.org2008-11-141-2/+2
| | | | | | Review URL: http://codereview.chromium.org/10767 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5517 0039d316-1c4b-4281-b951-d872f2087c98
* Reduce RandDouble to one call to ldexp, add one bit of precisionmark@chromium.org2008-09-301-18/+11
| | | | | | Review URL: http://codereview.chromium.org/5801 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2712 0039d316-1c4b-4281-b951-d872f2087c98
* Refactoring for portability:mark@chromium.org2008-09-291-0/+47
- Move chrome/common/env_util to base/sys_info - Move chrome/common/rand_util to base/rand_util (new), simplify its public interface, and fix its implementation Patch by Paweł Hajdan, Jr. <phajdan.jr@gmail.com> http://codereview.chromium.org/4079 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2697 0039d316-1c4b-4281-b951-d872f2087c98