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

Unified Diff: chrome/browser/sessions/tab_restore_service.cc

Issue 6544023: Fix crashes in ExtensionService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add comment/TODO 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/sessions/session_restore.cc ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sessions/tab_restore_service.cc
diff --git a/chrome/browser/sessions/tab_restore_service.cc b/chrome/browser/sessions/tab_restore_service.cc
index c4f3ae4ecbaf536ae7a65422f56937124fe45509..7d32607e810fe2c8686f475cb8aa06139b59bb5c 100644
--- a/chrome/browser/sessions/tab_restore_service.cc
+++ b/chrome/browser/sessions/tab_restore_service.cc
@@ -155,7 +155,10 @@ void RemoveEntryByID(SessionID::id_type id,
void RecordAppLaunch(Browser* browser, const TabRestoreService::Tab& tab) {
GURL url = tab.navigations.at(tab.current_navigation_index).virtual_url();
Profile* profile = browser->profile();
- if (!profile->GetExtensionService()->IsInstalledApp(url))
+ // TODO: the ExtensionService should never be NULL, but in some cases it is,
+ // see bug 73768. After it is resolved, the explicit test can go away.
+ ExtensionService* service = profile->GetExtensionService();
+ if (!service || !service->IsInstalledApp(url))
return;
UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram,
« no previous file with comments | « chrome/browser/sessions/session_restore.cc ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698