Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Unified Diff: chrome/browser/cocoa/browser_window_controller.mm

Issue 70001: Force c++ dtors to get called in objc interfaces (it was always on since gcc4... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/cocoa/browser_window_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/browser_window_controller.mm
===================================================================
--- chrome/browser/cocoa/browser_window_controller.mm (revision 13455)
+++ chrome/browser/cocoa/browser_window_controller.mm (working copy)
@@ -27,11 +27,11 @@
// up as the window's delegate.
- (id)initWithBrowser:(Browser*)browser {
if ((self = [super initWithWindowNibName:@"BrowserWindow"])) {
- browser_ = browser;
- DCHECK(browser_);
- tabObserver_ = new TabStripModelObserverBridge(browser->tabstrip_model(),
- self);
- windowShim_ = new BrowserWindowCocoa(browser, self, [self window]);
+ browser_.reset(browser);
+ DCHECK(browser_.get());
Mark Mentovai 2009/04/10 15:23:29 Eliminate a .get() if you DCHCEK on browser instea
+ tabObserver_.reset(
+ new TabStripModelObserverBridge(browser->tabstrip_model(), self));
+ windowShim_.reset(new BrowserWindowCocoa(browser, self, [self window]));
// The window is now fully realized and |-windowDidLoad:| has been
// called. We shouldn't do much in wDL because |windowShim_| won't yet
@@ -46,17 +46,17 @@
// this window's Browser and the tab strip view. The controller will handle
// registering for the appropriate tab notifications from the back-end and
// managing the creation of new tabs.
- tabStripController_ = [[TabStripController alloc]
- initWithView:[self tabStripView]
- switchView:[self tabContentArea]
- browser:browser_];
+ tabStripController_.reset([[TabStripController alloc]
+ initWithView:[self tabStripView]
+ switchView:[self tabContentArea]
+ browser:browser_.get()]);
// Create a controller for the toolbar, giving it the toolbar model object
// and the toolbar view from the nib. The controller will handle
// registering for the appropriate command state changes from the back-end.
- toolbarController_ = [[ToolbarController alloc]
- initWithModel:browser->toolbar_model()
- commands:browser->command_updater()];
+ toolbarController_.reset([[ToolbarController alloc]
+ initWithModel:browser->toolbar_model()
+ commands:browser->command_updater()]);
[self positionToolbar];
}
return self;
@@ -64,17 +64,12 @@
- (void)dealloc {
browser_->CloseAllTabs();
- [tabStripController_ release];
- [toolbarController_ release];
- delete windowShim_;
- delete tabObserver_;
- delete browser_;
[super dealloc];
}
// Access the C++ bridge between the NSWindow and the rest of Chromium
- (BrowserWindow*)browserWindow {
- return windowShim_;
+ return windowShim_.get();
}
// Position |toolbarView_| below the tab strip, but not as a sibling. The
@@ -147,7 +142,7 @@
// Called right after our window became the main window.
- (void)windowDidBecomeMain:(NSNotification *)notification {
- BrowserList::SetLastActive(browser_);
+ BrowserList::SetLastActive(browser_.get());
}
// Update a toggle state for an NSMenuItem if modified.
« no previous file with comments | « chrome/browser/cocoa/browser_window_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698