summaryrefslogtreecommitdiffstats
path: root/webkit/port/bindings/v8/extensions/GCController.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/port/bindings/v8/extensions/GCController.cpp')
-rw-r--r--webkit/port/bindings/v8/extensions/GCController.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/webkit/port/bindings/v8/extensions/GCController.cpp b/webkit/port/bindings/v8/extensions/GCController.cpp
new file mode 100644
index 0000000..1b514f5
--- /dev/null
+++ b/webkit/port/bindings/v8/extensions/GCController.cpp
@@ -0,0 +1,24 @@
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "GCController.h"
+
+namespace WebCore {
+
+const char* kGCExtensionName = "v8/GCController";
+
+v8::Extension* GCExtension::Get() {
+ v8::Extension* extension = new v8::Extension(
+ kGCExtensionName,
+ "(function () {"
+ " var v8_gc;"
+ " if (gc) v8_gc = gc;"
+ " GCController = new Object();"
+ " GCController.collect ="
+ " function() {if (v8_gc) v8_gc(); };"
+ " })()");
+ return extension;
+}
+
+}