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

Unified Diff: trunk/src/chrome/browser/chrome_browser_main_win.cc

Issue 45783003: Revert 230968 "Use HighResNow whenever possible on Windows." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 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 | trunk/src/content/app/content_main_runner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/chrome/browser/chrome_browser_main_win.cc
===================================================================
--- trunk/src/chrome/browser/chrome_browser_main_win.cc (revision 231150)
+++ trunk/src/chrome/browser/chrome_browser_main_win.cc (working copy)
@@ -144,12 +144,26 @@
return result;
}
+void MaybeEnableHighResolutionTimeEverywhere() {
+ chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
+ bool user_enabled = CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableHighResolutionTime);
+ if (user_enabled || channel == chrome::VersionInfo::CHANNEL_CANARY) {
+ bool is_enabled = base::TimeTicks::SetNowIsHighResNowIfSupported();
+ if (is_enabled && !user_enabled) {
+ // Ensure that all of the renderers will enable it too.
+ CommandLine::ForCurrentProcess()->AppendSwitch(
+ switches::kEnableHighResolutionTime);
+ }
+ }
+}
+
// ChromeBrowserMainPartsWin ---------------------------------------------------
ChromeBrowserMainPartsWin::ChromeBrowserMainPartsWin(
const content::MainFunctionParams& parameters)
: ChromeBrowserMainParts(parameters) {
- base::TimeTicks::SetNowIsHighResNowIfSupported();
+ MaybeEnableHighResolutionTimeEverywhere();
if (base::win::IsMetroProcess()) {
typedef const wchar_t* (*GetMetroSwitches)(void);
GetMetroSwitches metro_switches_proc = reinterpret_cast<GetMetroSwitches>(
« no previous file with comments | « no previous file | trunk/src/content/app/content_main_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698