AtomBrowserMainParts::AtomBrowserMainParts()
: browser_(new Browser),
node_bindings_(NodeBindings::Create(true)),
- atom_bindings_(new AtomBindings) {
+ atom_bindings_(new AtomBindings),
+ gc_timer_(true, true) {
DCHECK(!self_) << "Cannot have two AtomBrowserMainParts";
self_ = this;
}
node_bindings_->PrepareMessageLoop();
node_bindings_->RunMessageLoop();
+ // Start idle gc.
+ gc_timer_.Start(
+ FROM_HERE, base::TimeDelta::FromMinutes(1),
+ base::Bind(base::IgnoreResult(&v8::Isolate::IdleNotification),
+ base::Unretained(js_env_->isolate()),
+ 1000));
+
brightray::BrowserMainParts::PreMainMessageLoopRun();
#if defined(USE_X11)
#ifndef ATOM_BROWSER_ATOM_BROWSER_MAIN_PARTS_H_
#define ATOM_BROWSER_ATOM_BROWSER_MAIN_PARTS_H_
+#include "base/timer/timer.h"
#include "brightray/browser/browser_main_parts.h"
namespace atom {
scoped_ptr<AtomBindings> atom_bindings_;
scoped_ptr<NodeDebugger> node_debugger_;
+ base::Timer gc_timer_;
+
static AtomBrowserMainParts* self_;
DISALLOW_COPY_AND_ASSIGN(AtomBrowserMainParts);