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

Side by Side Diff: chrome/browser/chrome_browser_main_win.cc

Issue 792873004: Win32k lockdown: move to chrome://flags, add UMA, add finch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 6 years 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chrome_browser_main_win.h" 5 #include "chrome/browser/chrome_browser_main_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <shellapi.h> 8 #include <shellapi.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 230
231 // Windows 8+ provides a mode where by a process cannot call Win32K/GDI 231 // Windows 8+ provides a mode where by a process cannot call Win32K/GDI
232 // functions in the kernel (win32k.sys). If we are on Windows 8+ and if 232 // functions in the kernel (win32k.sys). If we are on Windows 8+ and if
233 // we are launched with the kEnableWin32kRendererLockDown switch then we 233 // we are launched with the kEnableWin32kRendererLockDown switch then we
234 // force the PDF pepper plugin to run out of process. This is because the 234 // force the PDF pepper plugin to run out of process. This is because the
235 // PDF plugin uses GDI for text rendering which does not work in the 235 // PDF plugin uses GDI for text rendering which does not work in the
236 // Win32K lockdown mode. Running it out of process ensures that the process 236 // Win32K lockdown mode. Running it out of process ensures that the process
237 // launched for the plugin does not have the Win32K lockdown mode enabled. 237 // launched for the plugin does not have the Win32K lockdown mode enabled.
238 // TODO(ananta) 238 // TODO(ananta)
239 // Revisit this when the pdf plugin uses skia and stops using GDI. 239 // Revisit this when the pdf plugin uses skia and stops using GDI.
240 if (CommandLine::ForCurrentProcess()->HasSwitch( 240 if (switches::IsWin32kRendererLockdownEnabled() &&
241 switches::kEnableWin32kRendererLockDown) &&
242 base::win::GetVersion() >= base::win::VERSION_WIN8) { 241 base::win::GetVersion() >= base::win::VERSION_WIN8) {
243 CommandLine::ForCurrentProcess()->AppendSwitch( 242 CommandLine::ForCurrentProcess()->AppendSwitch(
244 switches::kEnableOutOfProcessPdf); 243 switches::kEnableOutOfProcessPdf);
245 } 244 }
246 return rv; 245 return rv;
247 } 246 }
248 247
249 void ChromeBrowserMainPartsWin::ShowMissingLocaleMessageBox() { 248 void ChromeBrowserMainPartsWin::ShowMissingLocaleMessageBox() {
250 ui::MessageBox(NULL, 249 ui::MessageBox(NULL,
251 base::ASCIIToUTF16(chrome_browser::kMissingLocaleDataMessage), 250 base::ASCIIToUTF16(chrome_browser::kMissingLocaleDataMessage),
(...skipping 16 matching lines...) Expand all
268 content::BrowserThread::IO, FROM_HERE, 267 content::BrowserThread::IO, FROM_HERE,
269 base::Bind(ExecuteFontCacheBuildTask, path)); 268 base::Bind(ExecuteFontCacheBuildTask, path));
270 } 269 }
271 } 270 }
272 } 271 }
273 272
274 void ChromeBrowserMainPartsWin::PostBrowserStart() { 273 void ChromeBrowserMainPartsWin::PostBrowserStart() {
275 ChromeBrowserMainParts::PostBrowserStart(); 274 ChromeBrowserMainParts::PostBrowserStart();
276 275
277 UMA_HISTOGRAM_BOOLEAN("Windows.Tablet", base::win::IsTabletDevice()); 276 UMA_HISTOGRAM_BOOLEAN("Windows.Tablet", base::win::IsTabletDevice());
277 UMA_HISTOGRAM_BOOLEAN("Windows.Win32kRendererLockdown",
278 switches::IsWin32kRendererLockdownEnabled());
278 279
279 // Set up a task to verify installed modules in the current process. Use a 280 // Set up a task to verify installed modules in the current process. Use a
280 // delay to reduce the impact on startup time. 281 // delay to reduce the impact on startup time.
281 content::BrowserThread::GetMessageLoopProxyForThread( 282 content::BrowserThread::GetMessageLoopProxyForThread(
282 content::BrowserThread::UI)->PostDelayedTask( 283 content::BrowserThread::UI)->PostDelayedTask(
283 FROM_HERE, 284 FROM_HERE,
284 base::Bind(&VerifyInstallation), 285 base::Bind(&VerifyInstallation),
285 base::TimeDelta::FromSeconds(45)); 286 base::TimeDelta::FromSeconds(45));
286 287
287 InitializeChromeElf(); 288 InitializeChromeElf();
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 if (resource_id) 476 if (resource_id)
476 return l10n_util::GetStringUTF16(resource_id); 477 return l10n_util::GetStringUTF16(resource_id);
477 return base::string16(); 478 return base::string16();
478 } 479 }
479 480
480 // static 481 // static
481 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { 482 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() {
482 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); 483 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ());
483 installer::SetTranslationDelegate(&delegate); 484 installer::SetTranslationDelegate(&delegate);
484 } 485 }
OLDNEW
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698