summaryrefslogtreecommitdiffstats
path: root/content/app/content_main_runner.cc
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-04 11:10:51 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-04 11:10:51 +0000
commit6c72e093fc68313c0b3977e01ef140a698ad6fc6 (patch)
treec9756acd26813c633942c8ff3a699988772dc52b /content/app/content_main_runner.cc
parent82ba6a405f3f83ae5dd4b304c1eb5f8a01b91c43 (diff)
downloadchromium_src-6c72e093fc68313c0b3977e01ef140a698ad6fc6.zip
chromium_src-6c72e093fc68313c0b3977e01ef140a698ad6fc6.tar.gz
chromium_src-6c72e093fc68313c0b3977e01ef140a698ad6fc6.tar.bz2
Pass the device scale factor in the command line to renderer processes.
This is to ensure that we don't use GDI to query the device scale factor in renderer processes. This is in preparation for setting the MITIGATION_WIN32K_DISABLE policy on renderer processes, which will lock them out from making user32/gdi32 calls which enter win32k.sys. BUG=365160 Review URL: https://codereview.chromium.org/308003020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274766 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/app/content_main_runner.cc')
-rw-r--r--content/app/content_main_runner.cc18
1 files changed, 17 insertions, 1 deletions
diff --git a/content/app/content_main_runner.cc b/content/app/content_main_runner.cc
index 24a5289..8c767321 100644
--- a/content/app/content_main_runner.cc
+++ b/content/app/content_main_runner.cc
@@ -49,7 +49,6 @@
#include "sandbox/win/src/sandbox_types.h"
#include "ui/base/ui_base_paths.h"
#include "ui/base/ui_base_switches.h"
-#include "ui/gfx/win/dpi.h"
#if defined(USE_TCMALLOC)
#include "third_party/tcmalloc/chromium/src/gperftools/malloc_extension.h"
@@ -74,6 +73,10 @@
#include <atlapp.h>
#include <malloc.h>
#include <cstring>
+
+#include "base/strings/string_number_conversions.h"
+#include "ui/base/win/dpi_setup.h"
+#include "ui/gfx/win/dpi.h"
#elif defined(OS_MACOSX)
#include "base/mac/scoped_nsautorelease_pool.h"
#if !defined(OS_IOS)
@@ -658,6 +661,19 @@ class ContentMainRunnerImpl : public ContentMainRunner {
if (command_line.HasSwitch(switches::kEnableHighResolutionTime))
base::TimeTicks::SetNowIsHighResNowIfSupported();
+ bool init_device_scale_factor = true;
+ if (command_line.HasSwitch(switches::kDeviceScaleFactor)) {
+ std::string scale_factor_string = command_line.GetSwitchValueASCII(
+ switches::kDeviceScaleFactor);
+ double scale_factor = 0;
+ if (base::StringToDouble(scale_factor_string, &scale_factor)) {
+ init_device_scale_factor = false;
+ gfx::InitDeviceScaleFactor(scale_factor);
+ }
+ }
+ if (init_device_scale_factor)
+ ui::win::InitDeviceScaleFactor();
+
SetupCRT(command_line);
#endif