Chromium Code Reviews| 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 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 442 | 442 |
| 443 HistoryService::Handle HistoryService::GetPageThumbnail( | 443 HistoryService::Handle HistoryService::GetPageThumbnail( |
| 444 const GURL& page_url, | 444 const GURL& page_url, |
| 445 CancelableRequestConsumerBase* consumer, | 445 CancelableRequestConsumerBase* consumer, |
| 446 ThumbnailDataCallback* callback) { | 446 ThumbnailDataCallback* callback) { |
| 447 return Schedule(PRIORITY_NORMAL, &HistoryBackend::GetPageThumbnail, consumer, | 447 return Schedule(PRIORITY_NORMAL, &HistoryBackend::GetPageThumbnail, consumer, |
| 448 new history::GetPageThumbnailRequest(callback), page_url); | 448 new history::GetPageThumbnailRequest(callback), page_url); |
| 449 } | 449 } |
| 450 | 450 |
| 451 void HistoryService::GetFavicon(FaviconService::GetFaviconRequest* request, | 451 void HistoryService::GetFavicon(FaviconService::GetFaviconRequest* request, |
| 452 const GURL& icon_url) { | 452 const GURL& icon_url, |
| 453 history::IconType icon_type) { | |
| 453 Schedule(PRIORITY_NORMAL, &HistoryBackend::GetFavIcon, NULL, request, | 454 Schedule(PRIORITY_NORMAL, &HistoryBackend::GetFavIcon, NULL, request, |
|
sky
2011/03/09 21:41:08
See how there is multiple arguments on a single li
michaelbai
2011/03/09 23:11:45
I have gone though the whole CL and kept the style
| |
| 454 icon_url, history::FAV_ICON); | 455 icon_url, icon_type); |
| 455 } | 456 } |
| 456 | 457 |
| 457 void HistoryService::UpdateFaviconMappingAndFetch( | 458 void HistoryService::UpdateFaviconMappingAndFetch( |
| 458 FaviconService::GetFaviconRequest* request, | 459 FaviconService::GetFaviconRequest* request, |
| 459 const GURL& page_url, | 460 const GURL& page_url, |
| 460 const GURL& icon_url) { | 461 const GURL& icon_url, |
| 462 history::IconType icon_type) { | |
| 461 Schedule(PRIORITY_NORMAL, &HistoryBackend::UpdateFavIconMappingAndFetch, NULL, | 463 Schedule(PRIORITY_NORMAL, &HistoryBackend::UpdateFavIconMappingAndFetch, NULL, |
| 462 request, page_url, icon_url, history::FAV_ICON); | 464 request, page_url, icon_url, history::FAV_ICON); |
| 463 } | 465 } |
| 464 | 466 |
| 465 void HistoryService::GetFaviconForURL( | 467 void HistoryService::GetFaviconForURL( |
| 466 FaviconService::GetFaviconRequest* request, | 468 FaviconService::GetFaviconRequest* request, |
| 467 const GURL& page_url) { | 469 const GURL& page_url, |
| 470 int icon_type) { | |
| 468 Schedule(PRIORITY_NORMAL, &HistoryBackend::GetFavIconForURL, NULL, request, | 471 Schedule(PRIORITY_NORMAL, &HistoryBackend::GetFavIconForURL, NULL, request, |
| 469 page_url, history::FAV_ICON); | 472 page_url, icon_type); |
| 470 } | 473 } |
| 471 | 474 |
| 472 void HistoryService::SetFavicon(const GURL& page_url, | 475 void HistoryService::SetFavicon(const GURL& page_url, |
| 473 const GURL& icon_url, | 476 const GURL& icon_url, |
| 474 const std::vector<unsigned char>& image_data) { | 477 const std::vector<unsigned char>& image_data, |
| 478 history::IconType icon_type) { | |
| 475 if (!CanAddURL(page_url)) | 479 if (!CanAddURL(page_url)) |
| 476 return; | 480 return; |
| 477 | 481 |
| 478 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::SetFavIcon, | 482 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::SetFavIcon, |
| 479 page_url, icon_url, | 483 page_url, icon_url, |
| 480 scoped_refptr<RefCountedMemory>(new RefCountedBytes(image_data)), | 484 scoped_refptr<RefCountedMemory>(new RefCountedBytes(image_data)), |
| 481 history::FAV_ICON); | 485 icon_type); |
| 482 } | 486 } |
| 483 | 487 |
| 484 void HistoryService::SetFaviconOutOfDateForPage(const GURL& page_url) { | 488 void HistoryService::SetFaviconOutOfDateForPage(const GURL& page_url) { |
| 485 ScheduleAndForget(PRIORITY_NORMAL, | 489 ScheduleAndForget(PRIORITY_NORMAL, |
| 486 &HistoryBackend::SetFavIconOutOfDateForPage, page_url); | 490 &HistoryBackend::SetFavIconOutOfDateForPage, |
| 491 page_url); | |
| 487 } | 492 } |
| 488 | 493 |
| 489 void HistoryService::SetImportedFavicons( | 494 void HistoryService::SetImportedFavicons( |
| 490 const std::vector<history::ImportedFavIconUsage>& favicon_usage) { | 495 const std::vector<history::ImportedFavIconUsage>& favicon_usage) { |
| 491 ScheduleAndForget(PRIORITY_NORMAL, | 496 ScheduleAndForget(PRIORITY_NORMAL, |
| 492 &HistoryBackend::SetImportedFavicons, favicon_usage); | 497 &HistoryBackend::SetImportedFavicons, favicon_usage); |
| 493 } | 498 } |
| 494 | 499 |
| 495 void HistoryService::IterateURLs(URLEnumerator* enumerator) { | 500 void HistoryService::IterateURLs(URLEnumerator* enumerator) { |
| 496 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::IterateURLs, enumerator); | 501 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::IterateURLs, enumerator); |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 807 history::TopSites* ts = profile_->GetTopSitesWithoutCreating(); | 812 history::TopSites* ts = profile_->GetTopSitesWithoutCreating(); |
| 808 if (ts) | 813 if (ts) |
| 809 ts->MigrateFromHistory(); | 814 ts->MigrateFromHistory(); |
| 810 } | 815 } |
| 811 } | 816 } |
| 812 | 817 |
| 813 void HistoryService::OnTopSitesReady() { | 818 void HistoryService::OnTopSitesReady() { |
| 814 ScheduleAndForget(PRIORITY_NORMAL, | 819 ScheduleAndForget(PRIORITY_NORMAL, |
| 815 &HistoryBackend::MigrateThumbnailsDatabase); | 820 &HistoryBackend::MigrateThumbnailsDatabase); |
| 816 } | 821 } |
| OLD | NEW |