| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 for (size_t i = 0; i < add_page_args.redirects.size() - 1; i++) | 350 for (size_t i = 0; i < add_page_args.redirects.size() - 1; i++) |
| 351 visited_links->AddURL(add_page_args.redirects[i]); | 351 visited_links->AddURL(add_page_args.redirects[i]); |
| 352 } | 352 } |
| 353 } | 353 } |
| 354 | 354 |
| 355 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::AddPage, | 355 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::AddPage, |
| 356 scoped_refptr<history::HistoryAddPageArgs>( | 356 scoped_refptr<history::HistoryAddPageArgs>( |
| 357 add_page_args.Clone())); | 357 add_page_args.Clone())); |
| 358 } | 358 } |
| 359 | 359 |
| 360 void HistoryService::AddPageNoVisit(const GURL& url) { |
| 361 if (!CanAddURL(url)) |
| 362 return; |
| 363 |
| 364 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::AddPageNoVisit, url); |
| 365 } |
| 366 |
| 360 void HistoryService::SetPageTitle(const GURL& url, | 367 void HistoryService::SetPageTitle(const GURL& url, |
| 361 const string16& title) { | 368 const string16& title) { |
| 362 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::SetPageTitle, url, title); | 369 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::SetPageTitle, url, title); |
| 363 } | 370 } |
| 364 | 371 |
| 365 void HistoryService::AddPageWithDetails(const GURL& url, | 372 void HistoryService::AddPageWithDetails(const GURL& url, |
| 366 const string16& title, | 373 const string16& title, |
| 367 int visit_count, | 374 int visit_count, |
| 368 int typed_count, | 375 int typed_count, |
| 369 Time last_visit, | 376 Time last_visit, |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 798 history::TopSites* ts = profile_->GetTopSitesWithoutCreating(); | 805 history::TopSites* ts = profile_->GetTopSitesWithoutCreating(); |
| 799 if (ts) | 806 if (ts) |
| 800 ts->MigrateFromHistory(); | 807 ts->MigrateFromHistory(); |
| 801 } | 808 } |
| 802 } | 809 } |
| 803 | 810 |
| 804 void HistoryService::OnTopSitesReady() { | 811 void HistoryService::OnTopSitesReady() { |
| 805 ScheduleAndForget(PRIORITY_NORMAL, | 812 ScheduleAndForget(PRIORITY_NORMAL, |
| 806 &HistoryBackend::MigrateThumbnailsDatabase); | 813 &HistoryBackend::MigrateThumbnailsDatabase); |
| 807 } | 814 } |
| OLD | NEW |