OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/login/tpm_password_fetcher.h" | 5 #include "chrome/browser/chromeos/login/tpm_password_fetcher.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "chromeos/dbus/cryptohome_client.h" | 10 #include "chromeos/dbus/cryptohome_client.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 LOG(ERROR) << "TPM returned an empty password."; | 59 LOG(ERROR) << "TPM returned an empty password."; |
60 } | 60 } |
61 delegate_->OnPasswordFetched(password); | 61 delegate_->OnPasswordFetched(password); |
62 } else { | 62 } else { |
63 // Password hasn't been acquired, reschedule fetch. | 63 // Password hasn't been acquired, reschedule fetch. |
64 RescheduleFetch(); | 64 RescheduleFetch(); |
65 } | 65 } |
66 } | 66 } |
67 | 67 |
68 void TpmPasswordFetcher::RescheduleFetch() { | 68 void TpmPasswordFetcher::RescheduleFetch() { |
69 MessageLoop::current()->PostDelayedTask( | 69 base::MessageLoop::current()->PostDelayedTask( |
70 FROM_HERE, | 70 FROM_HERE, |
71 base::Bind(&TpmPasswordFetcher::Fetch, weak_factory_.GetWeakPtr()), | 71 base::Bind(&TpmPasswordFetcher::Fetch, weak_factory_.GetWeakPtr()), |
72 base::TimeDelta::FromMilliseconds(kTpmCheckIntervalMs)); | 72 base::TimeDelta::FromMilliseconds(kTpmCheckIntervalMs)); |
73 } | 73 } |
74 | 74 |
75 } // namespace chromeos | 75 } // namespace chromeos |
OLD | NEW |