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

Side by Side Diff: components/webdata/encryptor/encryptor_mac.mm

Issue 13973004: Convert string16 -> base::string16 in components/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
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 "components/webdata/encryptor/encryptor.h" 5 #include "components/webdata/encryptor/encryptor.h"
6 6
7 #include <CommonCrypto/CommonCryptor.h> // for kCCBlockSizeAES128 7 #include <CommonCrypto/CommonCryptor.h> // for kCCBlockSizeAES128
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 salt, 62 salt,
63 kEncryptionIterations, 63 kEncryptionIterations,
64 kDerivedKeySizeInBits)); 64 kDerivedKeySizeInBits));
65 DCHECK(encryption_key.get()); 65 DCHECK(encryption_key.get());
66 66
67 return encryption_key.release(); 67 return encryption_key.release();
68 } 68 }
69 69
70 } // namespace 70 } // namespace
71 71
72 bool Encryptor::EncryptString16(const string16& plaintext, 72 bool Encryptor::EncryptString16(const base::string16& plaintext,
73 std::string* ciphertext) { 73 std::string* ciphertext) {
74 return EncryptString(UTF16ToUTF8(plaintext), ciphertext); 74 return EncryptString(UTF16ToUTF8(plaintext), ciphertext);
75 } 75 }
76 76
77 bool Encryptor::DecryptString16(const std::string& ciphertext, 77 bool Encryptor::DecryptString16(const std::string& ciphertext,
78 string16* plaintext) { 78 base::string16* plaintext) {
79 std::string utf8; 79 std::string utf8;
80 if (!DecryptString(ciphertext, &utf8)) 80 if (!DecryptString(ciphertext, &utf8))
81 return false; 81 return false;
82 82
83 *plaintext = UTF8ToUTF16(utf8); 83 *plaintext = UTF8ToUTF16(utf8);
84 return true; 84 return true;
85 } 85 }
86 86
87 bool Encryptor::EncryptString(const std::string& plaintext, 87 bool Encryptor::EncryptString(const std::string& plaintext,
88 std::string* ciphertext) { 88 std::string* ciphertext) {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 if (!encryptor.Decrypt(raw_ciphertext, plaintext)) 141 if (!encryptor.Decrypt(raw_ciphertext, plaintext))
142 return false; 142 return false;
143 143
144 return true; 144 return true;
145 } 145 }
146 146
147 void Encryptor::UseMockKeychain(bool use_mock) { 147 void Encryptor::UseMockKeychain(bool use_mock) {
148 use_mock_keychain = use_mock; 148 use_mock_keychain = use_mock;
149 } 149 }
150 150
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698