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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::SetOnBackendDestroyTask, | 363 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::SetOnBackendDestroyTask, |
364 base::MessageLoop::current(), task); | 364 base::MessageLoop::current(), task); |
365 } | 365 } |
366 | 366 |
367 void HistoryService::AddPage(const GURL& url, | 367 void HistoryService::AddPage(const GURL& url, |
368 Time time, | 368 Time time, |
369 history::ContextID context_id, | 369 history::ContextID context_id, |
370 int32 page_id, | 370 int32 page_id, |
371 const GURL& referrer, | 371 const GURL& referrer, |
372 const history::RedirectList& redirects, | 372 const history::RedirectList& redirects, |
373 content::PageTransition transition, | 373 ui::PageTransition transition, |
374 history::VisitSource visit_source, | 374 history::VisitSource visit_source, |
375 bool did_replace_entry) { | 375 bool did_replace_entry) { |
376 DCHECK(thread_checker_.CalledOnValidThread()); | 376 DCHECK(thread_checker_.CalledOnValidThread()); |
377 AddPage( | 377 AddPage( |
378 history::HistoryAddPageArgs(url, time, context_id, page_id, referrer, | 378 history::HistoryAddPageArgs(url, time, context_id, page_id, referrer, |
379 redirects, transition, visit_source, | 379 redirects, transition, visit_source, |
380 did_replace_entry)); | 380 did_replace_entry)); |
381 } | 381 } |
382 | 382 |
383 void HistoryService::AddPage(const GURL& url, | 383 void HistoryService::AddPage(const GURL& url, |
384 base::Time time, | 384 base::Time time, |
385 history::VisitSource visit_source) { | 385 history::VisitSource visit_source) { |
386 DCHECK(thread_checker_.CalledOnValidThread()); | 386 DCHECK(thread_checker_.CalledOnValidThread()); |
387 AddPage( | 387 AddPage( |
388 history::HistoryAddPageArgs(url, time, NULL, 0, GURL(), | 388 history::HistoryAddPageArgs(url, time, NULL, 0, GURL(), |
389 history::RedirectList(), | 389 history::RedirectList(), |
390 content::PAGE_TRANSITION_LINK, | 390 ui::PAGE_TRANSITION_LINK, |
391 visit_source, false)); | 391 visit_source, false)); |
392 } | 392 } |
393 | 393 |
394 void HistoryService::AddPage(const history::HistoryAddPageArgs& add_page_args) { | 394 void HistoryService::AddPage(const history::HistoryAddPageArgs& add_page_args) { |
395 DCHECK(thread_) << "History service being called after cleanup"; | 395 DCHECK(thread_) << "History service being called after cleanup"; |
396 DCHECK(thread_checker_.CalledOnValidThread()); | 396 DCHECK(thread_checker_.CalledOnValidThread()); |
397 | 397 |
398 // Filter out unwanted URLs. We don't add auto-subframe URLs. They are a | 398 // Filter out unwanted URLs. We don't add auto-subframe URLs. They are a |
399 // large part of history (think iframes for ads) and we never display them in | 399 // large part of history (think iframes for ads) and we never display them in |
400 // history UI. We will still add manual subframes, which are ones the user | 400 // history UI. We will still add manual subframes, which are ones the user |
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1245 const HistoryService::OnFaviconChangedCallback& callback) { | 1245 const HistoryService::OnFaviconChangedCallback& callback) { |
1246 DCHECK(thread_checker_.CalledOnValidThread()); | 1246 DCHECK(thread_checker_.CalledOnValidThread()); |
1247 return favicon_changed_callback_list_.Add(callback); | 1247 return favicon_changed_callback_list_.Add(callback); |
1248 } | 1248 } |
1249 | 1249 |
1250 void HistoryService::NotifyFaviconChanged( | 1250 void HistoryService::NotifyFaviconChanged( |
1251 const std::set<GURL>& changed_favicons) { | 1251 const std::set<GURL>& changed_favicons) { |
1252 DCHECK(thread_checker_.CalledOnValidThread()); | 1252 DCHECK(thread_checker_.CalledOnValidThread()); |
1253 favicon_changed_callback_list_.Notify(changed_favicons); | 1253 favicon_changed_callback_list_.Notify(changed_favicons); |
1254 } | 1254 } |
OLD | NEW |