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

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

Issue 2082333002: Remove calls to deprecated MessageLoop methods in components. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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 830 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 // 841 //
842 // TODO(ajwong): Cleanup HistoryBackend lifetime issues. 842 // TODO(ajwong): Cleanup HistoryBackend lifetime issues.
843 // See http://crbug.com/99767. 843 // See http://crbug.com/99767.
844 history_backend_->AddRef(); 844 history_backend_->AddRef();
845 base::Closure closing_task = 845 base::Closure closing_task =
846 base::Bind(&HistoryBackend::Closing, history_backend_.get()); 846 base::Bind(&HistoryBackend::Closing, history_backend_.get());
847 ScheduleTask(PRIORITY_NORMAL, closing_task); 847 ScheduleTask(PRIORITY_NORMAL, closing_task);
848 closing_task.Reset(); 848 closing_task.Reset();
849 HistoryBackend* raw_ptr = history_backend_.get(); 849 HistoryBackend* raw_ptr = history_backend_.get();
850 history_backend_ = nullptr; 850 history_backend_ = nullptr;
851 thread_->message_loop()->ReleaseSoon(FROM_HERE, raw_ptr); 851 thread_->task_runner()->ReleaseSoon(FROM_HERE, raw_ptr);
852 } 852 }
853 853
854 // Delete the thread, which joins with the background thread. We defensively 854 // Delete the thread, which joins with the background thread. We defensively
855 // nullptr the pointer before deleting it in case somebody tries to use it 855 // nullptr the pointer before deleting it in case somebody tries to use it
856 // during shutdown, but this shouldn't happen. 856 // during shutdown, but this shouldn't happen.
857 base::Thread* thread = thread_; 857 base::Thread* thread = thread_;
858 thread_ = nullptr; 858 thread_ = nullptr;
859 delete thread; 859 delete thread;
860 } 860 }
861 861
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
1132 return favicon_changed_callback_list_.Add(callback); 1132 return favicon_changed_callback_list_.Add(callback);
1133 } 1133 }
1134 1134
1135 void HistoryService::NotifyFaviconsChanged(const std::set<GURL>& page_urls, 1135 void HistoryService::NotifyFaviconsChanged(const std::set<GURL>& page_urls,
1136 const GURL& icon_url) { 1136 const GURL& icon_url) {
1137 DCHECK(thread_checker_.CalledOnValidThread()); 1137 DCHECK(thread_checker_.CalledOnValidThread());
1138 favicon_changed_callback_list_.Notify(page_urls, icon_url); 1138 favicon_changed_callback_list_.Notify(page_urls, icon_url);
1139 } 1139 }
1140 1140
1141 } // namespace history 1141 } // namespace history
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698