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 "chrome/browser/chrome_browser_main.h" | 5 #include "chrome/browser/chrome_browser_main.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1155 | 1155 |
| 1156 three_d_observer_.reset(new ThreeDAPIObserver()); | 1156 three_d_observer_.reset(new ThreeDAPIObserver()); |
| 1157 | 1157 |
| 1158 // Start the out-of-memory priority manager here so that we give the most | 1158 // Start the out-of-memory priority manager here so that we give the most |
| 1159 // amount of time for the other services to start up before we start | 1159 // amount of time for the other services to start up before we start |
| 1160 // adjusting the oom priority. | 1160 // adjusting the oom priority. |
| 1161 // | 1161 // |
| 1162 // On CrOS, it is always enabled. On other platforms, it's behind a flag for | 1162 // On CrOS, it is always enabled. On other platforms, it's behind a flag for |
| 1163 // now. | 1163 // now. |
| 1164 #if defined(OS_CHROMEOS) | 1164 #if defined(OS_CHROMEOS) |
| 1165 g_browser_process->GetOomPriorityManager()->Start(); | 1165 g_browser_process->GetOomPriorityManager()->Start(false); |
| 1166 #elif defined(OS_WIN) || defined(OS_MACOSX) | 1166 #elif defined(OS_WIN) || defined(OS_MACOSX) |
| 1167 const std::string group_name = | 1167 const std::string group_name = |
| 1168 base::FieldTrialList::FindFullName("AutomaticTabDiscarding"); | 1168 base::FieldTrialList::FindFullName("AutomaticTabDiscarding"); |
| 1169 if (parsed_command_line().HasSwitch(switches::kEnableTabDiscarding) || | 1169 if (parsed_command_line().HasSwitch(switches::kEnableTabDiscarding) || |
| 1170 base::StartsWith(group_name, "Enabled", base::CompareCase::SENSITIVE)) { | 1170 base::StartsWith(group_name, "Enabled", base::CompareCase::SENSITIVE)) { |
| 1171 g_browser_process->GetOomPriorityManager()->Start(); | 1171 g_browser_process->GetOomPriorityManager()->Start(group_name == |
|
rkaplow
2015/09/11 21:07:03
suggest using StartsWith
Georges Khalil
2015/09/14 18:17:48
Done.
| |
| 1172 "Enabled_Once"); | |
| 1172 } | 1173 } |
| 1173 #endif | 1174 #endif |
| 1174 } | 1175 } |
| 1175 | 1176 |
| 1176 void ChromeBrowserMainParts::PostBrowserStart() { | 1177 void ChromeBrowserMainParts::PostBrowserStart() { |
| 1177 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PostBrowserStart"); | 1178 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PostBrowserStart"); |
| 1178 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i) | 1179 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i) |
| 1179 chrome_extra_parts_[i]->PostBrowserStart(); | 1180 chrome_extra_parts_[i]->PostBrowserStart(); |
| 1180 #if !defined(OS_ANDROID) | 1181 #if !defined(OS_ANDROID) |
| 1181 // Allow ProcessSingleton to process messages. | 1182 // Allow ProcessSingleton to process messages. |
| (...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1848 chromeos::CrosSettings::Shutdown(); | 1849 chromeos::CrosSettings::Shutdown(); |
| 1849 #endif // defined(OS_CHROMEOS) | 1850 #endif // defined(OS_CHROMEOS) |
| 1850 #endif // defined(OS_ANDROID) | 1851 #endif // defined(OS_ANDROID) |
| 1851 } | 1852 } |
| 1852 | 1853 |
| 1853 // Public members: | 1854 // Public members: |
| 1854 | 1855 |
| 1855 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 1856 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
| 1856 chrome_extra_parts_.push_back(parts); | 1857 chrome_extra_parts_.push_back(parts); |
| 1857 } | 1858 } |
| OLD | NEW |