diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-06 21:00:46 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-06 21:00:46 +0000 |
commit | 2baa4b428c71526d2b6d58fa58f55f8b5602ca3a (patch) | |
tree | b3e9213e6c6237bd34a3e8ece459d528b8c3499e /chrome/browser/cocoa | |
parent | 949d0238e22516eb14cafdf12cd1e38d730976cc (diff) | |
download | chromium_src-2baa4b428c71526d2b6d58fa58f55f8b5602ca3a.zip chromium_src-2baa4b428c71526d2b6d58fa58f55f8b5602ca3a.tar.gz chromium_src-2baa4b428c71526d2b6d58fa58f55f8b5602ca3a.tar.bz2 |
some more fixes for ignored scoped_ptr::release() calls
BUG=42904
TEST=bots
Review URL: http://codereview.chromium.org/1982001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46622 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa')
-rw-r--r-- | chrome/browser/cocoa/browser_test_helper.h | 8 | ||||
-rw-r--r-- | chrome/browser/cocoa/browser_window_controller.mm | 2 | ||||
-rw-r--r-- | chrome/browser/cocoa/location_bar_view_mac.mm | 10 |
3 files changed, 11 insertions, 9 deletions
diff --git a/chrome/browser/cocoa/browser_test_helper.h b/chrome/browser/cocoa/browser_test_helper.h index 8869aad..77016f1 100644 --- a/chrome/browser/cocoa/browser_test_helper.h +++ b/chrome/browser/cocoa/browser_test_helper.h @@ -40,7 +40,7 @@ class BrowserTestHelper { virtual ~BrowserTestHelper() { // Delete the testing profile on the UI thread. But first release the // browser, since it may trigger accesses to the profile upon destruction. - browser_.reset(NULL); + browser_.reset(); message_loop_.DeleteSoon(FROM_HERE, profile_.release()); message_loop_.RunAllPending(); } @@ -55,13 +55,15 @@ class BrowserTestHelper { return browser_->window(); } - // Closes the window for this browser. + // Closes the window for this browser. This must only be called after + // CreateBrowserWindow(). void CloseBrowserWindow() { // Check to make sure a window was actually created. DCHECK(browser_->window()); browser_->CloseAllTabs(); browser_->CloseWindow(); - browser_.release(); + // |browser_| will be deleted by its BrowserWindowController. + ignore_result(browser_.release()); } private: diff --git a/chrome/browser/cocoa/browser_window_controller.mm b/chrome/browser/cocoa/browser_window_controller.mm index bd78486..f64d48c 100644 --- a/chrome/browser/cocoa/browser_window_controller.mm +++ b/chrome/browser/cocoa/browser_window_controller.mm @@ -325,7 +325,7 @@ // Under certain testing configurations we may not actually own the browser. if (ownsBrowser_ == NO) - browser_.release(); + ignore_result(browser_.release()); [[NSNotificationCenter defaultCenter] removeObserver:self]; diff --git a/chrome/browser/cocoa/location_bar_view_mac.mm b/chrome/browser/cocoa/location_bar_view_mac.mm index 807c400..2d68c91 100644 --- a/chrome/browser/cocoa/location_bar_view_mac.mm +++ b/chrome/browser/cocoa/location_bar_view_mac.mm @@ -240,8 +240,8 @@ void LocationBarViewMac::OnAutocompleteAccept(const GURL& url, return; } - scoped_ptr<AlternateNavURLFetcher> fetcher( - new AlternateNavURLFetcher(alternate_nav_url)); + AlternateNavURLFetcher* fetcher = + new AlternateNavURLFetcher(alternate_nav_url); // The AlternateNavURLFetcher will listen for the pending navigation // notification that will be issued as a result of the "open URL." It // will automatically install itself into that navigation controller. @@ -249,10 +249,10 @@ void LocationBarViewMac::OnAutocompleteAccept(const GURL& url, if (fetcher->state() == AlternateNavURLFetcher::NOT_STARTED) { // I'm not sure this should be reachable, but I'm not also sure enough // that it shouldn't to stick in a NOTREACHED(). In any case, this is - // harmless; we can simply let the fetcher get deleted here and it will - // clean itself up properly. + // harmless. + delete fetcher; } else { - fetcher.release(); // The navigation controller will delete the fetcher. + // The navigation controller will delete the fetcher. } } |