diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-18 02:47:39 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-18 02:47:39 +0000 |
commit | c2818d44191bc4342c2ae322f3e0cb218dd2ec66 (patch) | |
tree | de6265a7e8506e6df679a436cb4df1cd7281a614 | |
parent | e8b53808f5251d1486dd8b992fa94d96bb604e01 (diff) | |
download | chromium_src-c2818d44191bc4342c2ae322f3e0cb218dd2ec66.zip chromium_src-c2818d44191bc4342c2ae322f3e0cb218dd2ec66.tar.gz chromium_src-c2818d44191bc4342c2ae322f3e0cb218dd2ec66.tar.bz2 |
Move scoped_nsdisable_screen_update from base to app/mac
Move scoped_aedesc from base to base/mac
Use namespace and proper Google-style class naming.
TEST=it compiles
BUG=none
Review URL: http://codereview.chromium.org/3828009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62904 0039d316-1c4b-4281-b951-d872f2087c98
51 files changed, 151 insertions, 137 deletions
diff --git a/app/app_base.gypi b/app/app_base.gypi index 92963df..2866bfd 100644 --- a/app/app_base.gypi +++ b/app/app_base.gypi @@ -165,6 +165,7 @@ 'l10n_util_win.h', 'linear_animation.cc', 'linear_animation.h', + 'mac/scoped_nsdisable_screen_updates.h', 'menus/accelerator.h', 'menus/accelerator_gtk.h', 'menus/accelerator_cocoa.h', diff --git a/base/scoped_nsdisable_screen_updates.h b/app/mac/scoped_nsdisable_screen_updates.h index 5af6026..14a948c 100644 --- a/base/scoped_nsdisable_screen_updates.h +++ b/app/mac/scoped_nsdisable_screen_updates.h @@ -1,23 +1,23 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef BASE_SCOPED_NSDISABLE_SCREEN_UPDATES_H_ -#define BASE_SCOPED_NSDISABLE_SCREEN_UPDATES_H_ +#ifndef APP_MAC_SCOPED_NSDISABLE_SCREEN_UPDATES_H_ +#define APP_MAC_SCOPED_NSDISABLE_SCREEN_UPDATES_H_ #pragma once #import <Cocoa/Cocoa.h> #include "base/basictypes.h" -namespace base { +namespace app { +namespace mac { // A stack-based class to disable Cocoa screen updates. When instantiated, it // disables screen updates and enables them when destroyed. Update disabling // can be nested, and there is a time-maximum (about 1 second) after which // Cocoa will automatically re-enable updating. This class doesn't attempt to // overrule that. - class ScopedNSDisableScreenUpdates { public: ScopedNSDisableScreenUpdates() { @@ -31,6 +31,7 @@ class ScopedNSDisableScreenUpdates { DISALLOW_COPY_AND_ASSIGN(ScopedNSDisableScreenUpdates); }; -} // namespace +} // namespace mac +} // namespace app -#endif // BASE_SCOPED_NSDISABLE_SCREEN_UPDATES_H_ +#endif // APP_MAC_SCOPED_NSDISABLE_SCREEN_UPDATES_H_ diff --git a/app/test_suite.h b/app/test_suite.h index 61bedab..7e9076c 100644 --- a/app/test_suite.h +++ b/app/test_suite.h @@ -14,7 +14,7 @@ #if defined(OS_MACOSX) #include "base/mac_util.h" #endif -#include "base/scoped_nsautorelease_pool.h" +#include "base/mac/scoped_nsautorelease_pool.h" #include "base/test/test_suite.h" class AppTestSuite : public base::TestSuite { @@ -25,7 +25,7 @@ class AppTestSuite : public base::TestSuite { protected: virtual void Initialize() { - base::ScopedNSAutoreleasePool autorelease_pool; + base::mac::ScopedNSAutoreleasePool autorelease_pool; TestSuite::Initialize(); diff --git a/base/base.gypi b/base/base.gypi index b90c033..992cdcc 100644 --- a/base/base.gypi +++ b/base/base.gypi @@ -118,6 +118,9 @@ 'logging_win.cc', 'mac_util.h', 'mac_util.mm', + 'mac/scoped_aedesc.h', + 'mac/scoped_nsautorelease_pool.h', + 'mac/scoped_nsautorelease_pool.mm', 'mach_ipc_mac.h', 'mach_ipc_mac.mm', 'memory_debug.cc', @@ -191,13 +194,9 @@ 'resource_util.h', 'safe_strerror_posix.cc', 'safe_strerror_posix.h', - 'scoped_aedesc.h', 'scoped_callback_factory.h', 'scoped_cftyperef.h', 'scoped_handle.h', - 'scoped_nsautorelease_pool.h', - 'scoped_nsautorelease_pool.mm', - 'scoped_nsdisable_screen_updates.h', 'scoped_nsobject.h', 'scoped_open_process.h', 'scoped_ptr.h', diff --git a/base/chrome_application_mac.h b/base/chrome_application_mac.h index 3d620b4..676959ec 100644 --- a/base/chrome_application_mac.h +++ b/base/chrome_application_mac.h @@ -20,7 +20,7 @@ @interface CrApplication : NSApplication { @private BOOL handlingSendEvent_; - // Array of objects implementing the CrApplicationEventHookProtocol + // Array of objects implementing the CrApplicationEventHookProtocol scoped_nsobject<NSMutableArray> eventHooks_; } @property(readonly, diff --git a/base/scoped_aedesc.h b/base/mac/scoped_aedesc.h index 9239887..83a38c6 100644 --- a/base/scoped_aedesc.h +++ b/base/mac/scoped_aedesc.h @@ -2,29 +2,32 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef BASE_SCOPED_AEDESC_H_ -#define BASE_SCOPED_AEDESC_H_ +#ifndef BASE_MAC_SCOPED_AEDESC_H_ +#define BASE_MAC_SCOPED_AEDESC_H_ #pragma once #import <CoreServices/CoreServices.h> #include "base/basictypes.h" -// The scoped_aedesc is used to scope AppleEvent descriptors. On creation, +namespace base { +namespace mac { + +// The ScopedAEDesc is used to scope AppleEvent descriptors. On creation, // it will store a NULL descriptor. On destruction, it will dispose of the // descriptor. // // This class is parameterized for additional type safety checks. You can use // the generic AEDesc type by not providing a template parameter: -// scoped_aedesc<> desc; +// ScopedAEDesc<> desc; template <typename AEDescType = AEDesc> -class scoped_aedesc { +class ScopedAEDesc { public: - scoped_aedesc() { + ScopedAEDesc() { AECreateDesc(typeNull, NULL, 0, &desc_); } - ~scoped_aedesc() { + ~ScopedAEDesc() { AEDisposeDesc(&desc_); } @@ -41,7 +44,10 @@ class scoped_aedesc { private: AEDescType desc_; - DISALLOW_COPY_AND_ASSIGN(scoped_aedesc); + DISALLOW_COPY_AND_ASSIGN(ScopedAEDesc); }; -#endif // BASE_SCOPED_AEDESC_H_ +} // namespace mac +} // namespace base + +#endif // BASE_MAC_SCOPED_AEDESC_H_ diff --git a/base/scoped_nsautorelease_pool.h b/base/mac/scoped_nsautorelease_pool.h index 9f428ac..0a95bd1b 100644 --- a/base/scoped_nsautorelease_pool.h +++ b/base/mac/scoped_nsautorelease_pool.h @@ -1,9 +1,9 @@ -// Copyright (c) 2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef BASE_SCOPED_NSAUTORELEASE_POOL_H_ -#define BASE_SCOPED_NSAUTORELEASE_POOL_H_ +#ifndef BASE_MAC_SCOPED_NSAUTORELEASE_POOL_H_ +#define BASE_MAC_SCOPED_NSAUTORELEASE_POOL_H_ #pragma once #include "base/basictypes.h" @@ -17,6 +17,7 @@ class NSAutoreleasePool; #endif // OS_MACOSX namespace base { +namespace mac { // On the Mac, ScopedNSAutoreleasePool allocates an NSAutoreleasePool when // instantiated and sends it a -drain message when destroyed. This allows an @@ -48,6 +49,7 @@ class ScopedNSAutoreleasePool { DISALLOW_COPY_AND_ASSIGN(ScopedNSAutoreleasePool); }; +} // namespace mac } // namespace base -#endif // BASE_SCOPED_NSAUTORELEASE_POOL_H_ +#endif // BASE_MAC_SCOPED_NSAUTORELEASE_POOL_H_ diff --git a/base/scoped_nsautorelease_pool.mm b/base/mac/scoped_nsautorelease_pool.mm index 174fb82..e542ca8 100644 --- a/base/scoped_nsautorelease_pool.mm +++ b/base/mac/scoped_nsautorelease_pool.mm @@ -1,14 +1,15 @@ -// Copyright (c) 2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/scoped_nsautorelease_pool.h" +#include "base/mac/scoped_nsautorelease_pool.h" #import <Foundation/Foundation.h> #include "base/logging.h" namespace base { +namespace mac { ScopedNSAutoreleasePool::ScopedNSAutoreleasePool() : autorelease_pool_([[NSAutoreleasePool alloc] init]) { @@ -27,4 +28,5 @@ void ScopedNSAutoreleasePool::Recycle() { DCHECK(autorelease_pool_); } +} // namespace mac } // namespace base diff --git a/base/message_pump_default.cc b/base/message_pump_default.cc index d69fc03..518684a 100644 --- a/base/message_pump_default.cc +++ b/base/message_pump_default.cc @@ -5,7 +5,7 @@ #include "base/message_pump_default.h" #include "base/logging.h" -#include "base/scoped_nsautorelease_pool.h" +#include "base/mac/scoped_nsautorelease_pool.h" namespace base { @@ -18,7 +18,7 @@ void MessagePumpDefault::Run(Delegate* delegate) { DCHECK(keep_running_) << "Quit must have been called outside of Run!"; for (;;) { - ScopedNSAutoreleasePool autorelease_pool; + mac::ScopedNSAutoreleasePool autorelease_pool; bool did_work = delegate->DoWork(); if (!keep_running_) diff --git a/base/message_pump_libevent.cc b/base/message_pump_libevent.cc index ff4a04a..d325957 100644 --- a/base/message_pump_libevent.cc +++ b/base/message_pump_libevent.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -10,8 +10,8 @@ #include "base/auto_reset.h" #include "base/eintr_wrapper.h" #include "base/logging.h" +#include "base/mac/scoped_nsautorelease_pool.h" #include "base/observer_list.h" -#include "base/scoped_nsautorelease_pool.h" #include "base/scoped_ptr.h" #include "base/time.h" #if defined(USE_SYSTEM_LIBEVENT) @@ -265,7 +265,7 @@ void MessagePumpLibevent::Run(Delegate* delegate) { scoped_ptr<event> timer_event(new event); for (;;) { - ScopedNSAutoreleasePool autorelease_pool; + mac::ScopedNSAutoreleasePool autorelease_pool; bool did_work = delegate->DoWork(); if (!keep_running_) diff --git a/base/shared_memory_unittest.cc b/base/shared_memory_unittest.cc index 97287fa..53bffb4 100644 --- a/base/shared_memory_unittest.cc +++ b/base/shared_memory_unittest.cc @@ -1,10 +1,10 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/basictypes.h" +#include "base/mac/scoped_nsautorelease_pool.h" #include "base/platform_thread.h" -#include "base/scoped_nsautorelease_pool.h" #include "base/shared_memory.h" #include "base/scoped_ptr.h" #include "base/test/multiprocess_test.h" @@ -33,7 +33,7 @@ class MultipleThreadMain : public PlatformThread::Delegate { // PlatformThread::Delegate interface. void ThreadMain() { - ScopedNSAutoreleasePool pool; // noop if not OSX + mac::ScopedNSAutoreleasePool pool; // noop if not OSX const uint32 kDataSize = 1024; SharedMemory memory; bool rv = memory.Create(s_test_name_, false, true, kDataSize); @@ -286,7 +286,7 @@ class SharedMemoryProcessTest : public base::MultiProcessTest { static int TaskTestMain() { int errors = 0; - ScopedNSAutoreleasePool pool; // noop if not OSX + mac::ScopedNSAutoreleasePool pool; // noop if not OSX const uint32 kDataSize = 1024; SharedMemory memory; bool rv = memory.Create(s_test_name_, false, true, kDataSize); diff --git a/base/test/test_suite.cc b/base/test/test_suite.cc index a08bbd9..f2e6069 100644 --- a/base/test/test_suite.cc +++ b/base/test/test_suite.cc @@ -13,10 +13,10 @@ #include "base/file_path.h" #include "base/i18n/icu_util.h" #include "base/logging.h" +#include "base/mac/scoped_nsautorelease_pool.h" #include "base/nss_util.h" #include "base/path_service.h" #include "base/process_util.h" -#include "base/scoped_nsautorelease_pool.h" #include "base/scoped_ptr.h" #include "base/test/multiprocess_test.h" #include "base/test/test_timeouts.h" @@ -113,7 +113,7 @@ void TestSuite::CatchMaybeTests() { // Don't add additional code to this method. Instead add it to // Initialize(). See bug 6436. int TestSuite::Run() { - base::ScopedNSAutoreleasePool scoped_pool; + base::mac::ScopedNSAutoreleasePool scoped_pool; Initialize(); std::string client_func = diff --git a/base/worker_pool_mac.mm b/base/worker_pool_mac.mm index a301bf8..01c0a98 100644 --- a/base/worker_pool_mac.mm +++ b/base/worker_pool_mac.mm @@ -5,8 +5,8 @@ #include "base/worker_pool_mac.h" #include "base/logging.h" +#import "base/mac/scoped_nsautorelease_pool.h" #include "base/metrics/histogram.h" -#import "base/scoped_nsautorelease_pool.h" #include "base/scoped_ptr.h" #import "base/singleton_objc.h" #include "base/task.h" @@ -83,7 +83,7 @@ size_t outstanding_ = 0; // Operations posted but not completed. ++running_; } - base::ScopedNSAutoreleasePool autoreleasePool; + base::mac::ScopedNSAutoreleasePool autoreleasePool; @try { task_->Run(); @@ -117,7 +117,7 @@ size_t outstanding_ = 0; // Operations posted but not completed. bool WorkerPool::PostTask(const tracked_objects::Location& from_here, Task* task, bool task_is_slow) { - base::ScopedNSAutoreleasePool autorelease_pool; + base::mac::ScopedNSAutoreleasePool autorelease_pool; // Ignore |task_is_slow|, it doesn't map directly to any tunable aspect of // an NSOperation. @@ -157,7 +157,7 @@ bool WorkerPool::PostTask(const tracked_objects::Location& from_here, ++outstanding_; running_ops = running_; if (last_check_.is_null() || now - last_check_ > kCheckPeriod) { - base::ScopedNSAutoreleasePool autoreleasePool; + base::mac::ScopedNSAutoreleasePool autoreleasePool; std::vector<id> ops; for (id op in [operation_queue operations]) { // DO NOT RETAIN. diff --git a/chrome/app/breakpad_mac.mm b/chrome/app/breakpad_mac.mm index 54d32c0..de14e92 100644 --- a/chrome/app/breakpad_mac.mm +++ b/chrome/app/breakpad_mac.mm @@ -15,8 +15,8 @@ #import "base/logging.h" #include "base/mac_util.h" #include "base/mac/scoped_cftyperef.h" +#import "base/mac/scoped_nsautorelease_pool.h" #include "base/path_service.h" -#import "base/scoped_nsautorelease_pool.h" #include "base/sys_string_conversions.h" #import "breakpad/src/client/mac/Framework/Breakpad.h" #include "chrome/common/child_process_logging.h" @@ -46,7 +46,7 @@ void DestructCrashReporter() { // Only called for a branded build of Chrome.app. void InitCrashReporter() { DCHECK(gBreakpadRef == NULL); - base::ScopedNSAutoreleasePool autorelease_pool; + base::mac::ScopedNSAutoreleasePool autorelease_pool; // Check whether crash reporting should be enabled. If enterprise // configuration management controls crash reporting, it takes precedence. diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc index dad27d8..ca73937 100644 --- a/chrome/app/chrome_dll_main.cc +++ b/chrome/app/chrome_dll_main.cc @@ -39,12 +39,12 @@ #include "base/command_line.h" #include "base/debug_util.h" #include "base/i18n/icu_util.h" +#include "base/mac/scoped_nsautorelease_pool.h" #include "base/message_loop.h" #include "base/metrics/stats_counters.h" #include "base/metrics/stats_table.h" #include "base/path_service.h" #include "base/process_util.h" -#include "base/scoped_nsautorelease_pool.h" #include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" @@ -484,7 +484,7 @@ int ChromeMain(int argc, char** argv) { // event loop, but we don't want to leave them hanging around until the // app quits. Each "main" needs to flush this pool right before it goes into // its main event loop to get rid of the cruft. - base::ScopedNSAutoreleasePool autorelease_pool; + base::mac::ScopedNSAutoreleasePool autorelease_pool; #if defined(OS_CHROMEOS) chromeos::BootTimesLoader::Get()->SaveChromeMainStats(); diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index ac9fe52..f21b2e2 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -16,9 +16,9 @@ #include "base/command_line.h" #include "base/file_path.h" #include "base/file_util.h" +#include "base/mac/scoped_nsautorelease_pool.h" #include "base/metrics/field_trial.h" #include "base/metrics/histogram.h" -#include "base/scoped_nsautorelease_pool.h" #include "base/path_service.h" #include "base/platform_thread.h" #include "base/process_util.h" @@ -919,7 +919,7 @@ int BrowserMain(const MainFunctionParams& parameters) { // TODO(viettrungluu): put the remainder into BrowserMainParts const CommandLine& parsed_command_line = parameters.command_line_; - base::ScopedNSAutoreleasePool* pool = parameters.autorelease_pool_; + base::mac::ScopedNSAutoreleasePool* pool = parameters.autorelease_pool_; FilePath user_data_dir; #if defined(OS_WIN) diff --git a/chrome/browser/cocoa/bookmarks/bookmark_bubble_controller_unittest.mm b/chrome/browser/cocoa/bookmarks/bookmark_bubble_controller_unittest.mm index 9bb5037..4a5b600 100644 --- a/chrome/browser/cocoa/bookmarks/bookmark_bubble_controller_unittest.mm +++ b/chrome/browser/cocoa/bookmarks/bookmark_bubble_controller_unittest.mm @@ -127,7 +127,7 @@ TEST_F(BookmarkBubbleControllerTest, TestClosingParentWindow) { EXPECT_TRUE(controller); NSWindow* window = [controller window]; EXPECT_TRUE(window); - base::ScopedNSAutoreleasePool pool; + base::mac::ScopedNSAutoreleasePool pool; [test_window() performClose:NSApp]; } diff --git a/chrome/browser/cocoa/bookmarks/bookmark_folder_target_unittest.mm b/chrome/browser/cocoa/bookmarks/bookmark_folder_target_unittest.mm index ae5a6a0..403002d 100644 --- a/chrome/browser/cocoa/bookmarks/bookmark_folder_target_unittest.mm +++ b/chrome/browser/cocoa/bookmarks/bookmark_folder_target_unittest.mm @@ -43,7 +43,7 @@ class BookmarkFolderTargetTest : public CocoaTest { BrowserTestHelper helper_; const BookmarkNode* bmbNode_; - base::ScopedNSAutoreleasePool pool_; + base::mac::ScopedNSAutoreleasePool pool_; }; TEST_F(BookmarkFolderTargetTest, StartWithNothing) { diff --git a/chrome/browser/cocoa/browser_frame_view.mm b/chrome/browser/cocoa/browser_frame_view.mm index 96e3542..87c27a0 100644 --- a/chrome/browser/cocoa/browser_frame_view.mm +++ b/chrome/browser/cocoa/browser_frame_view.mm @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -8,7 +8,7 @@ #import <Carbon/Carbon.h> #include "base/logging.h" -#include "base/scoped_nsautorelease_pool.h" +#include "base/mac/scoped_nsautorelease_pool.h" #import "chrome/browser/cocoa/framed_browser_window.h" #import "chrome/browser/cocoa/themed_window.h" #import "chrome/browser/themes/browser_theme_provider.h" @@ -46,7 +46,7 @@ static BOOL gCanGetCornerRadius = NO; // others. If they all fail, we will lose window frame theming and // roll overs for our close widgets, but things should still function // correctly. - base::ScopedNSAutoreleasePool pool; + base::mac::ScopedNSAutoreleasePool pool; Class grayFrameClass = NSClassFromString(@"NSGrayFrame"); DCHECK(grayFrameClass); if (!grayFrameClass) return; diff --git a/chrome/browser/cocoa/browser_window_controller.mm b/chrome/browser/cocoa/browser_window_controller.mm index 632ca8b..dc9f400 100644 --- a/chrome/browser/cocoa/browser_window_controller.mm +++ b/chrome/browser/cocoa/browser_window_controller.mm @@ -9,8 +9,8 @@ #include "app/l10n_util.h" #include "app/l10n_util_mac.h" #include "base/mac_util.h" +#include "app/mac/scoped_nsdisable_screen_updates.h" #include "base/nsimage_cache_mac.h" -#include "base/scoped_nsdisable_screen_updates.h" #import "base/scoped_nsobject.h" #include "base/sys_string_conversions.h" #include "chrome/app/chrome_dll_resource.h" // IDC_* @@ -456,7 +456,7 @@ // going away) will again call to close the window when it's finally ready. - (BOOL)windowShouldClose:(id)sender { // Disable updates while closing all tabs to avoid flickering. - base::ScopedNSDisableScreenUpdates disabler; + app::mac::ScopedNSDisableScreenUpdates disabler; // Give beforeunload handlers the chance to cancel the close before we hide // the window below. if (!browser_->ShouldCloseWindow()) @@ -1174,7 +1174,7 @@ - (TabWindowController*)detachTabToNewWindow:(TabView*)tabView { // Disable screen updates so that this appears as a single visual change. - base::ScopedNSDisableScreenUpdates disabler; + app::mac::ScopedNSDisableScreenUpdates disabler; // Fetch the tab contents for the tab being dragged. int index = [tabStripController_ modelIndexForTabView:tabView]; diff --git a/chrome/browser/cocoa/cocoa_test_helper.h b/chrome/browser/cocoa/cocoa_test_helper.h index da244e4..58b5a36 100644 --- a/chrome/browser/cocoa/cocoa_test_helper.h +++ b/chrome/browser/cocoa/cocoa_test_helper.h @@ -12,7 +12,7 @@ #include "base/debug_util.h" #include "base/mac_util.h" #include "base/path_service.h" -#import "base/scoped_nsautorelease_pool.h" +#import "base/mac/scoped_nsautorelease_pool.h" #import "base/scoped_nsobject.h" #include "chrome/common/chrome_constants.h" #include "testing/platform_test.h" @@ -90,7 +90,7 @@ class CocoaTest : public PlatformTest { std::set<NSWindow*> WindowsLeft(); bool called_tear_down_; - base::ScopedNSAutoreleasePool pool_; + base::mac::ScopedNSAutoreleasePool pool_; // Windows which existed at the beginning of the test. std::set<NSWindow*> initial_windows_; diff --git a/chrome/browser/cocoa/cocoa_test_helper.mm b/chrome/browser/cocoa/cocoa_test_helper.mm index 46029aa..136412b 100644 --- a/chrome/browser/cocoa/cocoa_test_helper.mm +++ b/chrome/browser/cocoa/cocoa_test_helper.mm @@ -124,7 +124,7 @@ void CocoaTest::TearDown() { // Autorelease anything thrown up by the event loop. { - base::ScopedNSAutoreleasePool pool; + base::mac::ScopedNSAutoreleasePool pool; ++spins; NSEvent *next_event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:nil @@ -164,7 +164,7 @@ std::set<NSWindow*> CocoaTest::ApplicationWindows() { // Must create a pool here because [NSApp windows] has created an array // with retains on all the windows in it. - base::ScopedNSAutoreleasePool pool; + base::mac::ScopedNSAutoreleasePool pool; NSArray *appWindows = [NSApp windows]; for (NSWindow *window in appWindows) { windows.insert(window); diff --git a/chrome/browser/cocoa/content_exceptions_window_controller_unittest.mm b/chrome/browser/cocoa/content_exceptions_window_controller_unittest.mm index 3ec1944..b5beb62 100644 --- a/chrome/browser/cocoa/content_exceptions_window_controller_unittest.mm +++ b/chrome/browser/cocoa/content_exceptions_window_controller_unittest.mm @@ -17,7 +17,7 @@ namespace { void ProcessEvents() { for (;;) { - base::ScopedNSAutoreleasePool pool; + base::mac::ScopedNSAutoreleasePool pool; NSEvent* next_event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:nil inMode:NSDefaultRunLoopMode diff --git a/chrome/browser/cocoa/html_dialog_window_controller_unittest.mm b/chrome/browser/cocoa/html_dialog_window_controller_unittest.mm index 2ec3f6f..b6eae68 100644 --- a/chrome/browser/cocoa/html_dialog_window_controller_unittest.mm +++ b/chrome/browser/cocoa/html_dialog_window_controller_unittest.mm @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -9,7 +9,7 @@ #import <Cocoa/Cocoa.h> -#import "base/scoped_nsautorelease_pool.h" +#import "base/mac/scoped_nsautorelease_pool.h" #include "base/sys_string_conversions.h" #include "chrome/browser/cocoa/cocoa_test_helper.h" #include "chrome/browser/dom_ui/dom_ui.h" @@ -70,7 +70,7 @@ TEST_F(HtmlDialogWindowControllerTest, showDialog) { // // TODO(dmaclach): Remove this once // http://code.google.com/p/chromium/issues/detail?id=26133 is fixed. - base::ScopedNSAutoreleasePool release_pool; + base::mac::ScopedNSAutoreleasePool release_pool; EXPECT_CALL(delegate_, GetDialogTitle()) .WillOnce(Return(title_)); diff --git a/chrome/browser/cocoa/install_from_dmg.mm b/chrome/browser/cocoa/install_from_dmg.mm index be6ad3b..e702e64 100644 --- a/chrome/browser/cocoa/install_from_dmg.mm +++ b/chrome/browser/cocoa/install_from_dmg.mm @@ -19,7 +19,7 @@ #include "base/command_line.h" #include "base/logging.h" #import "base/mac_util.h" -#include "base/scoped_nsautorelease_pool.h" +#include "base/mac/scoped_nsautorelease_pool.h" #include "chrome/browser/cocoa/authorization_util.h" #include "chrome/browser/cocoa/scoped_authorizationref.h" #import "chrome/browser/cocoa/keystone_glue.h" @@ -370,7 +370,7 @@ void ShowErrorDialog() { } // namespace bool MaybeInstallFromDiskImage() { - base::ScopedNSAutoreleasePool autorelease_pool; + base::mac::ScopedNSAutoreleasePool autorelease_pool; if (!IsAppRunningFromReadOnlyDiskImage()) { return false; diff --git a/chrome/browser/cocoa/keyword_editor_cocoa_controller_unittest.mm b/chrome/browser/cocoa/keyword_editor_cocoa_controller_unittest.mm index 7c7610d..bebe7b2 100644 --- a/chrome/browser/cocoa/keyword_editor_cocoa_controller_unittest.mm +++ b/chrome/browser/cocoa/keyword_editor_cocoa_controller_unittest.mm @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/scoped_nsautorelease_pool.h" +#include "base/mac/scoped_nsautorelease_pool.h" #include "base/scoped_nsobject.h" #include "chrome/browser/browser.h" #include "chrome/browser/cocoa/browser_test_helper.h" @@ -71,7 +71,7 @@ class KeywordEditorCocoaControllerTest : public CocoaTest { // Helper to count the keyword editors. NSUInteger CountKeywordEditors() { - base::ScopedNSAutoreleasePool pool; + base::mac::ScopedNSAutoreleasePool pool; NSUInteger count = 0; for (NSWindow* window in [NSApp windows]) { id controller = [window windowController]; @@ -108,7 +108,7 @@ TEST_F(KeywordEditorCocoaControllerTest, ShowKeywordEditor) { // The window unwinds using -autorelease, so we need to introduce an // autorelease pool to really test whether it went away or not. { - base::ScopedNSAutoreleasePool pool; + base::mac::ScopedNSAutoreleasePool pool; // +showKeywordEditor: creates a new controller. [KeywordEditorCocoaController showKeywordEditor:profile]; diff --git a/chrome/browser/cocoa/preferences_window_controller.mm b/chrome/browser/cocoa/preferences_window_controller.mm index 61317e4..a6005ef7 100644 --- a/chrome/browser/cocoa/preferences_window_controller.mm +++ b/chrome/browser/cocoa/preferences_window_controller.mm @@ -11,7 +11,7 @@ #include "app/resource_bundle.h" #include "base/logging.h" #include "base/mac_util.h" -#include "base/scoped_aedesc.h" +#include "base/mac/scoped_aedesc.h" #include "base/string16.h" #include "base/string_util.h" #include "base/sys_string_conversions.h" @@ -1520,7 +1520,7 @@ const int kDisabledIndex = 1; @"/System/Library/PreferencePanes/Network.prefPane"]]; const char* proxyPrefCommand = "Proxies"; - scoped_aedesc<> openParams; + base::mac::ScopedAEDesc<> openParams; OSStatus status = AECreateDesc('ptru', proxyPrefCommand, strlen(proxyPrefCommand), diff --git a/chrome/browser/cocoa/tabpose_window_unittest.mm b/chrome/browser/cocoa/tabpose_window_unittest.mm index 82bc472..c1c56d2 100644 --- a/chrome/browser/cocoa/tabpose_window_unittest.mm +++ b/chrome/browser/cocoa/tabpose_window_unittest.mm @@ -43,7 +43,7 @@ TEST_F(TabposeWindowTest, TestShow) { for (int i = 0; i < 3; ++i) AppendTabToStrip(); - base::ScopedNSAutoreleasePool pool; + base::mac::ScopedNSAutoreleasePool pool; TabposeWindow* window = [TabposeWindow openTabposeFor:parent rect:NSMakeRect(10, 20, 250, 160) @@ -65,7 +65,7 @@ TEST_F(TabposeWindowTest, TestModelObserver) { for (int i = 0; i < 3; ++i) AppendTabToStrip(); - base::ScopedNSAutoreleasePool pool; + base::mac::ScopedNSAutoreleasePool pool; TabposeWindow* window = [TabposeWindow openTabposeFor:parent rect:NSMakeRect(10, 20, 250, 160) diff --git a/chrome/browser/cocoa/web_drop_target_unittest.mm b/chrome/browser/cocoa/web_drop_target_unittest.mm index 6849646..2bd7085 100644 --- a/chrome/browser/cocoa/web_drop_target_unittest.mm +++ b/chrome/browser/cocoa/web_drop_target_unittest.mm @@ -1,8 +1,8 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/scoped_nsautorelease_pool.h" +#include "base/mac/scoped_nsautorelease_pool.h" #include "base/sys_string_conversions.h" #include "base/utf_string_conversions.h" #import "chrome/browser/cocoa/cocoa_test_helper.h" @@ -42,7 +42,7 @@ class WebDropTargetTest : public RenderViewHostTestHarness { forType:kCorePasteboardFlavorType_urln]; } - base::ScopedNSAutoreleasePool pool_; + base::mac::ScopedNSAutoreleasePool pool_; scoped_nsobject<WebDropTarget> drop_target_; }; diff --git a/chrome/browser/dom_ui/options/advanced_options_utils_mac.mm b/chrome/browser/dom_ui/options/advanced_options_utils_mac.mm index 1e1fcab..e3bd4f7 100644 --- a/chrome/browser/dom_ui/options/advanced_options_utils_mac.mm +++ b/chrome/browser/dom_ui/options/advanced_options_utils_mac.mm @@ -7,7 +7,7 @@ #include "chrome/browser/dom_ui/options/advanced_options_utils.h" #include "base/logging.h" -#include "base/scoped_aedesc.h" +#include "base/mac/scoped_aedesc.h" void AdvancedOptionsUtilities::ShowNetworkProxySettings( TabContents* tab_contents) { @@ -15,7 +15,7 @@ void AdvancedOptionsUtilities::ShowNetworkProxySettings( @"/System/Library/PreferencePanes/Network.prefPane"]]; const char* proxyPrefCommand = "Proxies"; - scoped_aedesc<> openParams; + base::mac::ScopedAEDesc<> openParams; OSStatus status = AECreateDesc('ptru', proxyPrefCommand, strlen(proxyPrefCommand), diff --git a/chrome/browser/geolocation/wifi_data_provider_corewlan_mac.mm b/chrome/browser/geolocation/wifi_data_provider_corewlan_mac.mm index 6d1ddf3..abefaa9 100644 --- a/chrome/browser/geolocation/wifi_data_provider_corewlan_mac.mm +++ b/chrome/browser/geolocation/wifi_data_provider_corewlan_mac.mm @@ -9,7 +9,7 @@ #include <dlfcn.h> #import <Foundation/Foundation.h> -#include "base/scoped_nsautorelease_pool.h" +#include "base/mac/scoped_nsautorelease_pool.h" #include "base/scoped_nsobject.h" #include "base/sys_string_conversions.h" @@ -66,7 +66,7 @@ bool CoreWlanApi::Init() { // auto release pool. It's simplest to do this as an automatic variable in // each method that needs it, to ensure the scoping is correct and does not // interfere with any other code using autorelease pools on the thread. - base::ScopedNSAutoreleasePool auto_pool; + base::mac::ScopedNSAutoreleasePool auto_pool; bundle_.reset([[NSBundle alloc] initWithPath:@"/System/Library/Frameworks/CoreWLAN.framework"]); if (!bundle_) { @@ -98,7 +98,7 @@ bool CoreWlanApi::Init() { } bool CoreWlanApi::GetAccessPointData(WifiData::AccessPointDataSet* data) { - base::ScopedNSAutoreleasePool auto_pool; + base::mac::ScopedNSAutoreleasePool auto_pool; // Initialize the scan parameters with scan key merging disabled, so we get // every AP listed in the scan without any SSID de-duping logic. NSDictionary* params = diff --git a/chrome/browser/platform_util_mac.mm b/chrome/browser/platform_util_mac.mm index 3ee28b7..d7da563 100644 --- a/chrome/browser/platform_util_mac.mm +++ b/chrome/browser/platform_util_mac.mm @@ -12,7 +12,7 @@ #include "base/file_path.h" #include "base/logging.h" #include "base/mac_util.h" -#include "base/scoped_aedesc.h" +#include "base/mac/scoped_aedesc.h" #include "base/sys_string_conversions.h" #include "googleurl/src/gurl.h" #include "grit/generated_resources.h" @@ -43,7 +43,7 @@ void OpenItem(const FilePath& full_path) { OSErr status; // Create the target of this AppleEvent, the Finder. - scoped_aedesc<AEAddressDesc> address; + base::mac::ScopedAEDesc<AEAddressDesc> address; const OSType finderCreatorCode = 'MACS'; status = AECreateDesc(typeApplSignature, // type &finderCreatorCode, // data @@ -55,7 +55,7 @@ void OpenItem(const FilePath& full_path) { } // Build the AppleEvent data structure that instructs Finder to open files. - scoped_aedesc<AppleEvent> theEvent; + base::mac::ScopedAEDesc<AppleEvent> theEvent; status = AECreateAppleEvent(kCoreEventClass, // theAEEventClass kAEOpenDocuments, // theAEEventID address, // target @@ -68,7 +68,7 @@ void OpenItem(const FilePath& full_path) { } // Create the list of files (only ever one) to open. - scoped_aedesc<AEDescList> fileList; + base::mac::ScopedAEDesc<AEDescList> fileList; status = AECreateList(NULL, // factoringPtr 0, // factoredSize false, // isRecord @@ -107,7 +107,7 @@ void OpenItem(const FilePath& full_path) { } // Send the actual event. Do not care about the reply. - scoped_aedesc<AppleEvent> reply; + base::mac::ScopedAEDesc<AppleEvent> reply; status = AESend(theEvent, // theAppleEvent reply.OutPointer(), // reply kAENoReply + kAEAlwaysInteract, // sendMode 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 acf62a0..a7c6581 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_mac.mm +++ b/chrome/browser/renderer_host/render_widget_host_view_mac.mm @@ -12,8 +12,8 @@ #include "base/command_line.h" #include "base/logging.h" #include "base/mac/scoped_cftyperef.h" +#import "base/mac/scoped_nsautorelease_pool.h" #include "base/metrics/histogram.h" -#import "base/scoped_nsautorelease_pool.h" #import "base/scoped_nsobject.h" #include "base/string_util.h" #include "base/sys_info.h" @@ -205,7 +205,7 @@ void DisablePasswordInput() { - (CVReturn)getFrameForTime:(const CVTimeStamp*)outputTime { // There is no autorelease pool when this method is called because it will be // called from a background thread. - base::ScopedNSAutoreleasePool pool; + base::mac::ScopedNSAutoreleasePool pool; if (![self surfaceWasSwapped]) return kCVReturnSuccess; diff --git a/chrome/common/main_function_params.h b/chrome/common/main_function_params.h index 0f0ed37..e4a5fcc 100644 --- a/chrome/common/main_function_params.h +++ b/chrome/common/main_function_params.h @@ -14,19 +14,21 @@ #include "chrome/common/sandbox_init_wrapper.h" namespace base { +namespace mac { class ScopedNSAutoreleasePool; -}; +} +} class Task; struct MainFunctionParams { MainFunctionParams(const CommandLine& cl, const SandboxInitWrapper& sb, - base::ScopedNSAutoreleasePool* pool) + base::mac::ScopedNSAutoreleasePool* pool) : command_line_(cl), sandbox_info_(sb), autorelease_pool_(pool), ui_task(NULL) { } const CommandLine& command_line_; const SandboxInitWrapper& sandbox_info_; - base::ScopedNSAutoreleasePool* autorelease_pool_; + base::mac::ScopedNSAutoreleasePool* autorelease_pool_; // Used by InProcessBrowserTest. If non-null BrowserMain schedules this // task to run on the MessageLoop and BrowserInit is not invoked. Task* ui_task; diff --git a/chrome/common/sandbox_mac.mm b/chrome/common/sandbox_mac.mm index f4d1eec..608ba27 100644 --- a/chrome/common/sandbox_mac.mm +++ b/chrome/common/sandbox_mac.mm @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -18,7 +18,7 @@ extern "C" { #include "base/mac_util.h" #include "base/rand_util_c.h" #include "base/mac/scoped_cftyperef.h" -#include "base/scoped_nsautorelease_pool.h" +#include "base/mac/scoped_nsautorelease_pool.h" #include "base/string16.h" #include "base/string_util.h" #include "base/sys_info.h" @@ -187,7 +187,7 @@ bool QuoteStringForRegex(const std::string& str_utf8, std::string* dst) { // This function is tested on the following OS versions: // 10.5.6, 10.6.0 void SandboxWarmup() { - base::ScopedNSAutoreleasePool scoped_pool; + base::mac::ScopedNSAutoreleasePool scoped_pool; { // CGColorSpaceCreateWithName(), CGBitmapContextCreate() - 10.5.6 base::mac::ScopedCFTypeRef<CGColorSpaceRef> rgb_colorspace( diff --git a/chrome/renderer/renderer_main.cc b/chrome/renderer/renderer_main.cc index 83dcd07..4dd65a8 100644 --- a/chrome/renderer/renderer_main.cc +++ b/chrome/renderer/renderer_main.cc @@ -10,6 +10,7 @@ #include "app/hi_res_timer_manager.h" #include "app/system_monitor.h" #include "base/command_line.h" +#include "base/mac/scoped_nsautorelease_pool.h" #include "base/metrics/field_trial.h" #include "base/message_loop.h" #include "base/metrics/histogram.h" @@ -17,7 +18,6 @@ #include "base/path_service.h" #include "base/platform_thread.h" #include "base/process_util.h" -#include "base/scoped_nsautorelease_pool.h" #include "base/string_util.h" #include "base/trace_event.h" #include "chrome/common/chrome_constants.h" @@ -180,7 +180,7 @@ int RendererMain(const MainFunctionParams& parameters) { TRACE_EVENT_BEGIN("RendererMain", 0, ""); const CommandLine& parsed_command_line = parameters.command_line_; - base::ScopedNSAutoreleasePool* pool = parameters.autorelease_pool_; + base::mac::ScopedNSAutoreleasePool* pool = parameters.autorelease_pool_; #if defined(OS_MACOSX) // TODO(viettrungluu): Code taken from browser_main.cc. diff --git a/chrome/test/in_process_browser_test.cc b/chrome/test/in_process_browser_test.cc index 8536bf4..5bfa802 100644 --- a/chrome/test/in_process_browser_test.cc +++ b/chrome/test/in_process_browser_test.cc @@ -7,8 +7,8 @@ #include "base/command_line.h" #include "base/file_path.h" #include "base/file_util.h" +#include "base/mac/scoped_nsautorelease_pool.h" #include "base/path_service.h" -#include "base/scoped_nsautorelease_pool.h" #include "base/string_number_conversions.h" #include "base/test/test_file_util.h" #include "chrome/browser/browser.h" @@ -298,7 +298,7 @@ void InProcessBrowserTest::RunTestOnMainThreadLoop() { // deallocation via an autorelease pool (such as browser window closure and // browser shutdown). To avoid this, the following pool is recycled after each // time code is directly executed. - base::ScopedNSAutoreleasePool pool; + base::mac::ScopedNSAutoreleasePool pool; // Pump startup related events. MessageLoopForUI::current()->RunAllPending(); diff --git a/chrome/test/pyautolib/pyautolib.h b/chrome/test/pyautolib/pyautolib.h index e3c4c5c..c40b97e 100644 --- a/chrome/test/pyautolib/pyautolib.h +++ b/chrome/test/pyautolib/pyautolib.h @@ -10,7 +10,7 @@ #pragma once #include "base/message_loop.h" -#include "base/scoped_nsautorelease_pool.h" +#include "base/mac/scoped_nsautorelease_pool.h" #include "chrome/test/ui/ui_test.h" #include "chrome/test/ui/ui_test_suite.h" @@ -30,7 +30,7 @@ class PyUITestSuiteBase : public UITestSuite { void Initialize(const FilePath& browser_dir); private: - base::ScopedNSAutoreleasePool pool_; + base::mac::ScopedNSAutoreleasePool pool_; }; // The primary class that interfaces with Automation Proxy. diff --git a/chrome/test/test_launcher/out_of_proc_test_runner.cc b/chrome/test/test_launcher/out_of_proc_test_runner.cc index d9464f6..49ab5e6 100644 --- a/chrome/test/test_launcher/out_of_proc_test_runner.cc +++ b/chrome/test/test_launcher/out_of_proc_test_runner.cc @@ -6,8 +6,8 @@ #include "base/command_line.h" #include "base/logging.h" +#include "base/mac/scoped_nsautorelease_pool.h" #include "base/process_util.h" -#include "base/scoped_nsautorelease_pool.h" #include "base/scoped_temp_dir.h" #include "base/string_number_conversions.h" #include "base/test/test_suite.h" @@ -63,7 +63,7 @@ class OutOfProcTestRunner : public tests::TestRunner { bool RunTest(const std::string& test_name) { // Some of the below method calls will leak objects if there is no // autorelease pool in place. - base::ScopedNSAutoreleasePool pool; + base::mac::ScopedNSAutoreleasePool pool; const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); CommandLine new_cmd_line(cmd_line->GetProgram()); diff --git a/chrome/test/unit/chrome_test_suite.cc b/chrome/test/unit/chrome_test_suite.cc index 9613341..7c52254 100644 --- a/chrome/test/unit/chrome_test_suite.cc +++ b/chrome/test/unit/chrome_test_suite.cc @@ -7,9 +7,9 @@ #include "app/app_paths.h" #include "app/resource_bundle.h" #include "base/command_line.h" +#include "base/mac/scoped_nsautorelease_pool.h" #include "base/metrics/stats_table.h" #include "base/process_util.h" -#include "base/scoped_nsautorelease_pool.h" #include "base/utf_string_conversions.h" #include "chrome/browser/browser_process.h" #include "chrome/common/chrome_constants.h" @@ -85,7 +85,7 @@ ChromeTestSuite::~ChromeTestSuite() { } void ChromeTestSuite::Initialize() { - base::ScopedNSAutoreleasePool autorelease_pool; + base::mac::ScopedNSAutoreleasePool autorelease_pool; base::TestSuite::Initialize(); diff --git a/chrome/tools/mac_helpers/infoplist_strings_util.mm b/chrome/tools/mac_helpers/infoplist_strings_util.mm index 474e587..d086444 100644 --- a/chrome/tools/mac_helpers/infoplist_strings_util.mm +++ b/chrome/tools/mac_helpers/infoplist_strings_util.mm @@ -13,7 +13,7 @@ #include "base/data_pack.h" #include "base/file_path.h" -#include "base/scoped_nsautorelease_pool.h" +#include "base/mac/scoped_nsautorelease_pool.h" #include "base/scoped_ptr.h" #include "base/string_piece.h" #include "base/string_util.h" @@ -134,7 +134,7 @@ const char* kAppType_Helper = "helper"; // Helper app } // namespace int main(int argc, char* const argv[]) { - base::ScopedNSAutoreleasePool autorelease_pool; + base::mac::ScopedNSAutoreleasePool autorelease_pool; const char* version_file_path = NULL; const char* grit_output_dir = NULL; diff --git a/gfx/test_suite.h b/gfx/test_suite.h index 14d4ac9..8803c7c 100644 --- a/gfx/test_suite.h +++ b/gfx/test_suite.h @@ -16,7 +16,7 @@ #if defined(OS_MACOSX) #include "base/mac_util.h" #endif -#include "base/scoped_nsautorelease_pool.h" +#include "base/mac/scoped_nsautorelease_pool.h" #include "base/test/test_suite.h" class GfxTestSuite : public base::TestSuite { @@ -27,7 +27,7 @@ class GfxTestSuite : public base::TestSuite { protected: virtual void Initialize() { - base::ScopedNSAutoreleasePool autorelease_pool; + base::mac::ScopedNSAutoreleasePool autorelease_pool; TestSuite::Initialize(); diff --git a/gpu/command_buffer/client/cmd_buffer_helper_test.cc b/gpu/command_buffer/client/cmd_buffer_helper_test.cc index 6b5a9cf..9f526df 100644 --- a/gpu/command_buffer/client/cmd_buffer_helper_test.cc +++ b/gpu/command_buffer/client/cmd_buffer_helper_test.cc @@ -5,8 +5,8 @@ // Tests for the Command Buffer Helper. #include "base/callback.h" +#include "base/mac/scoped_nsautorelease_pool.h" #include "base/message_loop.h" -#include "base/scoped_nsautorelease_pool.h" #include "gpu/command_buffer/client/cmd_buffer_helper.h" #include "gpu/command_buffer/service/mocks.h" #include "gpu/command_buffer/service/command_buffer_service.h" @@ -152,7 +152,7 @@ class CommandBufferHelperTest : public testing::Test { CommandBufferOffset get_helper_put() { return helper_->put_; } - base::ScopedNSAutoreleasePool autorelease_pool_; + base::mac::ScopedNSAutoreleasePool autorelease_pool_; MessageLoop message_loop_; scoped_ptr<AsyncAPIMock> api_mock_; scoped_ptr<CommandBufferService> command_buffer_; diff --git a/gpu/command_buffer/client/fenced_allocator_test.cc b/gpu/command_buffer/client/fenced_allocator_test.cc index 4b66aab..658deef2 100644 --- a/gpu/command_buffer/client/fenced_allocator_test.cc +++ b/gpu/command_buffer/client/fenced_allocator_test.cc @@ -6,7 +6,7 @@ #include "base/callback.h" #include "base/message_loop.h" -#include "base/scoped_nsautorelease_pool.h" +#include "base/mac/scoped_nsautorelease_pool.h" #include "gpu/command_buffer/client/cmd_buffer_helper.h" #include "gpu/command_buffer/client/fenced_allocator.h" #include "gpu/command_buffer/service/cmd_buffer_engine.h" @@ -66,7 +66,7 @@ class BaseFencedAllocatorTest : public testing::Test { return command_buffer_->GetState().token; } - base::ScopedNSAutoreleasePool autorelease_pool_; + base::mac::ScopedNSAutoreleasePool autorelease_pool_; MessageLoop message_loop_; scoped_ptr<AsyncAPIMock> api_mock_; scoped_ptr<CommandBufferService> command_buffer_; diff --git a/gpu/command_buffer/client/mapped_memory_unittest.cc b/gpu/command_buffer/client/mapped_memory_unittest.cc index 4728aee..fe0a0a9 100644 --- a/gpu/command_buffer/client/mapped_memory_unittest.cc +++ b/gpu/command_buffer/client/mapped_memory_unittest.cc @@ -5,7 +5,7 @@ #include "gpu/command_buffer/client/mapped_memory.h" #include "base/callback.h" #include "base/message_loop.h" -#include "base/scoped_nsautorelease_pool.h" +#include "base/mac/scoped_nsautorelease_pool.h" #include "base/scoped_ptr.h" #include "gpu/command_buffer/client/cmd_buffer_helper.h" #include "gpu/command_buffer/service/mocks.h" @@ -64,7 +64,7 @@ class MappedMemoryTestBase : public testing::Test { return command_buffer_->GetState().token; } - base::ScopedNSAutoreleasePool autorelease_pool_; + base::mac::ScopedNSAutoreleasePool autorelease_pool_; MessageLoop message_loop_; scoped_ptr<AsyncAPIMock> api_mock_; scoped_ptr<CommandBufferService> command_buffer_; diff --git a/gpu/command_buffer/client/ring_buffer_test.cc b/gpu/command_buffer/client/ring_buffer_test.cc index 9ccb9b43..6510611 100644 --- a/gpu/command_buffer/client/ring_buffer_test.cc +++ b/gpu/command_buffer/client/ring_buffer_test.cc @@ -7,7 +7,7 @@ #include "gpu/command_buffer/client/ring_buffer.h" #include "base/callback.h" #include "base/message_loop.h" -#include "base/scoped_nsautorelease_pool.h" +#include "base/mac/scoped_nsautorelease_pool.h" #include "gpu/command_buffer/client/cmd_buffer_helper.h" #include "gpu/command_buffer/service/cmd_buffer_engine.h" #include "gpu/command_buffer/service/mocks.h" @@ -67,7 +67,7 @@ class BaseRingBufferTest : public testing::Test { return command_buffer_->GetState().token; } - base::ScopedNSAutoreleasePool autorelease_pool_; + base::mac::ScopedNSAutoreleasePool autorelease_pool_; MessageLoop message_loop_; scoped_ptr<AsyncAPIMock> api_mock_; scoped_ptr<CommandBufferService> command_buffer_; diff --git a/gpu/command_buffer/service/command_buffer_service_unittest.cc b/gpu/command_buffer/service/command_buffer_service_unittest.cc index 713c9a5..1dee78e 100644 --- a/gpu/command_buffer/service/command_buffer_service_unittest.cc +++ b/gpu/command_buffer/service/command_buffer_service_unittest.cc @@ -1,9 +1,9 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/callback.h" -#include "base/scoped_nsautorelease_pool.h" +#include "base/mac/scoped_nsautorelease_pool.h" #include "base/thread.h" #include "gpu/command_buffer/common/cmd_buffer_common.h" #include "gpu/command_buffer/service/command_buffer_service.h" @@ -41,7 +41,7 @@ class CommandBufferServiceTest : public testing::Test { return command_buffer_->GetState().error; } - base::ScopedNSAutoreleasePool autorelease_pool_; + base::mac::ScopedNSAutoreleasePool autorelease_pool_; scoped_ptr<CommandBufferService> command_buffer_; }; diff --git a/gpu/command_buffer/service/gpu_processor_unittest.cc b/gpu/command_buffer/service/gpu_processor_unittest.cc index f6a2f16..69adf03 100644 --- a/gpu/command_buffer/service/gpu_processor_unittest.cc +++ b/gpu/command_buffer/service/gpu_processor_unittest.cc @@ -1,9 +1,9 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/mac/scoped_nsautorelease_pool.h" #include "base/message_loop.h" -#include "base/scoped_nsautorelease_pool.h" #include "gpu/command_buffer/common/command_buffer_mock.h" #include "gpu/command_buffer/service/context_group.h" #include "gpu/command_buffer/service/gpu_processor.h" @@ -77,7 +77,7 @@ class GPUProcessorTest : public testing::Test { return command_buffer_->GetState().error; } - base::ScopedNSAutoreleasePool autorelease_pool_; + base::mac::ScopedNSAutoreleasePool autorelease_pool_; MessageLoop message_loop; scoped_ptr<MockCommandBuffer> command_buffer_; scoped_ptr<base::SharedMemory> shared_memory_; diff --git a/remoting/host/simple_host_process.cc b/remoting/host/simple_host_process.cc index f730ec0..744e100 100644 --- a/remoting/host/simple_host_process.cc +++ b/remoting/host/simple_host_process.cc @@ -23,8 +23,8 @@ #include "base/environment.h" #include "base/file_path.h" #include "base/logging.h" +#include "base/mac/scoped_nsautorelease_pool.h" #include "base/nss_util.h" -#include "base/scoped_nsautorelease_pool.h" #include "base/thread.h" #include "remoting/base/encoder_verbatim.h" #include "remoting/base/encoder_zlib.h" @@ -65,7 +65,7 @@ const std::string kVerbatimSwitchName = "verbatim"; int main(int argc, char** argv) { // Needed for the Mac, so we don't leak objects when threads are created. - base::ScopedNSAutoreleasePool pool; + base::mac::ScopedNSAutoreleasePool pool; CommandLine::Init(argc, argv); const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); diff --git a/testing/gtest_mac_unittest.mm b/testing/gtest_mac_unittest.mm index 552beee..c5bc47f 100644 --- a/testing/gtest_mac_unittest.mm +++ b/testing/gtest_mac_unittest.mm @@ -10,12 +10,12 @@ #import <Foundation/Foundation.h> -#include "base/scoped_nsautorelease_pool.h" +#include "base/mac/scoped_nsautorelease_pool.h" #include "testing/gtest/include/gtest/internal/gtest-port.h" #include "testing/gtest/include/gtest/gtest.h" TEST(GTestMac, ExpectNSEQ) { - base::ScopedNSAutoreleasePool pool; + base::mac::ScopedNSAutoreleasePool pool; EXPECT_NSEQ(@"a", @"a"); @@ -26,7 +26,7 @@ TEST(GTestMac, ExpectNSEQ) { } TEST(GTestMac, AssertNSEQ) { - base::ScopedNSAutoreleasePool pool; + base::mac::ScopedNSAutoreleasePool pool; NSNumber* n1 = [NSNumber numberWithInt:42]; NSNumber* n2 = [NSNumber numberWithInt:42]; @@ -35,13 +35,13 @@ TEST(GTestMac, AssertNSEQ) { } TEST(GTestMac, ExpectNSNE) { - base::ScopedNSAutoreleasePool pool; + base::mac::ScopedNSAutoreleasePool pool; EXPECT_NSNE([NSNumber numberWithInt:2], [NSNumber numberWithInt:42]); } TEST(GTestMac, AssertNSNE) { - base::ScopedNSAutoreleasePool pool; + base::mac::ScopedNSAutoreleasePool pool; ASSERT_NSNE(@"a", @"b"); } diff --git a/webkit/tools/test_shell/run_all_tests.cc b/webkit/tools/test_shell/run_all_tests.cc index 09c75bb..a8857ff 100644 --- a/webkit/tools/test_shell/run_all_tests.cc +++ b/webkit/tools/test_shell/run_all_tests.cc @@ -15,13 +15,9 @@ #include "base/at_exit.h" #include "base/command_line.h" #include "base/i18n/icu_util.h" -#if defined(OS_MACOSX) -#include "base/mac_util.h" -#include "base/path_service.h" -#endif +#include "base/mac/scoped_nsautorelease_pool.h" #include "base/message_loop.h" #include "base/process_util.h" -#include "base/scoped_nsautorelease_pool.h" #include "webkit/glue/webkit_glue.h" #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" #include "webkit/tools/test_shell/test_shell.h" @@ -31,6 +27,11 @@ #include "webkit/tools/test_shell/test_shell_webkit_init.h" #include "testing/gtest/include/gtest/gtest.h" +#if defined(OS_MACOSX) +#include "base/mac_util.h" +#include "base/path_service.h" +#endif + const char* const TestShellTest::kJavascriptDelayExitScript = "<script>" "window.layoutTestController.waitUntilDone();" @@ -41,7 +42,7 @@ const char* const TestShellTest::kJavascriptDelayExitScript = "</script>"; int main(int argc, char* argv[]) { - base::ScopedNSAutoreleasePool autorelease_pool; + base::mac::ScopedNSAutoreleasePool autorelease_pool; base::EnableInProcessStackDumping(); base::EnableTerminationOnHeapCorruption(); // Some unittests may use base::Singleton<>, thus we need to instanciate |