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

Unified Diff: sync/util/data_encryption_win.cc

Issue 11421047: sync: Move data_encryption_win.h into syncer namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix unittests Created 8 years, 1 month 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 | « sync/util/data_encryption_win.h ('k') | sync/util/data_encryption_win_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/util/data_encryption_win.cc
diff --git a/sync/util/data_encryption_win.cc b/sync/util/data_encryption_win.cc
index bdc1e9d9ba310498676e2471ede7a6371d78a6fb..943f849e36a27bc34f4159cac64a2e9a48da0369 100644
--- a/sync/util/data_encryption_win.cc
+++ b/sync/util/data_encryption_win.cc
@@ -1,8 +1,6 @@
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-//
-// NOTE: this file is Winodws specific.
#include "sync/util/data_encryption_win.h"
@@ -10,8 +8,6 @@
#include <wincrypt.h>
#include <cstddef>
-#include <string>
-#include <vector>
#include "base/logging.h"
@@ -21,10 +17,9 @@
// chrome/browser/password_manager/encryptor_win.cc. Preferably, all
// this stuff would live in crypto/.
-using std::string;
-using std::vector;
+namespace syncer {
-vector<uint8> EncryptData(const string& data) {
+std::vector<uint8> EncryptData(const std::string& data) {
DATA_BLOB unencrypted_data = { 0 };
unencrypted_data.pbData = (BYTE*)(data.data());
unencrypted_data.cbData = data.size();
@@ -34,13 +29,13 @@ vector<uint8> EncryptData(const string& data) {
&encrypted_data))
LOG(ERROR) << "Encryption fails: " << data;
- vector<uint8> result(encrypted_data.pbData,
- encrypted_data.pbData + encrypted_data.cbData);
+ std::vector<uint8> result(encrypted_data.pbData,
+ encrypted_data.pbData + encrypted_data.cbData);
LocalFree(encrypted_data.pbData);
return result;
}
-bool DecryptData(const vector<uint8>& in_data, string* out_data) {
+bool DecryptData(const std::vector<uint8>& in_data, std::string* out_data) {
DATA_BLOB encrypted_data, decrypted_data;
encrypted_data.pbData =
(in_data.empty() ? NULL : const_cast<BYTE*>(&in_data[0]));
@@ -58,3 +53,5 @@ bool DecryptData(const vector<uint8>& in_data, string* out_data) {
return true;
}
}
+
+} // namespace syncer
« no previous file with comments | « sync/util/data_encryption_win.h ('k') | sync/util/data_encryption_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698