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/app/chrome_main_delegate.h" | 5 #include "chrome/app/chrome_main_delegate.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 // For "miscellaneous" things, we want them after renderers, | 223 // For "miscellaneous" things, we want them after renderers, |
224 // but before plugins. | 224 // but before plugins. |
225 const int kMiscScore = kRendererScore - kScoreBump; | 225 const int kMiscScore = kRendererScore - kScoreBump; |
226 // We want plugins to die after the renderers. | 226 // We want plugins to die after the renderers. |
227 const int kPluginScore = kMiscScore - kScoreBump; | 227 const int kPluginScore = kMiscScore - kScoreBump; |
228 int score = -1; | 228 int score = -1; |
229 | 229 |
230 DCHECK(kMiscScore > 0); | 230 DCHECK(kMiscScore > 0); |
231 DCHECK(kPluginScore > 0); | 231 DCHECK(kPluginScore > 0); |
232 | 232 |
233 if (process_type == switches::kPluginProcess || | 233 if (process_type == switches::kPpapiPluginProcess) { |
234 process_type == switches::kPpapiPluginProcess) { | |
235 score = kPluginScore; | 234 score = kPluginScore; |
236 } else if (process_type == switches::kPpapiBrokerProcess) { | 235 } else if (process_type == switches::kPpapiBrokerProcess) { |
237 // The broker should be killed before the PPAPI plugin. | 236 // The broker should be killed before the PPAPI plugin. |
238 score = kPluginScore + kScoreBump; | 237 score = kPluginScore + kScoreBump; |
239 } else if (process_type == switches::kUtilityProcess || | 238 } else if (process_type == switches::kUtilityProcess || |
240 process_type == switches::kGpuProcess || | 239 process_type == switches::kGpuProcess || |
241 process_type == switches::kServiceProcess) { | 240 process_type == switches::kServiceProcess) { |
242 score = kMiscScore; | 241 score = kMiscScore; |
243 #ifndef DISABLE_NACL | 242 #ifndef DISABLE_NACL |
244 } else if (process_type == switches::kNaClLoaderProcess || | 243 } else if (process_type == switches::kNaClLoaderProcess || |
(...skipping 17 matching lines...) Expand all Loading... |
262 } | 261 } |
263 if (score > -1) | 262 if (score > -1) |
264 base::AdjustOOMScore(base::GetCurrentProcId(), score); | 263 base::AdjustOOMScore(base::GetCurrentProcId(), score); |
265 } | 264 } |
266 #endif // defined(OS_LINUX) | 265 #endif // defined(OS_LINUX) |
267 | 266 |
268 // Returns true if this subprocess type needs the ResourceBundle initialized | 267 // Returns true if this subprocess type needs the ResourceBundle initialized |
269 // and resources loaded. | 268 // and resources loaded. |
270 bool SubprocessNeedsResourceBundle(const std::string& process_type) { | 269 bool SubprocessNeedsResourceBundle(const std::string& process_type) { |
271 return | 270 return |
272 #if defined(OS_WIN) || defined(OS_MACOSX) | |
273 // Windows needs resources for the default/null plugin. | |
274 // Mac needs them for the plugin process name. | |
275 process_type == switches::kPluginProcess || | |
276 #endif | |
277 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 271 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
278 // The zygote process opens the resources for the renderers. | 272 // The zygote process opens the resources for the renderers. |
279 process_type == switches::kZygoteProcess || | 273 process_type == switches::kZygoteProcess || |
280 #endif | 274 #endif |
281 #if defined(OS_MACOSX) | 275 #if defined(OS_MACOSX) |
282 // Mac needs them too for scrollbar related images and for sandbox | 276 // Mac needs them too for scrollbar related images and for sandbox |
283 // profiles. | 277 // profiles. |
284 #if !defined(DISABLE_NACL) | 278 #if !defined(DISABLE_NACL) |
285 process_type == switches::kNaClLoaderProcess || | 279 process_type == switches::kNaClLoaderProcess || |
286 #endif | 280 #endif |
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1005 case version_info::Channel::CANARY: | 999 case version_info::Channel::CANARY: |
1006 return true; | 1000 return true; |
1007 case version_info::Channel::DEV: | 1001 case version_info::Channel::DEV: |
1008 case version_info::Channel::BETA: | 1002 case version_info::Channel::BETA: |
1009 case version_info::Channel::STABLE: | 1003 case version_info::Channel::STABLE: |
1010 default: | 1004 default: |
1011 // Don't enable instrumentation. | 1005 // Don't enable instrumentation. |
1012 return false; | 1006 return false; |
1013 } | 1007 } |
1014 } | 1008 } |
OLD | NEW |