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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "chromeos/cryptohome/async_method_caller.h" | 9 #include "chromeos/cryptohome/async_method_caller.h" |
10 #include "chromeos/dbus/blocking_method_caller.h" | 10 #include "chromeos/dbus/blocking_method_caller.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 // CryptohomeClient override. | 126 // CryptohomeClient override. |
127 virtual void AsyncMount(const std::string& username, | 127 virtual void AsyncMount(const std::string& username, |
128 const std::string& key, | 128 const std::string& key, |
129 int flags, | 129 int flags, |
130 const AsyncMethodCallback& callback) OVERRIDE { | 130 const AsyncMethodCallback& callback) OVERRIDE { |
131 INITIALIZE_METHOD_CALL(method_call, cryptohome::kCryptohomeAsyncMount); | 131 INITIALIZE_METHOD_CALL(method_call, cryptohome::kCryptohomeAsyncMount); |
132 dbus::MessageWriter writer(&method_call); | 132 dbus::MessageWriter writer(&method_call); |
133 writer.AppendString(username); | 133 writer.AppendString(username); |
134 writer.AppendString(key); | 134 writer.AppendString(key); |
135 writer.AppendBool(flags & cryptohome::CREATE_IF_MISSING); | 135 writer.AppendBool(flags & cryptohome::CREATE_IF_MISSING); |
136 writer.AppendBool(false); // deprecated_replace_tracked_subdirectories | 136 writer.AppendBool(flags & cryptohome::ENSURE_EPHEMERAL); |
137 // deprecated_tracked_subdirectories | 137 // deprecated_tracked_subdirectories |
138 writer.AppendArrayOfStrings(std::vector<std::string>()); | 138 writer.AppendArrayOfStrings(std::vector<std::string>()); |
139 writer.AppendBool(flags & cryptohome::ENSURE_EPHEMERAL); | |
140 proxy_->CallMethod(&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, | 139 proxy_->CallMethod(&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, |
141 base::Bind(&CryptohomeClientImpl::OnAsyncMethodCall, | 140 base::Bind(&CryptohomeClientImpl::OnAsyncMethodCall, |
142 weak_ptr_factory_.GetWeakPtr(), | 141 weak_ptr_factory_.GetWeakPtr(), |
143 callback)); | 142 callback)); |
144 } | 143 } |
145 | 144 |
146 // CryptohomeClient override. | 145 // CryptohomeClient override. |
147 virtual void AsyncMountGuest(const AsyncMethodCallback& callback) OVERRIDE { | 146 virtual void AsyncMountGuest(const AsyncMethodCallback& callback) OVERRIDE { |
148 INITIALIZE_METHOD_CALL(method_call, cryptohome::kCryptohomeAsyncMountGuest); | 147 INITIALIZE_METHOD_CALL(method_call, cryptohome::kCryptohomeAsyncMountGuest); |
149 proxy_->CallMethod(&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, | 148 proxy_->CallMethod(&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, |
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 // static | 673 // static |
675 CryptohomeClient* CryptohomeClient::Create(DBusClientImplementationType type, | 674 CryptohomeClient* CryptohomeClient::Create(DBusClientImplementationType type, |
676 dbus::Bus* bus) { | 675 dbus::Bus* bus) { |
677 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) | 676 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) |
678 return new CryptohomeClientImpl(bus); | 677 return new CryptohomeClientImpl(bus); |
679 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); | 678 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); |
680 return new CryptohomeClientStubImpl(); | 679 return new CryptohomeClientStubImpl(); |
681 } | 680 } |
682 | 681 |
683 } // namespace chromeos | 682 } // namespace chromeos |
OLD | NEW |