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

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

Issue 2502243002: Support multiple Observer instances for ArcSupportHost. (Closed)
Patch Set: rebase Created 4 years, 1 month 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/arc/arc_support_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4824f9e8d8b1ad84e1189767602540b69d287cf1..4c6d1e520f3e7ddf89f3ef5ea23c30e1fbde396b 100644
--- a/chrome/browser/chromeos/arc/arc_auth_service.cc
+++ b/chrome/browser/chromeos/arc/arc_auth_service.cc
@@ -608,6 +608,7 @@ void ArcAuthService::OnPrimaryUserProfilePrepared(Profile* profile) {
// do some action to solve the problem be means of UI.
if (!g_disable_ui_for_testing && !IsOptInVerificationDisabled() &&
!IsArcKioskMode()) {
+ DCHECK(!support_host_);
support_host_ = base::MakeUnique<ArcSupportHost>(profile_);
support_host_->AddObserver(this);
@@ -656,8 +657,11 @@ void ArcAuthService::OnIsSyncingChanged() {
void ArcAuthService::Shutdown() {
ShutdownBridge();
- if (support_host_)
+ if (support_host_) {
support_host_->Close();
+ support_host_->RemoveObserver(this);
+ support_host_.reset();
+ }
if (profile_) {
sync_preferences::PrefServiceSyncable* pref_service_syncable =
PrefServiceSyncableFromProfile(profile_);
« no previous file with comments | « no previous file | chrome/browser/chromeos/arc/arc_support_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698