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/history/url_index_private_data.h" | 5 #include "chrome/browser/history/url_index_private_data.h" |
6 | 6 |
7 #include <functional> | 7 #include <functional> |
8 #include <iterator> | 8 #include <iterator> |
9 #include <limits> | 9 #include <limits> |
10 #include <numeric> | 10 #include <numeric> |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 // Ignore this update. This can happen if, for instance, the user | 359 // Ignore this update. This can happen if, for instance, the user |
360 // removes the URL from URLIndexPrivateData before the historyDB call | 360 // removes the URL from URLIndexPrivateData before the historyDB call |
361 // returns. | 361 // returns. |
362 } | 362 } |
363 | 363 |
364 void URLIndexPrivateData::ScheduleUpdateRecentVisits( | 364 void URLIndexPrivateData::ScheduleUpdateRecentVisits( |
365 HistoryService* history_service, | 365 HistoryService* history_service, |
366 URLID url_id, | 366 URLID url_id, |
367 base::CancelableTaskTracker* tracker) { | 367 base::CancelableTaskTracker* tracker) { |
368 history_service->ScheduleDBTask( | 368 history_service->ScheduleDBTask( |
369 scoped_ptr<history::HistoryDBTask>( | 369 new UpdateRecentVisitsFromHistoryDBTask(this, url_id), tracker); |
370 new UpdateRecentVisitsFromHistoryDBTask(this, url_id)), tracker); | |
371 } | 370 } |
372 | 371 |
373 // Helper functor for DeleteURL. | 372 // Helper functor for DeleteURL. |
374 class HistoryInfoMapItemHasURL { | 373 class HistoryInfoMapItemHasURL { |
375 public: | 374 public: |
376 explicit HistoryInfoMapItemHasURL(const GURL& url): url_(url) {} | 375 explicit HistoryInfoMapItemHasURL(const GURL& url): url_(url) {} |
377 | 376 |
378 bool operator()(const std::pair<const HistoryID, HistoryInfoMapValue>& item) { | 377 bool operator()(const std::pair<const HistoryID, HistoryInfoMapValue>& item) { |
379 return item.second.url_row.url() == url_; | 378 return item.second.url_row.url() == url_; |
380 } | 379 } |
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1341 // recently visited (within the last 12/24 hours) as highly important. Get | 1340 // recently visited (within the last 12/24 hours) as highly important. Get |
1342 // input from mpearson. | 1341 // input from mpearson. |
1343 if (r1.typed_count() != r2.typed_count()) | 1342 if (r1.typed_count() != r2.typed_count()) |
1344 return (r1.typed_count() > r2.typed_count()); | 1343 return (r1.typed_count() > r2.typed_count()); |
1345 if (r1.visit_count() != r2.visit_count()) | 1344 if (r1.visit_count() != r2.visit_count()) |
1346 return (r1.visit_count() > r2.visit_count()); | 1345 return (r1.visit_count() > r2.visit_count()); |
1347 return (r1.last_visit() > r2.last_visit()); | 1346 return (r1.last_visit() > r2.last_visit()); |
1348 } | 1347 } |
1349 | 1348 |
1350 } // namespace history | 1349 } // namespace history |
OLD | NEW |