summaryrefslogtreecommitdiffstats
path: root/chrome/browser/metrics
diff options
context:
space:
mode:
authortim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-09 22:43:55 +0000
committertim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-09 22:43:55 +0000
commitb61236c6679615af0811d59d130c91397d8c6be7 (patch)
treedfcfe53c4445a577e81284dc505c235ce4e819df /chrome/browser/metrics
parent004af1999e1af93ce408ff4c4057eb6e174a82bd (diff)
downloadchromium_src-b61236c6679615af0811d59d130c91397d8c6be7.zip
chromium_src-b61236c6679615af0811d59d130c91397d8c6be7.tar.gz
chromium_src-b61236c6679615af0811d59d130c91397d8c6be7.tar.bz2
The profile Source parameter of a BookmarkModelLoaded event can be null during testing.
MetricsService and WebContents weren't handling this case properly. Review URL: http://codereview.chromium.org/66007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13475 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/metrics')
-rw-r--r--chrome/browser/metrics/metrics_service.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/chrome/browser/metrics/metrics_service.cc b/chrome/browser/metrics/metrics_service.cc
index 5fcdb3a..8e94e98 100644
--- a/chrome/browser/metrics/metrics_service.cc
+++ b/chrome/browser/metrics/metrics_service.cc
@@ -534,10 +534,12 @@ void MetricsService::Observe(NotificationType type,
*Details<AutocompleteLog>(details).ptr());
break;
- case NotificationType::BOOKMARK_MODEL_LOADED:
- LogBookmarks(Source<Profile>(source)->GetBookmarkModel());
+ case NotificationType::BOOKMARK_MODEL_LOADED: {
+ Profile* p = Source<Profile>(source).ptr();
+ if (p)
+ LogBookmarks(p->GetBookmarkModel());
break;
-
+ }
default:
NOTREACHED();
break;