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

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

Issue 1671063002: Enable deferred free for syzyasan builds behind a feature. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/common/chrome_features.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 #include "chrome/browser/ui/browser.h" 83 #include "chrome/browser/ui/browser.h"
84 #include "chrome/browser/ui/browser_finder.h" 84 #include "chrome/browser/ui/browser_finder.h"
85 #include "chrome/browser/ui/host_desktop.h" 85 #include "chrome/browser/ui/host_desktop.h"
86 #include "chrome/browser/ui/startup/bad_flags_prompt.h" 86 #include "chrome/browser/ui/startup/bad_flags_prompt.h"
87 #include "chrome/browser/ui/startup/default_browser_prompt.h" 87 #include "chrome/browser/ui/startup/default_browser_prompt.h"
88 #include "chrome/browser/ui/startup/startup_browser_creator.h" 88 #include "chrome/browser/ui/startup/startup_browser_creator.h"
89 #include "chrome/browser/ui/uma_browsing_activity_observer.h" 89 #include "chrome/browser/ui/uma_browsing_activity_observer.h"
90 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" 90 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h"
91 #include "chrome/common/channel_info.h" 91 #include "chrome/common/channel_info.h"
92 #include "chrome/common/chrome_constants.h" 92 #include "chrome/common/chrome_constants.h"
93 #include "chrome/common/chrome_features.h"
93 #include "chrome/common/chrome_paths.h" 94 #include "chrome/common/chrome_paths.h"
94 #include "chrome/common/chrome_result_codes.h" 95 #include "chrome/common/chrome_result_codes.h"
95 #include "chrome/common/chrome_switches.h" 96 #include "chrome/common/chrome_switches.h"
96 #include "chrome/common/crash_keys.h" 97 #include "chrome/common/crash_keys.h"
97 #include "chrome/common/env_vars.h" 98 #include "chrome/common/env_vars.h"
98 #include "chrome/common/features.h" 99 #include "chrome/common/features.h"
99 #include "chrome/common/logging_chrome.h" 100 #include "chrome/common/logging_chrome.h"
100 #include "chrome/common/net/net_resource_provider.h" 101 #include "chrome/common/net/net_resource_provider.h"
101 #include "chrome/common/pref_names.h" 102 #include "chrome/common/pref_names.h"
102 #include "chrome/common/profiling.h" 103 #include "chrome/common/profiling.h"
(...skipping 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after
1175 chrome_extra_parts_[i]->PostProfileInit(); 1176 chrome_extra_parts_[i]->PostProfileInit();
1176 } 1177 }
1177 1178
1178 void ChromeBrowserMainParts::PreBrowserStart() { 1179 void ChromeBrowserMainParts::PreBrowserStart() {
1179 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreBrowserStart"); 1180 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreBrowserStart");
1180 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i) 1181 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i)
1181 chrome_extra_parts_[i]->PreBrowserStart(); 1182 chrome_extra_parts_[i]->PreBrowserStart();
1182 1183
1183 three_d_observer_.reset(new ThreeDAPIObserver()); 1184 three_d_observer_.reset(new ThreeDAPIObserver());
1184 1185
1186 #if defined(SYZYASAN)
1187 // Enable the deferred free mechanism in the syzyasan module, which helps the
1188 // performance by deferring some work on the critical path to a background
1189 // thread.
1190 if (base::FeatureList::IsEnabled(features::kSyzyasanDeferredFree)) {
1191 typedef VOID(WINAPI * SyzyasanEnableDeferredFreeThreadFunc)(VOID);
1192 HMODULE SyzyasanModuleHandle = ::GetModuleHandle(L"syzyasan_rtl.dll");
chrisha 2016/03/17 18:35:28 euhh... snake_style variable names instead of Came
Georges Khalil 2016/03/17 19:34:39 Oops, I was looking at Windows code for too long :
1193 bool success = false;
1194 if (SyzyasanModuleHandle) {
1195 SyzyasanEnableDeferredFreeThreadFunc EnableDeferredFreeThread =
chrisha 2016/03/17 18:35:28 ditto
Georges Khalil 2016/03/17 19:34:39 Done.
1196 reinterpret_cast<SyzyasanEnableDeferredFreeThreadFunc>(
1197 ::GetProcAddress(SyzyasanModuleHandle,
1198 "asan_EnableDeferredFreeThread"));
1199 if (EnableDeferredFreeThread) {
1200 EnableDeferredFreeThread();
1201 success = true;
1202 }
1203 }
1204 UMA_HISTOGRAM_BOOLEAN("Syzyasan.DeferredFreeWasEnabled", success);
1205 }
1206 #endif
1207
1185 // Start the tab manager here so that we give the most amount of time for the 1208 // Start the tab manager here so that we give the most amount of time for the
1186 // other services to start up before we start adjusting the oom priority. 1209 // other services to start up before we start adjusting the oom priority.
1187 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_CHROMEOS) 1210 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_CHROMEOS)
1188 g_browser_process->GetTabManager()->Start(); 1211 g_browser_process->GetTabManager()->Start();
1189 #endif 1212 #endif
1190 } 1213 }
1191 1214
1192 void ChromeBrowserMainParts::PostBrowserStart() { 1215 void ChromeBrowserMainParts::PostBrowserStart() {
1193 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PostBrowserStart"); 1216 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PostBrowserStart");
1194 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i) 1217 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i)
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
1872 chromeos::CrosSettings::Shutdown(); 1895 chromeos::CrosSettings::Shutdown();
1873 #endif // defined(OS_CHROMEOS) 1896 #endif // defined(OS_CHROMEOS)
1874 #endif // defined(OS_ANDROID) 1897 #endif // defined(OS_ANDROID)
1875 } 1898 }
1876 1899
1877 // Public members: 1900 // Public members:
1878 1901
1879 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { 1902 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) {
1880 chrome_extra_parts_.push_back(parts); 1903 chrome_extra_parts_.push_back(parts);
1881 } 1904 }
OLDNEW
« no previous file with comments | « no previous file | chrome/common/chrome_features.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698