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

Side by Side Diff: chrome/browser/chromeos/arc/arc_auth_service.cc

Issue 2357053002: Always use arc::InstanceHolder<T>::GetInstanceForMethod (Closed)
Patch Set: review Created 4 years, 2 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chrome/browser/chromeos/arc/arc_auth_service.h" 5 #include "chrome/browser/chromeos/arc/arc_auth_service.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/common/shelf/shelf_delegate.h" 9 #include "ash/common/shelf/shelf_delegate.h"
10 #include "ash/common/wm_shell.h" 10 #include "ash/common/wm_shell.h"
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 if (user_manager::UserManager::Get() 222 if (user_manager::UserManager::Get()
223 ->IsCurrentUserCryptohomeDataEphemeral()) { 223 ->IsCurrentUserCryptohomeDataEphemeral()) {
224 VLOG(2) << "Users with ephemeral data are not supported in Arc."; 224 VLOG(2) << "Users with ephemeral data are not supported in Arc.";
225 return false; 225 return false;
226 } 226 }
227 227
228 return true; 228 return true;
229 } 229 }
230 230
231 void ArcAuthService::OnInstanceReady() { 231 void ArcAuthService::OnInstanceReady() {
232 arc_bridge_service()->auth()->instance()->Init( 232 auto* instance = arc_bridge_service()->auth()->GetInstanceForMethod("Init");
233 binding_.CreateInterfacePtrAndBind()); 233 if (!instance)
Yusuke Sato 2016/09/21 18:27:48 Previously, OnInstanceReady() methods were written
Yusuke Sato 2016/09/22 22:26:28 Changed to CHECK() based on your feedback. PTAL.
234 return;
235 instance->Init(binding_.CreateInterfacePtrAndBind());
234 } 236 }
235 237
236 void ArcAuthService::OnBridgeStopped(ArcBridgeService::StopReason reason) { 238 void ArcAuthService::OnBridgeStopped(ArcBridgeService::StopReason reason) {
237 // TODO(crbug.com/625923): Use |reason| to report more detailed errors. 239 // TODO(crbug.com/625923): Use |reason| to report more detailed errors.
238 if (arc_sign_in_timer_.IsRunning()) { 240 if (arc_sign_in_timer_.IsRunning()) {
239 OnSignInFailedInternal(ProvisioningResult::ARC_STOPPED); 241 OnSignInFailedInternal(ProvisioningResult::ARC_STOPPED);
240 } 242 }
241 243
242 if (clear_required_) { 244 if (clear_required_) {
243 // This should be always true, but just in case as this is looked at 245 // This should be always true, but just in case as this is looked at
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after
907 return os << kStateFetchingCode; 909 return os << kStateFetchingCode;
908 case ArcAuthService::State::ACTIVE: 910 case ArcAuthService::State::ACTIVE:
909 return os << kStateActive; 911 return os << kStateActive;
910 default: 912 default:
911 NOTREACHED(); 913 NOTREACHED();
912 return os; 914 return os;
913 } 915 }
914 } 916 }
915 917
916 } // namespace arc 918 } // namespace arc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698