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/settings/session_manager_operation.h" | 5 #include "chrome/browser/chromeos/settings/session_manager_operation.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 | 83 |
84 void SessionManagerOperation::ReportResult( | 84 void SessionManagerOperation::ReportResult( |
85 DeviceSettingsService::Status status) { | 85 DeviceSettingsService::Status status) { |
86 callback_.Run(this, status); | 86 callback_.Run(this, status); |
87 } | 87 } |
88 | 88 |
89 void SessionManagerOperation::EnsurePublicKey(const base::Closure& callback) { | 89 void SessionManagerOperation::EnsurePublicKey(const base::Closure& callback) { |
90 if (force_key_load_ || !public_key_ || !public_key_->is_loaded()) { | 90 if (force_key_load_ || !public_key_ || !public_key_->is_loaded()) { |
91 scoped_refptr<base::TaskRunner> task_runner = | 91 scoped_refptr<base::TaskRunner> task_runner = |
92 base::CreateTaskRunnerWithTraits( | 92 base::CreateTaskRunnerWithTraits( |
93 base::TaskTraits() | 93 {base::MayBlock(), base::TaskPriority::BACKGROUND, |
94 .MayBlock() | 94 base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}); |
95 .WithPriority(base::TaskPriority::BACKGROUND) | |
96 .WithShutdownBehavior( | |
97 base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN)); | |
98 base::PostTaskAndReplyWithResult( | 95 base::PostTaskAndReplyWithResult( |
99 task_runner.get(), FROM_HERE, | 96 task_runner.get(), FROM_HERE, |
100 base::Bind(&SessionManagerOperation::LoadPublicKey, owner_key_util_, | 97 base::Bind(&SessionManagerOperation::LoadPublicKey, owner_key_util_, |
101 force_key_load_ ? nullptr : public_key_), | 98 force_key_load_ ? nullptr : public_key_), |
102 base::Bind(&SessionManagerOperation::StorePublicKey, | 99 base::Bind(&SessionManagerOperation::StorePublicKey, |
103 weak_factory_.GetWeakPtr(), callback)); | 100 weak_factory_.GetWeakPtr(), callback)); |
104 } else { | 101 } else { |
105 callback.Run(); | 102 callback.Run(); |
106 } | 103 } |
107 } | 104 } |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 } | 267 } |
271 | 268 |
272 void StoreSettingsOperation::HandleStoreResult(bool success) { | 269 void StoreSettingsOperation::HandleStoreResult(bool success) { |
273 if (!success) | 270 if (!success) |
274 ReportResult(DeviceSettingsService::STORE_OPERATION_FAILED); | 271 ReportResult(DeviceSettingsService::STORE_OPERATION_FAILED); |
275 else | 272 else |
276 StartLoading(); | 273 StartLoading(); |
277 } | 274 } |
278 | 275 |
279 } // namespace chromeos | 276 } // namespace chromeos |
OLD | NEW |