| OLD | NEW |
| 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 "chrome/browser/history/visitsegment_database.h" | 5 #include "chrome/browser/history/visitsegment_database.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 if (!statement2.is_valid()) | 291 if (!statement2.is_valid()) |
| 292 return; | 292 return; |
| 293 | 293 |
| 294 for (size_t i = 0; i < results->size(); ++i) { | 294 for (size_t i = 0; i < results->size(); ++i) { |
| 295 PageUsageData* pud = (*results)[i]; | 295 PageUsageData* pud = (*results)[i]; |
| 296 statement2.BindInt64(0, pud->GetID()); | 296 statement2.BindInt64(0, pud->GetID()); |
| 297 if (statement2.Step()) { | 297 if (statement2.Step()) { |
| 298 pud->SetURL(GURL(statement2.ColumnString(0))); | 298 pud->SetURL(GURL(statement2.ColumnString(0))); |
| 299 pud->SetTitle(statement2.ColumnString16(1)); | 299 pud->SetTitle(statement2.ColumnString16(1)); |
| 300 } | 300 } |
| 301 statement2.Reset(); | 301 statement2.Reset(true); |
| 302 } | 302 } |
| 303 } | 303 } |
| 304 | 304 |
| 305 bool VisitSegmentDatabase::DeleteSegmentData(base::Time older_than) { | 305 bool VisitSegmentDatabase::DeleteSegmentData(base::Time older_than) { |
| 306 sql::Statement statement(GetDB().GetCachedStatement(SQL_FROM_HERE, | 306 sql::Statement statement(GetDB().GetCachedStatement(SQL_FROM_HERE, |
| 307 "DELETE FROM segment_usage WHERE time_slot < ?")); | 307 "DELETE FROM segment_usage WHERE time_slot < ?")); |
| 308 statement.BindInt64(0, older_than.LocalMidnight().ToInternalValue()); | 308 statement.BindInt64(0, older_than.LocalMidnight().ToInternalValue()); |
| 309 | 309 |
| 310 return statement.Run(); | 310 return statement.Run(); |
| 311 } | 311 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 332 return false; | 332 return false; |
| 333 | 333 |
| 334 sql::Statement delete_seg(GetDB().GetCachedStatement(SQL_FROM_HERE, | 334 sql::Statement delete_seg(GetDB().GetCachedStatement(SQL_FROM_HERE, |
| 335 "DELETE FROM segments WHERE url_id = ?")); | 335 "DELETE FROM segments WHERE url_id = ?")); |
| 336 delete_seg.BindInt64(0, url_id); | 336 delete_seg.BindInt64(0, url_id); |
| 337 | 337 |
| 338 return delete_seg.Run(); | 338 return delete_seg.Run(); |
| 339 } | 339 } |
| 340 | 340 |
| 341 } // namespace history | 341 } // namespace history |
| OLD | NEW |