| 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 "chromeos/dbus/cryptohome_client.h" | 5 #include "chromeos/dbus/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 923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 934 writer.AppendProtoAsArrayOfBytes(id_proto); | 934 writer.AppendProtoAsArrayOfBytes(id_proto); |
| 935 writer.AppendProtoAsArrayOfBytes(auth); | 935 writer.AppendProtoAsArrayOfBytes(auth); |
| 936 | 936 |
| 937 // The migration progress takes unpredicatable time depending on the | 937 // The migration progress takes unpredicatable time depending on the |
| 938 // user file size and the number. Setting the time limit to infinite. | 938 // user file size and the number. Setting the time limit to infinite. |
| 939 proxy_->CallMethod(&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, | 939 proxy_->CallMethod(&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, |
| 940 base::Bind(&CryptohomeClientImpl::OnVoidMethod, | 940 base::Bind(&CryptohomeClientImpl::OnVoidMethod, |
| 941 weak_ptr_factory_.GetWeakPtr(), callback)); | 941 weak_ptr_factory_.GetWeakPtr(), callback)); |
| 942 } | 942 } |
| 943 | 943 |
| 944 void NeedsDircryptoMigration( |
| 945 const cryptohome::Identification& cryptohome_id, |
| 946 const BoolDBusMethodCallback& callback) override { |
| 947 dbus::MethodCall method_call( |
| 948 cryptohome::kCryptohomeInterface, |
| 949 cryptohome::kCryptohomeNeedsDircryptoMigration); |
| 950 |
| 951 cryptohome::AccountIdentifier id_proto; |
| 952 FillIdentificationProtobuf(cryptohome_id, &id_proto); |
| 953 |
| 954 dbus::MessageWriter writer(&method_call); |
| 955 writer.AppendProtoAsArrayOfBytes(id_proto); |
| 956 |
| 957 proxy_->CallMethod(&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, |
| 958 base::Bind(&CryptohomeClientImpl::OnBoolMethod, |
| 959 weak_ptr_factory_.GetWeakPtr(), callback)); |
| 960 } |
| 961 |
| 944 protected: | 962 protected: |
| 945 void Init(dbus::Bus* bus) override { | 963 void Init(dbus::Bus* bus) override { |
| 946 proxy_ = bus->GetObjectProxy( | 964 proxy_ = bus->GetObjectProxy( |
| 947 cryptohome::kCryptohomeServiceName, | 965 cryptohome::kCryptohomeServiceName, |
| 948 dbus::ObjectPath(cryptohome::kCryptohomeServicePath)); | 966 dbus::ObjectPath(cryptohome::kCryptohomeServicePath)); |
| 949 | 967 |
| 950 blocking_method_caller_.reset(new BlockingMethodCaller(bus, proxy_)); | 968 blocking_method_caller_.reset(new BlockingMethodCaller(bus, proxy_)); |
| 951 | 969 |
| 952 proxy_->ConnectToSignal(cryptohome::kCryptohomeInterface, | 970 proxy_->ConnectToSignal(cryptohome::kCryptohomeInterface, |
| 953 cryptohome::kSignalAsyncCallStatus, | 971 cryptohome::kSignalAsyncCallStatus, |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1279 return new CryptohomeClientImpl(); | 1297 return new CryptohomeClientImpl(); |
| 1280 } | 1298 } |
| 1281 | 1299 |
| 1282 // static | 1300 // static |
| 1283 std::string CryptohomeClient::GetStubSanitizedUsername( | 1301 std::string CryptohomeClient::GetStubSanitizedUsername( |
| 1284 const cryptohome::Identification& cryptohome_id) { | 1302 const cryptohome::Identification& cryptohome_id) { |
| 1285 return cryptohome_id.id() + kUserIdStubHashSuffix; | 1303 return cryptohome_id.id() + kUserIdStubHashSuffix; |
| 1286 } | 1304 } |
| 1287 | 1305 |
| 1288 } // namespace chromeos | 1306 } // namespace chromeos |
| OLD | NEW |