0

Move Leopard compatible block code to content/.

BUG=95573
TEST=no change

Review URL: http://codereview.chromium.org/8060022

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103017 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
avi@chromium.org
2011-09-27 21:50:37 +00:00
parent 38ba7ae8f8
commit 439f1c99d7
9 changed files with 78 additions and 72 deletions

@ -7,7 +7,6 @@
#include <cmath>
#include "base/sys_string_conversions.h"
#include "chrome/browser/mac/closure_blocks_leopard_compat.h"
#include "chrome/browser/spellchecker/spellchecker_platform_engine.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h"
@ -15,6 +14,7 @@
#import "chrome/browser/ui/cocoa/view_id_util.h"
#include "chrome/common/spellcheck_messages.h"
#include "content/browser/debugger/devtools_client_host.h"
#include "content/browser/mac/closure_blocks_leopard_compat.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/renderer_host/render_view_host_observer.h"
#include "content/browser/renderer_host/render_widget_host.h"

@ -16,13 +16,13 @@
#include "base/string_util.h"
#include "base/sys_info.h"
#include "base/sys_string_conversions.h"
#include "chrome/browser/mac/closure_blocks_leopard_compat.h"
#import "chrome/browser/renderer_host/accelerated_plugin_view_mac.h"
#import "chrome/browser/ui/cocoa/rwhvm_editcommand_helper.h"
#import "content/browser/accessibility/browser_accessibility_cocoa.h"
#include "content/browser/browser_thread.h"
#include "content/browser/gpu/gpu_process_host.h"
#include "content/browser/gpu/gpu_process_host_ui_shim.h"
#include "content/browser/mac/closure_blocks_leopard_compat.h"
#include "content/browser/plugin_process_host.h"
#include "content/browser/renderer_host/backing_store_mac.h"
#include "content/browser/renderer_host/render_process_host.h"

@ -4298,7 +4298,7 @@
],
},
'dependencies': [
'closure_blocks_leopard_compat',
'../content/content.gyp:closure_blocks_leopard_compat',
],
'actions': [
{
@ -5025,65 +5025,4 @@
'includes': [ '../build/protoc.gypi' ]
},
],
'conditions': [
['OS=="mac"', {
'targets': [
{
'target_name': 'closure_blocks_leopard_compat',
'conditions': [
['mac_sdk == "10.5"', {
'type': 'shared_library',
'product_name': 'closure_blocks_leopard_compat_stub',
'variables': {
# This target controls stripping directly. See below.
'mac_strip': 0,
},
'sources': [
'browser/mac/closure_blocks_leopard_compat.S',
],
'xcode_settings': {
# These values are taken from libSystem.dylib in the 10.5 SDK.
# Setting LD_DYLIB_INSTALL_NAME causes anything linked against
# this stub library to look for the symbols it provides in the
# real libSystem at runtime. When using ld from Xcode 4 or
# later (ld64-123.2 and up), giving two libraries with the
# same "install name" to the linker will cause it to print
# "ld: warning: dylibs with same install name". This is
# harmless, and ld will behave as intended here.
#
# The real library's compatibility version is used, and the
# value of the current version from the SDK is used to make
# it appear as though anything linked against this stub was
# linked against the real thing.
'LD_DYLIB_INSTALL_NAME': '/usr/lib/libSystem.B.dylib',
'DYLIB_COMPATIBILITY_VERSION': '1.0.0',
'DYLIB_CURRENT_VERSION': '111.1.4',
# Turn on stripping (yes, even in debug mode), and add the -c
# flag. This is what produces a stub library (MH_DYLIB_STUB)
# as opposed to a dylib (MH_DYLIB). MH_DYLIB_STUB files
# contain symbol tables and everything else needed for
# linking, but are stripped of section contents. This is the
# same way that the stub libraries in Mac OS X SDKs are
# created. dyld will refuse to load a stub library, so this
# provides some insurance in case anyone tries to load the
# stub at runtime.
'DEPLOYMENT_POSTPROCESSING': 'YES',
'STRIP_STYLE': 'non-global',
'STRIPFLAGS': '-c',
},
}, { # else: mac_sdk != "10.5"
# When using the 10.6 SDK or newer, the necessary definitions
# are already present in libSystem.dylib. There is no need to
# build a stub dylib to provide these symbols at link time. This
# target is still useful to cause those symbols to be treated as
# weak imports in dependents, who still must #include
# closure_blocks_leopard_compat.h to get weak imports.
'type': 'none',
}],
],
},
],
}],
],
}

