| 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 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 executable.value().size() >= 3) { | 613 executable.value().size() >= 3) { |
| 614 std::string last_three = | 614 std::string last_three = |
| 615 executable.value().substr(executable.value().size() - 3); | 615 executable.value().substr(executable.value().size() - 3); |
| 616 | 616 |
| 617 if (last_three == " EH") { | 617 if (last_three == " EH") { |
| 618 CHECK(process_type == switches::kPluginProcess || | 618 CHECK(process_type == switches::kPluginProcess || |
| 619 process_type == switches::kUtilityProcess) | 619 process_type == switches::kUtilityProcess) |
| 620 << "Executable-heap process requires --type=" | 620 << "Executable-heap process requires --type=" |
| 621 << switches::kPluginProcess << " or " | 621 << switches::kPluginProcess << " or " |
| 622 << switches::kUtilityProcess << ", saw " << process_type; | 622 << switches::kUtilityProcess << ", saw " << process_type; |
| 623 } else if (last_three == " NP") { | |
| 624 #if !defined(DISABLE_NACL) | |
| 625 CHECK_EQ(switches::kNaClLoaderProcess, process_type) | |
| 626 << "Non-PIE process requires --type=" | |
| 627 << switches::kNaClLoaderProcess << ", saw " << process_type; | |
| 628 #endif | |
| 629 } else { | 623 } else { |
| 630 #if defined(DISABLE_NACL) | |
| 631 CHECK(process_type != switches::kPluginProcess) | 624 CHECK(process_type != switches::kPluginProcess) |
| 632 << "Non-executable-heap PIE process is intolerant of --type=" | 625 << "Non-executable-heap PIE process is intolerant of --type=" |
| 633 << switches::kPluginProcess; | 626 << switches::kPluginProcess; |
| 634 #else | |
| 635 CHECK(process_type != switches::kPluginProcess && | |
| 636 process_type != switches::kNaClLoaderProcess) | |
| 637 << "Non-executable-heap PIE process is intolerant of --type=" | |
| 638 << switches::kPluginProcess << " and " | |
| 639 << switches::kNaClLoaderProcess << ", saw " << process_type; | |
| 640 #endif | |
| 641 } | 627 } |
| 642 } | 628 } |
| 643 } else { | 629 } else { |
| 644 CHECK(!command_line.HasSwitch(switches::kProcessType) && | 630 CHECK(!command_line.HasSwitch(switches::kProcessType) && |
| 645 process_type.empty()) | 631 process_type.empty()) |
| 646 << "Main application forbids --type, saw " << process_type; | 632 << "Main application forbids --type, saw " << process_type; |
| 647 } | 633 } |
| 648 } | 634 } |
| 649 #endif // defined(OS_MACOSX) | 635 #endif // defined(OS_MACOSX) |
| 650 | 636 |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 972 case version_info::Channel::CANARY: | 958 case version_info::Channel::CANARY: |
| 973 return true; | 959 return true; |
| 974 case version_info::Channel::DEV: | 960 case version_info::Channel::DEV: |
| 975 case version_info::Channel::BETA: | 961 case version_info::Channel::BETA: |
| 976 case version_info::Channel::STABLE: | 962 case version_info::Channel::STABLE: |
| 977 default: | 963 default: |
| 978 // Don't enable instrumentation. | 964 // Don't enable instrumentation. |
| 979 return false; | 965 return false; |
| 980 } | 966 } |
| 981 } | 967 } |
| OLD | NEW |