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

Side by Side Diff: chrome/app/chrome_main_delegate.cc

Issue 1862513003: Remove NPAPI from browser and utility (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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 | « chrome/app/chrome_crash_reporter_client.cc ('k') | chrome/app/generated_resources.grd » ('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/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
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/app/chrome_crash_reporter_client.cc ('k') | chrome/app/generated_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698