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/webdata/autofill_table.h" | 5 #include "chrome/browser/webdata/autofill_table.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 cull_date_entry.BindString16(0, entries[i].key().name()); | 495 cull_date_entry.BindString16(0, entries[i].key().name()); |
496 cull_date_entry.BindString16(1, entries[i].key().value()); | 496 cull_date_entry.BindString16(1, entries[i].key().value()); |
497 cull_date_entry.BindInt64(2, | 497 cull_date_entry.BindInt64(2, |
498 entries[i].timestamps().empty() ? 0 : | 498 entries[i].timestamps().empty() ? 0 : |
499 entries[i].timestamps().front().ToTimeT()); | 499 entries[i].timestamps().front().ToTimeT()); |
500 cull_date_entry.BindInt64(3, | 500 cull_date_entry.BindInt64(3, |
501 entries[i].timestamps().empty() ? 0 : | 501 entries[i].timestamps().empty() ? 0 : |
502 entries[i].timestamps().back().ToTimeT()); | 502 entries[i].timestamps().back().ToTimeT()); |
503 if (!cull_date_entry.Run()) | 503 if (!cull_date_entry.Run()) |
504 return false; | 504 return false; |
505 cull_date_entry.Reset(); | 505 cull_date_entry.Reset(true); |
506 } | 506 } |
507 | 507 |
508 changes->clear(); | 508 changes->clear(); |
509 changes->reserve(entries_to_delete.size()); | 509 changes->reserve(entries_to_delete.size()); |
510 | 510 |
511 for (AutofillElementList::iterator it = entries_to_delete.begin(); | 511 for (AutofillElementList::iterator it = entries_to_delete.begin(); |
512 it != entries_to_delete.end(); ++it) { | 512 it != entries_to_delete.end(); ++it) { |
513 changes->push_back(AutofillChange( | 513 changes->push_back(AutofillChange( |
514 AutofillChange::REMOVE, AutofillKey(it->b, it->c))); | 514 AutofillChange::REMOVE, AutofillKey(it->b, it->c))); |
515 } | 515 } |
(...skipping 1462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1978 "WHERE guid=?")); | 1978 "WHERE guid=?")); |
1979 s_date.BindInt64(0, date_item->second); | 1979 s_date.BindInt64(0, date_item->second); |
1980 s_date.BindString(1, iter->guid()); | 1980 s_date.BindString(1, iter->guid()); |
1981 | 1981 |
1982 if (!s_date.Run()) | 1982 if (!s_date.Run()) |
1983 return false; | 1983 return false; |
1984 } | 1984 } |
1985 | 1985 |
1986 return true; | 1986 return true; |
1987 } | 1987 } |
OLD | NEW |