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

Side by Side Diff: components/history/core/browser/history_service.cc

Issue 1370493002: Enable history counting for time ranges. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments. Created 5 years, 2 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
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 // The history system runs on a background thread so that potentially slow 5 // The history system runs on a background thread so that potentially slow
6 // database operations don't delay the browser. This backend processing is 6 // database operations don't delay the browser. This backend processing is
7 // represented by HistoryBackend. The HistoryService's job is to dispatch to 7 // represented by HistoryBackend. The HistoryService's job is to dispatch to
8 // that thread. 8 // that thread.
9 // 9 //
10 // Main thread History thread 10 // Main thread History thread
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 after_startup_task_runner_.get(), FROM_HERE, 663 after_startup_task_runner_.get(), FROM_HERE,
664 base::Bind(&HistoryBackend::QueryURL, history_backend_.get(), url, 664 base::Bind(&HistoryBackend::QueryURL, history_backend_.get(), url,
665 want_visits, base::Unretained(query_url_result)), 665 want_visits, base::Unretained(query_url_result)),
666 base::Bind(&RunWithQueryURLResult, callback, 666 base::Bind(&RunWithQueryURLResult, callback,
667 base::Owned(query_url_result))); 667 base::Owned(query_url_result)));
668 } 668 }
669 669
670 // Statistics ------------------------------------------------------------------ 670 // Statistics ------------------------------------------------------------------
671 671
672 base::CancelableTaskTracker::TaskId HistoryService::GetHistoryCount( 672 base::CancelableTaskTracker::TaskId HistoryService::GetHistoryCount(
673 const Time& begin_time,
674 const Time& end_time,
673 const GetHistoryCountCallback& callback, 675 const GetHistoryCountCallback& callback,
674 base::CancelableTaskTracker* tracker) { 676 base::CancelableTaskTracker* tracker) {
675 DCHECK(thread_) << "History service being called after cleanup"; 677 DCHECK(thread_) << "History service being called after cleanup";
676 DCHECK(thread_checker_.CalledOnValidThread()); 678 DCHECK(thread_checker_.CalledOnValidThread());
677 679
678 return tracker->PostTaskAndReplyWithResult( 680 return tracker->PostTaskAndReplyWithResult(
679 thread_->task_runner().get(), FROM_HERE, 681 thread_->task_runner().get(), FROM_HERE,
680 base::Bind(&HistoryBackend::GetHistoryCount, history_backend_.get()), 682 base::Bind(&HistoryBackend::GetHistoryCount,
683 history_backend_.get(),
684 begin_time,
685 end_time),
681 callback); 686 callback);
682 } 687 }
683 688
684 // Downloads ------------------------------------------------------------------- 689 // Downloads -------------------------------------------------------------------
685 690
686 // Handle creation of a download by creating an entry in the history service's 691 // Handle creation of a download by creating an entry in the history service's
687 // 'downloads' table. 692 // 'downloads' table.
688 void HistoryService::CreateDownload( 693 void HistoryService::CreateDownload(
689 const DownloadRow& create_info, 694 const DownloadRow& create_info,
690 const HistoryService::DownloadCreateCallback& callback) { 695 const HistoryService::DownloadCreateCallback& callback) {
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
1186 return favicon_changed_callback_list_.Add(callback); 1191 return favicon_changed_callback_list_.Add(callback);
1187 } 1192 }
1188 1193
1189 void HistoryService::NotifyFaviconsChanged(const std::set<GURL>& page_urls, 1194 void HistoryService::NotifyFaviconsChanged(const std::set<GURL>& page_urls,
1190 const GURL& icon_url) { 1195 const GURL& icon_url) {
1191 DCHECK(thread_checker_.CalledOnValidThread()); 1196 DCHECK(thread_checker_.CalledOnValidThread());
1192 favicon_changed_callback_list_.Notify(page_urls, icon_url); 1197 favicon_changed_callback_list_.Notify(page_urls, icon_url);
1193 } 1198 }
1194 1199
1195 } // namespace history 1200 } // namespace history
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698