diff options
author | kerrnel <kerrnel@chromium.org> | 2015-09-21 11:39:54 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-21 18:40:28 +0000 |
commit | 0c619649467faa44c72db1ddfabbf59e535b4d31 (patch) | |
tree | 33467e72ec90979de3c6d6134a8ce3ff54e53295 | |
parent | ded8a57ee09a9e015c3dca39f860574d69f5b008 (diff) | |
download | chromium_src-0c619649467faa44c72db1ddfabbf59e535b4d31.zip chromium_src-0c619649467faa44c72db1ddfabbf59e535b4d31.tar.gz chromium_src-0c619649467faa44c72db1ddfabbf59e535b4d31.tar.bz2 |
Delete dead code related to the removed helper apps.
It is no longer clear if we will be adding more helper variants in the
near future. This change removes any additional dead code related to the
helper apps.
BUG=520680
Review URL: https://codereview.chromium.org/1354703002
Cr-Commit-Position: refs/heads/master@{#349970}
-rwxr-xr-x | build/mac/make_more_helpers.sh | 84 | ||||
-rwxr-xr-x | build/mac/verify_no_objc.sh | 42 | ||||
-rw-r--r-- | chrome/browser/memory_details_mac.cc | 27 | ||||
-rw-r--r-- | chrome/chrome.gyp | 8 | ||||
-rw-r--r-- | chrome/chrome_exe.gypi | 35 | ||||
-rw-r--r-- | chrome/common/chrome_constants.cc | 4 | ||||
-rw-r--r-- | chrome/common/chrome_constants.h | 10 | ||||
-rw-r--r-- | chrome/test/base/chrome_process_util.cc | 43 | ||||
-rwxr-xr-x | chrome/tools/build/mac/dump_product_syms | 9 | ||||
-rw-r--r-- | content/content_shell.gypi | 32 | ||||
-rw-r--r-- | extensions/shell/app_shell.gyp | 32 |
11 files changed, 11 insertions, 315 deletions
diff --git a/build/mac/make_more_helpers.sh b/build/mac/make_more_helpers.sh deleted file mode 100755 index b92ffdd..0000000 --- a/build/mac/make_more_helpers.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2012 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# Usage: make_more_helpers.sh <directory_within_contents> <app_name> -# -# This script creates additional helper .app bundles for Chromium, based on -# the existing helper .app bundle, changing their Mach-O header's flags to -# enable and disable various features. -# -# This script expects to be called from the chrome_exe target as a postbuild, -# and operates directly within the built-up browser app's versioned directory. -# -# Each helper is adjusted by giving it the proper bundle name, renaming the -# executable, adjusting several Info.plist keys, and changing the executable's -# Mach-O flags. - -set -eu - -make_helper() { - local containing_dir="${1}" - local app_name="${2}" - local feature="${3}" - local flags="${4}" - - local helper_name="${app_name} Helper" - local helper_stem="${containing_dir}/${helper_name}" - local original_helper="${helper_stem}.app" - if [[ ! -d "${original_helper}" ]]; then - echo "${0}: error: ${original_helper} is a required directory" >& 2 - exit 1 - fi - local original_helper_exe="${original_helper}/Contents/MacOS/${helper_name}" - if [[ ! -f "${original_helper_exe}" ]]; then - echo "${0}: error: ${original_helper_exe} is a required file" >& 2 - exit 1 - fi - - local feature_helper="${helper_stem} ${feature}.app" - - rsync -acC --delete --include '*.so' "${original_helper}/" "${feature_helper}" - - local helper_feature="${helper_name} ${feature}" - local helper_feature_exe="${feature_helper}/Contents/MacOS/${helper_feature}" - mv "${feature_helper}/Contents/MacOS/${helper_name}" "${helper_feature_exe}" - - local change_flags="$(dirname "${0}")/change_mach_o_flags.py" - "${change_flags}" ${flags} "${helper_feature_exe}" - - local feature_info="${feature_helper}/Contents/Info" - local feature_info_plist="${feature_info}.plist" - - defaults write "${feature_info}" "CFBundleDisplayName" "${helper_feature}" - defaults write "${feature_info}" "CFBundleExecutable" "${helper_feature}" - - cfbundleid="$(defaults read "${feature_info}" "CFBundleIdentifier")" - feature_cfbundleid="${cfbundleid}.${feature}" - defaults write "${feature_info}" "CFBundleIdentifier" "${feature_cfbundleid}" - - cfbundlename="$(defaults read "${feature_info}" "CFBundleName")" - feature_cfbundlename="${cfbundlename} ${feature}" - defaults write "${feature_info}" "CFBundleName" "${feature_cfbundlename}" - - # As usual, defaults might have put the plist into whatever format excites - # it, but Info.plists get converted back to the expected XML format. - plutil -convert xml1 "${feature_info_plist}" - - # `defaults` also changes the file permissions, so make the file - # world-readable again. - chmod a+r "${feature_info_plist}" -} - -if [[ ${#} -ne 2 ]]; then - echo "usage: ${0} <directory_within_contents> <app_name>" >& 2 - exit 1 -fi - -DIRECTORY_WITHIN_CONTENTS="${1}" -APP_NAME="${2}" - -CONTENTS_DIR="${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}" -CONTAINING_DIR="${CONTENTS_DIR}/${DIRECTORY_WITHIN_CONTENTS}" diff --git a/build/mac/verify_no_objc.sh b/build/mac/verify_no_objc.sh deleted file mode 100755 index e18a5ea..0000000 --- a/build/mac/verify_no_objc.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2011 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# This script makes sure that no __OBJC,__image_info section appears in the -# executable file built by the Xcode target that runs the script. If such a -# section appears, the script prints an error message and exits nonzero. -# -# Why is this important? -# -# On 10.5, there's a bug in CFBundlePreflightExecutable that causes it to -# crash when operating in an executable that has not loaded at its default -# address (that is, when it's a position-independent executable with the -# MH_PIE bit set in its mach_header) and the executable has an -# __OBJC,__image_info section. See http://crbug.com/88697. -# -# Chrome's main executables don't use any Objective-C at all, and don't need -# to carry this section around. Not linking them as Objective-C when they -# don't need it anyway saves about 4kB in the linked executable, although most -# of that 4kB is just filled with zeroes. -# -# This script makes sure that nobody goofs and accidentally introduces these -# sections into the main executables. - -set -eu - -executable="${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" - -if xcrun otool -arch i386 -o "${executable}" | grep -q '^Contents.*section$'; \ -then - echo "${0}: ${executable} has an __OBJC,__image_info section" 2>&1 - exit 1 -fi - -if [[ ${PIPESTATUS[0]} -ne 0 ]]; then - echo "${0}: otool failed" 2>&1 - exit 1 -fi - -exit 0 diff --git a/chrome/browser/memory_details_mac.cc b/chrome/browser/memory_details_mac.cc index 89ae9c1..1443494 100644 --- a/chrome/browser/memory_details_mac.cc +++ b/chrome/browser/memory_details_mac.cc @@ -210,28 +210,13 @@ void MemoryDetails::CollectProcessData( } } - // The helper might show up as these different flavors depending on the - // executable flags required. - std::vector<std::string> helper_names; - helper_names.push_back(chrome::kHelperProcessExecutableName); - for (const char* const* suffix = chrome::kHelperFlavorSuffixes; - *suffix; - ++suffix) { - std::string helper_name = chrome::kHelperProcessExecutableName; - helper_name.append(1, ' '); - helper_name.append(*suffix); - helper_names.push_back(helper_name); - } - - // Get PIDs of helpers. + // Get PIDs of the helper. std::vector<base::ProcessId> helper_pids; - for (size_t i = 0; i < helper_names.size(); ++i) { - std::string helper_name = helper_names[i]; - base::NamedProcessIterator helper_it(helper_name, NULL); - while (const base::ProcessEntry* entry = helper_it.NextProcessEntry()) { - helper_pids.push_back(entry->pid()); - all_pids.push_back(entry->pid()); - } + base::NamedProcessIterator helper_it(chrome::kHelperProcessExecutableName, + NULL); + while (const base::ProcessEntry* entry = helper_it.NextProcessEntry()) { + helper_pids.push_back(entry->pid()); + all_pids.push_back(entry->pid()); } if (mode == FROM_ALL_BROWSERS) { diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index c01c555..77f1d74 100644 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -230,14 +230,6 @@ '--keystone=0', '--scm=0'], }, - { - # Make sure there isn't any Objective-C in the helper app's - # executable. - 'postbuild_name': 'Verify No Objective-C', - 'action': [ - '../build/mac/verify_no_objc.sh', - ], - }, ], 'conditions': [ ['mac_breakpad==1', { diff --git a/chrome/chrome_exe.gypi b/chrome/chrome_exe.gypi index 5d6ed4e..adc8893 100644 --- a/chrome/chrome_exe.gypi +++ b/chrome/chrome_exe.gypi @@ -352,41 +352,6 @@ '<(version_full)' ], }, - { - # This postbuid step is responsible for creating the following - # helpers: - # - # Currently no helpers are produced (crbug.com/520680), but - # more will be added soon (crbug.com/497190). - # - # Normally, applications shipping as part of offical builds with - # Google Chrome branding have dsymutil (dwarf-with-dsym, - # mac_real_dsym) and dump_syms (mac_breakpad) run on them to - # produce a .dSYM bundle and a Breakpad .sym file. This is - # unnecessary for the "More Helpers" because they're identical - # to the original helper except for the bits in their Mach-O - # headers that change to enable or disable special features. - # Each .dSYM is identified by UUID stored in a Mach-O file's - # LC_UUID load command. Because the "More Helpers" share a UUID - # with the original helper, there's no need to run dsymutil - # again. All helpers can share the same .dSYM. Special handling - # is performed in chrome/tools/build/mac/dump_product_syms to - # prepare their Breakpad symbol files. - 'postbuild_name': 'Make More Helpers', - 'action': [ - '../build/mac/make_more_helpers.sh', - 'Versions/<(version_full)', - '<(mac_product_name)', - ], - }, - { - # Make sure there isn't any Objective-C in the browser app's - # executable. - 'postbuild_name': 'Verify No Objective-C', - 'action': [ - '../build/mac/verify_no_objc.sh', - ], - }, ], # postbuilds }, { # OS != "mac" 'conditions': [ diff --git a/chrome/common/chrome_constants.cc b/chrome/common/chrome_constants.cc index bac0a5a..89ae9cd 100644 --- a/chrome/common/chrome_constants.cc +++ b/chrome/common/chrome_constants.cc @@ -117,10 +117,6 @@ const base::FilePath::CharType kHelperProcessExecutablePath[] = FPL("chrome"); #if defined(OS_MACOSX) const base::FilePath::CharType kFrameworkName[] = FPL(PRODUCT_STRING " Framework.framework"); - -const char* const kHelperFlavorSuffixes[] = { - NULL -}; #endif // OS_MACOSX #if defined(OS_WIN) diff --git a/chrome/common/chrome_constants.h b/chrome/common/chrome_constants.h index 8d68887..3646cb4 100644 --- a/chrome/common/chrome_constants.h +++ b/chrome/common/chrome_constants.h @@ -41,16 +41,6 @@ extern const base::FilePath::CharType kHelperProcessExecutablePathChromium[]; // TODO(tfarina): Remove the comment above, when you fix components to use plist // on Mac. extern const base::FilePath::CharType kFrameworkName[]; - -// The helper .app bundle name and executable name may have one of these -// suffixes to identify specific features, or it may have no suffix at all. -// This is a NULL-terminated array of strings. If kHelperFlavorSuffixes -// contains "EN", "MF", and NULL, it indicates that if the normal helper is -// named Chromium Helper.app, helper executables could show up at any of -// Chromium Helper.app/Contents/MacOS/Chromium Helper, -// Chromium Helper EN.app/Contents/MacOS/Chromium Helper EN, and -// Chromium Helper MF.app/Contents/MacOS/Chromium Helper MF. -extern const base::FilePath::CharType* const kHelperFlavorSuffixes[]; #endif // OS_MACOSX #if defined(OS_WIN) extern const base::FilePath::CharType kBrowserResourcesDll[]; diff --git a/chrome/test/base/chrome_process_util.cc b/chrome/test/base/chrome_process_util.cc index 201b680..8466ec3 100644 --- a/chrome/test/base/chrome_process_util.cc +++ b/chrome/test/base/chrome_process_util.cc @@ -19,35 +19,6 @@ using base::TimeDelta; using base::TimeTicks; -namespace { - -#if defined(OS_POSIX) -// Returns the executable name of the current Chrome helper process. -std::vector<base::FilePath::StringType> GetRunningHelperExecutableNames() { - base::FilePath::StringType name = chrome::kHelperProcessExecutableName; - - std::vector<base::FilePath::StringType> names; - names.push_back(name); - -#if defined(OS_MACOSX) - // The helper might show up as these different flavors depending on the - // executable flags required. - for (const char* const* suffix = chrome::kHelperFlavorSuffixes; - *suffix; - ++suffix) { - std::string flavor_name(name); - flavor_name.append(1, ' '); - flavor_name.append(*suffix); - names.push_back(flavor_name); - } -#endif - - return names; -} -#endif // defined(OS_POSIX) - -} // namespace - void TerminateAllChromeProcesses(const ChromeProcessList& process_pids) { ChromeProcessList::const_iterator it; for (it = process_pids.begin(); it != process_pids.end(); ++it) { @@ -108,15 +79,11 @@ ChromeProcessList GetRunningChromeProcesses(base::ProcessId browser_pid) { // on Linux via /proc/self/exe, so they end up with a different // name. We must collect them in a second pass. { - std::vector<base::FilePath::StringType> names = - GetRunningHelperExecutableNames(); - for (size_t i = 0; i < names.size(); ++i) { - base::FilePath::StringType name = names[i]; - ChildProcessFilter filter(browser_pid); - base::NamedProcessIterator it(name, &filter); - while (const base::ProcessEntry* process_entry = it.NextProcessEntry()) - result.push_back(process_entry->pid()); - } + base::FilePath::StringType name = chrome::kHelperProcessExecutableName; + ChildProcessFilter filter(browser_pid); + base::NamedProcessIterator it(name, &filter); + while (const base::ProcessEntry* process_entry = it.NextProcessEntry()) + result.push_back(process_entry->pid()); } #endif // defined(OS_POSIX) diff --git a/chrome/tools/build/mac/dump_product_syms b/chrome/tools/build/mac/dump_product_syms index 0673a1e..c15c058 100755 --- a/chrome/tools/build/mac/dump_product_syms +++ b/chrome/tools/build/mac/dump_product_syms @@ -163,15 +163,6 @@ for SRC_NAME in "${SRC_NAMES[@]}"; do "${SRC_STEM} Canary" "${SRC_STEM} Canary.app" \ "${ARCH}" ;; - - "${SRC_APP_NAME} Helper.app") - # Google Chrome Helper EH and Google Chrome Helper NP are produced by - # build/mac/make_more_helpers.sh. - redump_syms_variant "${BPAD_SYM_PATH}" "${SRC_STEM}" \ - "${SRC_STEM} EH" "${SRC_STEM} EH.app" "${ARCH}" - redump_syms_variant "${BPAD_SYM_PATH}" "${SRC_STEM}" \ - "${SRC_STEM} NP" "${SRC_STEM} NP.app" "${ARCH}" - ;; esac done diff --git a/content/content_shell.gypi b/content/content_shell.gypi index 9d634b1..f8d63cb 100644 --- a/content/content_shell.gypi +++ b/content/content_shell.gypi @@ -564,30 +564,6 @@ '--scm=1', '--version=<(content_shell_version)'], }, - { - # This postbuid step is responsible for creating the following - # helpers: - # - # Content Shell Helper EH.app and Content Shell Helper NP.app are - # created from Content Shell Helper.app. - # - # The EH helper is marked for an executable heap. The NP helper - # is marked for no PIE (ASLR). - 'postbuild_name': 'Make More Helpers', - 'action': [ - '../build/mac/make_more_helpers.sh', - 'Frameworks', - '<(content_shell_product_name)', - ], - }, - { - # Make sure there isn't any Objective-C in the shell's - # executable. - 'postbuild_name': 'Verify No Objective-C', - 'action': [ - '../build/mac/verify_no_objc.sh', - ], - }, ], }], # OS=="mac" ['OS=="android"', { @@ -857,14 +833,6 @@ '--scm=0', '--version=<(content_shell_version)'], }, - { - # Make sure there isn't any Objective-C in the helper app's - # executable. - 'postbuild_name': 'Verify No Objective-C', - 'action': [ - '../build/mac/verify_no_objc.sh', - ], - }, ], 'conditions': [ ['component=="shared_library"', { diff --git a/extensions/shell/app_shell.gyp b/extensions/shell/app_shell.gyp index 9c6ead5..0ad524c 100644 --- a/extensions/shell/app_shell.gyp +++ b/extensions/shell/app_shell.gyp @@ -179,30 +179,6 @@ '--scm=1', '--version=<(app_shell_version)'], }, - { - # This postbuild step is responsible for creating the following - # helpers: - # - # App Shell Helper EH.app and App Shell Helper NP.app are - # created from App Shell Helper.app. - # - # The EH helper is marked for an executable heap. The NP helper - # is marked for no PIE (ASLR). - 'postbuild_name': 'Make More Helpers', - 'action': [ - '../../build/mac/make_more_helpers.sh', - 'Frameworks', - '<(app_shell_product_name)', - ], - }, - { - # Make sure there isn't any Objective-C in the shell's - # executable. - 'postbuild_name': 'Verify No Objective-C', - 'action': [ - '../../build/mac/verify_no_objc.sh', - ], - }, ], }], ], @@ -416,14 +392,6 @@ '--scm=0', '--version=<(app_shell_version)'], }, - { - # Make sure there isn't any Objective-C in the helper app's - # executable. - 'postbuild_name': 'Verify No Objective-C', - 'action': [ - '../../build/mac/verify_no_objc.sh', - ], - }, ], }, # target app_shell_helper ], |