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

Side by Side Diff: chromeos/dbus/fake_cryptohome_client.cc

Issue 15774005: chromeos: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « chromeos/dbus/fake_bluetooth_device_client.cc ('k') | chromeos/dbus/fake_gsm_sms_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/dbus/fake_cryptohome_client.h" 5 #include "chromeos/dbus/fake_cryptohome_client.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "third_party/cros_system_api/dbus/service_constants.h" 9 #include "third_party/cros_system_api/dbus/service_constants.h"
10 10
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 } 64 }
65 65
66 void FakeCryptohomeClient::AsyncMigrateKey( 66 void FakeCryptohomeClient::AsyncMigrateKey(
67 const std::string& username, 67 const std::string& username,
68 const std::string& from_key, 68 const std::string& from_key,
69 const std::string& to_key, 69 const std::string& to_key,
70 const AsyncMethodCallback& callback) { 70 const AsyncMethodCallback& callback) {
71 } 71 }
72 72
73 void FakeCryptohomeClient::IsMounted(const BoolDBusMethodCallback& callback) { 73 void FakeCryptohomeClient::IsMounted(const BoolDBusMethodCallback& callback) {
74 MessageLoop::current()->PostTask(FROM_HERE, 74 base::MessageLoop::current()->PostTask(FROM_HERE,
75 base::Bind(callback, 75 base::Bind(callback,
76 DBUS_METHOD_CALL_SUCCESS, true)); 76 DBUS_METHOD_CALL_SUCCESS, true));
77 } 77 }
78 78
79 bool FakeCryptohomeClient::InstallAttributesGet(const std::string& name, 79 bool FakeCryptohomeClient::InstallAttributesGet(const std::string& name,
80 std::vector<uint8>* value, 80 std::vector<uint8>* value,
81 bool* successful) { 81 bool* successful) {
82 return false; 82 return false;
83 } 83 }
84 84
85 void FakeCryptohomeClient::AsyncMount(const std::string& username, 85 void FakeCryptohomeClient::AsyncMount(const std::string& username,
86 const std::string& key, int flags, 86 const std::string& key, int flags,
87 const AsyncMethodCallback& callback) { 87 const AsyncMethodCallback& callback) {
88 DCHECK(!callback.is_null()); 88 DCHECK(!callback.is_null());
89 89
90 MessageLoop::current()->PostTask(FROM_HERE, 90 base::MessageLoop::current()->PostTask(FROM_HERE,
91 base::Bind(callback, 1 /* async_id */)); 91 base::Bind(callback, 1 /* async_id */));
92 if (!handler_.is_null()) 92 if (!handler_.is_null())
93 MessageLoop::current()->PostTask(FROM_HERE, 93 base::MessageLoop::current()->PostTask(FROM_HERE,
94 base::Bind(handler_, 94 base::Bind(handler_,
95 1, // async_id 95 1, // async_id
96 true, // return_status 96 true, // return_status
97 cryptohome::MOUNT_ERROR_NONE)); 97 cryptohome::MOUNT_ERROR_NONE));
98 } 98 }
99 99
100 void FakeCryptohomeClient::AsyncMountGuest( 100 void FakeCryptohomeClient::AsyncMountGuest(
101 const AsyncMethodCallback& callback) { 101 const AsyncMethodCallback& callback) {
102 } 102 }
103 103
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 } 155 }
156 156
157 void FakeCryptohomeClient::TpmAttestationGetCertificate( 157 void FakeCryptohomeClient::TpmAttestationGetCertificate(
158 attestation::AttestationKeyType key_type, 158 attestation::AttestationKeyType key_type,
159 const std::string& key_name, 159 const std::string& key_name,
160 const DataMethodCallback& callback) { 160 const DataMethodCallback& callback) {
161 } 161 }
162 162
163 void FakeCryptohomeClient::InstallAttributesIsReady( 163 void FakeCryptohomeClient::InstallAttributesIsReady(
164 const BoolDBusMethodCallback& callback) { 164 const BoolDBusMethodCallback& callback) {
165 MessageLoop::current()->PostTask(FROM_HERE, 165 base::MessageLoop::current()->PostTask(FROM_HERE,
166 base::Bind(callback, 166 base::Bind(callback,
167 DBUS_METHOD_CALL_SUCCESS, true)); 167 DBUS_METHOD_CALL_SUCCESS, true));
168 } 168 }
169 169
170 void FakeCryptohomeClient::TpmAttestationGetPublicKey( 170 void FakeCryptohomeClient::TpmAttestationGetPublicKey(
171 attestation::AttestationKeyType key_type, 171 attestation::AttestationKeyType key_type,
172 const std::string& key_name, 172 const std::string& key_name,
173 const DataMethodCallback& callback) { 173 const DataMethodCallback& callback) {
174 } 174 }
175 175
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 const std::string& key_name, 222 const std::string& key_name,
223 const std::string& payload, 223 const std::string& payload,
224 const BoolDBusMethodCallback& callback) { 224 const BoolDBusMethodCallback& callback) {
225 } 225 }
226 226
227 void FakeCryptohomeClient::GetSanitizedUsername( 227 void FakeCryptohomeClient::GetSanitizedUsername(
228 const std::string& username, 228 const std::string& username,
229 const StringDBusMethodCallback& callback) { 229 const StringDBusMethodCallback& callback) {
230 DCHECK(!callback.is_null()); 230 DCHECK(!callback.is_null());
231 231
232 MessageLoop::current()->PostTask( 232 base::MessageLoop::current()->PostTask(
233 FROM_HERE, 233 FROM_HERE,
234 base::Bind(callback, 234 base::Bind(callback,
235 chromeos::DBUS_METHOD_CALL_SUCCESS, 235 chromeos::DBUS_METHOD_CALL_SUCCESS,
236 username)); 236 username));
237 if (!data_handler_.is_null()) 237 if (!data_handler_.is_null())
238 MessageLoop::current()->PostTask( 238 base::MessageLoop::current()->PostTask(
239 FROM_HERE, 239 FROM_HERE,
240 base::Bind(data_handler_, 240 base::Bind(data_handler_,
241 1, // async_id 241 1, // async_id
242 true, // return_status 242 true, // return_status
243 username)); 243 username));
244 } 244 }
245 245
246 void FakeCryptohomeClient::TpmAttestationSignEnterpriseChallenge( 246 void FakeCryptohomeClient::TpmAttestationSignEnterpriseChallenge(
247 attestation::AttestationKeyType key_type, 247 attestation::AttestationKeyType key_type,
248 const std::string& key_name, 248 const std::string& key_name,
(...skipping 17 matching lines...) Expand all
266 bool FakeCryptohomeClient::CallTpmClearStoredPasswordAndBlock() { 266 bool FakeCryptohomeClient::CallTpmClearStoredPasswordAndBlock() {
267 return false; 267 return false;
268 } 268 }
269 269
270 void FakeCryptohomeClient::AsyncTpmAttestationCreateCertRequest( 270 void FakeCryptohomeClient::AsyncTpmAttestationCreateCertRequest(
271 int options, 271 int options,
272 const AsyncMethodCallback& callback) { 272 const AsyncMethodCallback& callback) {
273 } 273 }
274 274
275 } // namespace chromeos 275 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/fake_bluetooth_device_client.cc ('k') | chromeos/dbus/fake_gsm_sms_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698