| 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 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 urls.push_back(i->url()); | 378 urls.push_back(i->url()); |
| 379 | 379 |
| 380 visited_links->AddURLs(urls); | 380 visited_links->AddURLs(urls); |
| 381 } | 381 } |
| 382 | 382 |
| 383 ScheduleAndForget(PRIORITY_NORMAL, | 383 ScheduleAndForget(PRIORITY_NORMAL, |
| 384 &HistoryBackend::AddPagesWithDetails, info); | 384 &HistoryBackend::AddPagesWithDetails, info); |
| 385 } | 385 } |
| 386 | 386 |
| 387 void HistoryService::SetPageContents(const GURL& url, | 387 void HistoryService::SetPageContents(const GURL& url, |
| 388 const std::wstring& contents) { | 388 const string16& contents) { |
| 389 if (!CanAddURL(url)) | 389 if (!CanAddURL(url)) |
| 390 return; | 390 return; |
| 391 | 391 |
| 392 ScheduleAndForget(PRIORITY_LOW, &HistoryBackend::SetPageContents, | 392 ScheduleAndForget(PRIORITY_LOW, &HistoryBackend::SetPageContents, |
| 393 url, contents); | 393 url, contents); |
| 394 } | 394 } |
| 395 | 395 |
| 396 void HistoryService::SetPageThumbnail(const GURL& page_url, | 396 void HistoryService::SetPageThumbnail(const GURL& page_url, |
| 397 const SkBitmap& thumbnail, | 397 const SkBitmap& thumbnail, |
| 398 const ThumbnailScore& score) { | 398 const ThumbnailScore& score) { |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 ScheduleAndForget(PRIORITY_UI, &HistoryBackend::Init, no_db_); | 736 ScheduleAndForget(PRIORITY_UI, &HistoryBackend::Init, no_db_); |
| 737 } | 737 } |
| 738 | 738 |
| 739 void HistoryService::OnDBLoaded() { | 739 void HistoryService::OnDBLoaded() { |
| 740 LOG(INFO) << "History backend finished loading"; | 740 LOG(INFO) << "History backend finished loading"; |
| 741 backend_loaded_ = true; | 741 backend_loaded_ = true; |
| 742 NotificationService::current()->Notify(NotificationType::HISTORY_LOADED, | 742 NotificationService::current()->Notify(NotificationType::HISTORY_LOADED, |
| 743 Source<Profile>(profile_), | 743 Source<Profile>(profile_), |
| 744 Details<HistoryService>(this)); | 744 Details<HistoryService>(this)); |
| 745 } | 745 } |
| OLD | NEW |