Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(692)

Side by Side Diff: chrome/browser/history/history_service.cc

Issue 879763002: Remove dependencies of InMemoryURLIndex on Profile (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@773103004
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 946 matching lines...) Expand 10 before | Expand all | Expand 10 after
957 return false; 957 return false;
958 } 958 }
959 959
960 history_dir_ = history_database_params.history_dir; 960 history_dir_ = history_database_params.history_dir;
961 no_db_ = no_db; 961 no_db_ = no_db;
962 962
963 if (profile_) { 963 if (profile_) {
964 std::string languages = 964 std::string languages =
965 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages); 965 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages);
966 in_memory_url_index_.reset(new history::InMemoryURLIndex( 966 in_memory_url_index_.reset(new history::InMemoryURLIndex(
967 profile_, this, history_dir_, languages, history_client_)); 967 this, history_dir_, languages, history_client_));
968 in_memory_url_index_->Init(); 968 in_memory_url_index_->Init();
969 } 969 }
970 970
971 // Create the history backend. 971 // Create the history backend.
972 scoped_refptr<HistoryBackend> backend(new HistoryBackend( 972 scoped_refptr<HistoryBackend> backend(new HistoryBackend(
973 history_dir_, new BackendDelegate(weak_ptr_factory_.GetWeakPtr(), 973 history_dir_, new BackendDelegate(weak_ptr_factory_.GetWeakPtr(),
974 base::ThreadTaskRunnerHandle::Get()), 974 base::ThreadTaskRunnerHandle::Get()),
975 history_client_)); 975 history_client_));
976 history_backend_.swap(backend); 976 history_backend_.swap(backend);
977 977
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
1269 const HistoryService::OnFaviconChangedCallback& callback) { 1269 const HistoryService::OnFaviconChangedCallback& callback) {
1270 DCHECK(thread_checker_.CalledOnValidThread()); 1270 DCHECK(thread_checker_.CalledOnValidThread());
1271 return favicon_changed_callback_list_.Add(callback); 1271 return favicon_changed_callback_list_.Add(callback);
1272 } 1272 }
1273 1273
1274 void HistoryService::NotifyFaviconChanged( 1274 void HistoryService::NotifyFaviconChanged(
1275 const std::set<GURL>& changed_favicons) { 1275 const std::set<GURL>& changed_favicons) {
1276 DCHECK(thread_checker_.CalledOnValidThread()); 1276 DCHECK(thread_checker_.CalledOnValidThread());
1277 favicon_changed_callback_list_.Notify(changed_favicons); 1277 favicon_changed_callback_list_.Notify(changed_favicons);
1278 } 1278 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/history/in_memory_url_index.h » ('j') | chrome/browser/history/in_memory_url_index.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698