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

Unified Diff: chrome/browser/chrome_browser_main_win.cc

Issue 16896018: Enable high resolution time for TimeTicks::Now on Windows Canary (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix TrackedTime Created 7 years, 4 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
Index: chrome/browser/chrome_browser_main_win.cc
diff --git a/chrome/browser/chrome_browser_main_win.cc b/chrome/browser/chrome_browser_main_win.cc
index b9ef21059b6c938b3ff2e009f551ec40a85d85fe..c2caf7bd1ca9407c0c0d6ed1e8b33277d064dde1 100644
--- a/chrome/browser/chrome_browser_main_win.cc
+++ b/chrome/browser/chrome_browser_main_win.cc
@@ -30,6 +30,7 @@
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_result_codes.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/chrome_version_info.h"
#include "chrome/common/env_vars.h"
#include "chrome/installer/launcher_support/chrome_launcher_support.h"
#include "chrome/installer/util/browser_distribution.h"
@@ -141,11 +142,26 @@ int DoUninstallTasks(bool chrome_still_running) {
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::MaybeEnableHighResNowEverywhere();
+ 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) {
+ MaybeEnableHighResolutionTimeEverywhere();
if (base::win::IsMetroProcess()) {
typedef const wchar_t* (*GetMetroSwitches)(void);
GetMetroSwitches metro_switches_proc = reinterpret_cast<GetMetroSwitches>(

Powered by Google App Engine
This is Rietveld 408576698