| OLD | NEW |
| 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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 s.BindString(0, form.origin.spec()); | 408 s.BindString(0, form.origin.spec()); |
| 409 s.BindString16(1, form.username_element); | 409 s.BindString16(1, form.username_element); |
| 410 s.BindString16(2, form.username_value); | 410 s.BindString16(2, form.username_value); |
| 411 s.BindString16(3, form.password_element); | 411 s.BindString16(3, form.password_element); |
| 412 s.BindString16(4, form.submit_element); | 412 s.BindString16(4, form.submit_element); |
| 413 s.BindString(5, form.signon_realm); | 413 s.BindString(5, form.signon_realm); |
| 414 | 414 |
| 415 return s.Run(); | 415 return s.Run(); |
| 416 } | 416 } |
| 417 | 417 |
| 418 bool LoginDatabase::RemoveLoginsCreatedBetween(const base::Time delete_begin, | 418 bool LoginDatabase::RemoveLoginsCreatedBetween(base::Time delete_begin, |
| 419 const base::Time delete_end) { | 419 base::Time delete_end) { |
| 420 sql::Statement s(db_.GetCachedStatement(SQL_FROM_HERE, | 420 sql::Statement s(db_.GetCachedStatement(SQL_FROM_HERE, |
| 421 "DELETE FROM logins WHERE " | 421 "DELETE FROM logins WHERE " |
| 422 "date_created >= ? AND date_created < ?")); | 422 "date_created >= ? AND date_created < ?")); |
| 423 s.BindInt64(0, delete_begin.ToTimeT()); | 423 s.BindInt64(0, delete_begin.ToTimeT()); |
| 424 s.BindInt64(1, delete_end.is_null() ? std::numeric_limits<int64>::max() | 424 s.BindInt64(1, delete_end.is_null() ? std::numeric_limits<int64>::max() |
| 425 : delete_end.ToTimeT()); | 425 : delete_end.ToTimeT()); |
| 426 | 426 |
| 427 return s.Run(); | 427 return s.Run(); |
| 428 } | 428 } |
| 429 | 429 |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 689 | 689 |
| 690 bool LoginDatabase::DeleteAndRecreateDatabaseFile() { | 690 bool LoginDatabase::DeleteAndRecreateDatabaseFile() { |
| 691 DCHECK(db_.is_open()); | 691 DCHECK(db_.is_open()); |
| 692 meta_table_.Reset(); | 692 meta_table_.Reset(); |
| 693 db_.Close(); | 693 db_.Close(); |
| 694 sql::Connection::Delete(db_path_); | 694 sql::Connection::Delete(db_path_); |
| 695 return Init(db_path_); | 695 return Init(db_path_); |
| 696 } | 696 } |
| 697 | 697 |
| 698 } // namespace password_manager | 698 } // namespace password_manager |
| OLD | NEW |