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

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

Issue 2748743004: cryptohome: Add dbus method and signal name for encryption migration. (Closed)
Patch Set: Created 3 years, 9 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
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 } 56 }
57 57
58 void FakeCryptohomeClient::ResetAsyncCallStatusHandlers() { 58 void FakeCryptohomeClient::ResetAsyncCallStatusHandlers() {
59 async_call_status_handler_.Reset(); 59 async_call_status_handler_.Reset();
60 async_call_status_data_handler_.Reset(); 60 async_call_status_data_handler_.Reset();
61 } 61 }
62 62
63 void FakeCryptohomeClient::SetLowDiskSpaceHandler( 63 void FakeCryptohomeClient::SetLowDiskSpaceHandler(
64 const LowDiskSpaceHandler& handler) {} 64 const LowDiskSpaceHandler& handler) {}
65 65
66 void FakeCryptohomeClient::SetDircryptoMigrationProgressHandler(
67 const DircryptoMigrationProgessHandler& handler) {}
68
66 void FakeCryptohomeClient::WaitForServiceToBeAvailable( 69 void FakeCryptohomeClient::WaitForServiceToBeAvailable(
67 const WaitForServiceToBeAvailableCallback& callback) { 70 const WaitForServiceToBeAvailableCallback& callback) {
68 if (service_is_available_) { 71 if (service_is_available_) {
69 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, 72 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE,
70 base::Bind(callback, true)); 73 base::Bind(callback, true));
71 } else { 74 } else {
72 pending_wait_for_service_to_be_available_callbacks_.push_back(callback); 75 pending_wait_for_service_to_be_available_callbacks_.push_back(callback);
73 } 76 }
74 } 77 }
75 78
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 ReturnProtobufMethodCallback(reply, callback); 570 ReturnProtobufMethodCallback(reply, callback);
568 } 571 }
569 572
570 void FakeCryptohomeClient::FlushAndSignBootAttributes( 573 void FakeCryptohomeClient::FlushAndSignBootAttributes(
571 const cryptohome::FlushAndSignBootAttributesRequest& request, 574 const cryptohome::FlushAndSignBootAttributesRequest& request,
572 const ProtobufMethodCallback& callback) { 575 const ProtobufMethodCallback& callback) {
573 cryptohome::BaseReply reply; 576 cryptohome::BaseReply reply;
574 ReturnProtobufMethodCallback(reply, callback); 577 ReturnProtobufMethodCallback(reply, callback);
575 } 578 }
576 579
580 void FakeCryptohomeClient::MigrateToDircrypto(
581 const cryptohome::Identification& cryptohome_id,
582 const cryptohome::AuthorizationRequest& auth,
583 const ProtobufMethodCallback& callback) {
584 cryptohome::BaseReply reply;
585 ReturnProtobufMethodCallback(reply, callback);
Darren Krahn 2017/03/14 16:03:33 Make a few progress calls to test the handler?
kinaba 2017/03/15 08:17:30 Good point. Actually, @fukino is now writing an U
586 }
587
577 void FakeCryptohomeClient::SetServiceIsAvailable(bool is_available) { 588 void FakeCryptohomeClient::SetServiceIsAvailable(bool is_available) {
578 service_is_available_ = is_available; 589 service_is_available_ = is_available;
579 if (is_available) { 590 if (is_available) {
580 std::vector<WaitForServiceToBeAvailableCallback> callbacks; 591 std::vector<WaitForServiceToBeAvailableCallback> callbacks;
581 callbacks.swap(pending_wait_for_service_to_be_available_callbacks_); 592 callbacks.swap(pending_wait_for_service_to_be_available_callbacks_);
582 for (size_t i = 0; i < callbacks.size(); ++i) 593 for (size_t i = 0; i < callbacks.size(); ++i)
583 callbacks[i].Run(is_available); 594 callbacks[i].Run(is_available);
584 } 595 }
585 } 596 }
586 597
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 callback.Run(async_call_id_); 643 callback.Run(async_call_id_);
633 if (!async_call_status_data_handler_.is_null()) { 644 if (!async_call_status_data_handler_.is_null()) {
634 base::ThreadTaskRunnerHandle::Get()->PostTask( 645 base::ThreadTaskRunnerHandle::Get()->PostTask(
635 FROM_HERE, base::Bind(async_call_status_data_handler_, async_call_id_, 646 FROM_HERE, base::Bind(async_call_status_data_handler_, async_call_id_,
636 true, data)); 647 true, data));
637 } 648 }
638 ++async_call_id_; 649 ++async_call_id_;
639 } 650 }
640 651
641 } // namespace chromeos 652 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698