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 "chrome/browser/chrome_browser_main.h" | 5 #include "chrome/browser/chrome_browser_main.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 #include "chrome/browser/ui/browser.h" | 86 #include "chrome/browser/ui/browser.h" |
87 #include "chrome/browser/ui/browser_finder.h" | 87 #include "chrome/browser/ui/browser_finder.h" |
88 #include "chrome/browser/ui/host_desktop.h" | 88 #include "chrome/browser/ui/host_desktop.h" |
89 #include "chrome/browser/ui/startup/bad_flags_prompt.h" | 89 #include "chrome/browser/ui/startup/bad_flags_prompt.h" |
90 #include "chrome/browser/ui/startup/default_browser_prompt.h" | 90 #include "chrome/browser/ui/startup/default_browser_prompt.h" |
91 #include "chrome/browser/ui/startup/startup_browser_creator.h" | 91 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
92 #include "chrome/browser/ui/uma_browsing_activity_observer.h" | 92 #include "chrome/browser/ui/uma_browsing_activity_observer.h" |
93 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" | 93 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" |
94 #include "chrome/common/channel_info.h" | 94 #include "chrome/common/channel_info.h" |
95 #include "chrome/common/chrome_constants.h" | 95 #include "chrome/common/chrome_constants.h" |
| 96 #include "chrome/common/chrome_features.h" |
96 #include "chrome/common/chrome_paths.h" | 97 #include "chrome/common/chrome_paths.h" |
97 #include "chrome/common/chrome_result_codes.h" | 98 #include "chrome/common/chrome_result_codes.h" |
98 #include "chrome/common/chrome_switches.h" | 99 #include "chrome/common/chrome_switches.h" |
99 #include "chrome/common/crash_keys.h" | 100 #include "chrome/common/crash_keys.h" |
100 #include "chrome/common/env_vars.h" | 101 #include "chrome/common/env_vars.h" |
101 #include "chrome/common/features.h" | 102 #include "chrome/common/features.h" |
102 #include "chrome/common/logging_chrome.h" | 103 #include "chrome/common/logging_chrome.h" |
103 #include "chrome/common/media/media_resource_provider.h" | 104 #include "chrome/common/media/media_resource_provider.h" |
104 #include "chrome/common/net/net_resource_provider.h" | 105 #include "chrome/common/net/net_resource_provider.h" |
105 #include "chrome/common/pref_names.h" | 106 #include "chrome/common/pref_names.h" |
(...skipping 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1197 chrome_extra_parts_[i]->PostProfileInit(); | 1198 chrome_extra_parts_[i]->PostProfileInit(); |
1198 } | 1199 } |
1199 | 1200 |
1200 void ChromeBrowserMainParts::PreBrowserStart() { | 1201 void ChromeBrowserMainParts::PreBrowserStart() { |
1201 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreBrowserStart"); | 1202 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreBrowserStart"); |
1202 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i) | 1203 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i) |
1203 chrome_extra_parts_[i]->PreBrowserStart(); | 1204 chrome_extra_parts_[i]->PreBrowserStart(); |
1204 | 1205 |
1205 three_d_observer_.reset(new ThreeDAPIObserver()); | 1206 three_d_observer_.reset(new ThreeDAPIObserver()); |
1206 | 1207 |
| 1208 #if defined(SYZYASAN) |
| 1209 // Enable the deferred free mechanism in the syzyasan module, which helps the |
| 1210 // performance by deferring some work on the critical path to a background |
| 1211 // thread. |
| 1212 if (base::FeatureList::IsEnabled(features::kSyzyasanDeferredFree)) { |
| 1213 typedef VOID(WINAPI * SyzyasanEnableDeferredFreeThreadFunc)(VOID); |
| 1214 HMODULE syzyasan_handle = ::GetModuleHandle(L"syzyasan_rtl.dll"); |
| 1215 bool success = false; |
| 1216 if (syzyasan_handle) { |
| 1217 SyzyasanEnableDeferredFreeThreadFunc syzyasan_enable_deferred_free = |
| 1218 reinterpret_cast<SyzyasanEnableDeferredFreeThreadFunc>( |
| 1219 ::GetProcAddress(syzyasan_handle, |
| 1220 "asan_EnableDeferredFreeThread")); |
| 1221 if (syzyasan_enable_deferred_free) { |
| 1222 syzyasan_enable_deferred_free(); |
| 1223 success = true; |
| 1224 } |
| 1225 } |
| 1226 UMA_HISTOGRAM_BOOLEAN("Syzyasan.DeferredFreeWasEnabled", success); |
| 1227 } |
| 1228 #endif |
| 1229 |
1207 // Start the tab manager here so that we give the most amount of time for the | 1230 // Start the tab manager here so that we give the most amount of time for the |
1208 // other services to start up before we start adjusting the oom priority. | 1231 // other services to start up before we start adjusting the oom priority. |
1209 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_CHROMEOS) | 1232 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_CHROMEOS) |
1210 g_browser_process->GetTabManager()->Start(); | 1233 g_browser_process->GetTabManager()->Start(); |
1211 #endif | 1234 #endif |
1212 } | 1235 } |
1213 | 1236 |
1214 void ChromeBrowserMainParts::PostBrowserStart() { | 1237 void ChromeBrowserMainParts::PostBrowserStart() { |
1215 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PostBrowserStart"); | 1238 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PostBrowserStart"); |
1216 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i) | 1239 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i) |
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1894 chromeos::CrosSettings::Shutdown(); | 1917 chromeos::CrosSettings::Shutdown(); |
1895 #endif // defined(OS_CHROMEOS) | 1918 #endif // defined(OS_CHROMEOS) |
1896 #endif // defined(OS_ANDROID) | 1919 #endif // defined(OS_ANDROID) |
1897 } | 1920 } |
1898 | 1921 |
1899 // Public members: | 1922 // Public members: |
1900 | 1923 |
1901 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 1924 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
1902 chrome_extra_parts_.push_back(parts); | 1925 chrome_extra_parts_.push_back(parts); |
1903 } | 1926 } |
OLD | NEW |