| 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 // 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 22 matching lines...) Expand all Loading... |
| 33 #include "base/message_loop.h" | 33 #include "base/message_loop.h" |
| 34 #include "base/path_service.h" | 34 #include "base/path_service.h" |
| 35 #include "base/prefs/pref_service.h" | 35 #include "base/prefs/pref_service.h" |
| 36 #include "base/thread_task_runner_handle.h" | 36 #include "base/thread_task_runner_handle.h" |
| 37 #include "base/threading/thread.h" | 37 #include "base/threading/thread.h" |
| 38 #include "base/time.h" | 38 #include "base/time.h" |
| 39 #include "chrome/browser/autocomplete/history_url_provider.h" | 39 #include "chrome/browser/autocomplete/history_url_provider.h" |
| 40 #include "chrome/browser/bookmarks/bookmark_model.h" | 40 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 41 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 41 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 42 #include "chrome/browser/browser_process.h" | 42 #include "chrome/browser/browser_process.h" |
| 43 #include "chrome/browser/favicon/imported_favicon_usage.h" |
| 43 #include "chrome/browser/history/download_row.h" | 44 #include "chrome/browser/history/download_row.h" |
| 44 #include "chrome/browser/history/history_backend.h" | 45 #include "chrome/browser/history/history_backend.h" |
| 45 #include "chrome/browser/history/history_notifications.h" | 46 #include "chrome/browser/history/history_notifications.h" |
| 46 #include "chrome/browser/history/history_types.h" | 47 #include "chrome/browser/history/history_types.h" |
| 47 #include "chrome/browser/history/in_memory_database.h" | 48 #include "chrome/browser/history/in_memory_database.h" |
| 48 #include "chrome/browser/history/in_memory_history_backend.h" | 49 #include "chrome/browser/history/in_memory_history_backend.h" |
| 49 #include "chrome/browser/history/in_memory_url_index.h" | 50 #include "chrome/browser/history/in_memory_url_index.h" |
| 50 #include "chrome/browser/history/top_sites.h" | 51 #include "chrome/browser/history/top_sites.h" |
| 51 #include "chrome/browser/history/visit_database.h" | 52 #include "chrome/browser/history/visit_database.h" |
| 52 #include "chrome/browser/history/visit_filter.h" | 53 #include "chrome/browser/history/visit_filter.h" |
| (...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 732 } | 733 } |
| 733 | 734 |
| 734 void HistoryService::CloneFavicons(const GURL& old_page_url, | 735 void HistoryService::CloneFavicons(const GURL& old_page_url, |
| 735 const GURL& new_page_url) { | 736 const GURL& new_page_url) { |
| 736 DCHECK(thread_checker_.CalledOnValidThread()); | 737 DCHECK(thread_checker_.CalledOnValidThread()); |
| 737 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::CloneFavicons, | 738 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::CloneFavicons, |
| 738 old_page_url, new_page_url); | 739 old_page_url, new_page_url); |
| 739 } | 740 } |
| 740 | 741 |
| 741 void HistoryService::SetImportedFavicons( | 742 void HistoryService::SetImportedFavicons( |
| 742 const std::vector<history::ImportedFaviconUsage>& favicon_usage) { | 743 const std::vector<ImportedFaviconUsage>& favicon_usage) { |
| 743 DCHECK(thread_checker_.CalledOnValidThread()); | 744 DCHECK(thread_checker_.CalledOnValidThread()); |
| 744 ScheduleAndForget(PRIORITY_NORMAL, | 745 ScheduleAndForget(PRIORITY_NORMAL, |
| 745 &HistoryBackend::SetImportedFavicons, favicon_usage); | 746 &HistoryBackend::SetImportedFavicons, favicon_usage); |
| 746 } | 747 } |
| 747 | 748 |
| 748 HistoryService::Handle HistoryService::QueryURL( | 749 HistoryService::Handle HistoryService::QueryURL( |
| 749 const GURL& url, | 750 const GURL& url, |
| 750 bool want_visits, | 751 bool want_visits, |
| 751 CancelableRequestConsumerBase* consumer, | 752 CancelableRequestConsumerBase* consumer, |
| 752 const QueryURLCallback& callback) { | 753 const QueryURLCallback& callback) { |
| (...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1270 DCHECK(thread_checker_.CalledOnValidThread()); | 1271 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1271 visit_database_observers_.RemoveObserver(observer); | 1272 visit_database_observers_.RemoveObserver(observer); |
| 1272 } | 1273 } |
| 1273 | 1274 |
| 1274 void HistoryService::NotifyVisitDBObserversOnAddVisit( | 1275 void HistoryService::NotifyVisitDBObserversOnAddVisit( |
| 1275 const history::BriefVisitInfo& info) { | 1276 const history::BriefVisitInfo& info) { |
| 1276 DCHECK(thread_checker_.CalledOnValidThread()); | 1277 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1277 FOR_EACH_OBSERVER(history::VisitDatabaseObserver, visit_database_observers_, | 1278 FOR_EACH_OBSERVER(history::VisitDatabaseObserver, visit_database_observers_, |
| 1278 OnAddVisit(info)); | 1279 OnAddVisit(info)); |
| 1279 } | 1280 } |
| OLD | NEW |