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 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
885 history::TopSites* ts = profile_->GetTopSitesWithoutCreating(); | 885 history::TopSites* ts = profile_->GetTopSitesWithoutCreating(); |
886 if (ts) | 886 if (ts) |
887 ts->MigrateFromHistory(); | 887 ts->MigrateFromHistory(); |
888 } | 888 } |
889 } | 889 } |
890 | 890 |
891 void HistoryService::OnTopSitesReady() { | 891 void HistoryService::OnTopSitesReady() { |
892 ScheduleAndForget(PRIORITY_NORMAL, | 892 ScheduleAndForget(PRIORITY_NORMAL, |
893 &HistoryBackend::MigrateThumbnailsDatabase); | 893 &HistoryBackend::MigrateThumbnailsDatabase); |
894 } | 894 } |
895 | |
896 void HistoryService::AddVisitDatabaseObserver( | |
897 history::VisitDatabaseObserver* observer) { | |
898 LoadBackendIfNecessary(); | |
899 history_backend_->AddVisitDatabaseObserver(observer); | |
900 } | |
901 | |
902 void HistoryService::RemoveVisitDatabaseObserver( | |
903 history::VisitDatabaseObserver* observer) { | |
904 // If the history backend is no longer present, nothing to do here. | |
905 if (history_backend_) | |
cbentzel
2012/04/12 21:16:36
Why don't you need to do this check in the Add cas
tburkard
2012/04/12 21:32:37
In the add case, I am loading the database backend
| |
906 history_backend_->RemoveVisitDatabaseObserver(observer); | |
907 } | |
OLD | NEW |