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

Side by Side Diff: components/history/core/browser/history_service.cc

Issue 1179163002: Migrate callers of message_loop_proxy() to task_runner() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 years, 6 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
« no previous file with comments | « cloud_print/gcp20/prototype/printer.cc ('k') | components/html_viewer/setup.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 PRIORITY_NORMAL, 353 PRIORITY_NORMAL,
354 base::Bind(&HistoryBackend::SetOnBackendDestroyTask, 354 base::Bind(&HistoryBackend::SetOnBackendDestroyTask,
355 history_backend_.get(), base::MessageLoop::current(), task)); 355 history_backend_.get(), base::MessageLoop::current(), task));
356 } 356 }
357 357
358 void HistoryService::TopHosts(int num_hosts, 358 void HistoryService::TopHosts(int num_hosts,
359 const TopHostsCallback& callback) const { 359 const TopHostsCallback& callback) const {
360 DCHECK(thread_) << "History service being called after cleanup"; 360 DCHECK(thread_) << "History service being called after cleanup";
361 DCHECK(thread_checker_.CalledOnValidThread()); 361 DCHECK(thread_checker_.CalledOnValidThread());
362 PostTaskAndReplyWithResult( 362 PostTaskAndReplyWithResult(
363 thread_->message_loop_proxy().get(), FROM_HERE, 363 thread_->task_runner().get(), FROM_HERE,
364 base::Bind(&HistoryBackend::TopHosts, history_backend_.get(), num_hosts), 364 base::Bind(&HistoryBackend::TopHosts, history_backend_.get(), num_hosts),
365 callback); 365 callback);
366 } 366 }
367 367
368 void HistoryService::AddPage(const GURL& url, 368 void HistoryService::AddPage(const GURL& url,
369 Time time, 369 Time time,
370 ContextID context_id, 370 ContextID context_id,
371 int nav_entry_id, 371 int nav_entry_id,
372 const GURL& referrer, 372 const GURL& referrer,
373 const RedirectList& redirects, 373 const RedirectList& redirects,
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
1129 return favicon_changed_callback_list_.Add(callback); 1129 return favicon_changed_callback_list_.Add(callback);
1130 } 1130 }
1131 1131
1132 void HistoryService::NotifyFaviconChanged( 1132 void HistoryService::NotifyFaviconChanged(
1133 const std::set<GURL>& changed_favicons) { 1133 const std::set<GURL>& changed_favicons) {
1134 DCHECK(thread_checker_.CalledOnValidThread()); 1134 DCHECK(thread_checker_.CalledOnValidThread());
1135 favicon_changed_callback_list_.Notify(changed_favicons); 1135 favicon_changed_callback_list_.Notify(changed_favicons);
1136 } 1136 }
1137 1137
1138 } // namespace history 1138 } // namespace history
OLDNEW
« no previous file with comments | « cloud_print/gcp20/prototype/printer.cc ('k') | components/html_viewer/setup.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698