summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/sessions/session_restore.cc5
-rw-r--r--chrome/browser/sessions/tab_restore_service.cc5
-rw-r--r--chrome/browser/ui/browser.cc10
-rw-r--r--chrome/browser/ui/browser_init.cc4
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm5
-rw-r--r--chrome/browser/ui/gtk/bookmark_bar_gtk.cc5
-rw-r--r--chrome/browser/ui/views/bookmark_bar_view.cc5
-rw-r--r--chrome/browser/webui/app_launcher_handler.cc5
8 files changed, 36 insertions, 8 deletions
diff --git a/chrome/browser/sessions/session_restore.cc b/chrome/browser/sessions/session_restore.cc
index e3f27b7..480f80f 100644
--- a/chrome/browser/sessions/session_restore.cc
+++ b/chrome/browser/sessions/session_restore.cc
@@ -652,7 +652,10 @@ class SessionRestoreImpl : public NotificationObserver {
// Record an app launch, if applicable.
GURL url = tab.navigations.at(tab.current_navigation_index).virtual_url();
- if (browser->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 = browser->profile()->GetExtensionService();
+ if (service && service->IsInstalledApp(url)) {
UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram,
extension_misc::APP_LAUNCH_SESSION_RESTORE,
extension_misc::APP_LAUNCH_BUCKET_BOUNDARY);
diff --git a/chrome/browser/sessions/tab_restore_service.cc b/chrome/browser/sessions/tab_restore_service.cc
index c4f3ae4..7d32607 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,
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 17d54be..0b3820c 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);
diff --git a/chrome/browser/ui/browser_init.cc b/chrome/browser/ui/browser_init.cc
index 56d0def..7ddc43c 100644
--- a/chrome/browser/ui/browser_init.cc
+++ b/chrome/browser/ui/browser_init.cc
@@ -457,7 +457,11 @@ void RecordAppLaunches(
Profile* profile,
const std::vector<GURL>& cmd_line_urls,
const std::vector<BrowserInit::LaunchWithProfile::Tab>& autolaunch_tabs) {
+ // 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* extension_service = profile->GetExtensionService();
+ if (!extension_service)
+ return;
for (size_t i = 0; i < cmd_line_urls.size(); ++i) {
if (extension_service->IsInstalledApp(cmd_line_urls.at(i))) {
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
index e69e46b..2a41ae5 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
@@ -121,7 +121,10 @@ const CGFloat kBookmarkBarOverlap = 3.0;
const NSTimeInterval kBookmarkBarAnimationDuration = 0.12;
void RecordAppLaunch(Profile* profile, GURL url) {
- 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,
diff --git a/chrome/browser/ui/gtk/bookmark_bar_gtk.cc b/chrome/browser/ui/gtk/bookmark_bar_gtk.cc
index c9c1d07..18586f3 100644
--- a/chrome/browser/ui/gtk/bookmark_bar_gtk.cc
+++ b/chrome/browser/ui/gtk/bookmark_bar_gtk.cc
@@ -109,7 +109,10 @@ void SetToolBarStyle() {
}
void RecordAppLaunch(Profile* profile, GURL url) {
- 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,
diff --git a/chrome/browser/ui/views/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmark_bar_view.cc
index 5c51f5a..bab8e07 100644
--- a/chrome/browser/ui/views/bookmark_bar_view.cc
+++ b/chrome/browser/ui/views/bookmark_bar_view.cc
@@ -235,7 +235,10 @@ class OverFlowButton : public views::MenuButton {
};
void RecordAppLaunch(Profile* profile, GURL url) {
- 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,
diff --git a/chrome/browser/webui/app_launcher_handler.cc b/chrome/browser/webui/app_launcher_handler.cc
index 9b1c8ea..00ea365 100644
--- a/chrome/browser/webui/app_launcher_handler.cc
+++ b/chrome/browser/webui/app_launcher_handler.cc
@@ -478,7 +478,10 @@ void AppLauncherHandler::RecordAppLaunchByURL(
CHECK(bucket != extension_misc::APP_LAUNCH_BUCKET_INVALID);
GURL url(UnescapeURLComponent(escaped_url, kUnescapeRules));
- 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, bucket,