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 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 void HistoryService::SetOnBackendDestroyTask(const base::Closure& task) { | 385 void HistoryService::SetOnBackendDestroyTask(const base::Closure& task) { |
386 DCHECK(thread_) << "History service being called after cleanup"; | 386 DCHECK(thread_) << "History service being called after cleanup"; |
387 DCHECK(thread_checker_.CalledOnValidThread()); | 387 DCHECK(thread_checker_.CalledOnValidThread()); |
388 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::SetOnBackendDestroyTask, | 388 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::SetOnBackendDestroyTask, |
389 base::MessageLoop::current(), task); | 389 base::MessageLoop::current(), task); |
390 } | 390 } |
391 | 391 |
392 void HistoryService::AddPage(const GURL& url, | 392 void HistoryService::AddPage(const GURL& url, |
393 Time time, | 393 Time time, |
394 history::ContextID context_id, | 394 history::ContextID context_id, |
395 int32 page_id, | 395 int nav_entry_id, |
396 const GURL& referrer, | 396 const GURL& referrer, |
397 const history::RedirectList& redirects, | 397 const history::RedirectList& redirects, |
398 ui::PageTransition transition, | 398 ui::PageTransition transition, |
399 history::VisitSource visit_source, | 399 history::VisitSource visit_source, |
400 bool did_replace_entry) { | 400 bool did_replace_entry) { |
401 DCHECK(thread_checker_.CalledOnValidThread()); | 401 DCHECK(thread_checker_.CalledOnValidThread()); |
402 AddPage( | 402 AddPage( |
403 history::HistoryAddPageArgs(url, time, context_id, page_id, referrer, | 403 history::HistoryAddPageArgs(url, time, context_id, nav_entry_id, referrer, |
404 redirects, transition, visit_source, | 404 redirects, transition, visit_source, |
405 did_replace_entry)); | 405 did_replace_entry)); |
406 } | 406 } |
407 | 407 |
408 void HistoryService::AddPage(const GURL& url, | 408 void HistoryService::AddPage(const GURL& url, |
409 base::Time time, | 409 base::Time time, |
410 history::VisitSource visit_source) { | 410 history::VisitSource visit_source) { |
411 DCHECK(thread_checker_.CalledOnValidThread()); | 411 DCHECK(thread_checker_.CalledOnValidThread()); |
412 AddPage( | 412 AddPage( |
413 history::HistoryAddPageArgs(url, time, NULL, 0, GURL(), | 413 history::HistoryAddPageArgs(url, time, NULL, 0, GURL(), |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 } | 458 } |
459 | 459 |
460 void HistoryService::SetPageTitle(const GURL& url, | 460 void HistoryService::SetPageTitle(const GURL& url, |
461 const base::string16& title) { | 461 const base::string16& title) { |
462 DCHECK(thread_) << "History service being called after cleanup"; | 462 DCHECK(thread_) << "History service being called after cleanup"; |
463 DCHECK(thread_checker_.CalledOnValidThread()); | 463 DCHECK(thread_checker_.CalledOnValidThread()); |
464 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::SetPageTitle, url, title); | 464 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::SetPageTitle, url, title); |
465 } | 465 } |
466 | 466 |
467 void HistoryService::UpdateWithPageEndTime(history::ContextID context_id, | 467 void HistoryService::UpdateWithPageEndTime(history::ContextID context_id, |
468 int32 page_id, | 468 int nav_entry_id, |
469 const GURL& url, | 469 const GURL& url, |
470 Time end_ts) { | 470 Time end_ts) { |
471 DCHECK(thread_) << "History service being called after cleanup"; | 471 DCHECK(thread_) << "History service being called after cleanup"; |
472 DCHECK(thread_checker_.CalledOnValidThread()); | 472 DCHECK(thread_checker_.CalledOnValidThread()); |
473 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::UpdateWithPageEndTime, | 473 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::UpdateWithPageEndTime, |
474 context_id, page_id, url, end_ts); | 474 context_id, nav_entry_id, url, end_ts); |
475 } | 475 } |
476 | 476 |
477 void HistoryService::AddPageWithDetails(const GURL& url, | 477 void HistoryService::AddPageWithDetails(const GURL& url, |
478 const base::string16& title, | 478 const base::string16& title, |
479 int visit_count, | 479 int visit_count, |
480 int typed_count, | 480 int typed_count, |
481 Time last_visit, | 481 Time last_visit, |
482 bool hidden, | 482 bool hidden, |
483 history::VisitSource visit_source) { | 483 history::VisitSource visit_source) { |
484 DCHECK(thread_) << "History service being called after cleanup"; | 484 DCHECK(thread_) << "History service being called after cleanup"; |
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1285 const HistoryService::OnFaviconChangedCallback& callback) { | 1285 const HistoryService::OnFaviconChangedCallback& callback) { |
1286 DCHECK(thread_checker_.CalledOnValidThread()); | 1286 DCHECK(thread_checker_.CalledOnValidThread()); |
1287 return favicon_changed_callback_list_.Add(callback); | 1287 return favicon_changed_callback_list_.Add(callback); |
1288 } | 1288 } |
1289 | 1289 |
1290 void HistoryService::NotifyFaviconChanged( | 1290 void HistoryService::NotifyFaviconChanged( |
1291 const std::set<GURL>& changed_favicons) { | 1291 const std::set<GURL>& changed_favicons) { |
1292 DCHECK(thread_checker_.CalledOnValidThread()); | 1292 DCHECK(thread_checker_.CalledOnValidThread()); |
1293 favicon_changed_callback_list_.Notify(changed_favicons); | 1293 favicon_changed_callback_list_.Notify(changed_favicons); |
1294 } | 1294 } |
OLD | NEW |