summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa
diff options
context:
space:
mode:
authormark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-13 12:53:16 +0000
committermark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-13 12:53:16 +0000
commit1bba09cc68b4f5335ecd335a4e52b74f221ef583 (patch)
treed3d7cbe9c9cfada1a901023b4c50245f559e5fe4 /chrome/browser/cocoa
parentf3964daf023b2d10df1111248de367a0647d6392 (diff)
downloadchromium_src-1bba09cc68b4f5335ecd335a4e52b74f221ef583.zip
chromium_src-1bba09cc68b4f5335ecd335a4e52b74f221ef583.tar.gz
chromium_src-1bba09cc68b4f5335ecd335a4e52b74f221ef583.tar.bz2
Disable RTTI and C++ exceptions in the Mac build. Disable RTTI in the Linux
build, where C++ exceptions are already disabled. BUG=19094 12248 TEST=Mac release-mode Google Chrome.app should shrink by about 6MB. Mac disk image should shrink by about 1.5MB. Linux binary and package should shrink too. Review URL: http://codereview.chromium.org/165330 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23304 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa')
-rw-r--r--chrome/browser/cocoa/nsimage_cache.h8
-rw-r--r--chrome/browser/cocoa/nsimage_cache.mm11
2 files changed, 14 insertions, 5 deletions
diff --git a/chrome/browser/cocoa/nsimage_cache.h b/chrome/browser/cocoa/nsimage_cache.h
index 2d2511e..7085eef 100644
--- a/chrome/browser/cocoa/nsimage_cache.h
+++ b/chrome/browser/cocoa/nsimage_cache.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_COCOA_IMAGE_CACHE_H_
-#define CHROME_BROWSER_COCOA_IMAGE_CACHE_H_
+#ifndef CHROME_BROWSER_COCOA_NSIMAGE_CACHE_H_
+#define CHROME_BROWSER_COCOA_NSIMAGE_CACHE_H_
#import <Cocoa/Cocoa.h>
@@ -21,6 +21,6 @@ NSImage *ImageNamed(NSString* name);
// Clears the cache.
void Clear(void);
-}
+} // namespace nsimage_cache
-#endif // CHROME_BROWSER_COCOA_IMAGE_CACHE_H_
+#endif // CHROME_BROWSER_COCOA_NSIMAGE_CACHE_H_
diff --git a/chrome/browser/cocoa/nsimage_cache.mm b/chrome/browser/cocoa/nsimage_cache.mm
index 05957ea6..feb0376 100644
--- a/chrome/browser/cocoa/nsimage_cache.mm
+++ b/chrome/browser/cocoa/nsimage_cache.mm
@@ -7,6 +7,15 @@
#include "base/logging.h"
#include "base/mac_util.h"
+// When C++ exceptions are disabled, the C++ library defines |try| and
+// |catch| so as to allow exception-expecting C++ code to build properly when
+// language support for exceptions is not present. These macros interfere
+// with the use of |@try| and |@catch| in Objective-C files such as this one.
+// Undefine these macros here, after everything has been #included, since
+// there will be no C++ uses and only Objective-C uses from this point on.
+#undef try
+#undef catch
+
namespace nsimage_cache {
static NSMutableDictionary *image_cache = nil;
@@ -53,4 +62,4 @@ void Clear(void) {
[image_cache removeAllObjects];
}
-} // nsimage_cache
+} // namespace nsimage_cache