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

Unified Diff: chrome/browser/chromeos/arc/arc_auth_service.cc

Issue 2149853004: arc: Implement safe access to ArcAuthService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup Created 4 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/chromeos/arc/arc_auth_service.cc
diff --git a/chrome/browser/chromeos/arc/arc_auth_service.cc b/chrome/browser/chromeos/arc/arc_auth_service.cc
index 2f68cd39a8b671c0e9ea76adffb5520cd2d9f717..71d44e1eb97878a06ba3146d357ca8b3ba490299 100644
--- a/chrome/browser/chromeos/arc/arc_auth_service.cc
+++ b/chrome/browser/chromeos/arc/arc_auth_service.cc
@@ -341,9 +341,6 @@ void ArcAuthService::OnPrimaryUserProfilePrepared(Profile* profile) {
Shutdown();
- profile_ = profile;
khmel 2016/07/14 23:17:10 Actually this incorrect. It was changed while ago
- SetState(State::STOPPED);
-
if (!IsAllowedForProfile(profile))
return;
@@ -353,6 +350,9 @@ void ArcAuthService::OnPrimaryUserProfilePrepared(Profile* profile) {
return;
}
+ profile_ = profile;
+ SetState(State::STOPPED);
+
PrefServiceSyncableFromProfile(profile_)->AddSyncedPrefObserver(
prefs::kArcEnabled, this);
@@ -636,6 +636,9 @@ bool ArcAuthService::IsArcManaged() const {
bool ArcAuthService::IsArcEnabled() const {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ if (!IsAllowed())
khmel 2016/07/14 23:17:11 There are several calls to IsArcEnabled without pr
xiyuan 2016/07/15 17:12:52 Makes sense.
+ return false;
+
DCHECK(profile_);
return profile_->GetPrefs()->GetBoolean(prefs::kArcEnabled);
}

Powered by Google App Engine
This is Rietveld 408576698