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

Unified Diff: include/v8.h

Issue 7395012: Introduce a random entropy source which can optionally be provided at initialization. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 5 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 | src/api.cc » ('j') | src/v8.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
===================================================================
--- include/v8.h (revision 8657)
+++ include/v8.h (working copy)
@@ -2801,7 +2801,14 @@
char** raw_data;
};
+
/**
+ * EntropySource is used as a callback function when v8 needs a source
+ * of cryptographically safe entropy.
Mads Ager (chromium) 2011/07/17 08:59:12 Let's remove the "cryptographically safe" part of
+ */
+typedef bool (*EntropySource)(unsigned char* buffer, size_t length);
+
+/**
* Container class for static utility functions.
*/
class V8EXPORT V8 {
@@ -3026,6 +3033,12 @@
static bool Initialize();
/**
+ * Allows the host application to provide a callback which can be used
+ * as a source of entropy for random number generators.
+ */
+ static void SetEntropySource(EntropySource source);
+
+ /**
* Adjusts the amount of registered external memory. Used to give
* V8 an indication of the amount of externally allocated memory
* that is kept alive by JavaScript objects. V8 uses this to decide
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/v8.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698