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

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

Issue 2797163002: cryptohome: Make CryptohomeClient::Unmount non-blocking (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « chromeos/dbus/fake_cryptohome_client.h ('k') | chromeos/dbus/mock_cryptohome_client.h » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 pending_wait_for_service_to_be_available_callbacks_.push_back(callback); 83 pending_wait_for_service_to_be_available_callbacks_.push_back(callback);
84 } 84 }
85 } 85 }
86 86
87 void FakeCryptohomeClient::IsMounted( 87 void FakeCryptohomeClient::IsMounted(
88 const BoolDBusMethodCallback& callback) { 88 const BoolDBusMethodCallback& callback) {
89 base::ThreadTaskRunnerHandle::Get()->PostTask( 89 base::ThreadTaskRunnerHandle::Get()->PostTask(
90 FROM_HERE, base::Bind(callback, DBUS_METHOD_CALL_SUCCESS, true)); 90 FROM_HERE, base::Bind(callback, DBUS_METHOD_CALL_SUCCESS, true));
91 } 91 }
92 92
93 bool FakeCryptohomeClient::Unmount(bool* success) { 93 void FakeCryptohomeClient::Unmount(const BoolDBusMethodCallback& callback) {
94 *success = unmount_result_; 94 base::ThreadTaskRunnerHandle::Get()->PostTask(
95 return true; 95 FROM_HERE,
96 base::Bind(callback, DBUS_METHOD_CALL_SUCCESS, unmount_result_));
96 } 97 }
97 98
98 void FakeCryptohomeClient::AsyncCheckKey( 99 void FakeCryptohomeClient::AsyncCheckKey(
99 const cryptohome::Identification& cryptohome_id, 100 const cryptohome::Identification& cryptohome_id,
100 const std::string& key, 101 const std::string& key,
101 const AsyncMethodCallback& callback) { 102 const AsyncMethodCallback& callback) {
102 ReturnAsyncMethodResult(callback); 103 ReturnAsyncMethodResult(callback);
103 } 104 }
104 105
105 void FakeCryptohomeClient::AsyncMigrateKey( 106 void FakeCryptohomeClient::AsyncMigrateKey(
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 if (!dircrypto_migration_progress_handler_.is_null()) { 684 if (!dircrypto_migration_progress_handler_.is_null()) {
684 base::ThreadTaskRunnerHandle::Get()->PostTask( 685 base::ThreadTaskRunnerHandle::Get()->PostTask(
685 FROM_HERE, base::Bind(dircrypto_migration_progress_handler_, 686 FROM_HERE, base::Bind(dircrypto_migration_progress_handler_,
686 cryptohome::DIRCRYPTO_MIGRATION_IN_PROGRESS, 687 cryptohome::DIRCRYPTO_MIGRATION_IN_PROGRESS,
687 dircrypto_migration_progress_, 688 dircrypto_migration_progress_,
688 kDircryptoMigrationMaxProgress)); 689 kDircryptoMigrationMaxProgress));
689 } 690 }
690 } 691 }
691 692
692 } // namespace chromeos 693 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/fake_cryptohome_client.h ('k') | chromeos/dbus/mock_cryptohome_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698