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

Unified Diff: crypto/encryptor_win.cc

Issue 7230037: Use base::StringPiece for input parameters in Encryptor, rather than std::string (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Feedback Created 9 years, 6 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
« crypto/encryptor_openssl.cc ('K') | « crypto/encryptor_openssl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/encryptor_win.cc
diff --git a/crypto/encryptor_win.cc b/crypto/encryptor_win.cc
index 8bbd6b8c5685e23d90e7b99dc2abeeacf2e4b819..088c9e56d680f9a0a9dddd2f666077f690bbd448 100644
--- a/crypto/encryptor_win.cc
+++ b/crypto/encryptor_win.cc
@@ -37,7 +37,9 @@ Encryptor::Encryptor()
Encryptor::~Encryptor() {
}
-bool Encryptor::Init(SymmetricKey* key, Mode mode, const std::string& iv) {
+bool Encryptor::Init(SymmetricKey* key,
+ Mode mode,
+ const base::StringPiece& iv) {
DCHECK(key);
DCHECK_EQ(CBC, mode) << "Unsupported mode of operation";
@@ -77,7 +79,8 @@ bool Encryptor::Init(SymmetricKey* key, Mode mode, const std::string& iv) {
return true;
}
-bool Encryptor::Encrypt(const std::string& plaintext, std::string* ciphertext) {
+bool Encryptor::Encrypt(const base::StringPiece& plaintext,
+ std::string* ciphertext) {
DWORD data_len = plaintext.size();
DWORD total_len = data_len + block_size_;
@@ -94,7 +97,8 @@ bool Encryptor::Encrypt(const std::string& plaintext, std::string* ciphertext) {
return true;
}
-bool Encryptor::Decrypt(const std::string& ciphertext, std::string* plaintext) {
+bool Encryptor::Decrypt(const base::StringPiece& ciphertext,
+ std::string* plaintext) {
DWORD data_len = ciphertext.size();
if (data_len == 0)
return false;
« crypto/encryptor_openssl.cc ('K') | « crypto/encryptor_openssl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698