| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/statistics_table.h" | 5 #include "components/password_manager/core/browser/statistics_table.h" |
| 6 | 6 |
| 7 #include <stdint.h> |
| 8 |
| 7 #include <algorithm> | 9 #include <algorithm> |
| 8 #include <limits> | 10 #include <limits> |
| 9 | 11 |
| 10 #include "sql/connection.h" | 12 #include "sql/connection.h" |
| 11 #include "sql/statement.h" | 13 #include "sql/statement.h" |
| 12 | 14 |
| 13 namespace password_manager { | 15 namespace password_manager { |
| 14 namespace { | 16 namespace { |
| 15 | 17 |
| 16 // Convenience enum for interacting with SQL queries that use all the columns. | 18 // Convenience enum for interacting with SQL queries that use all the columns. |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 } | 125 } |
| 124 return result; | 126 return result; |
| 125 } | 127 } |
| 126 | 128 |
| 127 bool StatisticsTable::RemoveStatsBetween(base::Time delete_begin, | 129 bool StatisticsTable::RemoveStatsBetween(base::Time delete_begin, |
| 128 base::Time delete_end) { | 130 base::Time delete_end) { |
| 129 sql::Statement s(db_->GetCachedStatement( | 131 sql::Statement s(db_->GetCachedStatement( |
| 130 SQL_FROM_HERE, | 132 SQL_FROM_HERE, |
| 131 "DELETE FROM stats WHERE update_time >= ? AND update_time < ?")); | 133 "DELETE FROM stats WHERE update_time >= ? AND update_time < ?")); |
| 132 s.BindInt64(0, delete_begin.ToInternalValue()); | 134 s.BindInt64(0, delete_begin.ToInternalValue()); |
| 133 s.BindInt64(1, delete_end.is_null() ? std::numeric_limits<int64>::max() | 135 s.BindInt64(1, delete_end.is_null() ? std::numeric_limits<int64_t>::max() |
| 134 : delete_end.ToInternalValue()); | 136 : delete_end.ToInternalValue()); |
| 135 return s.Run(); | 137 return s.Run(); |
| 136 } | 138 } |
| 137 | 139 |
| 138 } // namespace password_manager | 140 } // namespace password_manager |
| OLD | NEW |