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 "base/base_paths.h" | 7 #include "base/base_paths.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/cpu.h" | 9 #include "base/cpu.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 DCHECK(kMiscScore > 0); | 184 DCHECK(kMiscScore > 0); |
185 DCHECK(kPluginScore > 0); | 185 DCHECK(kPluginScore > 0); |
186 | 186 |
187 if (process_type == switches::kPluginProcess || | 187 if (process_type == switches::kPluginProcess || |
188 process_type == switches::kPpapiPluginProcess) { | 188 process_type == switches::kPpapiPluginProcess) { |
189 score = kPluginScore; | 189 score = kPluginScore; |
190 } else if (process_type == switches::kPpapiBrokerProcess) { | 190 } else if (process_type == switches::kPpapiBrokerProcess) { |
191 // The broker should be killed before the PPAPI plugin. | 191 // The broker should be killed before the PPAPI plugin. |
192 score = kPluginScore + kScoreBump; | 192 score = kPluginScore + kScoreBump; |
193 } else if (process_type == switches::kUtilityProcess || | 193 } else if (process_type == switches::kUtilityProcess || |
194 process_type == switches::kWorkerProcess || | |
195 process_type == switches::kGpuProcess || | 194 process_type == switches::kGpuProcess || |
196 process_type == switches::kServiceProcess) { | 195 process_type == switches::kServiceProcess) { |
197 score = kMiscScore; | 196 score = kMiscScore; |
198 #ifndef DISABLE_NACL | 197 #ifndef DISABLE_NACL |
199 } else if (process_type == switches::kNaClLoaderProcess || | 198 } else if (process_type == switches::kNaClLoaderProcess || |
200 process_type == switches::kNaClLoaderNonSfiProcess) { | 199 process_type == switches::kNaClLoaderNonSfiProcess) { |
201 score = kPluginScore; | 200 score = kPluginScore; |
202 #endif | 201 #endif |
203 } else if (process_type == switches::kZygoteProcess || | 202 } else if (process_type == switches::kZygoteProcess || |
204 process_type.empty()) { | 203 process_type.empty()) { |
(...skipping 16 matching lines...) Expand all Loading... |
221 #endif // defined(OS_LINUX) | 220 #endif // defined(OS_LINUX) |
222 | 221 |
223 // Returns true if this subprocess type needs the ResourceBundle initialized | 222 // Returns true if this subprocess type needs the ResourceBundle initialized |
224 // and resources loaded. | 223 // and resources loaded. |
225 bool SubprocessNeedsResourceBundle(const std::string& process_type) { | 224 bool SubprocessNeedsResourceBundle(const std::string& process_type) { |
226 return | 225 return |
227 #if defined(OS_WIN) || defined(OS_MACOSX) | 226 #if defined(OS_WIN) || defined(OS_MACOSX) |
228 // Windows needs resources for the default/null plugin. | 227 // Windows needs resources for the default/null plugin. |
229 // Mac needs them for the plugin process name. | 228 // Mac needs them for the plugin process name. |
230 process_type == switches::kPluginProcess || | 229 process_type == switches::kPluginProcess || |
231 // Needed for scrollbar related images. | |
232 process_type == switches::kWorkerProcess || | |
233 #endif | 230 #endif |
234 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 231 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
235 // The zygote process opens the resources for the renderers. | 232 // The zygote process opens the resources for the renderers. |
236 process_type == switches::kZygoteProcess || | 233 process_type == switches::kZygoteProcess || |
237 #endif | 234 #endif |
238 #if defined(OS_MACOSX) | 235 #if defined(OS_MACOSX) |
239 // Mac needs them too for scrollbar related images and for sandbox | 236 // Mac needs them too for scrollbar related images and for sandbox |
240 // profiles. | 237 // profiles. |
241 #if !defined(DISABLE_NACL) | 238 #if !defined(DISABLE_NACL) |
242 process_type == switches::kNaClLoaderProcess || | 239 process_type == switches::kNaClLoaderProcess || |
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
928 } | 925 } |
929 | 926 |
930 content::ContentUtilityClient* | 927 content::ContentUtilityClient* |
931 ChromeMainDelegate::CreateContentUtilityClient() { | 928 ChromeMainDelegate::CreateContentUtilityClient() { |
932 #if defined(CHROME_MULTIPLE_DLL_BROWSER) | 929 #if defined(CHROME_MULTIPLE_DLL_BROWSER) |
933 return NULL; | 930 return NULL; |
934 #else | 931 #else |
935 return g_chrome_content_utility_client.Pointer(); | 932 return g_chrome_content_utility_client.Pointer(); |
936 #endif | 933 #endif |
937 } | 934 } |
OLD | NEW |