summaryrefslogtreecommitdiffstats
path: root/webkit/support/gc_extension.cc
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-18 19:26:37 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-18 19:26:37 +0000
commitf45c5f3d74273e913c62598fcbde35e20924ab50 (patch)
tree6364e206042679e527802f2214132138a731e826 /webkit/support/gc_extension.cc
parent55410d7379f605f828d9845ee1ae8f62c0b0b145 (diff)
downloadchromium_src-f45c5f3d74273e913c62598fcbde35e20924ab50.zip
chromium_src-f45c5f3d74273e913c62598fcbde35e20924ab50.tar.gz
chromium_src-f45c5f3d74273e913c62598fcbde35e20924ab50.tar.bz2
Cleanup of v8 extension stuff. Playback extension is only used in chrome, so move it to chrome\renderer and all of its associated switches to chrome. GC extension is only used by webkit\support, so move it there. The other two profiler extensions aren't used, so remove them.
Review URL: https://chromiumcodereview.appspot.com/10117022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132841 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/support/gc_extension.cc')
-rw-r--r--webkit/support/gc_extension.cc27
1 files changed, 27 insertions, 0 deletions
diff --git a/webkit/support/gc_extension.cc b/webkit/support/gc_extension.cc
new file mode 100644
index 0000000..44c3e11
--- /dev/null
+++ b/webkit/support/gc_extension.cc
@@ -0,0 +1,27 @@
+// Copyright (c) 2011 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 "webkit/support/gc_extension.h"
+
+#include "v8/include/v8.h"
+
+const char kGCExtensionName[] = "v8/GCController";
+
+namespace extensions_v8 {
+
+// static
+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;
+}
+
+} // namespace extensions_v8