Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: shell/src/GcCommand.cpp

Issue 9763002: Add command to initiate garbage collection (Closed)
Patch Set: Created March 11, 2013, 11:07 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « shell/src/GcCommand.h ('k') | shell/src/Main.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: shell/src/GcCommand.cpp
===================================================================
new file mode 100644
--- /dev/null
+++ b/shell/src/GcCommand.cpp
@@ -0,0 +1,21 @@
+#include "GcCommand.h"
+
+GcCommand::GcCommand(AdblockPlus::JsEngine& jsEngine)
+ : Command("gc"), jsEngine(jsEngine)
+{
+}
+
+void GcCommand::operator()(const std::string& arguments)
+{
+ jsEngine.Gc();
+}
+
+std::string GcCommand::GetDescription() const
+{
+ return "Initiates a garbage collection";
+}
+
+std::string GcCommand::GetUsage() const
+{
+ return name;
+}
« no previous file with comments | « shell/src/GcCommand.h ('k') | shell/src/Main.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld