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

Unified Diff: src/bootstrapper.cc

Issue 130213009: Various extension-related cleanup and simplifications. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Whitespace Created 6 years, 11 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 | « src/bootstrapper.h ('k') | src/extensions/externalize-string-extension.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index 288cac20a81d7c045abac75564c4a48e7d726bfd..97364ca6999a6f35816fd2bde788b71bf1ed0632 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -101,12 +101,39 @@ void Bootstrapper::Initialize(bool create_heap_objects) {
}
+static const char* GCFunctionName() {
+ bool flag_given = FLAG_expose_gc_as != NULL && strlen(FLAG_expose_gc_as) != 0;
+ return flag_given ? FLAG_expose_gc_as : "gc";
+}
+
+
+v8::Extension* Bootstrapper::free_buffer_extension_ = NULL;
+v8::Extension* Bootstrapper::gc_extension_ = NULL;
+v8::Extension* Bootstrapper::externalize_string_extension_ = NULL;
+v8::Extension* Bootstrapper::statistics_extension_ = NULL;
+v8::Extension* Bootstrapper::trigger_failure_extension_ = NULL;
+
+
void Bootstrapper::InitializeOncePerProcess() {
- FreeBufferExtension::Register();
- GCExtension::Register();
- ExternalizeStringExtension::Register();
- StatisticsExtension::Register();
- TriggerFailureExtension::Register();
+ free_buffer_extension_ = new FreeBufferExtension;
+ v8::RegisterExtension(free_buffer_extension_);
+ gc_extension_ = new GCExtension(GCFunctionName());
+ v8::RegisterExtension(gc_extension_);
+ externalize_string_extension_ = new ExternalizeStringExtension;
+ v8::RegisterExtension(externalize_string_extension_);
+ statistics_extension_ = new StatisticsExtension;
+ v8::RegisterExtension(statistics_extension_);
+ trigger_failure_extension_ = new TriggerFailureExtension;
+ v8::RegisterExtension(trigger_failure_extension_);
+}
+
+
+void Bootstrapper::TearDownExtensions() {
+ delete free_buffer_extension_;
+ delete gc_extension_;
+ delete externalize_string_extension_;
+ delete statistics_extension_;
+ delete trigger_failure_extension_;
}
« no previous file with comments | « src/bootstrapper.h ('k') | src/extensions/externalize-string-extension.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698