diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-27 21:50:37 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-27 21:50:37 +0000 |
commit | 439f1c99d74bc572952b0e01ba30ee13681959b0 (patch) | |
tree | c3dff2918556c5986f4de06698b3082926f17744 | |
parent | 38ba7ae8f8aa0a2399e466c36d458a9e38e94297 (diff) | |
download | chromium_src-439f1c99d74bc572952b0e01ba30ee13681959b0.zip chromium_src-439f1c99d74bc572952b0e01ba30ee13681959b0.tar.gz chromium_src-439f1c99d74bc572952b0e01ba30ee13681959b0.tar.bz2 |
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
-rw-r--r-- | chrome/browser/renderer_host/chrome_render_widget_host_view_mac_delegate.mm | 2 | ||||
-rw-r--r-- | chrome/browser/renderer_host/render_widget_host_view_mac.mm | 2 | ||||
-rw-r--r-- | chrome/chrome_browser.gypi | 63 | ||||
-rw-r--r-- | chrome/chrome_tests.gypi | 5 | ||||
-rw-r--r-- | content/browser/mac/closure_blocks_leopard_compat.S (renamed from chrome/browser/mac/closure_blocks_leopard_compat.S) | 0 | ||||
-rw-r--r-- | content/browser/mac/closure_blocks_leopard_compat.h (renamed from chrome/browser/mac/closure_blocks_leopard_compat.h) | 8 | ||||
-rw-r--r-- | content/browser/mac/closure_blocks_leopard_compat_unittest.cc (renamed from chrome/browser/mac/closure_blocks_leopard_compat_unittest.cc) | 2 | ||||
-rw-r--r-- | content/content.gyp | 62 | ||||
-rw-r--r-- | content/content_tests.gypi | 6 |
9 files changed, 78 insertions, 72 deletions
diff --git a/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_delegate.mm b/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_delegate.mm index ae8108c..d3349fb 100644 --- a/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_delegate.mm +++ b/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_delegate.mm @@ -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" diff --git a/chrome/browser/renderer_host/render_widget_host_view_mac.mm b/chrome/browser/renderer_host/render_widget_host_view_mac.mm index cfedd97..94530cd 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_mac.mm +++ b/chrome/browser/renderer_host/render_widget_host_view_mac.mm @@ -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" diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index 86267c1..c06f627 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -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', - }], - ], - }, - ], - }], - ], } diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi index 210c514..850a619 100644 --- a/chrome/chrome_tests.gypi +++ b/chrome/chrome_tests.gypi @@ -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': [ diff --git a/chrome/browser/mac/closure_blocks_leopard_compat.S b/content/browser/mac/closure_blocks_leopard_compat.S index 88a63da..88a63da 100644 --- a/chrome/browser/mac/closure_blocks_leopard_compat.S +++ b/content/browser/mac/closure_blocks_leopard_compat.S diff --git a/chrome/browser/mac/closure_blocks_leopard_compat.h b/content/browser/mac/closure_blocks_leopard_compat.h index 516a18f..518c7b1 100644 --- a/chrome/browser/mac/closure_blocks_leopard_compat.h +++ b/content/browser/mac/closure_blocks_leopard_compat.h @@ -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_ diff --git a/chrome/browser/mac/closure_blocks_leopard_compat_unittest.cc b/content/browser/mac/closure_blocks_leopard_compat_unittest.cc index fa1717d..fd2e467 100644 --- a/chrome/browser/mac/closure_blocks_leopard_compat_unittest.cc +++ b/content/browser/mac/closure_blocks_leopard_compat_unittest.cc @@ -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 diff --git a/content/content.gyp b/content/content.gyp index 20b8581..cdc8712 100644 --- a/content/content.gyp +++ b/content/content.gyp @@ -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': { diff --git a/content/content_tests.gypi b/content/content_tests.gypi index fd79b78..5146d05 100644 --- a/content/content_tests.gypi +++ b/content/content_tests.gypi @@ -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', + ], + }], ], }, ], |