| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/startup/startup_browser_creator.h" | 5 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> // For max(). | 9 #include <algorithm> // For max(). |
| 10 #include <limits> | 10 #include <limits> |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 // This is NULL until the profile to activate has been chosen. This value, | 241 // This is NULL until the profile to activate has been chosen. This value, |
| 242 // should only be set once all profiles have been launched, otherwise, | 242 // should only be set once all profiles have been launched, otherwise, |
| 243 // activation may not happen after the launch of newer profiles. | 243 // activation may not happen after the launch of newer profiles. |
| 244 Profile* profile_to_activate_; | 244 Profile* profile_to_activate_; |
| 245 // Set once we attempted to activate a profile. We only get one shot at this. | 245 // Set once we attempted to activate a profile. We only get one shot at this. |
| 246 bool activated_profile_; | 246 bool activated_profile_; |
| 247 | 247 |
| 248 DISALLOW_COPY_AND_ASSIGN(ProfileLaunchObserver); | 248 DISALLOW_COPY_AND_ASSIGN(ProfileLaunchObserver); |
| 249 }; | 249 }; |
| 250 | 250 |
| 251 base::LazyInstance<ProfileLaunchObserver> profile_launch_observer = | 251 base::LazyInstance<ProfileLaunchObserver>::DestructorAtExit |
| 252 LAZY_INSTANCE_INITIALIZER; | 252 profile_launch_observer = LAZY_INSTANCE_INITIALIZER; |
| 253 | 253 |
| 254 // Dumps the current set of the browser process's histograms to |output_file|. | 254 // Dumps the current set of the browser process's histograms to |output_file|. |
| 255 // The file is overwritten if it exists. This function should only be called in | 255 // The file is overwritten if it exists. This function should only be called in |
| 256 // the blocking pool. | 256 // the blocking pool. |
| 257 void DumpBrowserHistograms(const base::FilePath& output_file) { | 257 void DumpBrowserHistograms(const base::FilePath& output_file) { |
| 258 base::ThreadRestrictions::AssertIOAllowed(); | 258 base::ThreadRestrictions::AssertIOAllowed(); |
| 259 | 259 |
| 260 std::string output_string(base::StatisticsRecorder::ToJSON(std::string())); | 260 std::string output_string(base::StatisticsRecorder::ToJSON(std::string())); |
| 261 base::WriteFile(output_file, output_string.data(), | 261 base::WriteFile(output_file, output_string.data(), |
| 262 static_cast<int>(output_string.size())); | 262 static_cast<int>(output_string.size())); |
| (...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1012 if (!entry->IsSigninRequired()) { | 1012 if (!entry->IsSigninRequired()) { |
| 1013 Profile* profile = profile_manager->GetProfile(entry->GetPath()); | 1013 Profile* profile = profile_manager->GetProfile(entry->GetPath()); |
| 1014 if (profile) | 1014 if (profile) |
| 1015 return profile; | 1015 return profile; |
| 1016 } | 1016 } |
| 1017 } | 1017 } |
| 1018 | 1018 |
| 1019 return nullptr; | 1019 return nullptr; |
| 1020 } | 1020 } |
| 1021 #endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID) | 1021 #endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID) |
| OLD | NEW |