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

Side by Side Diff: chrome/common/chrome_content_client.cc

Issue 12662019: Split the ProcessType enum into process types that content knows about (which will remain in src\co… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 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 | Annotate | Revision Log
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/common/chrome_content_client.h" 5 #include "chrome/common/chrome_content_client.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/cpu.h" 8 #include "base/cpu.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
11 #include "base/process_util.h" 11 #include "base/process_util.h"
12 #include "base/string_util.h" 12 #include "base/string_util.h"
13 #include "base/stringprintf.h" 13 #include "base/stringprintf.h"
14 #include "base/strings/string_number_conversions.h" 14 #include "base/strings/string_number_conversions.h"
15 #include "base/strings/string_split.h" 15 #include "base/strings/string_split.h"
16 #include "base/utf_string_conversions.h" 16 #include "base/utf_string_conversions.h"
17 #include "build/build_config.h" 17 #include "build/build_config.h"
18 #include "chrome/common/child_process_logging.h" 18 #include "chrome/common/child_process_logging.h"
19 #include "chrome/common/chrome_paths.h" 19 #include "chrome/common/chrome_paths.h"
20 #include "chrome/common/chrome_process_type.h"
20 #include "chrome/common/chrome_switches.h" 21 #include "chrome/common/chrome_switches.h"
21 #include "chrome/common/chrome_version_info.h" 22 #include "chrome/common/chrome_version_info.h"
22 #include "chrome/common/pepper_flash.h" 23 #include "chrome/common/pepper_flash.h"
23 #include "chrome/common/render_messages.h" 24 #include "chrome/common/render_messages.h"
24 #include "chrome/common/url_constants.h" 25 #include "chrome/common/url_constants.h"
25 #include "content/public/common/content_switches.h" 26 #include "content/public/common/content_switches.h"
26 #include "content/public/common/pepper_plugin_info.h" 27 #include "content/public/common/pepper_plugin_info.h"
27 #include "content/public/common/url_constants.h" 28 #include "content/public/common/url_constants.h"
28 #include "extensions/common/constants.h" 29 #include "extensions/common/constants.h"
29 #include "grit/common_resources.h" 30 #include "grit/common_resources.h"
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 438
438 base::RefCountedStaticMemory* ChromeContentClient::GetDataResourceBytes( 439 base::RefCountedStaticMemory* ChromeContentClient::GetDataResourceBytes(
439 int resource_id) const { 440 int resource_id) const {
440 return ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id); 441 return ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id);
441 } 442 }
442 443
443 gfx::Image& ChromeContentClient::GetNativeImageNamed(int resource_id) const { 444 gfx::Image& ChromeContentClient::GetNativeImageNamed(int resource_id) const {
444 return ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id); 445 return ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id);
445 } 446 }
446 447
448 std::string ChromeContentClient::GetProcessTypeNameInEnglish(int type) {
449 switch(type) {
450 case PROCESS_TYPE_PROFILE_IMPORT:
451 return "Profile Import helper";
452 case PROCESS_TYPE_NACL_LOADER:
453 return "Native Client module";
454 case PROCESS_TYPE_NACL_BROKER:
455 return "Native Client broker";
456 }
457
458 DCHECK(false) << "Unknown child process type!";
459 return "Unknown";
460 }
461
447 #if defined(OS_MACOSX) && !defined(OS_IOS) 462 #if defined(OS_MACOSX) && !defined(OS_IOS)
448 bool ChromeContentClient::GetSandboxProfileForSandboxType( 463 bool ChromeContentClient::GetSandboxProfileForSandboxType(
449 int sandbox_type, 464 int sandbox_type,
450 int* sandbox_profile_resource_id) const { 465 int* sandbox_profile_resource_id) const {
451 DCHECK(sandbox_profile_resource_id); 466 DCHECK(sandbox_profile_resource_id);
452 if (sandbox_type == CHROME_SANDBOX_TYPE_NACL_LOADER) { 467 if (sandbox_type == CHROME_SANDBOX_TYPE_NACL_LOADER) {
453 *sandbox_profile_resource_id = IDR_NACL_SANDBOX_PROFILE; 468 *sandbox_profile_resource_id = IDR_NACL_SANDBOX_PROFILE;
454 return true; 469 return true;
455 } 470 }
456 return false; 471 return false;
457 } 472 }
458 473
459 std::string ChromeContentClient::GetCarbonInterposePath() const { 474 std::string ChromeContentClient::GetCarbonInterposePath() const {
460 return std::string(kInterposeLibraryPath); 475 return std::string(kInterposeLibraryPath);
461 } 476 }
462 #endif 477 #endif
463 478
464 } // namespace chrome 479 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698