| 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 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1032 db_->GetVisitsSource(visits, sources); | 1032 db_->GetVisitsSource(visits, sources); |
| 1033 return true; | 1033 return true; |
| 1034 } | 1034 } |
| 1035 | 1035 |
| 1036 bool HistoryBackend::GetURL(const GURL& url, URLRow* url_row) { | 1036 bool HistoryBackend::GetURL(const GURL& url, URLRow* url_row) { |
| 1037 if (db_) | 1037 if (db_) |
| 1038 return db_->GetRowForURL(url, url_row) != 0; | 1038 return db_->GetRowForURL(url, url_row) != 0; |
| 1039 return false; | 1039 return false; |
| 1040 } | 1040 } |
| 1041 | 1041 |
| 1042 bool HistoryBackend::GetURLByID(URLID url_id, URLRow* url_row) { |
| 1043 if (db_) |
| 1044 return db_->GetURLRow(url_id, url_row); |
| 1045 return false; |
| 1046 } |
| 1047 |
| 1042 void HistoryBackend::QueryURL(const GURL& url, | 1048 void HistoryBackend::QueryURL(const GURL& url, |
| 1043 bool want_visits, | 1049 bool want_visits, |
| 1044 QueryURLResult* result) { | 1050 QueryURLResult* result) { |
| 1045 DCHECK(result); | 1051 DCHECK(result); |
| 1046 result->success = db_ && db_->GetRowForURL(url, &result->row); | 1052 result->success = db_ && db_->GetRowForURL(url, &result->row); |
| 1047 // Optionally query the visits. | 1053 // Optionally query the visits. |
| 1048 if (result->success && want_visits) | 1054 if (result->success && want_visits) |
| 1049 db_->GetVisitsForURL(result->row.id(), &result->visits); | 1055 db_->GetVisitsForURL(result->row.id(), &result->visits); |
| 1050 } | 1056 } |
| 1051 | 1057 |
| (...skipping 1587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2639 // transaction is currently open. | 2645 // transaction is currently open. |
| 2640 db_->CommitTransaction(); | 2646 db_->CommitTransaction(); |
| 2641 db_->Vacuum(); | 2647 db_->Vacuum(); |
| 2642 db_->BeginTransaction(); | 2648 db_->BeginTransaction(); |
| 2643 db_->GetStartDate(&first_recorded_time_); | 2649 db_->GetStartDate(&first_recorded_time_); |
| 2644 | 2650 |
| 2645 return true; | 2651 return true; |
| 2646 } | 2652 } |
| 2647 | 2653 |
| 2648 } // namespace history | 2654 } // namespace history |
| OLD | NEW |