Commit d47fdd69 authored by Darren Shen's avatar Darren Shen Committed by Commit Bot

Revert "Run ClearSigninProfile on user session start"

This reverts commit b5418f5c.

Reason for revert: FindIt says it's 74% confident that it's breaking KioskTest.LaunchAppUserCancel on linux cros.

https://findit-for-me.appspot.com/waterfall/failure?url=https://build.chromium.org/p/chromium.chromiumos/builders/linux-chromeos-rel/builds/16574

Original change's description:
> Run ClearSigninProfile on user session start
> 
> Also, ClearSigninProfile now closes any browser window opened in the
> profile. Ideally, no browsers would be open in the sign-in profile, but
> we've had cases where that had happened.
> 
> BUG=906837,901768
> 
> Change-Id: Ia231d2ce3420c5c743bcd17f839ad00f4a851874
> Reviewed-on: https://chromium-review.googlesource.com/c/1347105
> Reviewed-by: Jacob Dufault <jdufault@chromium.org>
> Reviewed-by: Alexander Alekseev <alemate@chromium.org>
> Commit-Queue: Toni Baržić <tbarzic@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#611442}

TBR=tbarzic@chromium.org,achuith@chromium.org,alemate@chromium.org,jdufault@chromium.org

Change-Id: I3f497a9076e926be8d28110f051685edb27e8f7e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 906837, 901768
Reviewed-on: https://chromium-review.googlesource.com/c/1352121Reviewed-by: default avatarDarren Shen <shend@chromium.org>
Commit-Queue: Darren Shen <shend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611544}
parent d21cd662
...@@ -1448,7 +1448,7 @@ void UserSessionManager::PrepareTpmDeviceAndFinalizeProfile(Profile* profile) { ...@@ -1448,7 +1448,7 @@ void UserSessionManager::PrepareTpmDeviceAndFinalizeProfile(Profile* profile) {
BootTimesRecorder::Get()->AddLoginTimeMarker("TPMOwn-Start", false); BootTimesRecorder::Get()->AddLoginTimeMarker("TPMOwn-Start", false);
if (!tpm_util::TpmIsEnabled() || tpm_util::TpmIsBeingOwned()) { if (!tpm_util::TpmIsEnabled() || tpm_util::TpmIsBeingOwned()) {
ClearSigninProfileAndFinalizePrepareProfile(profile); FinalizePrepareProfile(profile);
return; return;
} }
...@@ -1475,13 +1475,7 @@ void UserSessionManager::PrepareTpmDeviceAndFinalizeProfile(Profile* profile) { ...@@ -1475,13 +1475,7 @@ void UserSessionManager::PrepareTpmDeviceAndFinalizeProfile(Profile* profile) {
void UserSessionManager::OnCryptohomeOperationCompleted(Profile* profile, void UserSessionManager::OnCryptohomeOperationCompleted(Profile* profile,
bool result) { bool result) {
DCHECK(result); DCHECK(result);
ClearSigninProfileAndFinalizePrepareProfile(profile); FinalizePrepareProfile(profile);
}
void UserSessionManager::ClearSigninProfileAndFinalizePrepareProfile(
Profile* profile) {
ProfileHelper::Get()->ClearSigninProfile(base::BindRepeating(
&UserSessionManager::FinalizePrepareProfile, AsWeakPtr(), profile));
} }
void UserSessionManager::FinalizePrepareProfile(Profile* profile) { void UserSessionManager::FinalizePrepareProfile(Profile* profile) {
......
...@@ -389,9 +389,6 @@ class UserSessionManager ...@@ -389,9 +389,6 @@ class UserSessionManager
// Called on UI thread once Cryptohome operation completes. // Called on UI thread once Cryptohome operation completes.
void OnCryptohomeOperationCompleted(Profile* profile, bool result); void OnCryptohomeOperationCompleted(Profile* profile, bool result);
// Clears the sign-in profile, and initiates the user profile finalization.
void ClearSigninProfileAndFinalizePrepareProfile(Profile* profile);
// Finalized profile preparation. // Finalized profile preparation.
void FinalizePrepareProfile(Profile* profile); void FinalizePrepareProfile(Profile* profile);
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/profiles/profiles_state.h" #include "chrome/browser/profiles/profiles_state.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_switches.h"
#include "chromeos/chromeos_constants.h" #include "chromeos/chromeos_constants.h"
...@@ -53,11 +52,6 @@ bool ShouldAddProfileDirPrefix(const std::string& user_id_hash) { ...@@ -53,11 +52,6 @@ bool ShouldAddProfileDirPrefix(const std::string& user_id_hash) {
user_id_hash != chrome::kTestUserProfileDir; user_id_hash != chrome::kTestUserProfileDir;
} }
void WrapAsBrowsersCloseCallback(const base::RepeatingClosure& callback,
const base::FilePath& path) {
callback.Run();
}
class UsernameHashMatcher { class UsernameHashMatcher {
public: public:
explicit UsernameHashMatcher(const std::string& h) : username_hash(h) {} explicit UsernameHashMatcher(const std::string& h) : username_hash(h) {}
...@@ -292,7 +286,7 @@ void ProfileHelper::ClearSigninProfile(const base::Closure& on_clear_callback) { ...@@ -292,7 +286,7 @@ void ProfileHelper::ClearSigninProfile(const base::Closure& on_clear_callback) {
return; return;
} }
on_clear_profile_stage_finished_ = on_clear_profile_stage_finished_ =
base::BarrierClosure(3, base::Bind(&ProfileHelper::OnSigninProfileCleared, base::BarrierClosure(2, base::Bind(&ProfileHelper::OnSigninProfileCleared,
weak_factory_.GetWeakPtr())); weak_factory_.GetWeakPtr()));
LOG_ASSERT(!browsing_data_remover_); LOG_ASSERT(!browsing_data_remover_);
browsing_data_remover_ = browsing_data_remover_ =
...@@ -308,16 +302,6 @@ void ProfileHelper::ClearSigninProfile(const base::Closure& on_clear_callback) { ...@@ -308,16 +302,6 @@ void ProfileHelper::ClearSigninProfile(const base::Closure& on_clear_callback) {
login::SigninPartitionManager::Factory::GetForBrowserContext( login::SigninPartitionManager::Factory::GetForBrowserContext(
GetSigninProfile()) GetSigninProfile())
->CloseCurrentSigninSession(on_clear_profile_stage_finished_); ->CloseCurrentSigninSession(on_clear_profile_stage_finished_);
BrowserList::CloseAllBrowsersWithProfile(
GetSigninProfile(),
base::BindRepeating(
&WrapAsBrowsersCloseCallback,
on_clear_profile_stage_finished_) /* on_close_success */,
base::BindRepeating(
&WrapAsBrowsersCloseCallback,
on_clear_profile_stage_finished_) /* on_close_aborted */,
true /* skip_beforeunload */);
} }
Profile* ProfileHelper::GetProfileByAccountId(const AccountId& account_id) { Profile* ProfileHelper::GetProfileByAccountId(const AccountId& account_id) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment