| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 const GURL& referrer, | 266 const GURL& referrer, |
| 267 PageTransition::Type transition, | 267 PageTransition::Type transition, |
| 268 const history::RedirectList& redirects, | 268 const history::RedirectList& redirects, |
| 269 bool did_replace_entry) { | 269 bool did_replace_entry) { |
| 270 DCHECK(history_backend_) << "History service being called after cleanup"; | 270 DCHECK(history_backend_) << "History service being called after cleanup"; |
| 271 | 271 |
| 272 // Filter out unwanted URLs. We don't add auto-subframe URLs. They are a | 272 // Filter out unwanted URLs. We don't add auto-subframe URLs. They are a |
| 273 // large part of history (think iframes for ads) and we never display them in | 273 // large part of history (think iframes for ads) and we never display them in |
| 274 // history UI. We will still add manual subframes, which are ones the user | 274 // history UI. We will still add manual subframes, which are ones the user |
| 275 // has clicked on to get. | 275 // has clicked on to get. |
| 276 if (!CanAddURL(url) || PageTransition::StripQualifier(transition) == | 276 if (!CanAddURL(url)) |
| 277 PageTransition::AUTO_SUBFRAME) | |
| 278 return; | 277 return; |
| 279 | 278 |
| 280 // Add link & all redirects to visited link list. | 279 // Add link & all redirects to visited link list. |
| 281 VisitedLinkMaster* visited_links; | 280 VisitedLinkMaster* visited_links; |
| 282 if (profile_ && (visited_links = profile_->GetVisitedLinkMaster())) { | 281 if (profile_ && (visited_links = profile_->GetVisitedLinkMaster())) { |
| 283 visited_links->AddURL(url); | 282 visited_links->AddURL(url); |
| 284 | 283 |
| 285 if (!redirects.empty()) { | 284 if (!redirects.empty()) { |
| 286 // We should not be asked to add a page in the middle of a redirect chain. | 285 // We should not be asked to add a page in the middle of a redirect chain. |
| 287 DCHECK(redirects[redirects.size() - 1] == url); | 286 DCHECK(redirects[redirects.size() - 1] == url); |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 NotificationService::current()->Notify(type, source, det); | 676 NotificationService::current()->Notify(type, source, det); |
| 678 } | 677 } |
| 679 | 678 |
| 680 void HistoryService::OnDBLoaded() { | 679 void HistoryService::OnDBLoaded() { |
| 681 LOG(INFO) << "History backend finished loading"; | 680 LOG(INFO) << "History backend finished loading"; |
| 682 backend_loaded_ = true; | 681 backend_loaded_ = true; |
| 683 NotificationService::current()->Notify(NotificationType::HISTORY_LOADED, | 682 NotificationService::current()->Notify(NotificationType::HISTORY_LOADED, |
| 684 Source<Profile>(profile_), | 683 Source<Profile>(profile_), |
| 685 Details<HistoryService>(this)); | 684 Details<HistoryService>(this)); |
| 686 } | 685 } |
| OLD | NEW |