diff options
-rwxr-xr-x | build/mac/dump_app_syms | 79 | ||||
-rwxr-xr-x | build/mac/tweak_app_infoplist | 67 | ||||
-rw-r--r-- | chrome/app/app-Info.plist | 2 | ||||
-rw-r--r-- | chrome/browser/plugin_process_host.cc | 9 | ||||
-rw-r--r-- | chrome/browser/renderer_host/browser_render_process_host.cc | 24 | ||||
-rw-r--r-- | chrome/browser/utility_process_host.cc | 7 | ||||
-rw-r--r-- | chrome/browser/worker_host/worker_process_host.cc | 4 | ||||
-rw-r--r-- | chrome/chrome.gyp | 137 | ||||
-rw-r--r-- | chrome/common/child_process_host.cc | 65 | ||||
-rw-r--r-- | chrome/common/child_process_host.h | 7 |
10 files changed, 116 insertions, 285 deletions
diff --git a/build/mac/dump_app_syms b/build/mac/dump_app_syms index 130b5a0..cd6e626 100755 --- a/build/mac/dump_app_syms +++ b/build/mac/dump_app_syms @@ -1,26 +1,9 @@ -#!/bin/bash +#!/bin/sh # Copyright (c) 2009 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 expects the following environment variables to be set. Xcode -# normally sets them: -# -# CONFIGURATION - Release or Debug; this script only operates when Release. -# SRCROOT - /path/to/chrome/src/chrome -# BUILT_PRODUTS_DIR - /path/to/chrome/src/xcodebuild/Release -# -# The script also takes a single argument defining the branding type. -# -# To test this script without running an entire build: -# -# cd /path/to/chrome/src/chrome -# CONFIGURATION=Release \ -# SRCROOT=$(pwd) \ -# BUILT_PRODUCTS_DIR=$(pwd)/../xcodebuild/Release \ -# ../build/mac/dump_app_syms Chromium - # Make sure we got the header to write into passed to us if [ $# -ne 1 ]; then echo "error: missing branding as an argument" >&2 @@ -42,43 +25,37 @@ SRC_APP_NAME=$("${BRAND_SCRIPT}" "${BUILD_BRANDING}" PRODUCT_FULLNAME) . "${TOP}/chrome/VERSION" BREAKPAD_DUMP_SYMS="${BUILT_PRODUCTS_DIR}/dump_syms" +BREAKPAD_PRODUCT_ID="${BUILD_BRANDING}_Mac" FULL_VERSION="${MAJOR}.${MINOR}.${BUILD}.${PATCH}" -ARCH="i386" - -DSYM_TAR_PATH="${BUILT_PRODUCTS_DIR}/${SRC_APP_NAME}.dSYM.tar.bz2" - -declare -a DSYMS - -for SRC_BUNDLE in "${SRC_APP_NAME}.app" \ - "${SRC_APP_NAME} Framework.framework" \ - "${SRC_APP_NAME} Helper.app" ; do - SRC_STEM=$(echo "${SRC_BUNDLE}" | sed -Ee 's/^(.*)\..*$/\1/') - SRC_BUNDLE_PATH="${BUILT_PRODUCTS_DIR}/${SRC_BUNDLE}" - DSYM_NAME="${SRC_BUNDLE}.dSYM" - DSYM_PATH="${BUILT_PRODUCTS_DIR}/${DSYM_NAME}" - DWARF_PATH="${DSYM_PATH}/Contents/Resources/DWARF/${SRC_STEM}" - BPAD_SYM_NAME="${SRC_STEM}-${FULL_VERSION}-${ARCH}.breakpad" - BPAD_SYM_PATH="${BUILT_PRODUCTS_DIR}/${BPAD_SYM_NAME}" +SRC_APP_PATH="${BUILT_PRODUCTS_DIR}/${SRC_APP_NAME}.app" +# Created by the build/mac/strip_from_xcode script. +UNSTRIPPED_APP="${SRC_APP_PATH}.dSYM/Contents/Resources/DWARF/${SRC_APP_NAME}" +APP_SYMBOL_FILE="${BUILT_PRODUCTS_DIR}/${SRC_APP_NAME}-${FULL_VERSION}-i386.breakpad" + +# Only run dump_syms if the file has changed since we last did a dump. +if [ "${UNSTRIPPED_APP}" -nt "${APP_SYMBOL_FILE}" ] ; then + "${BREAKPAD_DUMP_SYMS}" -a i386 "${UNSTRIPPED_APP}" > "${APP_SYMBOL_FILE}" +fi +APP_DSYM_NAME="${SRC_APP_NAME}.app.dSYM" - # Only run dump_syms if the file has changed since the last dump. - if [ "${DWARF_PATH}" -nt "${BPAD_SYM_PATH}" ] ; then - "${BREAKPAD_DUMP_SYMS}" -a "${ARCH}" "${DWARF_PATH}" > "${BPAD_SYM_PATH}" - fi +# Do the same thing for chrome_dll. - # Remove the .dSYM archive if the file has changed since the archive was - # last generated. This will cause a new .dSYM archive to be created. - if [ "${DWARF_PATH}" -nt "${DSYM_TAR_PATH}" ] ; then - rm -f "${DSYM_TAR_PATH}" - fi +SRC_DYLIB_NAME="${SRC_APP_NAME} Framework" +SRC_DYLIB_PATH="${BUILT_PRODUCTS_DIR}/${SRC_DYLIB_NAME}.framework" +UNSTRIPPED_DYLIB="${SRC_DYLIB_PATH}.dSYM/Contents/Resources/DWARF/${SRC_DYLIB_NAME}" +DYLIB_SYMBOL_FILE="${BUILT_PRODUCTS_DIR}/${SRC_DYLIB_NAME}-${FULL_VERSION}-i386.breakpad" +if [ "${UNSTRIPPED_DYLIB}" -nt "${DYLIB_SYMBOL_FILE}" ] ; then + "${BREAKPAD_DUMP_SYMS}" -a i386 "${UNSTRIPPED_DYLIB}" > "${DYLIB_SYMBOL_FILE}" +fi +DYLIB_DSYM_NAME="${SRC_DYLIB_NAME}.framework.dSYM" - # Push the .dSYM bundle onto the DSYMS array so that it will be included in - # the .dSYM archive if a new one is needed - DSYMS[${#DSYMS[@]}]="${DSYM_NAME}" -done +DSYM_TAR_PATH="${BUILT_PRODUCTS_DIR}/${APP_DSYM_NAME}.tar.bz2" -# Create the archive of .dSYM bundles. -if [ ! -e "${DSYM_TAR_PATH}" ] ; then - # Change directory so that absolute paths aren't included in the archive. +# Make a .tar.bz2 out of the .dSYM +if [ "${BUILT_PRODUCTS_DIR}/${APP_DSYM_NAME}" -nt "${DSYM_TAR_PATH}" ] || + [ "${BUILT_PRODUCTS_DIR}/${DYLIB_DSYM_NAME}" -nt "${DSYM_TAR_PATH}" ] ; then + # Change directory so when building the tar, we don't include the build dir + # in the tar paths. (cd "${BUILT_PRODUCTS_DIR}" && - tar --owner 0 --group 0 -jcf "${DSYM_TAR_PATH}" "${DSYMS[@]}") + tar -jcf "${DSYM_TAR_PATH}" "${APP_DSYM_NAME}" "${DYLIB_DSYM_NAME}") fi diff --git a/build/mac/tweak_app_infoplist b/build/mac/tweak_app_infoplist index 120c3c8..845fc7e 100755 --- a/build/mac/tweak_app_infoplist +++ b/build/mac/tweak_app_infoplist @@ -9,9 +9,8 @@ set -e # Pull off the optional args USE_BREAKPAD=0 USE_KEYSTONE=0 -USE_SVN=1 OPTERR=0 -while getopts ":b:k:s:" an_opt ; do +while getopts ":b:k:" an_opt ; do case $an_opt in b) USE_BREAKPAD=$OPTARG @@ -19,9 +18,6 @@ while getopts ":b:k:s:" an_opt ; do k) USE_KEYSTONE=$OPTARG ;; - s) - USE_SVN=$OPTARG - ;; \?) echo "Unknown option $OPTARG" exit 1 @@ -38,7 +34,7 @@ while getopts ":b:k:s:" an_opt ; do done shift $(($OPTIND - 1)) -# Make sure the branding argument was supplied. +# Make sure we got the header to write into passed to us if [ $# -ne 1 ]; then echo "error: missing branding as an argument" >&2 exit 1 @@ -49,7 +45,7 @@ fi # because: # # 1. Xcode wants to do the Info.plist work before it runs any build phases, -# this means if we were to generate a .h file for INFOPLIST_PREFIX_HEADER +# this means if we were to generate a .h file for INFOPLIST_PREFIX_HEADER # we'd have to put it in another target so it runs in time. # 2. Xcode also doesn't check to see if the header being used as a prefix for # the Info.plist has changed. So even if we updated it, it's only looking @@ -67,37 +63,23 @@ BRAND_SCRIPT="${TOP}/build/branding_value.sh" set -x APP_NAME=$("${BRAND_SCRIPT}" "${BUILD_BRANDING}" PRODUCT_FULLNAME) -SRC_APP_PATH="${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}" - -if [ "${USE_SVN}" = "1" ] ; then - # Visible in the about:version page. - SVN_INFO=$(svn info "${TOP}") - SVN_REVISION=$(echo "${SVN_INFO}" | sed -Ene 's/^Revision: (.*)$/\1/p') - if [ -z "${SVN_REVISION}" ] ; then - echo "Could not determine svn revision. This may be OK." >&2 - # TODO: check for git, and get the version number from it? - fi - - # Grab the path to the source root in the Subversion repository by taking the - # URL to the source root directory and the repository root, and removing the - # latter from the former. This ensures that SVN_PATH will contain a useful - # path regardless of the Subversion server, mirror, and authentication scheme - # in use. - SVN_URL=$(echo "${SVN_INFO}" | sed -Ene 's/^URL: (.*)$/\1/p') - SVN_ROOT=$(echo "${SVN_INFO}" | sed -Ene 's/^Repository Root: (.*)$/\1/p') - if [ -n "${SVN_ROOT}" ] && \ - [ "${SVN_URL:0:${#SVN_ROOT}}" = "${SVN_ROOT}" ] ; then - SVN_PATH="${SVN_URL:${#SVN_ROOT}}" - fi +SRC_APP_PATH="${BUILT_PRODUCTS_DIR}/${APP_NAME}.app" + +# Visible in the about:version page. +SVN_REVISION=$(svn info "${SRCROOT}" | grep "Revision:" | cut -d" " -f2-) +if [ -z "${SVN_REVISION}" ] ; then + echo "Could not determine svn revision. This may be OK." >&2 + # TODO: check for git, and get the version number from it? fi -# Pull in the Chrome version number. +# Pull in the chrome version number . "${TOP}/chrome/VERSION" FULL_VERSION="${MAJOR}.${MINOR}.${BUILD}.${PATCH}" +SHORT_VERSION="${MAJOR}.${MINOR}.${BUILD}" -# Fetch the copyright. +# Fetch the copyright COPYRIGHT_STRING=$("${BRAND_SCRIPT}" "${BUILD_BRANDING}" COPYRIGHT) -# Map (c) or (C) to the copyright symbol. +# Map (c) or (C) to the copyright sign COPYRIGHT_STRING=$(echo "${COPYRIGHT_STRING}" | sed -e $'s/([cC])/\302\251/g') # Build the full copyright string @@ -110,25 +92,17 @@ TMP_INFO_PLIST_DEFAULTS="${TEMP_DIR}/Info" TMP_INFO_PLIST="${TMP_INFO_PLIST_DEFAULTS}.plist" cp "${SRC_APP_PATH}/${INFO_PLIST_PATH}" "${TMP_INFO_PLIST}" -# Save off the Subversion revision number and source root path in case they're -# needed. +# Save off the svn version number in case we need it if [ ! -z "${SVN_REVISION}" ] ; then defaults write "${TMP_INFO_PLIST_DEFAULTS}" \ - SVNRevision -string "${SVN_REVISION}" -else - defaults delete "${TMP_INFO_PLIST_DEFAULTS}" SVNRevision || true -fi -if [ ! -z "${SVN_PATH}" ] ; then - defaults write "${TMP_INFO_PLIST_DEFAULTS}" SVNPath -string "${SVN_PATH}" -else - defaults delete "${TMP_INFO_PLIST_DEFAULTS}" SVNPath || true + SVNRevision -string "${SVN_REVISION}" fi # Add public version info so "Get Info" works defaults write "${TMP_INFO_PLIST_DEFAULTS}" \ CFBundleGetInfoString -string "${LONG_COPYRIGHT}" defaults write "${TMP_INFO_PLIST_DEFAULTS}" \ - CFBundleShortVersionString -string "${FULL_VERSION}" + CFBundleShortVersionString -string "${SHORT_VERSION}" # Honor the 429496.72.95 limit. The maximum comes from splitting 2^32 - 1 into # 6, 2, 2 digits. The limitation was present in Tiger, but it could have been # fixed in later OS release, but hasn't been tested (it's easy enough to find @@ -141,7 +115,7 @@ defaults write "${TMP_INFO_PLIST_DEFAULTS}" \ defaults write "${TMP_INFO_PLIST_DEFAULTS}" \ NSHumanReadableCopyright -string "${COPYRIGHT_STRING}" -# Add or remove the Breakpad keys. +# Add/Remove the breakpad keys if [ "${USE_BREAKPAD}" = "1" ] ; then defaults write "${TMP_INFO_PLIST_DEFAULTS}" \ BreakpadURL "https://clients2.google.com/cr/report" @@ -165,7 +139,7 @@ else defaults delete "${TMP_INFO_PLIST_DEFAULTS}" BreakpadSkipConfirm || true fi -# Add or remove the Keystone keys (only supported in release builds). +# Add/Remove keystone keys (only supported in release builds) if [ "${USE_KEYSTONE}" = "1" ] && [ "${CONFIGURATION}" = "Release" ] ; then KEYSTONE_URL="https://tools.google.com/service/update2" KEYSTONE_APP_ID=$(defaults read "${TMP_INFO_PLIST_DEFAULTS}" \ @@ -186,6 +160,3 @@ fi # might have done. plutil -convert xml1 "${TMP_INFO_PLIST}" cp "${TMP_INFO_PLIST}" "${SRC_APP_PATH}/${INFO_PLIST_PATH}" - -# Clean up. -rm -f "${TMP_INFO_PLIST}" diff --git a/chrome/app/app-Info.plist b/chrome/app/app-Info.plist index 3a8e686..51594c3 100644 --- a/chrome/app/app-Info.plist +++ b/chrome/app/app-Info.plist @@ -190,6 +190,8 @@ <true/> <key>LSMinimumSystemVersion</key> <string>10.5.0</string> + <key>LSUIElement</key> + <string>1</string> <key>NSMainNibFile</key> <string>MainMenu</string> <key>NSPrincipalClass</key> diff --git a/chrome/browser/plugin_process_host.cc b/chrome/browser/plugin_process_host.cc index 9a81b94..3c5f169 100644 --- a/chrome/browser/plugin_process_host.cc +++ b/chrome/browser/plugin_process_host.cc @@ -335,10 +335,11 @@ bool PluginProcessHost::Init(const WebPluginInfo& info, // build command line for plugin, we have to quote the plugin's path to deal // with spaces. - std::wstring exe_path = GetChildPath(); - if (exe_path.empty()) { + const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); + std::wstring exe_path = + browser_command_line.GetSwitchValue(switches::kBrowserSubprocessPath); + if (exe_path.empty() && !PathService::Get(base::FILE_EXE, &exe_path)) return false; - } CommandLine cmd_line(exe_path); if (logging::DialogsAreSuppressed()) @@ -367,8 +368,6 @@ bool PluginProcessHost::Init(const WebPluginInfo& info, switches::kEnableStatsTable, }; - const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); - for (size_t i = 0; i < arraysize(switch_names); ++i) { if (browser_command_line.HasSwitch(switch_names[i])) { cmd_line.AppendSwitchWithValue( diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc index 07b7c7e..0fc5e05 100644 --- a/chrome/browser/renderer_host/browser_render_process_host.cc +++ b/chrome/browser/renderer_host/browser_render_process_host.cc @@ -47,7 +47,6 @@ #include "chrome/browser/visitedlink_master.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/child_process_info.h" -#include "chrome/common/child_process_host.h" #include "chrome/common/chrome_descriptors.h" #include "chrome/common/logging_chrome.h" #include "chrome/common/notification_service.h" @@ -202,6 +201,16 @@ class VisitedLinkUpdater { VisitedLinkCommon::Fingerprints pending_; }; + +// Used for a View_ID where the renderer has not been attached yet +const int32 kInvalidViewID = -1; + +// Get the path to the renderer executable, which is the same as the +// current executable. +bool GetRendererPath(std::wstring* cmd_line) { + return PathService::Get(base::FILE_EXE, cmd_line); +} + BrowserRenderProcessHost::BrowserRenderProcessHost(Profile* profile) : RenderProcessHost(profile), visible_widgets_(0), @@ -298,12 +307,15 @@ bool BrowserRenderProcessHost::Init() { // Build command line for renderer, we have to quote the executable name to // deal with spaces. - std::wstring renderer_path = ChildProcessHost::GetChildPath(); + std::wstring renderer_path = + browser_command_line.GetSwitchValue(switches::kBrowserSubprocessPath); if (renderer_path.empty()) { - // Need to reset the channel we created above or others might think the - // connection is live. - channel_.reset(); - return false; + if (!GetRendererPath(&renderer_path)) { + // Need to reset the channel we created above or others might think the + // connection is live. + channel_.reset(); + return false; + } } CommandLine cmd_line(renderer_path); if (logging::DialogsAreSuppressed()) diff --git a/chrome/browser/utility_process_host.cc b/chrome/browser/utility_process_host.cc index c06749d..149d296 100644 --- a/chrome/browser/utility_process_host.cc +++ b/chrome/browser/utility_process_host.cc @@ -52,7 +52,12 @@ bool UtilityProcessHost::StartWebResourceUnpacker(const std::string& data) { } std::wstring UtilityProcessHost::GetUtilityProcessCmd() { - return GetChildPath(); + std::wstring exe_path = CommandLine::ForCurrentProcess()->GetSwitchValue( + switches::kBrowserSubprocessPath); + if (exe_path.empty()) { + PathService::Get(base::FILE_EXE, &exe_path); + } + return exe_path; } bool UtilityProcessHost::StartProcess(const FilePath& exposed_dir) { diff --git a/chrome/browser/worker_host/worker_process_host.cc b/chrome/browser/worker_host/worker_process_host.cc index 16cbada..e1e7829 100644 --- a/chrome/browser/worker_host/worker_process_host.cc +++ b/chrome/browser/worker_host/worker_process_host.cc @@ -88,8 +88,8 @@ bool WorkerProcessHost::Init() { if (!CreateChannel()) return false; - std::wstring exe_path = GetChildPath(); - if (exe_path.empty()) + std::wstring exe_path; + if (!PathService::Get(base::FILE_EXE, &exe_path)) return false; CommandLine cmd_line(exe_path); diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index b98860f..ab3333d 100644 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -65,18 +65,7 @@ '../views/controls/label_unittest.cc', '../views/controls/table/table_view_unittest.cc', '../views/grid_layout_unittest.cc', - ], - 'conditions': [ - ['OS=="mac"', { - 'conditions': [ - ['branding=="Chrome"', { - 'bundle_id': 'com.google.Chrome', - }, { # else: branding!="Chrome" - 'bundle_id': 'org.chromium.Chromium', - }], # branding - ], # conditions - }], # OS=="mac" - ], # conditions + ] }, 'includes': [ '../build/common.gypi', @@ -3022,6 +3011,9 @@ 'conditions': [ ['branding=="Chrome"', { 'mac_bundle_resources': ['app/theme/google_chrome/app.icns'], + 'variables': { + 'bundle_id': 'com.google.Chrome', + }, 'copies': [ { 'destination': '<(PRODUCT_DIR)/<(mac_product_name).app/Contents/MacOS/', @@ -3033,6 +3025,9 @@ ], }, { # else: 'branding!="Chrome" 'mac_bundle_resources': ['app/theme/chromium/app.icns'], + 'variables': { + 'bundle_id': 'org.chromium.Chromium', + }, 'copies': [ { 'destination': '<(PRODUCT_DIR)/<(mac_product_name).app/Contents/MacOS/', @@ -3085,12 +3080,8 @@ 'CHROMIUM_BUNDLE_ID': '<(bundle_id)', 'CHROMIUM_SHORT_NAME': '<(branding)', }, - 'mac_bundle_resources': [ - '<(PRODUCT_DIR)/<(mac_product_name) Helper.app', - ], + # Bring in pdfsqueeze and run it on all pdfs 'dependencies': [ - 'helper_app', - # Bring in pdfsqueeze and run it on all pdfs '../build/temp_gyp/pdfsqueeze.gyp:pdfsqueeze', 'interpose_dependency_shim', ], @@ -3113,23 +3104,6 @@ 'destination': '<(PRODUCT_DIR)/<(mac_product_name).app/Contents/Frameworks', 'files': ['<(PRODUCT_DIR)/<(mac_product_name) Framework.framework'], }, - { - # Copy web inspector resources to the Contents/Resources folder. - 'destination': '<(PRODUCT_DIR)/<(mac_product_name).app/Contents/Resources', - 'files': ['<(PRODUCT_DIR)/resources/inspector/'], - }, - ], - 'postbuilds': [ - { - # Modify the Info.plist as needed. The script explains why this - # is needed. This is also done in the helper_app target. - 'postbuild_name': 'Tweak Info.plist', - 'action': ['<(DEPTH)/build/mac/tweak_app_infoplist', - '-b<(mac_breakpad)', - '-k<(mac_keystone)', - '-s1', # Include Subversion information - '<(branding)'], - }, ], }, { # else: OS != "mac" 'conditions': [ @@ -3147,6 +3121,34 @@ }], ], }], + ['OS=="mac"', { + 'actions': [ + { + # Mac adds an action to modify the Info.plist to meet our needs + # (see the script for why this is done). + 'action_name': 'tweak_app_infoplist', + # We don't list any inputs or outputs because we always want + # the script to run. Why? Because it does thinks like record + # the svn revision into the info.plist, so there is no file to + # depend on that will change when ever that changes. + 'inputs': [], + 'outputs': [], + 'action': ['<(DEPTH)/build/mac/tweak_app_infoplist', + '-b<(mac_breakpad)', + '-k<(mac_keystone)', + '<(branding)'], + }, + ], + }], + ['OS=="mac"', { + # Copy web inspector resources to the Contents/Resources folder. + 'copies': [ + { + 'destination': '<(PRODUCT_DIR)/<(mac_product_name).app/Contents/Resources', + 'files': ['<(PRODUCT_DIR)/resources/inspector/'], + }, + ], + }], ['OS=="linux"', { 'conditions': [ ['branding=="Chrome"', { @@ -4396,7 +4398,7 @@ # app bundle, the only dependent of this target. # TODO(mark): Fix. 'mac_bundle_resources/': [ - ['exclude', '.*'], + ['exclude', ''], ], 'direct_dependent_settings': { 'mac_bundle_resources': [ @@ -4475,71 +4477,6 @@ ['OS=="mac"', { 'targets': [ { - 'target_name': 'helper_app', - 'type': 'executable', - 'product_name': '<(mac_product_name) Helper', - 'mac_bundle': 1, - 'dependencies': [ - 'chrome_dll', - ], - 'sources': [ - # chrome_exe_main.mm's main() is the entry point for the "chrome" - # (browser app) target. All it does is jump to chrome_dll's - # ChromeMain. This is appropriate for helper processes too, - # because the logic to discriminate between process types at run - # time is actually directed by the --type command line argument - # processed by ChromeMain. Sharing chrome_exe_main.mm with the - # browser app will suffice for now. - 'app/chrome_exe_main.mm', - 'app/helper-Info.plist', - ], - # TODO(mark): Come up with a fancier way to do this. It should only - # be necessary to list app-Info.plist once, not the three times it is - # listed here. - 'mac_bundle_resources!': [ - 'app/helper-Info.plist', - ], - # TODO(mark): For now, don't put any resources into this app. Its - # resources directory will be a symbolic link to the browser app's - # resources directory. - 'mac_bundle_resources/': [ - ['exclude', '.*'], - ], - 'xcode_settings': { - 'CHROMIUM_BUNDLE_ID': '<(bundle_id)', - 'CHROMIUM_SHORT_NAME': '<(branding)', - 'INFOPLIST_FILE': 'app/helper-Info.plist', - }, - 'postbuilds': [ - { - 'postbuild_name': 'Make Symbolic Links', - 'action': ['app/make_mac_app_symlinks'], - }, - { - # Modify the Info.plist as needed. The script explains why this - # is needed. This is also done in the chrome target. In - # this case, -k0 is always used because Keystone never runs - # within the helper app. -s0 is used to avoid placing Subversion - # data in the helper app's Info.plist. It will be present in - # the main app's Info.plist, which is sufficient. - 'postbuild_name': 'Tweak Info.plist', - 'action': ['<(DEPTH)/build/mac/tweak_app_infoplist', - '-b<(mac_breakpad)', - '-k0', - '-s0', - '<(branding)'], - }, - ], - 'conditions': [ - ['mac_breakpad==1', { - 'variables': { - # A real .dSYM is needed for dump_syms to operate on. - 'mac_real_dsym': 1, - }, - }], - ], - }, - { # Convenience target to build a disk image. 'target_name': 'build_app_dmg', # Don't place this in the 'all' list; most won't want it. diff --git a/chrome/common/child_process_host.cc b/chrome/common/child_process_host.cc index ca0f972..b7cab7f 100644 --- a/chrome/common/child_process_host.cc +++ b/chrome/common/child_process_host.cc @@ -4,17 +4,13 @@ #include "chrome/common/child_process_host.h" -#include "base/command_line.h" #include "base/compiler_specific.h" -#include "base/file_path.h" #include "base/logging.h" #include "base/message_loop.h" -#include "base/path_service.h" #include "base/process_util.h" #include "base/singleton.h" #include "base/waitable_event.h" #include "chrome/browser/chrome_thread.h" -#include "chrome/common/chrome_switches.h" #include "chrome/common/notification_service.h" #include "chrome/common/notification_type.h" #include "chrome/common/plugin_messages.h" @@ -69,67 +65,6 @@ ChildProcessHost::~ChildProcessHost() { ProcessWatcher::EnsureProcessTerminated(handle()); } -// static -std::wstring ChildProcessHost::GetChildPath() { - std::wstring child_path = CommandLine::ForCurrentProcess()->GetSwitchValue( - switches::kBrowserSubprocessPath); - if (!child_path.empty()) - return child_path; - -#if !defined(OS_MACOSX) - // On most platforms, the child executable is the same as the current - // executable. - PathService::Get(base::FILE_EXE, &child_path); - return child_path; -#else - // On the Mac, the child executable lives at a predefined location within - // the current app bundle. - - FilePath path; - if (!PathService::Get(base::FILE_EXE, &path)) - return child_path; - - // Figure out the current executable name. In a browser, this will be - // "Chromium" or "Google Chrome". The child name will be the browser - // executable name with " Helper" appended. The child app bundle name will - // be that name with ".app" appended. - FilePath::StringType child_exe_name = path.BaseName().value(); - const FilePath::StringType child_suffix = FILE_PATH_LITERAL(" Helper"); - - if (child_exe_name.size() > child_suffix.size()) { - size_t test_suffix_pos = child_exe_name.size() - child_suffix.size(); - const FilePath::CharType* test_suffix = - child_exe_name.c_str() + test_suffix_pos; - if (strcmp(test_suffix, child_suffix.c_str()) == 0) { - // FILE_EXE already ends with the child suffix and therefore already - // refers to the child process path. Just return it. - return path.ToWStringHack(); - } - } - - child_exe_name.append(child_suffix); - FilePath::StringType child_app_name = child_exe_name; - child_app_name.append(FILE_PATH_LITERAL(".app")); - // The renderer app bundle lives in the browser app bundle's Resources - // directory. Take off the executable name. - path = path.DirName(); - - // Take off the MacOS component, after verifying that's what's there. - FilePath::StringType macos = path.BaseName().value(); - DCHECK_EQ(macos, FILE_PATH_LITERAL("MacOS")); - path = path.DirName(); - - // Append the components to get to the sub-app bundle's executable. - path = path.Append(FILE_PATH_LITERAL("Resources")); - path = path.Append(child_app_name); - path = path.Append(FILE_PATH_LITERAL("Contents")); - path = path.Append(FILE_PATH_LITERAL("MacOS")); - path = path.Append(child_exe_name); - - return path.ToWStringHack(); -#endif // OS_MACOSX -} - bool ChildProcessHost::CreateChannel() { channel_id_ = GenerateRandomChannelID(this); channel_.reset(new IPC::Channel( diff --git a/chrome/common/child_process_host.h b/chrome/common/child_process_host.h index 95b97b6..926bdd2 100644 --- a/chrome/common/child_process_host.h +++ b/chrome/common/child_process_host.h @@ -22,13 +22,6 @@ class ChildProcessHost : public ResourceDispatcherHost::Receiver, public: virtual ~ChildProcessHost(); - // Returns the pathname to be used for a child process. If a subprocess - // pathname was specified on the command line, that will be used. Otherwise, - // the default child process pathname will be returned. On most platforms, - // this will be the same as the currently-executing process. On failure, - // returns an empty wstring. - static std::wstring GetChildPath(); - // ResourceDispatcherHost::Receiver implementation: virtual bool Send(IPC::Message* msg); |