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

Side by Side Diff: chrome/browser/ui/cocoa/browser_window_controller.mm

Issue 2042123005: Revert of Address a crash under -[NSWindow close] via a WeakPtr PostTask from Browser::TabStripEmpty (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_cocoa.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "chrome/browser/ui/cocoa/browser_window_controller.h" 5 #import "chrome/browser/ui/cocoa/browser_window_controller.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <numeric> 8 #include <numeric>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 afterDelay:0]; 523 afterDelay:0];
524 } 524 }
525 525
526 // Called when the window meets the criteria to be closed (ie, 526 // Called when the window meets the criteria to be closed (ie,
527 // |-windowShouldClose:| returns YES). We must be careful to preserve the 527 // |-windowShouldClose:| returns YES). We must be careful to preserve the
528 // semantics of BrowserWindow::Close() and not call the Browser's dtor directly 528 // semantics of BrowserWindow::Close() and not call the Browser's dtor directly
529 // from this method. 529 // from this method.
530 - (void)windowWillClose:(NSNotification*)notification { 530 - (void)windowWillClose:(NSNotification*)notification {
531 DCHECK_EQ([notification object], [self window]); 531 DCHECK_EQ([notification object], [self window]);
532 DCHECK(browser_->tab_strip_model()->empty()); 532 DCHECK(browser_->tab_strip_model()->empty());
533 windowShim_->OnWindowWillClose();
534 [savedRegularWindow_ close]; 533 [savedRegularWindow_ close];
535 // We delete statusBubble here because we need to kill off the dependency 534 // We delete statusBubble here because we need to kill off the dependency
536 // that its window has on our window before our window goes away. 535 // that its window has on our window before our window goes away.
537 delete statusBubble_; 536 delete statusBubble_;
538 statusBubble_ = NULL; 537 statusBubble_ = NULL;
539 // We can't actually use |-autorelease| here because there's an embedded 538 // We can't actually use |-autorelease| here because there's an embedded
540 // run loop in the |-performClose:| which contains its own autorelease pool. 539 // run loop in the |-performClose:| which contains its own autorelease pool.
541 // Instead call it after a zero-length delay, which gets us back to the main 540 // Instead call it after a zero-length delay, which gets us back to the main
542 // event loop. 541 // event loop.
543 [self performSelector:@selector(autorelease) 542 [self performSelector:@selector(autorelease)
(...skipping 1513 matching lines...) Expand 10 before | Expand all | Expand 10 after
2057 2056
2058 - (BOOL)isTabbedWindow { 2057 - (BOOL)isTabbedWindow {
2059 return browser_->is_type_tabbed(); 2058 return browser_->is_type_tabbed();
2060 } 2059 }
2061 2060
2062 - (NSRect)savedRegularWindowFrame { 2061 - (NSRect)savedRegularWindowFrame {
2063 return savedRegularWindowFrame_; 2062 return savedRegularWindowFrame_;
2064 } 2063 }
2065 2064
2066 @end // @implementation BrowserWindowController(WindowType) 2065 @end // @implementation BrowserWindowController(WindowType)
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_cocoa.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698