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

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

Issue 2949023002: [WIP] Fix history.replaceState() not propagating back favicons (Closed)
Patch Set: Created 3 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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 } 370 }
371 371
372 void HistoryService::AddPage(const GURL& url, 372 void HistoryService::AddPage(const GURL& url,
373 Time time, 373 Time time,
374 ContextID context_id, 374 ContextID context_id,
375 int nav_entry_id, 375 int nav_entry_id,
376 const GURL& referrer, 376 const GURL& referrer,
377 const RedirectList& redirects, 377 const RedirectList& redirects,
378 ui::PageTransition transition, 378 ui::PageTransition transition,
379 VisitSource visit_source, 379 VisitSource visit_source,
380 bool did_replace_entry) { 380 base::Optional<GURL> replaced_entry_url) {
381 DCHECK(thread_checker_.CalledOnValidThread()); 381 DCHECK(thread_checker_.CalledOnValidThread());
382 AddPage(HistoryAddPageArgs(url, time, context_id, nav_entry_id, referrer, 382 AddPage(HistoryAddPageArgs(url, time, context_id, nav_entry_id, referrer,
383 redirects, transition, visit_source, 383 redirects, transition, visit_source,
384 did_replace_entry, true)); 384 replaced_entry_url, true));
sky 2017/06/22 15:26:39 If you're going to pass around values, shouldn't y
385 } 385 }
386 386
387 void HistoryService::AddPage(const GURL& url, 387 void HistoryService::AddPage(const GURL& url,
388 base::Time time, 388 base::Time time,
389 VisitSource visit_source) { 389 VisitSource visit_source) {
390 DCHECK(thread_checker_.CalledOnValidThread()); 390 DCHECK(thread_checker_.CalledOnValidThread());
391 AddPage(HistoryAddPageArgs(url, time, nullptr, 0, GURL(), RedirectList(), 391 AddPage(HistoryAddPageArgs(url, time, nullptr, 0, GURL(), RedirectList(),
392 ui::PAGE_TRANSITION_LINK, visit_source, false, 392 ui::PAGE_TRANSITION_LINK, visit_source,
393 true)); 393 base::nullopt, true));
394 } 394 }
395 395
396 void HistoryService::AddPage(const HistoryAddPageArgs& add_page_args) { 396 void HistoryService::AddPage(const HistoryAddPageArgs& add_page_args) {
397 DCHECK(backend_task_runner_) << "History service being called after cleanup"; 397 DCHECK(backend_task_runner_) << "History service being called after cleanup";
398 DCHECK(thread_checker_.CalledOnValidThread()); 398 DCHECK(thread_checker_.CalledOnValidThread());
399 399
400 if (history_client_ && !history_client_->CanAddURL(add_page_args.url)) 400 if (history_client_ && !history_client_->CanAddURL(add_page_args.url))
401 return; 401 return;
402 402
403 // Inform VisitedDelegate of all links and redirects. 403 // Inform VisitedDelegate of all links and redirects.
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
1190 return favicon_changed_callback_list_.Add(callback); 1190 return favicon_changed_callback_list_.Add(callback);
1191 } 1191 }
1192 1192
1193 void HistoryService::NotifyFaviconsChanged(const std::set<GURL>& page_urls, 1193 void HistoryService::NotifyFaviconsChanged(const std::set<GURL>& page_urls,
1194 const GURL& icon_url) { 1194 const GURL& icon_url) {
1195 DCHECK(thread_checker_.CalledOnValidThread()); 1195 DCHECK(thread_checker_.CalledOnValidThread());
1196 favicon_changed_callback_list_.Notify(page_urls, icon_url); 1196 favicon_changed_callback_list_.Notify(page_urls, icon_url);
1197 } 1197 }
1198 1198
1199 } // namespace history 1199 } // namespace history
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698