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

Side by Side Diff: chromeos/cryptohome/cryptohome_util.cc

Issue 1540803002: Switch to standard integer types in chromeos/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more includes Created 5 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
« no previous file with comments | « chromeos/cryptohome/cryptohome_parameters.cc ('k') | chromeos/cryptohome/homedir_methods.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/cryptohome/cryptohome_util.h" 5 #include "chromeos/cryptohome/cryptohome_util.h"
6 6
7 #include <stdint.h>
8
7 #include "base/logging.h" 9 #include "base/logging.h"
8 #include "chromeos/dbus/cryptohome_client.h" 10 #include "chromeos/dbus/cryptohome_client.h"
9 #include "chromeos/dbus/dbus_thread_manager.h" 11 #include "chromeos/dbus/dbus_thread_manager.h"
10 12
11 namespace chromeos { 13 namespace chromeos {
12 namespace cryptohome_util { 14 namespace cryptohome_util {
13 15
14 bool TpmIsEnabled() { 16 bool TpmIsEnabled() {
15 bool result = false; 17 bool result = false;
16 DBusThreadManager::Get()->GetCryptohomeClient()->CallTpmIsEnabledAndBlock( 18 DBusThreadManager::Get()->GetCryptohomeClient()->CallTpmIsEnabledAndBlock(
(...skipping 10 matching lines...) Expand all
27 29
28 bool TpmIsBeingOwned() { 30 bool TpmIsBeingOwned() {
29 bool result = false; 31 bool result = false;
30 DBusThreadManager::Get()->GetCryptohomeClient()-> 32 DBusThreadManager::Get()->GetCryptohomeClient()->
31 CallTpmIsBeingOwnedAndBlock(&result); 33 CallTpmIsBeingOwnedAndBlock(&result);
32 return result; 34 return result;
33 } 35 }
34 36
35 bool InstallAttributesGet( 37 bool InstallAttributesGet(
36 const std::string& name, std::string* value) { 38 const std::string& name, std::string* value) {
37 std::vector<uint8> buf; 39 std::vector<uint8_t> buf;
38 bool success = false; 40 bool success = false;
39 DBusThreadManager::Get()->GetCryptohomeClient()-> 41 DBusThreadManager::Get()->GetCryptohomeClient()->
40 InstallAttributesGet(name, &buf, &success); 42 InstallAttributesGet(name, &buf, &success);
41 if (success) { 43 if (success) {
42 // Cryptohome returns 'buf' with a terminating '\0' character. 44 // Cryptohome returns 'buf' with a terminating '\0' character.
43 DCHECK(!buf.empty()); 45 DCHECK(!buf.empty());
44 DCHECK_EQ(buf.back(), 0); 46 DCHECK_EQ(buf.back(), 0);
45 value->assign(reinterpret_cast<char*>(buf.data()), buf.size() - 1); 47 value->assign(reinterpret_cast<char*>(buf.data()), buf.size() - 1);
46 } 48 }
47 return success; 49 return success;
48 } 50 }
49 51
50 bool InstallAttributesSet( 52 bool InstallAttributesSet(
51 const std::string& name, const std::string& value) { 53 const std::string& name, const std::string& value) {
52 std::vector<uint8> buf(value.c_str(), value.c_str() + value.size() + 1); 54 std::vector<uint8_t> buf(value.c_str(), value.c_str() + value.size() + 1);
53 bool success = false; 55 bool success = false;
54 DBusThreadManager::Get()->GetCryptohomeClient()-> 56 DBusThreadManager::Get()->GetCryptohomeClient()->
55 InstallAttributesSet(name, buf, &success); 57 InstallAttributesSet(name, buf, &success);
56 return success; 58 return success;
57 } 59 }
58 60
59 bool InstallAttributesFinalize() { 61 bool InstallAttributesFinalize() {
60 bool success = false; 62 bool success = false;
61 DBusThreadManager::Get()->GetCryptohomeClient()-> 63 DBusThreadManager::Get()->GetCryptohomeClient()->
62 InstallAttributesFinalize(&success); 64 InstallAttributesFinalize(&success);
63 return success; 65 return success;
64 } 66 }
65 67
66 bool InstallAttributesIsInvalid() { 68 bool InstallAttributesIsInvalid() {
67 bool result = false; 69 bool result = false;
68 DBusThreadManager::Get()->GetCryptohomeClient()-> 70 DBusThreadManager::Get()->GetCryptohomeClient()->
69 InstallAttributesIsInvalid(&result); 71 InstallAttributesIsInvalid(&result);
70 return result; 72 return result;
71 } 73 }
72 74
73 bool InstallAttributesIsFirstInstall() { 75 bool InstallAttributesIsFirstInstall() {
74 bool result = false; 76 bool result = false;
75 DBusThreadManager::Get()->GetCryptohomeClient()-> 77 DBusThreadManager::Get()->GetCryptohomeClient()->
76 InstallAttributesIsFirstInstall(&result); 78 InstallAttributesIsFirstInstall(&result);
77 return result; 79 return result;
78 } 80 }
79 81
80 } // namespace cryptohome_util 82 } // namespace cryptohome_util
81 } // namespace chromeos 83 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/cryptohome/cryptohome_parameters.cc ('k') | chromeos/cryptohome/homedir_methods.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698