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 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1080 db_->GetMostRecentKeywordSearchTerms(keyword_id, prefix, max_count, | 1080 db_->GetMostRecentKeywordSearchTerms(keyword_id, prefix, max_count, |
1081 &(request->value)); | 1081 &(request->value)); |
1082 } | 1082 } |
1083 request->ForwardResult( | 1083 request->ForwardResult( |
1084 GetMostRecentKeywordSearchTermsRequest::TupleType(request->handle(), | 1084 GetMostRecentKeywordSearchTermsRequest::TupleType(request->handle(), |
1085 &request->value)); | 1085 &request->value)); |
1086 } | 1086 } |
1087 | 1087 |
1088 // Downloads ------------------------------------------------------------------- | 1088 // Downloads ------------------------------------------------------------------- |
1089 | 1089 |
| 1090 void HistoryBackend::GetNextDownloadId( |
| 1091 scoped_refptr<DownloadNextIdRequest> request) { |
| 1092 if (request->canceled()) return; |
| 1093 if (db_.get()) { |
| 1094 request->value = db_->next_download_id(); |
| 1095 } else { |
| 1096 request->value = 0; |
| 1097 } |
| 1098 request->ForwardResult(DownloadNextIdRequest::TupleType(request->value)); |
| 1099 } |
| 1100 |
1090 // Get all the download entries from the database. | 1101 // Get all the download entries from the database. |
1091 void HistoryBackend::QueryDownloads( | 1102 void HistoryBackend::QueryDownloads( |
1092 scoped_refptr<DownloadQueryRequest> request) { | 1103 scoped_refptr<DownloadQueryRequest> request) { |
1093 if (request->canceled()) | 1104 if (request->canceled()) |
1094 return; | 1105 return; |
1095 if (db_.get()) | 1106 if (db_.get()) |
1096 db_->QueryDownloads(&request->value); | 1107 db_->QueryDownloads(&request->value); |
1097 request->ForwardResult(DownloadQueryRequest::TupleType(&request->value)); | 1108 request->ForwardResult(DownloadQueryRequest::TupleType(&request->value)); |
1098 } | 1109 } |
1099 | 1110 |
(...skipping 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2240 return true; | 2251 return true; |
2241 } | 2252 } |
2242 | 2253 |
2243 BookmarkService* HistoryBackend::GetBookmarkService() { | 2254 BookmarkService* HistoryBackend::GetBookmarkService() { |
2244 if (bookmark_service_) | 2255 if (bookmark_service_) |
2245 bookmark_service_->BlockTillLoaded(); | 2256 bookmark_service_->BlockTillLoaded(); |
2246 return bookmark_service_; | 2257 return bookmark_service_; |
2247 } | 2258 } |
2248 | 2259 |
2249 } // namespace history | 2260 } // namespace history |
OLD | NEW |