1. 04 Apr, 2016 1 commit
  2. 26 Dec, 2015 1 commit
  3. 29 Oct, 2015 1 commit
    • Nico Weber's avatar
      Add missing overflow handling to base::RandInt(). · 0a3852a7
      Nico Weber authored
      The result of RandGenerator() could return a number as high as UINT_MAX,
      so casting that to int and adding it to another int will in general overflow.
      Overflow is undefined behavior for signed integers, so add some type casting
      to make sure this doesn't happen.
      
      The DCHECKs in RandInt() where catching that something fishy was going on
      (see bug), so as test just call RandInt() a few times with large bounds.
      This test made the DCHECK reliably fire without the fix.
      
      BUG=548375
      R=thestig@chromium.org
      
      Review URL: https://codereview.chromium.org/1419703005 .
      
      Cr-Commit-Position: refs/heads/master@{#356939}
      0a3852a7
  4. 26 Jan, 2015 1 commit
  5. 23 Jan, 2014 1 commit
    • dalecurtis@chromium.org's avatar
      Improve base::RandBytes() performance by 1.75x-2.10x on POSIX. · c910c5a6
      dalecurtis@chromium.org authored
      No real changes, just avoids doling out Uint64 sized chunks by
      using the underlying method to hand out correctly sized blocks.
      
      Windows is the only platform which doesn't have a byte stream
      based generator, so I've moved the generic RandBytes() method
      there and added native methods for other platforms which reuse
      each platforms internal generator.
      
      Performance measured by the new benchmark test over 5 runs,
      each representing 10 generations of 1mb of random data:
      
      Linux x64:
      Original: 1199625.4
      Modified: 686480.2
      Improvement: 1.75x
      
      On OSX (10.9.1):
      Original: 1532669.8
      Modified: 734808.0
      Improvement: 2.10x
      
      BUG=none
      TEST=new benchmark unittest.
      
      Review URL: https://codereview.chromium.org/140773006
      
      git-svn-id: svn://svn.chromium.org/chrome/trunk/src@246486 0039d316-1c4b-4281-b951-d872f2087c98
      c910c5a6
  6. 29 Nov, 2011 1 commit
  7. 24 Aug, 2011 1 commit
  8. 19 Jul, 2011 1 commit
  9. 30 May, 2011 1 commit
  10. 05 May, 2011 1 commit
  11. 29 Apr, 2011 1 commit
  12. 14 Oct, 2010 1 commit
  13. 13 Oct, 2010 1 commit
  14. 30 Aug, 2010 1 commit
  15. 30 Sep, 2008 1 commit
  16. 29 Sep, 2008 1 commit