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

Unified Diff: webkit/port/bindings/v8/v8_proxy.cpp

Issue 10719: Add GCController support to test_shell.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 1 month 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 | « webkit/port/bindings/v8/ScriptController.cpp ('k') | webkit/tools/test_shell/node_leak_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/port/bindings/v8/v8_proxy.cpp
===================================================================
--- webkit/port/bindings/v8/v8_proxy.cpp (revision 5396)
+++ webkit/port/bindings/v8/v8_proxy.cpp (working copy)
@@ -1826,8 +1826,23 @@
V8Custom::v8DOMWindowIndexedSecurityCheck,
v8::Integer::New(V8ClassIndex::DOMWINDOW));
- // Create a new context.
- m_context = v8::Context::New(NULL, global_template, m_global);
+ if (ScriptController::shouldExposeGCController()) {
+ v8::RegisterExtension(new v8::Extension("v8/GCController",
+ "(function v8_GCController() {"
+ " var v8_gc;"
+ " if (gc) v8_gc = gc;"
+ " GCController = new Object();"
+ " GCController.collect ="
+ " function() {if (v8_gc) v8_gc(); };"
Mike Belshe 2008/11/14 01:11:54 Cool - in JS! Could this be just: if (gc) gc(
+ " })()"));
+ const char* extension_names[] = { "v8/GCController" };
+ v8::ExtensionConfiguration extensions(1, extension_names);
+ // Create a new context.
+ m_context = v8::Context::New(&extensions, global_template, m_global);
+ } else {
+ m_context = v8::Context::New(NULL, global_template, m_global);
+ }
+
if (m_context.IsEmpty())
return;
« no previous file with comments | « webkit/port/bindings/v8/ScriptController.cpp ('k') | webkit/tools/test_shell/node_leak_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698