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

Unified Diff: base/rand_util.h

Issue 7276014: DnsQuery: changed raw function pointer to callback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 | « no previous file | net/base/dns_query.h » ('j') | net/base/dns_query_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/rand_util.h
diff --git a/base/rand_util.h b/base/rand_util.h
index 6bfbcb4896d087e1a144aaa19d40aa42321bcebf..3602585138dd283b6e0ef333e2b2757dae0dd374 100644
--- a/base/rand_util.h
+++ b/base/rand_util.h
@@ -10,6 +10,7 @@
#include "base/base_api.h"
#include "base/basictypes.h"
+#include "base/callback.h"
namespace base {
@@ -19,6 +20,8 @@ BASE_API uint64 RandUint64();
// Returns a random number between min and max (inclusive). Thread-safe.
BASE_API int RandInt(int min, int max);
+typedef base::Callback<int(int, int)> RandIntCallback;
brettw 2011/06/27 22:24:48 I don't understand why this is here. It's not nece
agayev 2011/06/27 23:53:52 I thought callback for a RandInt is general enough
willchan no longer on Chromium 2011/06/28 09:58:23 This looks to be an ease of use vs dependency bloa
brettw 2011/06/28 16:09:52 I might define it at the top of your DNS class so
agayev 2011/06/28 16:22:20 It's not specific to DNS. For example, UDPSocket
+
// Returns a random number in range [0, max). Thread-safe.
//
// Note that this can be used as an adapter for std::random_shuffle():
« no previous file with comments | « no previous file | net/base/dns_query.h » ('j') | net/base/dns_query_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698