[go: nahoru, domu]

Move WriteInto to base namespace.

Update all callers.

De-inlines the template. For some reason touching the namespaces started givin errors about DCHECK not being defined. Indeed, this header does not include logging.h. Rather than include logging in this very common header, it seems preferable to move the implementation to the .cc file.

This removes support for the wstring variant and updates the callers that used it.

R=ben@chromium.org, ben
TBR=jschuh (sandbox_win.cc)

NOPRESUBMIT=true
(this patch touches code using legacy wstrings)

Review URL: https://codereview.chromium.org/1223983002.

Cr-Commit-Position: refs/heads/master@{#337703}
diff --git a/crypto/symmetric_key_openssl.cc b/crypto/symmetric_key_openssl.cc
index e268a1d0..912c9b4 100644
--- a/crypto/symmetric_key_openssl.cc
+++ b/crypto/symmetric_key_openssl.cc
@@ -39,8 +39,8 @@
 
   OpenSSLErrStackTracer err_tracer(FROM_HERE);
   scoped_ptr<SymmetricKey> key(new SymmetricKey);
-  uint8* key_data =
-      reinterpret_cast<uint8*>(WriteInto(&key->key_, key_size_in_bytes + 1));
+  uint8* key_data = reinterpret_cast<uint8*>(
+      base::WriteInto(&key->key_, key_size_in_bytes + 1));
 
   int rv = RAND_bytes(key_data, static_cast<int>(key_size_in_bytes));
   return rv == 1 ? key.release() : NULL;
@@ -70,8 +70,8 @@
 
   OpenSSLErrStackTracer err_tracer(FROM_HERE);
   scoped_ptr<SymmetricKey> key(new SymmetricKey);
-  uint8* key_data =
-      reinterpret_cast<uint8*>(WriteInto(&key->key_, key_size_in_bytes + 1));
+  uint8* key_data = reinterpret_cast<uint8*>(
+      base::WriteInto(&key->key_, key_size_in_bytes + 1));
   int rv = PKCS5_PBKDF2_HMAC_SHA1(password.data(), password.length(),
                                   reinterpret_cast<const uint8*>(salt.data()),
                                   salt.length(), iterations,