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

Side by Side Diff: components/arc/user_data/arc_user_data_service.cc

Issue 2133653002: arc: Notify ARC instance failures via callbacks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "components/arc/user_data/arc_user_data_service.h" 5 #include "components/arc/user_data/arc_user_data_service.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chromeos/chromeos_switches.h" 8 #include "chromeos/chromeos_switches.h"
9 #include "chromeos/cryptohome/cryptohome_parameters.h" 9 #include "chromeos/cryptohome/cryptohome_parameters.h"
10 #include "chromeos/dbus/dbus_thread_manager.h" 10 #include "chromeos/dbus/dbus_thread_manager.h"
(...skipping 13 matching lines...) Expand all
24 primary_user_account_id_(account_id) { 24 primary_user_account_id_(account_id) {
25 arc_bridge_service()->AddObserver(this); 25 arc_bridge_service()->AddObserver(this);
26 ClearIfDisabled(); 26 ClearIfDisabled();
27 } 27 }
28 28
29 ArcUserDataService::~ArcUserDataService() { 29 ArcUserDataService::~ArcUserDataService() {
30 DCHECK(thread_checker_.CalledOnValidThread()); 30 DCHECK(thread_checker_.CalledOnValidThread());
31 arc_bridge_service()->RemoveObserver(this); 31 arc_bridge_service()->RemoveObserver(this);
32 } 32 }
33 33
34 void ArcUserDataService::OnBridgeStopped() { 34 void ArcUserDataService::OnBridgeStopped(ArcBridgeService::StopReason reason) {
35 DCHECK(thread_checker_.CalledOnValidThread()); 35 DCHECK(thread_checker_.CalledOnValidThread());
36 const AccountId& account_id = 36 const AccountId& account_id =
37 user_manager::UserManager::Get()->GetPrimaryUser()->GetAccountId(); 37 user_manager::UserManager::Get()->GetPrimaryUser()->GetAccountId();
38 if (account_id != primary_user_account_id_) { 38 if (account_id != primary_user_account_id_) {
39 LOG(ERROR) << "User preferences not loaded for " 39 LOG(ERROR) << "User preferences not loaded for "
40 << primary_user_account_id_.GetUserEmail() 40 << primary_user_account_id_.GetUserEmail()
41 << ", but current primary user is " << account_id.GetUserEmail(); 41 << ", but current primary user is " << account_id.GetUserEmail();
42 primary_user_account_id_ = EmptyAccountId(); 42 primary_user_account_id_ = EmptyAccountId();
43 return; 43 return;
44 } 44 }
(...skipping 11 matching lines...) Expand all
56 chromeos::switches::kDisableArcDataWipe)) { 56 chromeos::switches::kDisableArcDataWipe)) {
57 return; 57 return;
58 } 58 }
59 const cryptohome::Identification cryptohome_id(primary_user_account_id_); 59 const cryptohome::Identification cryptohome_id(primary_user_account_id_);
60 chromeos::SessionManagerClient* session_manager_client = 60 chromeos::SessionManagerClient* session_manager_client =
61 chromeos::DBusThreadManager::Get()->GetSessionManagerClient(); 61 chromeos::DBusThreadManager::Get()->GetSessionManagerClient();
62 session_manager_client->RemoveArcData(cryptohome_id); 62 session_manager_client->RemoveArcData(cryptohome_id);
63 } 63 }
64 64
65 } // namespace arc 65 } // namespace arc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698