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

Unified Diff: chrome/browser/browser_process_impl.cc

Issue 385123004: Implement the WindowsLogoffRace finch experiment. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add an additional timing check around EndSession to prevent test success when timing out on the blo… Created 6 years, 5 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/browser_process_impl.cc
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index 27b7c5be0d5e0e6cce3a5077219abbcc0efb88f7..c77e0b63470e226a6874a876dcb0334fadb54a44 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -15,6 +15,7 @@
#include "base/debug/alias.h"
#include "base/debug/leak_annotations.h"
#include "base/files/file_path.h"
+#include "base/metrics/field_trial.h"
#include "base/path_service.h"
#include "base/prefs/json_pref_store.h"
#include "base/prefs/pref_registry_simple.h"
@@ -441,9 +442,17 @@ bool RundownTaskCounter::TimedWait(const base::TimeDelta& max_time) {
return waitable_event_.TimedWait(max_time);
}
+bool ExperimentUseBrokenSynchronization() {
Alexei Svitkine (slow) 2014/07/14 18:55:02 It would be useful for the reader to add a comment
Sigurður Ásgeirsson 2014/07/14 20:31:38 Done.
+ const std::string group_name =
+ base::FieldTrialList::FindFullName("WindowsLogoffRace");
+ return group_name == "BrokenSynchronization";
+}
+
} // namespace
void BrowserProcessImpl::EndSession() {
+ bool use_broken_synchronization = ExperimentUseBrokenSynchronization();
+
// Mark all the profiles as clean.
ProfileManager* pm = profile_manager();
std::vector<Profile*> profiles(pm->GetLoadedProfiles());
@@ -452,7 +461,8 @@ void BrowserProcessImpl::EndSession() {
Profile* profile = profiles[i];
profile->SetExitType(Profile::EXIT_SESSION_ENDED);
- rundown_counter->Post(profile->GetIOTaskRunner());
+ if (!use_broken_synchronization)
+ rundown_counter->Post(profile->GetIOTaskRunner());
}
// Tell the metrics service it was cleanly shutdown.
@@ -465,7 +475,8 @@ void BrowserProcessImpl::EndSession() {
// commit metrics::prefs::kStabilitySessionEndCompleted change immediately.
local_state()->CommitPendingWrite();
- rundown_counter->Post(local_state_task_runner_);
+ if (!use_broken_synchronization)
+ rundown_counter->Post(local_state_task_runner_);
#endif
}
@@ -479,6 +490,11 @@ void BrowserProcessImpl::EndSession() {
// If you change the condition here, be sure to also change
// ProfileBrowserTests to match.
#if defined(USE_X11) || defined(OS_WIN)
+ if (use_broken_synchronization) {
+ rundown_counter->Post(
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE));
+ }
+
// Do a best-effort wait on the successful countdown of rundown tasks. Note
// that if we don't complete "quickly enough", Windows will terminate our
// process.
« no previous file with comments | « no previous file | chrome/browser/chrome_browser_field_trials.cc » ('j') | chrome/browser/chrome_browser_field_trials.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698