OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/history_backend.h" | 5 #include "chrome/browser/history/history_backend.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1077 db_->GetMostRecentKeywordSearchTerms(keyword_id, prefix, max_count, | 1077 db_->GetMostRecentKeywordSearchTerms(keyword_id, prefix, max_count, |
1078 &(request->value)); | 1078 &(request->value)); |
1079 } | 1079 } |
1080 request->ForwardResult( | 1080 request->ForwardResult( |
1081 GetMostRecentKeywordSearchTermsRequest::TupleType(request->handle(), | 1081 GetMostRecentKeywordSearchTermsRequest::TupleType(request->handle(), |
1082 &request->value)); | 1082 &request->value)); |
1083 } | 1083 } |
1084 | 1084 |
1085 // Downloads ------------------------------------------------------------------- | 1085 // Downloads ------------------------------------------------------------------- |
1086 | 1086 |
| 1087 void HistoryBackend::GetNextDownloadId( |
| 1088 scoped_refptr<DownloadNextIdRequest> request) { |
| 1089 if (request->canceled()) return; |
| 1090 if (db_.get()) { |
| 1091 request->value = db_->next_download_id(); |
| 1092 } else { |
| 1093 request->value = 0; |
| 1094 } |
| 1095 request->ForwardResult(DownloadNextIdRequest::TupleType(request->value)); |
| 1096 } |
| 1097 |
1087 // Get all the download entries from the database. | 1098 // Get all the download entries from the database. |
1088 void HistoryBackend::QueryDownloads( | 1099 void HistoryBackend::QueryDownloads( |
1089 scoped_refptr<DownloadQueryRequest> request) { | 1100 scoped_refptr<DownloadQueryRequest> request) { |
1090 if (request->canceled()) | 1101 if (request->canceled()) |
1091 return; | 1102 return; |
1092 if (db_.get()) | 1103 if (db_.get()) |
1093 db_->QueryDownloads(&request->value); | 1104 db_->QueryDownloads(&request->value); |
1094 request->ForwardResult(DownloadQueryRequest::TupleType(&request->value)); | 1105 request->ForwardResult(DownloadQueryRequest::TupleType(&request->value)); |
1095 } | 1106 } |
1096 | 1107 |
(...skipping 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2237 return true; | 2248 return true; |
2238 } | 2249 } |
2239 | 2250 |
2240 BookmarkService* HistoryBackend::GetBookmarkService() { | 2251 BookmarkService* HistoryBackend::GetBookmarkService() { |
2241 if (bookmark_service_) | 2252 if (bookmark_service_) |
2242 bookmark_service_->BlockTillLoaded(); | 2253 bookmark_service_->BlockTillLoaded(); |
2243 return bookmark_service_; | 2254 return bookmark_service_; |
2244 } | 2255 } |
2245 | 2256 |
2246 } // namespace history | 2257 } // namespace history |
OLD | NEW |