OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 virtual void StartTopSitesMigration() OVERRIDE { | 109 virtual void StartTopSitesMigration() OVERRIDE { |
110 message_loop_->PostTask(FROM_HERE, NewRunnableMethod(history_service_.get(), | 110 message_loop_->PostTask(FROM_HERE, NewRunnableMethod(history_service_.get(), |
111 &HistoryService::StartTopSitesMigration)); | 111 &HistoryService::StartTopSitesMigration)); |
112 } | 112 } |
113 | 113 |
114 private: | 114 private: |
115 scoped_refptr<HistoryService> history_service_; | 115 scoped_refptr<HistoryService> history_service_; |
116 MessageLoop* message_loop_; | 116 MessageLoop* message_loop_; |
117 }; | 117 }; |
118 | 118 |
119 // static | |
120 const history::StarID HistoryService::kBookmarkBarID = 1; | |
121 | |
122 // The history thread is intentionally not a BrowserThread because the | 119 // The history thread is intentionally not a BrowserThread because the |
123 // sync integration unit tests depend on being able to create more than one | 120 // sync integration unit tests depend on being able to create more than one |
124 // history thread. | 121 // history thread. |
125 HistoryService::HistoryService() | 122 HistoryService::HistoryService() |
126 : thread_(new base::Thread(kHistoryThreadName)), | 123 : thread_(new base::Thread(kHistoryThreadName)), |
127 profile_(NULL), | 124 profile_(NULL), |
128 backend_loaded_(false), | 125 backend_loaded_(false), |
129 bookmark_service_(NULL), | 126 bookmark_service_(NULL), |
130 no_db_(false), | 127 no_db_(false), |
131 needs_top_sites_migration_(false) { | 128 needs_top_sites_migration_(false) { |
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
810 history::TopSites* ts = profile_->GetTopSitesWithoutCreating(); | 807 history::TopSites* ts = profile_->GetTopSitesWithoutCreating(); |
811 if (ts) | 808 if (ts) |
812 ts->MigrateFromHistory(); | 809 ts->MigrateFromHistory(); |
813 } | 810 } |
814 } | 811 } |
815 | 812 |
816 void HistoryService::OnTopSitesReady() { | 813 void HistoryService::OnTopSitesReady() { |
817 ScheduleAndForget(PRIORITY_NORMAL, | 814 ScheduleAndForget(PRIORITY_NORMAL, |
818 &HistoryBackend::MigrateThumbnailsDatabase); | 815 &HistoryBackend::MigrateThumbnailsDatabase); |
819 } | 816 } |
OLD | NEW |