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

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

Issue 10265010: Adds NULL check in NotifySessionServiceOfRestoredTabs for (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to trunk Created 8 years, 7 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 | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #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 <string> 10 #include <string>
(...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after
946 params.tabstrip_add_types = add_types; 946 params.tabstrip_add_types = add_types;
947 browser::Navigate(&params); 947 browser::Navigate(&params);
948 } 948 }
949 } 949 }
950 950
951 // Invokes TabRestored on the SessionService for all tabs in browser after 951 // Invokes TabRestored on the SessionService for all tabs in browser after
952 // initial_count. 952 // initial_count.
953 void NotifySessionServiceOfRestoredTabs(Browser* browser, int initial_count) { 953 void NotifySessionServiceOfRestoredTabs(Browser* browser, int initial_count) {
954 SessionService* session_service = 954 SessionService* session_service =
955 SessionServiceFactory::GetForProfile(profile_); 955 SessionServiceFactory::GetForProfile(profile_);
956 if (!session_service)
957 return;
956 for (int i = initial_count; i < browser->tab_count(); ++i) 958 for (int i = initial_count; i < browser->tab_count(); ++i)
957 session_service->TabRestored(browser->GetTabContentsWrapperAt(i), 959 session_service->TabRestored(browser->GetTabContentsWrapperAt(i),
958 browser->IsTabPinned(i)); 960 browser->IsTabPinned(i));
959 } 961 }
960 962
961 // The profile to create the sessions for. 963 // The profile to create the sessions for.
962 Profile* profile_; 964 Profile* profile_;
963 965
964 // The first browser to restore to, may be null. 966 // The first browser to restore to, may be null.
965 Browser* browser_; 967 Browser* browser_;
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
1059 if (active_session_restorers == NULL) 1061 if (active_session_restorers == NULL)
1060 return false; 1062 return false;
1061 for (std::set<SessionRestoreImpl*>::const_iterator it = 1063 for (std::set<SessionRestoreImpl*>::const_iterator it =
1062 active_session_restorers->begin(); 1064 active_session_restorers->begin();
1063 it != active_session_restorers->end(); ++it) { 1065 it != active_session_restorers->end(); ++it) {
1064 if ((*it)->profile() == profile) 1066 if ((*it)->profile() == profile)
1065 return true; 1067 return true;
1066 } 1068 }
1067 return false; 1069 return false;
1068 } 1070 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698