| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/password_manager/login_database.h" | 5 #include "chrome/browser/password_manager/login_database.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "app/sql/statement.h" | |
| 11 #include "app/sql/transaction.h" | |
| 12 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| 13 #include "base/file_util.h" | 11 #include "base/file_util.h" |
| 14 #include "base/logging.h" | 12 #include "base/logging.h" |
| 15 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
| 16 #include "base/time.h" | 14 #include "base/time.h" |
| 17 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
| 16 #include "sql/statement.h" |
| 17 #include "sql/transaction.h" |
| 18 | 18 |
| 19 using webkit_glue::PasswordForm; | 19 using webkit_glue::PasswordForm; |
| 20 | 20 |
| 21 static const int kCurrentVersionNumber = 1; | 21 static const int kCurrentVersionNumber = 1; |
| 22 static const int kCompatibleVersionNumber = 1; | 22 static const int kCompatibleVersionNumber = 1; |
| 23 | 23 |
| 24 namespace { | 24 namespace { |
| 25 | 25 |
| 26 // Convenience enum for interacting with SQL queries that use all the columns. | 26 // Convenience enum for interacting with SQL queries that use all the columns. |
| 27 enum LoginTableColumns { | 27 enum LoginTableColumns { |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 return s.Succeeded(); | 398 return s.Succeeded(); |
| 399 } | 399 } |
| 400 | 400 |
| 401 bool LoginDatabase::DeleteAndRecreateDatabaseFile() { | 401 bool LoginDatabase::DeleteAndRecreateDatabaseFile() { |
| 402 DCHECK(db_.is_open()); | 402 DCHECK(db_.is_open()); |
| 403 meta_table_.Reset(); | 403 meta_table_.Reset(); |
| 404 db_.Close(); | 404 db_.Close(); |
| 405 file_util::Delete(db_path_, false); | 405 file_util::Delete(db_path_, false); |
| 406 return Init(db_path_); | 406 return Init(db_path_); |
| 407 } | 407 } |
| OLD | NEW |