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

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

Issue 6272028: Delete tab_loader when there are no more tabs to be loaded or painted (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed new suppressions Created 9 years, 10 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 | tools/valgrind/memcheck/suppressions.txt » ('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) 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/sessions/session_restore.h" 5 #include "chrome/browser/sessions/session_restore.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <list> 8 #include <list>
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 // to an already existing browser and an existing tab painted. 314 // to an already existing browser and an existing tab painted.
315 got_first_paint_ = true; 315 got_first_paint_ = true;
316 } 316 }
317 } 317 }
318 break; 318 break;
319 } 319 }
320 default: 320 default:
321 NOTREACHED() << "Unknown notification received:" << type.value; 321 NOTREACHED() << "Unknown notification received:" << type.value;
322 } 322 }
323 // Delete ourselves when we're not waiting for any more notifications. 323 // Delete ourselves when we're not waiting for any more notifications.
324 if (got_first_paint_&& tabs_loading_.empty() && tabs_to_load_.empty()) 324 if ((got_first_paint_ || render_widget_hosts_to_paint_.empty()) &&
325 tabs_loading_.empty() && tabs_to_load_.empty())
325 delete this; 326 delete this;
326 } 327 }
327 328
328 void TabLoader::RemoveTab(NavigationController* tab) { 329 void TabLoader::RemoveTab(NavigationController* tab) {
329 registrar_.Remove(this, NotificationType::TAB_CONTENTS_DESTROYED, 330 registrar_.Remove(this, NotificationType::TAB_CONTENTS_DESTROYED,
330 Source<TabContents>(tab->tab_contents())); 331 Source<TabContents>(tab->tab_contents()));
331 registrar_.Remove(this, NotificationType::LOAD_STOP, 332 registrar_.Remove(this, NotificationType::LOAD_STOP,
332 Source<NavigationController>(tab)); 333 Source<NavigationController>(tab));
333 registrar_.Remove(this, NotificationType::LOAD_START, 334 registrar_.Remove(this, NotificationType::LOAD_START,
334 Source<NavigationController>(tab)); 335 Source<NavigationController>(tab));
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 void SessionRestore::RestoreSessionSynchronously( 815 void SessionRestore::RestoreSessionSynchronously(
815 Profile* profile, 816 Profile* profile,
816 const std::vector<GURL>& urls_to_open) { 817 const std::vector<GURL>& urls_to_open) {
817 Restore(profile, NULL, true, false, true, urls_to_open); 818 Restore(profile, NULL, true, false, true, urls_to_open);
818 } 819 }
819 820
820 // static 821 // static
821 bool SessionRestore::IsRestoring() { 822 bool SessionRestore::IsRestoring() {
822 return restoring; 823 return restoring;
823 } 824 }
OLDNEW
« no previous file with comments | « no previous file | tools/valgrind/memcheck/suppressions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698