Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(334)

Side by Side Diff: chrome/browser/history/url_index_private_data.cc

Issue 387923002: Make HistoryDBTask not refcounted, and ensure it's destroyed on its origin thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: revert unnecessary changes Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 new UpdateRecentVisitsFromHistoryDBTask(this, url_id), tracker); 369 scoped_ptr<history::HistoryDBTask>(
370 new UpdateRecentVisitsFromHistoryDBTask(this, url_id)), tracker);
370 } 371 }
371 372
372 // Helper functor for DeleteURL. 373 // Helper functor for DeleteURL.
373 class HistoryInfoMapItemHasURL { 374 class HistoryInfoMapItemHasURL {
374 public: 375 public:
375 explicit HistoryInfoMapItemHasURL(const GURL& url): url_(url) {} 376 explicit HistoryInfoMapItemHasURL(const GURL& url): url_(url) {}
376 377
377 bool operator()(const std::pair<const HistoryID, HistoryInfoMapValue>& item) { 378 bool operator()(const std::pair<const HistoryID, HistoryInfoMapValue>& item) {
378 return item.second.url_row.url() == url_; 379 return item.second.url_row.url() == url_;
379 } 380 }
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after
1340 // recently visited (within the last 12/24 hours) as highly important. Get 1341 // recently visited (within the last 12/24 hours) as highly important. Get
1341 // input from mpearson. 1342 // input from mpearson.
1342 if (r1.typed_count() != r2.typed_count()) 1343 if (r1.typed_count() != r2.typed_count())
1343 return (r1.typed_count() > r2.typed_count()); 1344 return (r1.typed_count() > r2.typed_count());
1344 if (r1.visit_count() != r2.visit_count()) 1345 if (r1.visit_count() != r2.visit_count())
1345 return (r1.visit_count() > r2.visit_count()); 1346 return (r1.visit_count() > r2.visit_count());
1346 return (r1.last_visit() > r2.last_visit()); 1347 return (r1.last_visit() > r2.last_visit());
1347 } 1348 }
1348 1349
1349 } // namespace history 1350 } // namespace history
OLDNEW
« no previous file with comments | « chrome/browser/history/top_sites_impl_unittest.cc ('k') | chrome/browser/prerender/prerender_local_predictor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698