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

Side by Side Diff: components/password_manager/core/browser/login_database.cc

Issue 808173002: Add tests for version migration tesing in for LoginDatabase. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/password_manager/core/browser/login_database.h" 5 #include "components/password_manager/core/browser/login_database.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 10 matching lines...) Expand all
21 #include "google_apis/gaia/gaia_auth_util.h" 21 #include "google_apis/gaia/gaia_auth_util.h"
22 #include "google_apis/gaia/gaia_urls.h" 22 #include "google_apis/gaia/gaia_urls.h"
23 #include "sql/connection.h" 23 #include "sql/connection.h"
24 #include "sql/statement.h" 24 #include "sql/statement.h"
25 #include "sql/transaction.h" 25 #include "sql/transaction.h"
26 26
27 using autofill::PasswordForm; 27 using autofill::PasswordForm;
28 28
29 namespace password_manager { 29 namespace password_manager {
30 30
31 static const int kCurrentVersionNumber = 9; 31 const int kCurrentVersionNumber = 9;
32 static const int kCompatibleVersionNumber = 1; 32 static const int kCompatibleVersionNumber = 1;
33 33
34 Pickle SerializeVector(const std::vector<base::string16>& vec) { 34 Pickle SerializeVector(const std::vector<base::string16>& vec) {
35 Pickle p; 35 Pickle p;
36 for (size_t i = 0; i < vec.size(); ++i) { 36 for (size_t i = 0; i < vec.size(); ++i) {
37 p.WriteString16(vec[i]); 37 p.WriteString16(vec[i]);
38 } 38 }
39 return p; 39 return p;
40 } 40 }
41 41
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after
843 843
844 bool LoginDatabase::DeleteAndRecreateDatabaseFile() { 844 bool LoginDatabase::DeleteAndRecreateDatabaseFile() {
845 DCHECK(db_.is_open()); 845 DCHECK(db_.is_open());
846 meta_table_.Reset(); 846 meta_table_.Reset();
847 db_.Close(); 847 db_.Close();
848 sql::Connection::Delete(db_path_); 848 sql::Connection::Delete(db_path_);
849 return Init(db_path_); 849 return Init(db_path_);
850 } 850 }
851 851
852 } // namespace password_manager 852 } // namespace password_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698