@ -1318,7 +1318,6 @@
'browser/intents/web_intents_registry_unittest.cc',
'browser/internal_auth_unittest.cc',
'browser/language_usage_metrics_unittest.cc',
'browser/mac/closure_blocks_leopard_compat_unittest.cc',
'browser/mac/keystone_glue_unittest.mm',
'browser/media/media_internals_unittest.cc',
'browser/metrics/display_utils_unittest.cc',
@ -1479,7 +1478,7 @@
'browser/sync/glue/autofill_model_associator_unittest.cc',
'browser/sync/glue/autofill_profile_syncable_service_unittest.cc',
'browser/sync/glue/bookmark_data_type_controller_unittest.cc',
'browser/sync/glue/browser_thread_model_worker_unittest.cc',
'browser/sync/glue/browser_thread_model_worker_unittest.cc',
'browser/sync/glue/change_processor_mock.cc',
'browser/sync/glue/change_processor_mock.h',
'browser/sync/glue/data_type_controller_mock.cc',
@ -1985,7 +1984,7 @@
# exist on disk so it can pull from it.
'dependencies': [
'chrome',
'closure_blocks_leopard_compat',
'../content/content.gyp:closure_blocks_leopard_compat',
'../third_party/ocmock/ocmock.gyp:ocmock',
],
'include_dirs': [

@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_MAC_CLOSURE_BLOCKS_LEOPARD_COMPAT_H_
#define CHROME_BROWSER_MAC_CLOSURE_BLOCKS_LEOPARD_COMPAT_H_
#ifndef CONTENT_BROWSER_MAC_CLOSURE_BLOCKS_LEOPARD_COMPAT_H_
#define CONTENT_BROWSER_MAC_CLOSURE_BLOCKS_LEOPARD_COMPAT_H_
#pragma once
// libclosure (blocks) compatibilty for Mac OS X 10.5 (Leopard)
// libclosure (blocks) compatibility for Mac OS X 10.5 (Leopard)
//
// Background material:
// http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/Blocks
@ -101,4 +101,4 @@ MAYBE_WEAK_IMPORT extern void* _NSConcreteStackBlock[32];
#define Block_release(...) _Block_release((const void *)(__VA_ARGS__))
#endif
#endif // CHROME_BROWSER_MAC_CLOSURE_BLOCKS_LEOPARD_COMPAT_H_
#endif // CONTENT_BROWSER_MAC_CLOSURE_BLOCKS_LEOPARD_COMPAT_H_

@ -5,7 +5,7 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "base/mac/mac_util.h"
#include "chrome/browser/mac/closure_blocks_leopard_compat.h"
#include "content/browser/mac/closure_blocks_leopard_compat.h"
// Used in ClosureBlocksLeopardCompatTest.Global. Putting a block at global
// scope results in a block structure whose isa field is set to

@ -117,6 +117,68 @@
],
},
],
'conditions': [
['OS=="mac"', {
'targets': [
{
'target_name': 'closure_blocks_leopard_compat',
'conditions': [
['mac_sdk == "10.5"', {
'type': 'shared_library',
'product_name': 'closure_blocks_leopard_compat_stub',
'variables': {
# This target controls stripping directly. See below.
'mac_strip': 0,
},
'sources': [
'browser/mac/closure_blocks_leopard_compat.S',
],
'xcode_settings': {
# These values are taken from libSystem.dylib in the 10.5
# SDK. Setting LD_DYLIB_INSTALL_NAME causes anything linked
# against this stub library to look for the symbols it
# provides in the real libSystem at runtime. When using ld
# from Xcode 4 or later (ld64-123.2 and up), giving two
# libraries with the same "install name" to the linker will
# cause it to print "ld: warning: dylibs with same install
# name". This is harmless, and ld will behave as intended
# here.
#
# The real library's compatibility version is used, and the
# value of the current version from the SDK is used to make
# it appear as though anything linked against this stub was
# linked against the real thing.
'LD_DYLIB_INSTALL_NAME': '/usr/lib/libSystem.B.dylib',
'DYLIB_COMPATIBILITY_VERSION': '1.0.0',
'DYLIB_CURRENT_VERSION': '111.1.4',
# Turn on stripping (yes, even in debug mode), and add the -c
# flag. This is what produces a stub library (MH_DYLIB_STUB)
# as opposed to a dylib (MH_DYLIB). MH_DYLIB_STUB files
# contain symbol tables and everything else needed for
# linking, but are stripped of section contents. This is the
# same way that the stub libraries in Mac OS X SDKs are
# created. dyld will refuse to load a stub library, so this
# provides some insurance in case anyone tries to load the
# stub at runtime.
'DEPLOYMENT_POSTPROCESSING': 'YES',
'STRIP_STYLE': 'non-global',
'STRIPFLAGS': '-c',
},
}, { # else: mac_sdk != "10.5"
# When using the 10.6 SDK or newer, the necessary definitions
# are already present in libSystem.dylib. There is no need to
# build a stub dylib to provide these symbols at link time.
# This target is still useful to cause those symbols to be
# treated as weak imports in dependents, who still must
# #include closure_blocks_leopard_compat.h to get weak imports.
'type': 'none',
}],
],
},
],
}],
],
},
{ # component != static_library
'target_defaults': {

@ -117,6 +117,7 @@
'browser/gpu/gpu_blacklist_unittest.cc',
'browser/in_process_webkit/webkit_context_unittest.cc',
'browser/in_process_webkit/webkit_thread_unittest.cc',
'browser/mac/closure_blocks_leopard_compat_unittest.cc',
'browser/mach_broker_mac_unittest.cc',
'browser/renderer_host/gtk_key_bindings_handler_unittest.cc',
'browser/renderer_host/media/audio_input_device_manager_unittest.cc',
@ -181,6 +182,11 @@
['exclude', '^browser/renderer_host/gtk_key_bindings_handler_unittest.cc'],
],
}],
['OS=="mac"', {
'dependencies': [
'closure_blocks_leopard_compat',
],
}],
],
},
],