Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 "content/browser/browser_main_loop.h" | 5 #include "content/browser/browser_main_loop.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 124 #include "ui/ozone/public/client_native_pixmap_factory.h" | 124 #include "ui/ozone/public/client_native_pixmap_factory.h" |
| 125 #include "ui/ozone/public/ozone_platform.h" | 125 #include "ui/ozone/public/ozone_platform.h" |
| 126 #endif | 126 #endif |
| 127 | 127 |
| 128 #if defined(OS_WIN) | 128 #if defined(OS_WIN) |
| 129 #include <windows.h> | 129 #include <windows.h> |
| 130 #include <commctrl.h> | 130 #include <commctrl.h> |
| 131 #include <shellapi.h> | 131 #include <shellapi.h> |
| 132 | 132 |
| 133 #include "base/memory/memory_pressure_monitor_win.h" | 133 #include "base/memory/memory_pressure_monitor_win.h" |
| 134 #include "base/win/windows_version.h" | |
| 134 #include "content/common/sandbox_win.h" | 135 #include "content/common/sandbox_win.h" |
| 135 #include "net/base/winsock_init.h" | 136 #include "net/base/winsock_init.h" |
| 136 #include "ui/base/l10n/l10n_util_win.h" | 137 #include "ui/base/l10n/l10n_util_win.h" |
| 137 #endif | 138 #endif |
| 138 | 139 |
| 139 #if defined(OS_CHROMEOS) | 140 #if defined(OS_CHROMEOS) |
| 140 #include "base/memory/memory_pressure_monitor_chromeos.h" | 141 #include "base/memory/memory_pressure_monitor_chromeos.h" |
| 141 #include "chromeos/chromeos_switches.h" | 142 #include "chromeos/chromeos_switches.h" |
| 142 #endif | 143 #endif |
| 143 | 144 |
| (...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1326 CAUSE_FOR_GPU_LAUNCH_BROWSER_STARTUP)); | 1327 CAUSE_FOR_GPU_LAUNCH_BROWSER_STARTUP)); |
| 1327 } | 1328 } |
| 1328 | 1329 |
| 1329 #if defined(OS_MACOSX) | 1330 #if defined(OS_MACOSX) |
| 1330 ThemeHelperMac::GetInstance(); | 1331 ThemeHelperMac::GetInstance(); |
| 1331 SystemHotkeyHelperMac::GetInstance()->DeferredLoadSystemHotkeys(); | 1332 SystemHotkeyHelperMac::GetInstance()->DeferredLoadSystemHotkeys(); |
| 1332 #endif // defined(OS_MACOSX) | 1333 #endif // defined(OS_MACOSX) |
| 1333 | 1334 |
| 1334 #endif // !defined(OS_IOS) | 1335 #endif // !defined(OS_IOS) |
| 1335 | 1336 |
| 1337 #if defined(OS_WIN) | |
| 1338 BrowserThread::PostDelayedTask( | |
| 1339 BrowserThread::FILE, FROM_HERE, | |
| 1340 base::Bind(&BrowserMainLoop::RecordWindowsVersionInformation), | |
| 1341 base::TimeDelta::FromSeconds(3)); | |
| 1342 #endif | |
| 1343 | |
| 1336 return result_code_; | 1344 return result_code_; |
| 1337 } | 1345 } |
| 1338 | 1346 |
| 1339 bool BrowserMainLoop::UsingInProcessGpu() const { | 1347 bool BrowserMainLoop::UsingInProcessGpu() const { |
| 1340 return parsed_command_line_.HasSwitch(switches::kSingleProcess) || | 1348 return parsed_command_line_.HasSwitch(switches::kSingleProcess) || |
| 1341 parsed_command_line_.HasSwitch(switches::kInProcessGPU); | 1349 parsed_command_line_.HasSwitch(switches::kInProcessGPU); |
| 1342 } | 1350 } |
| 1343 | 1351 |
| 1352 #if defined(OS_WIN) | |
| 1353 void BrowserMainLoop::RecordWindowsVersionInformation() { | |
|
ncarter (slow)
2016/03/10 18:19:27
Does this instrumentation belong in content or chr
ncarter (slow)
2016/03/10 18:21:40
Also, perhaps chrome_browser_main_extra_parts_metr
scottmg
2016/03/10 23:51:40
Done.
| |
| 1354 UMA_HISTOGRAM_ENUMERATION("Windows.GetVersionExVersion", | |
| 1355 base::win::OSInfo::GetInstance()->version(), | |
| 1356 base::win::VERSION_WIN_LAST); | |
|
grt (UTC plus 2)
2016/03/10 19:43:44
please add a doc comment to enum Version in window
scottmg
2016/03/10 23:51:40
Done.
| |
| 1357 UMA_HISTOGRAM_ENUMERATION("Windows.Kernel32Version", | |
| 1358 base::win::OSInfo::GetInstance()->Kernel32Version(), | |
| 1359 base::win::VERSION_WIN_LAST); | |
| 1360 UMA_HISTOGRAM_BOOLEAN( | |
| 1361 "Windows.InCompatibilityMode", | |
| 1362 base::win::OSInfo::GetInstance()->version() != | |
| 1363 base::win::OSInfo::GetInstance()->Kernel32Version()); | |
| 1364 } | |
| 1365 #endif // OS_WIN | |
| 1366 | |
| 1344 bool BrowserMainLoop::InitializeToolkit() { | 1367 bool BrowserMainLoop::InitializeToolkit() { |
| 1345 TRACE_EVENT0("startup", "BrowserMainLoop::InitializeToolkit"); | 1368 TRACE_EVENT0("startup", "BrowserMainLoop::InitializeToolkit"); |
| 1346 TRACK_SCOPED_REGION("Startup", "BrowserMainLoop::InitializeToolkit"); | 1369 TRACK_SCOPED_REGION("Startup", "BrowserMainLoop::InitializeToolkit"); |
| 1347 | 1370 |
| 1348 // TODO(evan): this function is rather subtle, due to the variety | 1371 // TODO(evan): this function is rather subtle, due to the variety |
| 1349 // of intersecting ifdefs we have. To keep it easy to follow, there | 1372 // of intersecting ifdefs we have. To keep it easy to follow, there |
| 1350 // are no #else branches on any #ifs. | 1373 // are no #else branches on any #ifs. |
| 1351 // TODO(stevenjb): Move platform specific code into platform specific Parts | 1374 // TODO(stevenjb): Move platform specific code into platform specific Parts |
| 1352 // (Need to add InitializeToolkit stage to BrowserParts). | 1375 // (Need to add InitializeToolkit stage to BrowserParts). |
| 1353 // See also GTK setup in EarlyInitialization, above, and associated comments. | 1376 // See also GTK setup in EarlyInitialization, above, and associated comments. |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1466 DCHECK(is_tracing_startup_for_duration_); | 1489 DCHECK(is_tracing_startup_for_duration_); |
| 1467 | 1490 |
| 1468 is_tracing_startup_for_duration_ = false; | 1491 is_tracing_startup_for_duration_ = false; |
| 1469 TracingController::GetInstance()->StopTracing( | 1492 TracingController::GetInstance()->StopTracing( |
| 1470 TracingController::CreateFileSink( | 1493 TracingController::CreateFileSink( |
| 1471 startup_trace_file_, | 1494 startup_trace_file_, |
| 1472 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); | 1495 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); |
| 1473 } | 1496 } |
| 1474 | 1497 |
| 1475 } // namespace content | 1498 } // namespace content |
| OLD | NEW |