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

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

Issue 11474027: Merge 171734 (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1352/src/
Patch Set: Created 8 years 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 | « no previous file | no next file » | 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) 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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698