Make sure we register extensions only once. Removed unused member variable.
V8::Initialize() can be called from various threads simultaneously, so everything should be done only once per process or within the Isolate. For registering extensions, we do the former now. R=dslomov@chromium.org Review URL: https://codereview.chromium.org/15564002 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14730 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
8743661682
commit
4a7ed948fe
@ -149,12 +149,10 @@ class RegisteredExtension {
|
||||
static void UnregisterAll();
|
||||
Extension* extension() { return extension_; }
|
||||
RegisteredExtension* next() { return next_; }
|
||||
RegisteredExtension* next_auto() { return next_auto_; }
|
||||
static RegisteredExtension* first_extension() { return first_extension_; }
|
||||
private:
|
||||
Extension* extension_;
|
||||
RegisteredExtension* next_;
|
||||
RegisteredExtension* next_auto_;
|
||||
static RegisteredExtension* first_extension_;
|
||||
};
|
||||
|
||||
|
@ -95,6 +95,10 @@ Handle<String> Bootstrapper::NativesSourceLookup(int index) {
|
||||
|
||||
void Bootstrapper::Initialize(bool create_heap_objects) {
|
||||
extensions_cache_.Initialize(create_heap_objects);
|
||||
}
|
||||
|
||||
|
||||
void Bootstrapper::InitializeOncePerProcess() {
|
||||
GCExtension::Register();
|
||||
ExternalizeStringExtension::Register();
|
||||
StatisticsExtension::Register();
|
||||
|
@ -88,6 +88,8 @@ class SourceCodeCache BASE_EMBEDDED {
|
||||
// context.
|
||||
class Bootstrapper {
|
||||
public:
|
||||
static void InitializeOncePerProcess();
|
||||
|
||||
// Requires: Heap::SetUp has been called.
|
||||
void Initialize(bool create_heap_objects);
|
||||
void TearDown();
|
||||
|
Loading…
Reference in New Issue
Block a user