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

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

Issue 159255: Fix a race condition where rapid back/forward clicks could close a tab... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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 | « no previous file | chrome/browser/renderer_host/browser_render_process_host.h » ('j') | 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) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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.h" 5 #include "chrome/browser/browser.h"
6 6
7 #include "app/animation.h" 7 #include "app/animation.h"
8 #include "app/l10n_util.h" 8 #include "app/l10n_util.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/idle_timer.h" 10 #include "base/idle_timer.h"
(...skipping 2469 matching lines...) Expand 10 before | Expand all | Expand 10 after
2480 // TODO(ojan): We should add a call to browser_shutdown::OnShutdownStarting 2480 // TODO(ojan): We should add a call to browser_shutdown::OnShutdownStarting
2481 // somewhere around here so that we have accurate measurements of shutdown 2481 // somewhere around here so that we have accurate measurements of shutdown
2482 // time. 2482 // time.
2483 // TODO(ojan): We can probably fire all the unload events in parallel and 2483 // TODO(ojan): We can probably fire all the unload events in parallel and
2484 // get a perf benefit from that in the cases where the tab hangs in it's 2484 // get a perf benefit from that in the cases where the tab hangs in it's
2485 // unload handler or takes a long time to page in. 2485 // unload handler or takes a long time to page in.
2486 TabContents* tab = *(tabs_needing_unload_fired_.begin()); 2486 TabContents* tab = *(tabs_needing_unload_fired_.begin());
2487 // Null check render_view_host here as this gets called on a PostTask and 2487 // Null check render_view_host here as this gets called on a PostTask and
2488 // the tab's render_view_host may have been nulled out. 2488 // the tab's render_view_host may have been nulled out.
2489 if (tab->render_view_host()) { 2489 if (tab->render_view_host()) {
2490 tab->render_view_host()->FirePageUnload(); 2490 tab->render_view_host()->ClosePage(false, -1, -1);
2491 } else { 2491 } else {
2492 ClearUnloadState(tab); 2492 ClearUnloadState(tab);
2493 } 2493 }
2494 } else { 2494 } else {
2495 NOTREACHED(); 2495 NOTREACHED();
2496 } 2496 }
2497 } 2497 }
2498 2498
2499 bool Browser::HasCompletedUnloadProcessing() const { 2499 bool Browser::HasCompletedUnloadProcessing() const {
2500 return is_attempting_to_close_browser_ && 2500 return is_attempting_to_close_browser_ &&
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
2770 /////////////////////////////////////////////////////////////////////////////// 2770 ///////////////////////////////////////////////////////////////////////////////
2771 // BrowserToolbarModel (private): 2771 // BrowserToolbarModel (private):
2772 2772
2773 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { 2773 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() {
2774 // This |current_tab| can be NULL during the initialization of the 2774 // This |current_tab| can be NULL during the initialization of the
2775 // toolbar during window creation (i.e. before any tabs have been added 2775 // toolbar during window creation (i.e. before any tabs have been added
2776 // to the window). 2776 // to the window).
2777 TabContents* current_tab = browser_->GetSelectedTabContents(); 2777 TabContents* current_tab = browser_->GetSelectedTabContents();
2778 return current_tab ? &current_tab->controller() : NULL; 2778 return current_tab ? &current_tab->controller() : NULL;
2779 } 2779 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/renderer_host/browser_render_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698