| 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 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 int max_result_count, | 450 int max_result_count, |
| 451 const SegmentQueryCallback& callback) { | 451 const SegmentQueryCallback& callback) { |
| 452 DCHECK(thread_checker_.CalledOnValidThread()); | 452 DCHECK(thread_checker_.CalledOnValidThread()); |
| 453 return Schedule(PRIORITY_UI, &HistoryBackend::QuerySegmentDuration, | 453 return Schedule(PRIORITY_UI, &HistoryBackend::QuerySegmentDuration, |
| 454 consumer, new history::QuerySegmentUsageRequest(callback), | 454 consumer, new history::QuerySegmentUsageRequest(callback), |
| 455 from_time, max_result_count); | 455 from_time, max_result_count); |
| 456 } | 456 } |
| 457 | 457 |
| 458 void HistoryService::SetOnBackendDestroyTask(const base::Closure& task) { | 458 void HistoryService::SetOnBackendDestroyTask(const base::Closure& task) { |
| 459 DCHECK(thread_checker_.CalledOnValidThread()); | 459 DCHECK(thread_checker_.CalledOnValidThread()); |
| 460 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::SetOnBackendDestroyTask, | 460 ScheduleAndForget(PRIORITY_NORMAL, |
| 461 MessageLoop::current(), task); | 461 &HistoryBackend::SetOnBackendDestroyTask, |
| 462 base::MessageLoop::current(), |
| 463 task); |
| 462 } | 464 } |
| 463 | 465 |
| 464 void HistoryService::AddPage(const GURL& url, | 466 void HistoryService::AddPage(const GURL& url, |
| 465 Time time, | 467 Time time, |
| 466 const void* id_scope, | 468 const void* id_scope, |
| 467 int32 page_id, | 469 int32 page_id, |
| 468 const GURL& referrer, | 470 const GURL& referrer, |
| 469 const history::RedirectList& redirects, | 471 const history::RedirectList& redirects, |
| 470 content::PageTransition transition, | 472 content::PageTransition transition, |
| 471 history::VisitSource visit_source, | 473 history::VisitSource visit_source, |
| (...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1265 DCHECK(thread_checker_.CalledOnValidThread()); | 1267 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1266 visit_database_observers_.RemoveObserver(observer); | 1268 visit_database_observers_.RemoveObserver(observer); |
| 1267 } | 1269 } |
| 1268 | 1270 |
| 1269 void HistoryService::NotifyVisitDBObserversOnAddVisit( | 1271 void HistoryService::NotifyVisitDBObserversOnAddVisit( |
| 1270 const history::BriefVisitInfo& info) { | 1272 const history::BriefVisitInfo& info) { |
| 1271 DCHECK(thread_checker_.CalledOnValidThread()); | 1273 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1272 FOR_EACH_OBSERVER(history::VisitDatabaseObserver, visit_database_observers_, | 1274 FOR_EACH_OBSERVER(history::VisitDatabaseObserver, visit_database_observers_, |
| 1273 OnAddVisit(info)); | 1275 OnAddVisit(info)); |
| 1274 } | 1276 } |
| OLD | NEW |