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

Side by Side Diff: chrome/browser/ui/browser_list.cc

Issue 6379009: [linux] Avoid crash when there's an X error during shutdown. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/browser_list.h ('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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #include "chrome/browser/browser_list.h" 5 #include "chrome/browser/browser_list.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 // Terminate will result in a CloseAllBrowsers() call, and once (and if) 386 // Terminate will result in a CloseAllBrowsers() call, and once (and if)
387 // that is done, will cause the application to exit cleanly. 387 // that is done, will cause the application to exit cleanly.
388 chrome_browser_application_mac::Terminate(); 388 chrome_browser_application_mac::Terminate();
389 #endif 389 #endif
390 } 390 }
391 391
392 // static 392 // static
393 void BrowserList::SessionEnding() { 393 void BrowserList::SessionEnding() {
394 // EndSession is invoked once per frame. Only do something the first time. 394 // EndSession is invoked once per frame. Only do something the first time.
395 static bool already_ended = false; 395 static bool already_ended = false;
396 if (already_ended) 396 // We may get called in the middle of shutdown, e.g. http://crbug.com/70852
397 // In this case, do nothing.
398 if (already_ended || !NotificationService::current())
397 return; 399 return;
398 already_ended = true; 400 already_ended = true;
399 401
400 browser_shutdown::OnShutdownStarting(browser_shutdown::END_SESSION); 402 browser_shutdown::OnShutdownStarting(browser_shutdown::END_SESSION);
401 403
402 NotificationService::current()->Notify( 404 NotificationService::current()->Notify(
403 NotificationType::APP_EXITING, 405 NotificationType::APP_EXITING,
404 NotificationService::AllSources(), 406 NotificationService::AllSources(),
405 NotificationService::NoDetails()); 407 NotificationService::NoDetails());
406 408
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 } 614 }
613 615
614 TabContents* next_tab = 616 TabContents* next_tab =
615 (*browser_iterator_)->GetTabContentsAt(web_view_index_); 617 (*browser_iterator_)->GetTabContentsAt(web_view_index_);
616 if (next_tab) { 618 if (next_tab) {
617 cur_ = next_tab; 619 cur_ = next_tab;
618 return; 620 return;
619 } 621 }
620 } 622 }
621 } 623 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_list.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698