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

Unified Diff: chrome/browser/ui/browser.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/tab_restore_service.cc ('k') | chrome/browser/ui/browser_init.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index e3df05d90f166fd670f287bb675a7ddae5ff27af..8b4aa66a2544b405bc0d84a85791b6f446864b58 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -1327,7 +1327,10 @@ void Browser::OpenCurrentURL() {
TabStripModel::ADD_FORCE_INDEX | TabStripModel::ADD_INHERIT_OPENER;
browser::Navigate(&params);
- 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)) {
UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram,
extension_misc::APP_LAUNCH_OMNIBOX_LOCATION,
extension_misc::APP_LAUNCH_BUCKET_BOUNDARY);
@@ -3517,7 +3520,10 @@ void Browser::CommitInstant(TabContentsWrapper* preview_contents) {
instant_unload_handler_->RunUnloadListenersOrDestroy(old_contents, index);
GURL url = preview_contents->tab_contents()->GetURL();
- 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)) {
UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram,
extension_misc::APP_LAUNCH_OMNIBOX_INSTANT,
extension_misc::APP_LAUNCH_BUCKET_BOUNDARY);
« no previous file with comments | « chrome/browser/sessions/tab_restore_service.cc ('k') | chrome/browser/ui/browser_init.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698