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

Unified Diff: chrome/browser/profiles/profile_manager.cc

Issue 1279543002: Support needed to measure user and service traffic in Chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@NewHistogram
Patch Set: Addressing blundell's comments. Created 5 years, 3 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
Index: chrome/browser/profiles/profile_manager.cc
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc
index 1337b660518f900c4762c19bbbc2140b850de314..de946352615a770b42ab8a79712fcfba8e34e5b1 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -459,6 +459,9 @@ void ProfileManager::CreateProfileAsync(
}
bool ProfileManager::IsValidProfile(Profile* profile) {
+ // The profile_manager() returns NULL when running unit tests.
+ if (!g_browser_process->profile_manager())
Lei Zhang 2015/09/02 18:14:43 Curious, why is this even needed? What happens if
amohammadkhan 2015/09/03 04:31:19 It was causing segmentation fault in tests. It see
Lei Zhang 2015/09/03 04:47:11 I'm skeptical this is the right thing to do. Profi
amohammadkhan 2015/09/03 23:10:35 ChromeNetworkDelegateTest.DataUseMeasurementUserTe
Lei Zhang 2015/09/04 01:18:06 The right fix is to do the check in the caller, wh
amohammadkhan 2015/09/04 17:25:11 Done.
+ return false;
for (ProfilesInfoMap::iterator iter = profiles_info_.begin();
iter != profiles_info_.end(); ++iter) {
if (iter->second->created) {

Powered by Google App Engine
This is Rietveld 408576698