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

Unified Diff: chrome/browser/power/process_power_collector.cc

Issue 2329693002: Speculative fix to VS 2015 code-gen bug (Closed)
Patch Set: Add #ifdefs Created 4 years, 3 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: chrome/browser/power/process_power_collector.cc
diff --git a/chrome/browser/power/process_power_collector.cc b/chrome/browser/power/process_power_collector.cc
index 19c0f6375a25dd878728a5b6060a2f6f66c49970..9c8fc3e9ecf0296f898f8db27711fc401a0294cd 100644
--- a/chrome/browser/power/process_power_collector.cc
+++ b/chrome/browser/power/process_power_collector.cc
@@ -94,6 +94,11 @@ void ProcessPowerCollector::StartTimer() {
&ProcessPowerCollector::HandleUpdateTimeout);
}
+// Work around VS 2015 code-gen bug, seen in Update 2 and Update 3.
+// crbug.com/640588
+#if defined(COMPILER_MSVC)
+#pragma optimize("", off)
+#endif
double ProcessPowerCollector::UpdatePowerConsumption() {
double total_cpu_percent = SynchronizeProcesses();
@@ -108,6 +113,9 @@ double ProcessPowerCollector::UpdatePowerConsumption() {
void ProcessPowerCollector::HandleUpdateTimeout() {
UpdatePowerConsumption();
}
+#if defined(COMPILER_MSVC)
+#pragma optimize("", on)
+#endif
double ProcessPowerCollector::SynchronizeProcesses() {
// Update all tabs.
« 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