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

Side by Side Diff: content/browser/net/sqlite_persistent_cookie_store_unittest.cc

Issue 667943003: Standardize usage of virtual/override/final in content/browser/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
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 "content/browser/net/sqlite_persistent_cookie_store.h" 5 #include "content/browser/net/sqlite_persistent_cookie_store.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 22 matching lines...) Expand all
33 33
34 namespace content { 34 namespace content {
35 35
36 namespace { 36 namespace {
37 37
38 const base::FilePath::CharType kCookieFilename[] = FILE_PATH_LITERAL("Cookies"); 38 const base::FilePath::CharType kCookieFilename[] = FILE_PATH_LITERAL("Cookies");
39 39
40 class CookieCryptor : public content::CookieCryptoDelegate { 40 class CookieCryptor : public content::CookieCryptoDelegate {
41 public: 41 public:
42 CookieCryptor(); 42 CookieCryptor();
43 virtual bool EncryptString(const std::string& plaintext, 43 bool EncryptString(const std::string& plaintext,
44 std::string* ciphertext) override; 44 std::string* ciphertext) override;
45 virtual bool DecryptString(const std::string& ciphertext, 45 bool DecryptString(const std::string& ciphertext,
46 std::string* plaintext) override; 46 std::string* plaintext) override;
47 47
48 private: 48 private:
49 scoped_ptr<crypto::SymmetricKey> key_; 49 scoped_ptr<crypto::SymmetricKey> key_;
50 crypto::Encryptor encryptor_; 50 crypto::Encryptor encryptor_;
51 }; 51 };
52 52
53 CookieCryptor::CookieCryptor() : key_( 53 CookieCryptor::CookieCryptor() : key_(
54 crypto::SymmetricKey::DeriveKeyFromPassword( 54 crypto::SymmetricKey::DeriveKeyFromPassword(
55 crypto::SymmetricKey::AES, "password", "saltiest", 1000, 256)) { 55 crypto::SymmetricKey::AES, "password", "saltiest", 1000, 256)) {
56 std::string iv("the iv: 16 bytes"); 56 std::string iv("the iv: 16 bytes");
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 EXPECT_EQ(2, resultcount); 599 EXPECT_EQ(2, resultcount);
600 600
601 // Verify that "encrypted_value" is NOT visible in the file. 601 // Verify that "encrypted_value" is NOT visible in the file.
602 contents = ReadRawDBContents(); 602 contents = ReadRawDBContents();
603 EXPECT_NE(0U, contents.length()); 603 EXPECT_NE(0U, contents.length());
604 EXPECT_EQ(contents.find("encrypted_value123XYZ"), std::string::npos); 604 EXPECT_EQ(contents.find("encrypted_value123XYZ"), std::string::npos);
605 EXPECT_EQ(contents.find("something456ABC"), std::string::npos); 605 EXPECT_EQ(contents.find("something456ABC"), std::string::npos);
606 } 606 }
607 607
608 } // namespace content 608 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/net/sqlite_persistent_cookie_store.h ('k') | content/browser/net/view_http_cache_job_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698