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

Unified Diff: content/renderer/devtools/devtools_cpu_throttler.cc

Issue 2403253002: DevTools: Fix CPU page becoming unresponsive with timeline CPU throttling on Win (Closed)
Patch Set: Created 4 years, 2 months 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/devtools/devtools_cpu_throttler.cc
diff --git a/content/renderer/devtools/devtools_cpu_throttler.cc b/content/renderer/devtools/devtools_cpu_throttler.cc
index 277d863492523b8bacdac0771bc5521dbefb75a2..41d4f6b98127ee13f2af92d4e93e5b7713a9cab6 100644
--- a/content/renderer/devtools/devtools_cpu_throttler.cc
+++ b/content/renderer/devtools/devtools_cpu_throttler.cc
@@ -66,7 +66,12 @@ Atomic32 CPUThrottlingThread::suspended_;
Atomic32 CPUThrottlingThread::thread_exists_;
CPUThrottlingThread::CPUThrottlingThread(double rate)
+#ifdef OS_WIN
+ : throttled_thread_handle_(
+ ::OpenThread(THREAD_SUSPEND_RESUME, false, ::GetCurrentThreadId())),
+#else
: throttled_thread_handle_(base::PlatformThread::CurrentHandle()),
+#endif
throttling_rate_percent_(static_cast<Atomic32>(rate * 100)) {
CHECK(base::subtle::NoBarrier_AtomicExchange(&thread_exists_, 1) == 0);
Start();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698