summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-22 17:28:17 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-22 17:28:17 +0000
commit913506f0841bf0acf139b4599a47d84d486a47da (patch)
tree8aab12fbc1a6c2a63ecef4391b671b357d75deea
parentbddfd1b97a4735e73f1f782088c0f8bc682898b5 (diff)
downloadchromium_src-913506f0841bf0acf139b4599a47d84d486a47da.zip
chromium_src-913506f0841bf0acf139b4599a47d84d486a47da.tar.gz
chromium_src-913506f0841bf0acf139b4599a47d84d486a47da.tar.bz2
Scope some autorelease pools.
BUG=none TEST=none Review URL: http://codereview.chromium.org/6895019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82664 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa_unittest.mm9
-rw-r--r--chrome/renderer/print_web_view_helper_mac.mm8
-rw-r--r--webkit/tools/test_shell/test_shell_mac.mm7
3 files changed, 11 insertions, 13 deletions
diff --git a/chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa_unittest.mm b/chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa_unittest.mm
index 5fa32d4..1cf9160 100644
--- a/chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa_unittest.mm
+++ b/chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa_unittest.mm
@@ -7,6 +7,7 @@
#import <Cocoa/Cocoa.h>
#include "base/debug/debugger.h"
+#include "base/mac/scoped_nsautorelease_pool.h"
#include "base/memory/scoped_nsobject.h"
#import "chrome/browser/ui/cocoa/cocoa_test_helper.h"
#include "chrome/browser/ui/content_settings/content_setting_bubble_model.h"
@@ -37,15 +38,13 @@ class ContentSettingBubbleControllerTest
virtual ~ContentSettingBubbleControllerTest();
private:
- NSAutoreleasePool* pool_;
+ base::mac::ScopedNSAutoreleasePool pool_;
};
-ContentSettingBubbleControllerTest::ContentSettingBubbleControllerTest()
- : pool_([[NSAutoreleasePool alloc] init]) {
+ContentSettingBubbleControllerTest::ContentSettingBubbleControllerTest() {
}
ContentSettingBubbleControllerTest::~ContentSettingBubbleControllerTest() {
- [pool_ drain];
}
// Check that the bubble doesn't crash or leak for any settings type
@@ -82,5 +81,3 @@ TEST_F(ContentSettingBubbleControllerTest, Init) {
}
} // namespace
-
-
diff --git a/chrome/renderer/print_web_view_helper_mac.mm b/chrome/renderer/print_web_view_helper_mac.mm
index 759cb6c..f3981a5 100644
--- a/chrome/renderer/print_web_view_helper_mac.mm
+++ b/chrome/renderer/print_web_view_helper_mac.mm
@@ -7,6 +7,7 @@
#import <AppKit/AppKit.h>
#include "base/logging.h"
+#include "base/mac/scoped_nsautorelease_pool.h"
#include "chrome/common/print_messages.h"
#include "printing/metafile.h"
#include "printing/metafile_impl.h"
@@ -109,9 +110,10 @@ void PrintWebViewHelper::RenderPage(
// printPage can create autoreleased references to |context|. PDF contexts
// don't write all their data until they are destroyed, so we need to make
// certain that there are no lingering references.
- NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
- frame->printPage(page_number, metafile->context());
- [pool release];
+ {
+ base::mac::ScopedNSAutoreleasePool pool;
+ frame->printPage(page_number, metafile->context());
+ }
// Done printing. Close the device context to retrieve the compiled metafile.
metafile->FinishPage();
diff --git a/webkit/tools/test_shell/test_shell_mac.mm b/webkit/tools/test_shell/test_shell_mac.mm
index 840bbdd..f8ad17c 100644
--- a/webkit/tools/test_shell/test_shell_mac.mm
+++ b/webkit/tools/test_shell/test_shell_mac.mm
@@ -16,6 +16,7 @@
#include "base/file_util.h"
#include "base/logging.h"
#include "base/mac/mac_util.h"
+#include "base/mac/scoped_nsautorelease_pool.h"
#include "base/memory/memory_debug.h"
#include "base/message_loop.h"
#include "base/path_service.h"
@@ -395,9 +396,9 @@ void TestShell::TestFinished() {
}
- (void)run:(id)ignore {
- NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+ base::mac::ScopedNSAutoreleasePool scoped_pool;
- // check for debugger, just bail if so. We don't want the timeouts hitting
+ // Check for debugger, just bail if so. We don't want the timeouts hitting
// when we're trying to track down an issue.
if (base::debug::BeingDebugged())
return;
@@ -422,8 +423,6 @@ void TestShell::TestFinished() {
fflush(stdout);
abort();
}
-
- [pool release];
}
@end