From 9fcf7eb27c1f13f5007daefef2c2bc7cb5089be2 Mon Sep 17 00:00:00 2001 From: Felix Rieseberg Date: Tue, 3 Oct 2017 10:21:31 -0700 Subject: [PATCH] :wrench: Don't call GetIdleWakeupsPerSecond on Win --- atom/common/api/atom_bindings.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/atom/common/api/atom_bindings.cc b/atom/common/api/atom_bindings.cc index d8c21d63509..c2b158b0ce2 100644 --- a/atom/common/api/atom_bindings.cc +++ b/atom/common/api/atom_bindings.cc @@ -188,7 +188,14 @@ v8::Local AtomBindings::GetCPUUsage(v8::Isolate* isolate) { int processor_count = base::SysInfo::NumberOfProcessors(); dict.Set("percentCPUUsage", metrics_->GetPlatformIndependentCPUUsage() / processor_count); + + // NB: This will throw NOTIMPLEMENTED() on Windows + // For backwards compatibility, we'll return 0 +#if !defined(OS_WIN) dict.Set("idleWakeupsPerSecond", metrics_->GetIdleWakeupsPerSecond()); +#else + dict.Set("idleWakeupsPerSecond", 0); +#endif return dict.GetHandle(); }