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

Side by Side Diff: src/api.cc

Issue 23530071: [Sheriff] Revert "Let SetEntropySource() fail if called after V8::Initialize()." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 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 | « include/v8.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 4924 matching lines...) Expand 10 before | Expand all | Expand 10 after
4935 bool v8::V8::Initialize() { 4935 bool v8::V8::Initialize() {
4936 i::Isolate* isolate = i::Isolate::UncheckedCurrent(); 4936 i::Isolate* isolate = i::Isolate::UncheckedCurrent();
4937 if (isolate != NULL && isolate->IsInitialized()) { 4937 if (isolate != NULL && isolate->IsInitialized()) {
4938 return true; 4938 return true;
4939 } 4939 }
4940 return InitializeHelper(isolate); 4940 return InitializeHelper(isolate);
4941 } 4941 }
4942 4942
4943 4943
4944 void v8::V8::SetEntropySource(EntropySource entropy_source) { 4944 void v8::V8::SetEntropySource(EntropySource entropy_source) {
4945 // The entropy source must be set before the library is initialized,
4946 // as otherwise not all random number generators will pick up the
4947 // entropy source and will fall back to weak entropy instead.
4948 i::Isolate* isolate = i::Isolate::UncheckedCurrent();
4949 ApiCheck(isolate != NULL && isolate->IsInitialized(),
4950 "v8::V8::SetEntropySource",
4951 "Cannot set entropy source once V8 is initialized.");
4952 i::RandomNumberGenerator::SetEntropySource(entropy_source); 4945 i::RandomNumberGenerator::SetEntropySource(entropy_source);
4953 } 4946 }
4954 4947
4955 4948
4956 void v8::V8::SetReturnAddressLocationResolver( 4949 void v8::V8::SetReturnAddressLocationResolver(
4957 ReturnAddressLocationResolver return_address_resolver) { 4950 ReturnAddressLocationResolver return_address_resolver) {
4958 i::V8::SetReturnAddressLocationResolver(return_address_resolver); 4951 i::V8::SetReturnAddressLocationResolver(return_address_resolver);
4959 } 4952 }
4960 4953
4961 4954
(...skipping 2573 matching lines...) Expand 10 before | Expand all | Expand 10 after
7535 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7528 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7536 Address callback_address = 7529 Address callback_address =
7537 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7530 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7538 VMState<EXTERNAL> state(isolate); 7531 VMState<EXTERNAL> state(isolate);
7539 ExternalCallbackScope call_scope(isolate, callback_address); 7532 ExternalCallbackScope call_scope(isolate, callback_address);
7540 callback(info); 7533 callback(info);
7541 } 7534 }
7542 7535
7543 7536
7544 } } // namespace v8::internal 7537 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698