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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/v8.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 2783 matching lines...) Expand 10 before | Expand all | Expand 10 after
2794 protected: 2794 protected:
2795 virtual int DecompressData(char* raw_data, 2795 virtual int DecompressData(char* raw_data,
2796 int* raw_data_size, 2796 int* raw_data_size,
2797 const char* compressed_data, 2797 const char* compressed_data,
2798 int compressed_data_size) = 0; 2798 int compressed_data_size) = 0;
2799 2799
2800 private: 2800 private:
2801 char** raw_data; 2801 char** raw_data;
2802 }; 2802 };
2803 2803
2804
2805 /**
2806 * EntropySource is used as a callback function when v8 needs a source
2807 * of cryptographically safe entropy.
Mads Ager (chromium) 2011/07/17 08:59:12 Let's remove the "cryptographically safe" part of
2808 */
2809 typedef bool (*EntropySource)(unsigned char* buffer, size_t length);
2810
2804 /** 2811 /**
2805 * Container class for static utility functions. 2812 * Container class for static utility functions.
2806 */ 2813 */
2807 class V8EXPORT V8 { 2814 class V8EXPORT V8 {
2808 public: 2815 public:
2809 /** Set the callback to invoke in case of fatal errors. */ 2816 /** Set the callback to invoke in case of fatal errors. */
2810 static void SetFatalErrorHandler(FatalErrorCallback that); 2817 static void SetFatalErrorHandler(FatalErrorCallback that);
2811 2818
2812 /** 2819 /**
2813 * Set the callback to invoke to check if code generation from 2820 * Set the callback to invoke to check if code generation from
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
3019 size_t length); 3026 size_t length);
3020 3027
3021 /** 3028 /**
3022 * Initializes from snapshot if possible. Otherwise, attempts to 3029 * Initializes from snapshot if possible. Otherwise, attempts to
3023 * initialize from scratch. This function is called implicitly if 3030 * initialize from scratch. This function is called implicitly if
3024 * you use the API without calling it first. 3031 * you use the API without calling it first.
3025 */ 3032 */
3026 static bool Initialize(); 3033 static bool Initialize();
3027 3034
3028 /** 3035 /**
3036 * Allows the host application to provide a callback which can be used
3037 * as a source of entropy for random number generators.
3038 */
3039 static void SetEntropySource(EntropySource source);
3040
3041 /**
3029 * Adjusts the amount of registered external memory. Used to give 3042 * Adjusts the amount of registered external memory. Used to give
3030 * V8 an indication of the amount of externally allocated memory 3043 * V8 an indication of the amount of externally allocated memory
3031 * that is kept alive by JavaScript objects. V8 uses this to decide 3044 * that is kept alive by JavaScript objects. V8 uses this to decide
3032 * when to perform global garbage collections. Registering 3045 * when to perform global garbage collections. Registering
3033 * externally allocated memory will trigger global garbage 3046 * externally allocated memory will trigger global garbage
3034 * collections more often than otherwise in an attempt to garbage 3047 * collections more often than otherwise in an attempt to garbage
3035 * collect the JavaScript objects keeping the externally allocated 3048 * collect the JavaScript objects keeping the externally allocated
3036 * memory alive. 3049 * memory alive.
3037 * 3050 *
3038 * \param change_in_bytes the change in externally allocated memory 3051 * \param change_in_bytes the change in externally allocated memory
(...skipping 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after
4182 4195
4183 4196
4184 } // namespace v8 4197 } // namespace v8
4185 4198
4186 4199
4187 #undef V8EXPORT 4200 #undef V8EXPORT
4188 #undef TYPE_CHECK 4201 #undef TYPE_CHECK
4189 4202
4190 4203
4191 #endif // V8_H_ 4204 #endif // V8_H_
OLDNEW
« 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