Commit 1cd90f74 authored by thakis@chromium.org's avatar thakis@chromium.org

CrOs: Remove 2 static initializers and 2 exit time destructors.

Turn on -Wexit-time-destructors for (most of) the chrome target.

BUG=101600,94925
TEST=none
TBR=stevenjb

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110954 0039d316-1c4b-4281-b951-d872f2087c98
parent 79f06c73
...@@ -32,11 +32,11 @@ const int kThrobDurationMs = 750; ...@@ -32,11 +32,11 @@ const int kThrobDurationMs = 750;
// Network strength bars images. // Network strength bars images.
const int kNumBarsImages = 5; const int kNumBarsImages = 5;
SkBitmap kBarsImagesAnimating[kNumBarsImages - 1]; SkBitmap* kBarsImagesAnimating[kNumBarsImages - 1];
// Network strength arcs images. // Network strength arcs images.
const int kNumArcsImages = 5; const int kNumArcsImages = 5;
SkBitmap kArcsImagesAnimating[kNumArcsImages - 1]; SkBitmap* kArcsImagesAnimating[kNumArcsImages - 1];
// Badge offsets. If a badge is large enough that it won't fit within the icon // Badge offsets. If a badge is large enough that it won't fit within the icon
// when using the right or bottom offset, it gets shifted inwards so it will. // when using the right or bottom offset, it gets shifted inwards so it will.
...@@ -526,7 +526,7 @@ void NetworkMenuIcon::SetConnectingIcon(const Network* network, ...@@ -526,7 +526,7 @@ void NetworkMenuIcon::SetConnectingIcon(const Network* network,
double animation) { double animation) {
int image_count; int image_count;
BitmapType bitmap_type; BitmapType bitmap_type;
SkBitmap* images; SkBitmap** images;
if (network->type() == TYPE_WIFI) { if (network->type() == TYPE_WIFI) {
image_count = kNumArcsImages - 1; image_count = kNumArcsImages - 1;
...@@ -542,11 +542,12 @@ void NetworkMenuIcon::SetConnectingIcon(const Network* network, ...@@ -542,11 +542,12 @@ void NetworkMenuIcon::SetConnectingIcon(const Network* network,
index = max(min(index, image_count - 1), 0); index = max(min(index, image_count - 1), 0);
// Lazily cache images. // Lazily cache images.
if (images[index].empty()) { if (!images[index]) {
SkBitmap source = GetBitmap(bitmap_type, index + 1); SkBitmap source = GetBitmap(bitmap_type, index + 1);
images[index] = NetworkMenuIcon::GenerateConnectingBitmap(source); images[index] =
new SkBitmap(NetworkMenuIcon::GenerateConnectingBitmap(source));
} }
icon_->set_icon(images[index]); icon_->set_icon(*images[index]);
} }
// Sets up the icon and badges for GenerateBitmap(). // Sets up the icon and badges for GenerateBitmap().
......
...@@ -163,6 +163,7 @@ ...@@ -163,6 +163,7 @@
# TODO(joi): Move debugger-related build rules to content/ # TODO(joi): Move debugger-related build rules to content/
'target_name': 'debugger', 'target_name': 'debugger',
'type': 'static_library', 'type': 'static_library',
'variables': { 'enable_wexit_time_destructors': 1, },
'dependencies': [ 'dependencies': [
'chrome_resources.gyp:chrome_extra_resources', 'chrome_resources.gyp:chrome_extra_resources',
'chrome_resources.gyp:chrome_resources', 'chrome_resources.gyp:chrome_resources',
...@@ -217,6 +218,7 @@ ...@@ -217,6 +218,7 @@
{ {
'target_name': 'plugin', 'target_name': 'plugin',
'type': 'static_library', 'type': 'static_library',
'variables': { 'enable_wexit_time_destructors': 1, },
'dependencies': [ 'dependencies': [
'chrome_resources.gyp:chrome_strings', 'chrome_resources.gyp:chrome_strings',
'../base/base.gyp:base', '../base/base.gyp:base',
...@@ -234,6 +236,7 @@ ...@@ -234,6 +236,7 @@
{ {
'target_name': 'utility', 'target_name': 'utility',
'type': 'static_library', 'type': 'static_library',
'variables': { 'enable_wexit_time_destructors': 1, },
'dependencies': [ 'dependencies': [
'../base/base.gyp:base', '../base/base.gyp:base',
'../content/content.gyp:content_utility', '../content/content.gyp:content_utility',
...@@ -259,6 +262,7 @@ ...@@ -259,6 +262,7 @@
# or from compiling a stub implementation. # or from compiling a stub implementation.
'target_name': 'syncapi_core', 'target_name': 'syncapi_core',
'type': 'static_library', 'type': 'static_library',
'variables': { 'enable_wexit_time_destructors': 1, },
'sources': [ 'sources': [
'browser/sync/engine/syncapi_internal.cc', 'browser/sync/engine/syncapi_internal.cc',
'browser/sync/engine/syncapi_internal.h', 'browser/sync/engine/syncapi_internal.h',
...@@ -323,6 +327,7 @@ ...@@ -323,6 +327,7 @@
# Provides the API that Chrome services use to talk to sync. # Provides the API that Chrome services use to talk to sync.
'target_name': 'syncapi_service', 'target_name': 'syncapi_service',
'type': 'static_library', 'type': 'static_library',
'variables': { 'enable_wexit_time_destructors': 1, },
'sources': [ 'sources': [
'browser/sync/api/syncable_service.cc', 'browser/sync/api/syncable_service.cc',
'browser/sync/api/syncable_service.h', 'browser/sync/api/syncable_service.h',
...@@ -356,6 +361,7 @@ ...@@ -356,6 +361,7 @@
{ {
'target_name': 'sync', 'target_name': 'sync',
'type': 'static_library', 'type': 'static_library',
'variables': { 'enable_wexit_time_destructors': 1, },
'sources': [ 'sources': [
'browser/sync/engine/all_status.cc', 'browser/sync/engine/all_status.cc',
'browser/sync/engine/all_status.h', 'browser/sync/engine/all_status.h',
...@@ -554,6 +560,7 @@ ...@@ -554,6 +560,7 @@
{ {
'target_name': 'sync_notifier', 'target_name': 'sync_notifier',
'type': 'static_library', 'type': 'static_library',
'variables': { 'enable_wexit_time_destructors': 1, },
'sources': [ 'sources': [
'browser/sync/notifier/cache_invalidation_packet_handler.cc', 'browser/sync/notifier/cache_invalidation_packet_handler.cc',
'browser/sync/notifier/cache_invalidation_packet_handler.h', 'browser/sync/notifier/cache_invalidation_packet_handler.h',
...@@ -597,6 +604,7 @@ ...@@ -597,6 +604,7 @@
{ {
'target_name': 'service', 'target_name': 'service',
'type': 'static_library', 'type': 'static_library',
'variables': { 'enable_wexit_time_destructors': 1, },
'dependencies': [ 'dependencies': [
'chrome_resources.gyp:chrome_strings', 'chrome_resources.gyp:chrome_strings',
'common', 'common',
...@@ -687,6 +695,7 @@ ...@@ -687,6 +695,7 @@
{ {
'target_name': 'ipclist', 'target_name': 'ipclist',
'type': 'executable', 'type': 'executable',
'variables': { 'enable_wexit_time_destructors': 1, },
'dependencies': [ 'dependencies': [
'test_support_common', 'test_support_common',
'../skia/skia.gyp:skia', '../skia/skia.gyp:skia',
...@@ -705,6 +714,7 @@ ...@@ -705,6 +714,7 @@
{ {
'target_name': 'helper_app', 'target_name': 'helper_app',
'type': 'executable', 'type': 'executable',
'variables': { 'enable_wexit_time_destructors': 1, },
'product_name': '<(mac_product_name) Helper', 'product_name': '<(mac_product_name) Helper',
'mac_bundle': 1, 'mac_bundle': 1,
'dependencies': [ 'dependencies': [
...@@ -820,6 +830,7 @@ ...@@ -820,6 +830,7 @@
# itself is responsible for producing bundles. # itself is responsible for producing bundles.
'target_name': 'app_mode_app', 'target_name': 'app_mode_app',
'type': 'executable', 'type': 'executable',
'variables': { 'enable_wexit_time_destructors': 1, },
'product_name': '<(mac_product_name) App Mode Loader', 'product_name': '<(mac_product_name) App Mode Loader',
'sources': [ 'sources': [
'app/app_mode_loader_mac.mm', 'app/app_mode_loader_mac.mm',
...@@ -868,6 +879,7 @@ ...@@ -868,6 +879,7 @@
# build without actually linking to the resulting library. # build without actually linking to the resulting library.
'target_name': 'interpose_dependency_shim', 'target_name': 'interpose_dependency_shim',
'type': 'executable', 'type': 'executable',
'variables': { 'enable_wexit_time_destructors': 1, },
'dependencies': [ 'dependencies': [
'plugin_carbon_interpose', 'plugin_carbon_interpose',
], ],
...@@ -891,6 +903,7 @@ ...@@ -891,6 +903,7 @@
# dylib for interposing Carbon calls in the plugin process. # dylib for interposing Carbon calls in the plugin process.
'target_name': 'plugin_carbon_interpose', 'target_name': 'plugin_carbon_interpose',
'type': 'shared_library', 'type': 'shared_library',
'variables': { 'enable_wexit_time_destructors': 1, },
'dependencies': [ 'dependencies': [
'chrome_dll', 'chrome_dll',
], ],
...@@ -930,6 +943,7 @@ ...@@ -930,6 +943,7 @@
{ {
'target_name': 'infoplist_strings_tool', 'target_name': 'infoplist_strings_tool',
'type': 'executable', 'type': 'executable',
'variables': { 'enable_wexit_time_destructors': 1, },
'dependencies': [ 'dependencies': [
'chrome_resources.gyp:chrome_strings', 'chrome_resources.gyp:chrome_strings',
'../base/base.gyp:base', '../base/base.gyp:base',
...@@ -948,6 +962,7 @@ ...@@ -948,6 +962,7 @@
{ {
'target_name': 'convert_dict', 'target_name': 'convert_dict',
'type': 'executable', 'type': 'executable',
'variables': { 'enable_wexit_time_destructors': 1, },
'dependencies': [ 'dependencies': [
'../base/base.gyp:base', '../base/base.gyp:base',
'../base/base.gyp:base_i18n', '../base/base.gyp:base_i18n',
...@@ -962,6 +977,7 @@ ...@@ -962,6 +977,7 @@
'target_name': 'convert_dict_lib', 'target_name': 'convert_dict_lib',
'product_name': 'convert_dict', 'product_name': 'convert_dict',
'type': 'static_library', 'type': 'static_library',
'variables': { 'enable_wexit_time_destructors': 1, },
'include_dirs': [ 'include_dirs': [
'..', '..',
], ],
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
{ {
'target_name': 'browser', 'target_name': 'browser',
'type': 'static_library', 'type': 'static_library',
'variables': { 'enable_wexit_time_destructors': 1, },
'dependencies': [ 'dependencies': [
'app/policy/cloud_policy_codegen.gyp:policy', 'app/policy/cloud_policy_codegen.gyp:policy',
'autofill_regexes', 'autofill_regexes',
......
...@@ -9,6 +9,9 @@ ...@@ -9,6 +9,9 @@
'type': 'static_library', 'type': 'static_library',
'variables': { 'variables': {
'chrome_common_target': 1, 'chrome_common_target': 1,
# TODO(thakis): Turn this on. Blocked on g_log_function_mapping in
# ipc_message_macros.h. http://crbug.com/101600
#'enable_wexit_time_destructors': 1,
}, },
'include_dirs': [ 'include_dirs': [
'..', '..',
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
'targets': [ 'targets': [
{ {
'variables': { 'variables': {
'enable_wexit_time_destructors': 1,
'conditions' : [ 'conditions' : [
['OS=="win" and optimize_with_syzygy==1', { ['OS=="win" and optimize_with_syzygy==1', {
# On Windows we use build chrome_dll as an intermediate target # On Windows we use build chrome_dll as an intermediate target
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
'mac_bundle': 1, 'mac_bundle': 1,
'variables': { 'variables': {
'use_system_xdg_utils%': 0, 'use_system_xdg_utils%': 0,
'enable_wexit_time_destructors': 1,
}, },
'sources': [ 'sources': [
'app/breakpad_win.cc', 'app/breakpad_win.cc',
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
{ {
'target_name': 'renderer', 'target_name': 'renderer',
'type': 'static_library', 'type': 'static_library',
'variables': { 'enable_wexit_time_destructors': 1, },
'dependencies': [ 'dependencies': [
'common', 'common',
'common_net', 'common_net',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment