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

Unified Diff: chrome/browser/password_manager/encryptor.cc

Issue 28292: Convert encryptor.cc and friends to string16. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/password_manager/encryptor.h ('k') | chrome/browser/password_manager/encryptor_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/password_manager/encryptor.cc
===================================================================
--- chrome/browser/password_manager/encryptor.cc (revision 10646)
+++ chrome/browser/password_manager/encryptor.cc (working copy)
@@ -10,18 +10,18 @@
#pragma comment(lib, "crypt32.lib")
-bool Encryptor::EncryptWideString(const std::wstring& plaintext,
- std::string* ciphertext) {
- return EncryptString(WideToUTF8(plaintext), ciphertext);
+bool Encryptor::EncryptString16(const string16& plaintext,
+ std::string* ciphertext) {
+ return EncryptString(UTF16ToUTF8(plaintext), ciphertext);
}
-bool Encryptor::DecryptWideString(const std::string& ciphertext,
- std::wstring* plaintext){
+bool Encryptor::DecryptString16(const std::string& ciphertext,
+ string16* plaintext) {
std::string utf8;
if (!DecryptString(ciphertext, &utf8))
return false;
- *plaintext = UTF8ToWide(utf8);
+ *plaintext = UTF8ToUTF16(utf8);
return true;
}
@@ -47,7 +47,7 @@
}
bool Encryptor::DecryptString(const std::string& ciphertext,
- std::string* plaintext){
+ std::string* plaintext) {
DATA_BLOB input;
input.pbData = const_cast<BYTE*>(
reinterpret_cast<const BYTE*>(ciphertext.data()));
@@ -56,7 +56,7 @@
DATA_BLOB output;
BOOL result = CryptUnprotectData(&input, NULL, NULL, NULL, NULL,
0, &output);
- if(!result)
+ if (!result)
return false;
plaintext->assign(reinterpret_cast<char*>(output.pbData), output.cbData);
« no previous file with comments | « chrome/browser/password_manager/encryptor.h ('k') | chrome/browser/password_manager/encryptor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698