| 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 950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 961 const sync_pb::HistoryDeleteDirectiveSpecifics& delete_directive) { | 961 const sync_pb::HistoryDeleteDirectiveSpecifics& delete_directive) { |
| 962 DCHECK(thread_checker_.CalledOnValidThread()); | 962 DCHECK(thread_checker_.CalledOnValidThread()); |
| 963 return delete_directive_handler_.ProcessLocalDeleteDirective( | 963 return delete_directive_handler_.ProcessLocalDeleteDirective( |
| 964 delete_directive); | 964 delete_directive); |
| 965 } | 965 } |
| 966 | 966 |
| 967 void HistoryService::SetInMemoryBackend( | 967 void HistoryService::SetInMemoryBackend( |
| 968 std::unique_ptr<InMemoryHistoryBackend> mem_backend) { | 968 std::unique_ptr<InMemoryHistoryBackend> mem_backend) { |
| 969 DCHECK(thread_checker_.CalledOnValidThread()); | 969 DCHECK(thread_checker_.CalledOnValidThread()); |
| 970 DCHECK(!in_memory_backend_) << "Setting mem DB twice"; | 970 DCHECK(!in_memory_backend_) << "Setting mem DB twice"; |
| 971 in_memory_backend_.reset(mem_backend.release()); | 971 in_memory_backend_ = std::move(mem_backend); |
| 972 | 972 |
| 973 // The database requires additional initialization once we own it. | 973 // The database requires additional initialization once we own it. |
| 974 in_memory_backend_->AttachToHistoryService(this); | 974 in_memory_backend_->AttachToHistoryService(this); |
| 975 } | 975 } |
| 976 | 976 |
| 977 void HistoryService::NotifyProfileError(sql::InitStatus init_status, | 977 void HistoryService::NotifyProfileError(sql::InitStatus init_status, |
| 978 const std::string& diagnostics) { | 978 const std::string& diagnostics) { |
| 979 DCHECK(thread_checker_.CalledOnValidThread()); | 979 DCHECK(thread_checker_.CalledOnValidThread()); |
| 980 if (history_client_) | 980 if (history_client_) |
| 981 history_client_->NotifyProfileError(init_status, diagnostics); | 981 history_client_->NotifyProfileError(init_status, diagnostics); |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1142 return favicon_changed_callback_list_.Add(callback); | 1142 return favicon_changed_callback_list_.Add(callback); |
| 1143 } | 1143 } |
| 1144 | 1144 |
| 1145 void HistoryService::NotifyFaviconsChanged(const std::set<GURL>& page_urls, | 1145 void HistoryService::NotifyFaviconsChanged(const std::set<GURL>& page_urls, |
| 1146 const GURL& icon_url) { | 1146 const GURL& icon_url) { |
| 1147 DCHECK(thread_checker_.CalledOnValidThread()); | 1147 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1148 favicon_changed_callback_list_.Notify(page_urls, icon_url); | 1148 favicon_changed_callback_list_.Notify(page_urls, icon_url); |
| 1149 } | 1149 } |
| 1150 | 1150 |
| 1151 } // namespace history | 1151 } // namespace history |
| OLD | NEW |