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

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

Issue 959343004: Move InMemoryURLIndex outside of history namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@in-memory-url-index
Patch Set: Created 5 years, 9 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 921 matching lines...) Expand 10 before | Expand all | Expand 10 after
932 base::Thread::Options options; 932 base::Thread::Options options;
933 options.timer_slack = base::TIMER_SLACK_MAXIMUM; 933 options.timer_slack = base::TIMER_SLACK_MAXIMUM;
934 if (!thread_->StartWithOptions(options)) { 934 if (!thread_->StartWithOptions(options)) {
935 Cleanup(); 935 Cleanup();
936 return false; 936 return false;
937 } 937 }
938 938
939 if (!languages.empty()) { 939 if (!languages.empty()) {
940 // Do not create |in_memory_url_index_| when languages is empty (which 940 // Do not create |in_memory_url_index_| when languages is empty (which
941 // should only happens during testing). 941 // should only happens during testing).
942 in_memory_url_index_.reset(new history::InMemoryURLIndex( 942 in_memory_url_index_.reset(new InMemoryURLIndex(
943 this, history_database_params.history_dir, languages)); 943 this, history_database_params.history_dir, languages));
944 in_memory_url_index_->Init(); 944 in_memory_url_index_->Init();
945 } 945 }
946 946
947 // Create the history backend. 947 // Create the history backend.
948 scoped_refptr<HistoryBackend> backend(new HistoryBackend( 948 scoped_refptr<HistoryBackend> backend(new HistoryBackend(
949 new BackendDelegate(weak_ptr_factory_.GetWeakPtr(), 949 new BackendDelegate(weak_ptr_factory_.GetWeakPtr(),
950 base::ThreadTaskRunnerHandle::Get()), 950 base::ThreadTaskRunnerHandle::Get()),
951 history_client_)); 951 history_client_));
952 history_backend_.swap(backend); 952 history_backend_.swap(backend);
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
1239 const HistoryService::OnFaviconChangedCallback& callback) { 1239 const HistoryService::OnFaviconChangedCallback& callback) {
1240 DCHECK(thread_checker_.CalledOnValidThread()); 1240 DCHECK(thread_checker_.CalledOnValidThread());
1241 return favicon_changed_callback_list_.Add(callback); 1241 return favicon_changed_callback_list_.Add(callback);
1242 } 1242 }
1243 1243
1244 void HistoryService::NotifyFaviconChanged( 1244 void HistoryService::NotifyFaviconChanged(
1245 const std::set<GURL>& changed_favicons) { 1245 const std::set<GURL>& changed_favicons) {
1246 DCHECK(thread_checker_.CalledOnValidThread()); 1246 DCHECK(thread_checker_.CalledOnValidThread());
1247 favicon_changed_callback_list_.Notify(changed_favicons); 1247 favicon_changed_callback_list_.Notify(changed_favicons);
1248 } 1248 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698