| 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 "components/history/core/browser/history_backend.h" | 5 #include "components/history/core/browser/history_backend.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <functional> | 8 #include <functional> |
| 9 #include <list> | 9 #include <list> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 781 url_info.set_visit_count(1); | 781 url_info.set_visit_count(1); |
| 782 url_info.set_typed_count(typed_increment); | 782 url_info.set_typed_count(typed_increment); |
| 783 url_info.set_last_visit(time); | 783 url_info.set_last_visit(time); |
| 784 url_info.set_hidden(new_hidden); | 784 url_info.set_hidden(new_hidden); |
| 785 | 785 |
| 786 url_id = db_->AddURL(url_info); | 786 url_id = db_->AddURL(url_info); |
| 787 if (!url_id) { | 787 if (!url_id) { |
| 788 NOTREACHED() << "Adding URL failed."; | 788 NOTREACHED() << "Adding URL failed."; |
| 789 return std::make_pair(0, 0); | 789 return std::make_pair(0, 0); |
| 790 } | 790 } |
| 791 url_info.id_ = url_id; | 791 url_info.set_id(url_id); |
| 792 } | 792 } |
| 793 | 793 |
| 794 // Add the visit with the time to the database. | 794 // Add the visit with the time to the database. |
| 795 VisitRow visit_info(url_id, time, referring_visit, transition, 0); | 795 VisitRow visit_info(url_id, time, referring_visit, transition, 0); |
| 796 VisitID visit_id = db_->AddVisit(&visit_info, visit_source); | 796 VisitID visit_id = db_->AddVisit(&visit_info, visit_source); |
| 797 | 797 |
| 798 if (visit_info.visit_time < first_recorded_time_) | 798 if (visit_info.visit_time < first_recorded_time_) |
| 799 first_recorded_time_ = visit_info.visit_time; | 799 first_recorded_time_ = visit_info.visit_time; |
| 800 | 800 |
| 801 // Broadcast a notification of the visit. | 801 // Broadcast a notification of the visit. |
| (...skipping 1837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2639 // transaction is currently open. | 2639 // transaction is currently open. |
| 2640 db_->CommitTransaction(); | 2640 db_->CommitTransaction(); |
| 2641 db_->Vacuum(); | 2641 db_->Vacuum(); |
| 2642 db_->BeginTransaction(); | 2642 db_->BeginTransaction(); |
| 2643 db_->GetStartDate(&first_recorded_time_); | 2643 db_->GetStartDate(&first_recorded_time_); |
| 2644 | 2644 |
| 2645 return true; | 2645 return true; |
| 2646 } | 2646 } |
| 2647 | 2647 |
| 2648 } // namespace history | 2648 } // namespace history |
| OLD | NEW |