| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chromeos/login/auth/online_attempt.h" | 5 #include "chromeos/login/auth/online_attempt.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 namespace chromeos { | 27 namespace chromeos { |
| 28 | 28 |
| 29 // static | 29 // static |
| 30 const int OnlineAttempt::kClientLoginTimeoutMs = 10000; | 30 const int OnlineAttempt::kClientLoginTimeoutMs = 10000; |
| 31 | 31 |
| 32 OnlineAttempt::OnlineAttempt(AuthAttemptState* current_attempt, | 32 OnlineAttempt::OnlineAttempt(AuthAttemptState* current_attempt, |
| 33 AuthAttemptStateResolver* callback) | 33 AuthAttemptStateResolver* callback) |
| 34 : message_loop_(base::MessageLoopProxy::current()), | 34 : message_loop_(base::MessageLoopProxy::current()), |
| 35 attempt_(current_attempt), | 35 attempt_(current_attempt), |
| 36 resolver_(callback), | 36 resolver_(callback), |
| 37 weak_factory_(this), | 37 try_again_(true), |
| 38 try_again_(true) { | 38 weak_factory_(this) { |
| 39 DCHECK(attempt_->user_type == user_manager::USER_TYPE_REGULAR); | 39 DCHECK(attempt_->user_type == user_manager::USER_TYPE_REGULAR); |
| 40 } | 40 } |
| 41 | 41 |
| 42 OnlineAttempt::~OnlineAttempt() { | 42 OnlineAttempt::~OnlineAttempt() { |
| 43 // Just to be sure. | 43 // Just to be sure. |
| 44 if (client_fetcher_.get()) | 44 if (client_fetcher_.get()) |
| 45 client_fetcher_->CancelRequest(); | 45 client_fetcher_->CancelRequest(); |
| 46 } | 46 } |
| 47 | 47 |
| 48 void OnlineAttempt::Initiate(net::URLRequestContextGetter* request_context) { | 48 void OnlineAttempt::Initiate(net::URLRequestContextGetter* request_context) { |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 } | 143 } |
| 144 } | 144 } |
| 145 | 145 |
| 146 void OnlineAttempt::TriggerResolve(const AuthFailure& outcome) { | 146 void OnlineAttempt::TriggerResolve(const AuthFailure& outcome) { |
| 147 attempt_->RecordOnlineLoginStatus(outcome); | 147 attempt_->RecordOnlineLoginStatus(outcome); |
| 148 client_fetcher_.reset(NULL); | 148 client_fetcher_.reset(NULL); |
| 149 resolver_->Resolve(); | 149 resolver_->Resolve(); |
| 150 } | 150 } |
| 151 | 151 |
| 152 } // namespace chromeos | 152 } // namespace chromeos |
| OLD | NEW |